Author Topic: *test & x* Bug in JWasm and AsmC  (Read 3643 times)

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: *test & x* Bug in JWasm and AsmC
« Reply #15 on: May 09, 2016, 10:16:22 AM »
Quote
Well, this may not be an issue any more but I have to do some testing. If you apply the -W3 switch you will see where the C-parsing ended. The logic has changed a bit so this may work now.

I removed the auto-off switch for the C/macro parsing. This means that MasmBasic now will be assembled with all extensions of ASMC. Normally this would be turned off by the above code.

I also implemented the exception handler. There are still some unhanded exceptions in the library code that needs to be sorted out but at least it will exit more gracefully now.

Well, it passes the regression test but it would be interesting to see if it also passes the MasmBasic test. If this (for some reason) works you may look at the size of the output (old.lib/new.lib) to see if it actually produces the same binary output as before.

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: *test & x* Bug in JWasm and AsmC
« Reply #16 on: May 09, 2016, 10:55:18 AM »
it doesn't like OPTION CSTACK:0 in MasmBasic.inc, line 221
if I comment that out, it stumbles frequently over Mirror$() with error typedef

will check tomorrow...

jj2007

  • Member
  • *****
  • Posts: 7752
  • Assembler is fun ;-)
    • MasmBasic
Re: *test & x* Bug in JWasm and AsmC
« Reply #17 on: May 09, 2016, 10:38:15 PM »
I removed the auto-off switch for the C/macro parsing. This means that MasmBasic now will be assembled with all extensions of ASMC.

I got another weird one:

error A2190: INVOKE requires prototype for procedure

Code: [Select]
ExternDef MbFH:DWORD
invoke SetFileTime, MbFH(4*10), edi, edi, edi

It works with
- eax instead of MbFH()
- MbFH[4*10] instead of MbFH(4*10)

Btw is there any consensus on the use of round vs square brackets here? My checks show that ML and AsmC use the same encoding for both; but for me the round brackets look a bit wrong ::)

nidud

  • Member
  • *****
  • Posts: 1410
    • https://github.com/nidud/asmc
Re: *test & x* Bug in JWasm and AsmC
« Reply #18 on: May 10, 2016, 01:23:35 AM »
Quote
it doesn't like OPTION CSTACK:0

Option ASMC and CSTACK now use ON/OFF. The default for CSTACK is OFF, so no needs to turn it OFF. The option ASMC may however be used for testing the HLL parsing.

Quote
Btw is there any consensus on the use of round vs square brackets here? My checks show that ML and AsmC use the same encoding for both; but for me the round brackets look a bit wrong

Yes, that’s indeed a problem as addressed here:
http://masm32.com/board/index.php?topic=902.msg57244#msg57244

Other related issues on labels:
Code: [Select]
plabel proto
extern elabel:dword
.data
dlabel label dword
.code
clabel:
call ax
call eax
call dword ptr [eax]
call plabel
call elabel
call dlabel
call clabel
call xlabel

ax()
eax()
;dword ptr [eax]() ; TODO
plabel()
elabel()
dlabel()
clabel()
xlabel()
xlabel:

So use square brackets for accessing data and round brackets to execute. An error will be issued if OPTION ASMC:OFF is set and labels are accessed using round brackets, but this is not implemented yet.

Empty brackets () will be given special (or loose) handling if the token in front is not a macro.

I’m currently writing a manual, using the updated JWasm.chm file, to provide more details on all the new (and old) changes. It’s tiresome stuff but rather useful to tie some of the loose ends to a document.