NO

Author Topic: Why PoASM uses MASM-like syntax and the C compiler accepts NASM-like syntax?  (Read 8734 times)

Freddy

  • Guest
I just noticed that the C compiler will compile (and output ASM code from C with /Tx86-asm) NASM-Like syntax:
Code: [Select]
[global _addnum]
[section .text]
#line 1 "test.c"
[function _addnum]
_addnum:
push ebp
mov ebp,esp
mov eax,dword [ebp+(8)]
add eax,dword [ebp+(12)]
@1:
pop ebp
ret
..?X_addnum:
[section .drectve]
db " -defaultlib:crt"
[cpu pentium]

But PoASM assembles MASM-like syntax.
I don't know if it was on purpose. But very strange.
I like NASM-like syntax better, but I think PoASM is great.

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Historical/compatibility reasons - too late to change...
/Pelle

Romashka

  • Guest
I really thought POCC uses POASM now, instead of built-in assembler.
Is this planned for the future?

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
No. POCC and POASM share the same backend, but they use different parsers. POCC also have a separate inline assembly parser (which has nothing to do with POASM). Since it's possible to output an assembly file from POCC, tweak it (possibly using some private tool), and then pass the file back through POCC, I try to keep the POCC assembly syntax as 'static' as possible for compatibility reasons. Tweaking the assembly file from POCC is probably not very common, but I see no reason to change the current syntax.
/Pelle

akko

  • Guest
One silly question:
Where can I set the CCFLAG /Tx86-asm in the IDE?
I tried in Project Options - Macros , however it does not work. I can't find any asm output.
BTW I am using PellesC 6 rel.cand- #3 (perhaps it is just not working in the test release)

Thx

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Project Options -> Macros tab, but it will be 100% useless inside the IDE. You will get the assembly code as text in some xxx.obj file, and the following build steps will barf about the obj file not looking like an obj file. Use the command-line!
/Pelle