alberthdev / spasm-ng

SPASM-ng is a z80 assembler with extra features to support development for TI calculators.
GNU General Public License v2.0
97 stars 23 forks source link

invalid AppOnErr(xxxx) macro in ti83plus.inc #85

Open bxparks opened 5 months ago

bxparks commented 5 months ago

Problem

The definition of the AppOnErr(xxxx) macro in ti83plus.inc is incorrect and does not work. It is currently:

#define AppOnErr xxxx ld HL,xxxx \ CALL APP_PUSH_ERRORH

The error message is:

$ ../../spasm/spasm -I ../../spasm/inc -N rpn83p.asm rpn83p.8xk
Pass one... 
.../mainscanner.asm:30: Error during invocation of macro 'APPONERR'
.../mainscanner.asm:30: warning SW804: Macro 'APPONERR' was given too many arguments, ignoring extras

Solution

It should probably have some parenthesis:

#define AppOnErr(xxxx) ld HL,xxxx \ CALL APP_PUSH_ERRORH

Workaround

Just expand the macro manually when needed:

ld hl, xxxx
call APP_PUSH_ERRORH