EdouardBERGE / rasm

RASM powerful Z80 assembler
132 stars 16 forks source link

On error in a macro, assembler reports the line of the "call" to the macro instead of the line of the error inside the macro #24

Closed anrikun closed 2 years ago

anrikun commented 2 years ago

Hi, I have 2 files: the main.asm file and an included file with a bunch of macros.

There is an error in one of my macros but assembler reports the line of the "call" to the macro instead of the line in the macro itself, making it impossible to know where the error actually is. Am I missing something?

Output when assembling:

Pre-processing [./src/main.asm]
Assembling
Warning: [.\src\main.asm:140] Warning: truncating value #100 to #0

At line 140 in main.asm, there is: runFrame (void) ; (runFrame is the name of the macro present in the included file)

EdouardBERGE commented 2 years ago

there is no way to know if the error is due to the macro or an inappropriate arguments for the macro the main error must remain the macro call but i will try to do something to point out which line in the macro as a second information

anrikun commented 2 years ago

Thank you very much Edouard.

EdouardBERGE commented 2 years ago

solved with last commit any error will display first the macro call line then the file/line inside macro https://github.com/EdouardBERGE/rasm/commit/9bace62c71d5d2d1985662fc0764114b2ae4acea

macro glop
ld sp,sp
mend
glop (void)
ld sp,sp

Pre-processing [macrerr.asm]
Assembling
[macrerr.asm:4]  inside macro => [macrerr.asm:2] cannot use register SP in this context
[macrerr.asm:5] cannot use register SP in this context
2 errors
anrikun commented 2 years ago

Thank you again for your work Edouard.