6502user wrote:
Hi.
Can you help me also, please?
I'm starting to compile some code with the CCA65's CA65. When I compile it without MAcros, all is working ok. But if I use macros the macros don't be compiled (but the process don't give error.
You need to generate a listing file and have a look there. Use the -l flag like:
-l file.l on the command-line with the rest of the ca65 command.
Then you should see the macro expansion - however note that ca66 will only show the bytes gnerated and not the actual assembler macro expansion..
Here is an example of a macro definition:
Code:
.macro waitBaud
.local loop
ldy sBaud
loop: dey
bne loop
.endmacro
and what it looks like in the code:
Code:
; Delay 1 bit time
waitBaud
so just one line of the macro name.
And this is what it looks like in the listing file:
Code:
00005Br 1 ; Delay 1 bit time
00005Br 1
00005Br 1 A4 rr 88 D0 waitBaud
00005Fr 1 FD
The
rr just means a relocatable value but if you were to disassemble that it would look like:
Code:
ldy $EA
L109C: dey
bne L109C
(and here you can see the relocatable value is $EA - not really important here)
Hope that helps.
-Gordon
_________________
--
Gordon Henderson.
See my
Ruby 6502 and 65816 SBC projects here:
https://projects.drogon.net/ruby/