6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Sep 29, 2024 4:31 pm

All times are UTC




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Nov 15, 2019 8:53 pm 
Offline

Joined: Wed Oct 23, 2019 12:55 pm
Posts: 15
I'm using 64tass to build an application composed of optional modules

to avoid a lengthy list of includes I created a macro

I have a table of all the modules with value 0 or 1 (one if wanted)
...
MODREGS = 1
MODLOAD = 1
MODEXIT = 0
...

DEFPKG .MACRO CMD, FILE
.IF MOD\CMD
.INCLUDE "commands/" .. \FILE .. ".asm"
.ENDIF
.ENDM


with this macro I can reduce the include to 1 line by module
ex:
...
CMDLOAD .DEFPKG LOAD, "load"
CMDREGS .DEFPKG REGS, "regs"
...

here the content of "load" is only called from a table of pointers (the pointers are correct)
but for regs it's call directly (if the module is assembled in the code) or via the table of pointers

via the table of pointers, it always works
for the direct call the label CMDREGS is defined as 0000 so the application crashes

code generated:
...
.612b 20 26 62 jsr $6226 JSR PRTCRLF
.612e 20 00 00 jsr $0000 JSR CMDREGS ;- display the registers
.6131 2c 0e 7a bit $7a0e CMDLOOP: BIT STUFFED ;- suffed mode ?
...

64tass works fine but I'm new with 64tass and I'm really struggling with the macro

any idea on how I could solve this problem?

thanks


Top
 Profile  
Reply with quote  
PostPosted: Mon Nov 18, 2019 9:51 pm 
Offline

Joined: Mon Nov 18, 2019 8:08 pm
Posts: 9
Hello!

I tried the source code fragments provided with all release versions of past 6 years without success.

Please try to reduce the source code to a minimal but complete example which reproduces this behaviour. The version number and command line options may be interesting as well.

Thanks!
Code:
; 64tass Turbo Assembler Macro V1.54.2095 listing file
; 64tass --verbose-list -L listing.txt test.asm
; Mon Nov 18 21:08:15 2019

;Offset ;Hex            ;Monitor        ;Source

;******  Processing input file: a.asm

=1                                      MODREGS = 1
=1                                      MODLOAD = 1
=0                                      MODEXIT = 0

                                        DEFPKG .MACRO CMD, FILE
                                        .ENDM

                                        *=$1000

.1000                                   CMDREGS
                                        .IF MODREGS
                                        .INCLUDE "commands/" .. "regs" .. ".asm"

;******  Processing file: commands/regs.asm

.1000   ea              nop             NOP
.1001   60              rts             RTS

;******  Return to file: a.asm

                                        .ENDIF

.1002   ea              nop             NOP
.1003   20 00 10        jsr $1000       JSR CMDREGS
>1006   00 10            .ADDR CMDREGS

;******  End of listing


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: