NO

Author Topic: POASM  (Read 7052 times)

petrik

  • Guest
POASM
« on: August 31, 2010, 09:30:48 PM »
Dear Pelle

I especially love Windows assembly language programming using the combination of porc, poasm and polink. :D
I know that poasm is not specifically designed for assembly language progamming but I was wandering if you would please be able to change poasm so that it will accept multiple files to assemble (as polink will link multiple files). At present I have to include such files in an .inc file.
Thank you very much for your help.
Keep up the good work.

Regards

Petrik

Offline AlexN

  • Global Moderator
  • Member
  • *****
  • Posts: 394
    • Alex's Link Sammlung
Re: POASM
« Reply #1 on: September 01, 2010, 08:53:32 AM »
Have you tried Pelles compiler driver CC which calls POCC, POASM, PORC and POLINK.
Foir the option you can look in the help file of Pelles C.
best regards
 Alex ;)

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: POASM
« Reply #2 on: September 01, 2010, 10:06:22 AM »
Sorry but I don't understand exactly what the request is for. An assembler is an assembler and compile one source at time, it's the linker job to put together the object modules.
Polink can accept as many object files as you want on his command line, and link them together. Try to compile each of your asm sources then list all of them on the polink command line, you will get one executable (with the name of the first object in the list unless you use the /Fo option to specify the executable name) composed of all the object you supplied linked together.
In C programming is the same, all the sources are compiled one by one and then linked together (there is no difference between an assembler and a C object file).
Or even more easy simply create a project. Then in the project define all the assembler and inc files you want (you can also use the IDE as editor).
Finally press build project button and you get the executable. This way can also enable debugging and debug respect assembler source.
For instructions on use of tools (polink, poasm, polib, porc, etc.) refer to the PellesC help file.
Last just for the sake of correctness: Poasm is specifically designed for assembly programming (what an assembler should be supposed to do?) and is very adherent to masm syntax
PellesC, despise some small just-assembler mini development environment, is a fully structured multilanguage (C and assembler compilers are included, but you can define external tools for compilation of different sources) coss-compilation and integrated development platform (if you want compare it to something consider it an equivalent of M$ VisualStudio). Maybe if you read carefully the help file you can get some interesting hints.
« Last Edit: September 01, 2010, 10:27:46 AM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

petrik

  • Guest
Re: POASM
« Reply #3 on: September 01, 2010, 09:19:23 PM »
What I meant was that poasm will only accept 1 file to assemble in the command line, e.g. poasm source1.asm is fine but not poasm source1.asm source2.asm, source3.asm.
Other assemblers will allow the latter command line, e.g. jwasm source1.asm source2.asm, source3.asm produces source1.obj, source2.obj, source3.obj
I still use a makeit.bat file to compile resource files, to assemble and to link rather than use an IDE.
« Last Edit: September 01, 2010, 09:36:14 PM by petrik »

Offline Stefan Pendl

  • Global Moderator
  • Member
  • *****
  • Posts: 582
    • Homepage
Re: POASM
« Reply #4 on: September 02, 2010, 07:10:37 AM »
Since you are using a batch file, you can use the DOS FOR command to compile multiple assembly files:

Code: [Select]
FOR %%F in ( *.asm ) do POASM "%%~F"
---
Stefan

Proud member of the UltraDefrag Development Team

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 2115
Re: POASM
« Reply #5 on: September 02, 2010, 10:31:16 AM »
Here is helper program for that:
Code: [Select]
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char **argv)
{
int i;
char szOpt[512], szCmd[1024];

szOpt[0] = 0;
for (i=1; i<argc; i++) {
if (argv[i][0] == '-' || argv[i][0] == '/') { // collect options
strcat(szOpt, argv[i]);
strcat(szOpt, " ");
} else {
sprintf(szCmd, "poasm.exe %s %s", szOpt, argv[i]);
system(szCmd);
//puts(szCmd);
}
}
return 0;
}
May the source be with you

Offline frankie

  • Global Moderator
  • Member
  • *****
  • Posts: 2113
Re: POASM
« Reply #6 on: September 02, 2010, 11:53:27 AM »
Ok Petrik, now I understood.
In pellesC the line tools on themselves accept only one source file at time by design, but the functionality you want already exists simply using the CC compiler driver. Simply write at command line:
Code: [Select]
CC /c module1.asm module2.asm module3.asm ... modulen.asmAnd you will get module1.obj, module2.obj, module3.obj ... modulen.obj
The /c switch tell to the driver to only compile without linking. On the same line you can add assembler specific switches that are automatically passed over to the assembler (look to help file for more details).

Anyway maybe Pelle would consider your request.....
« Last Edit: September 02, 2010, 12:02:31 PM by frankie »
"It is better to be hated for what you are than to be loved for what you are not." - Andre Gide

petrik

  • Guest
Re: POASM
« Reply #7 on: September 02, 2010, 08:47:23 PM »
Frankie
Thank you very much for your help.
I never considered using cc before.
I'll 'give it a whirl'.
P.S. Thanks very much also to all the other solution contributors.
« Last Edit: September 02, 2010, 08:51:57 PM by petrik »