Quote from: HAL6128 on Today at 09:52Thanks for the fast response!
...oh, was not my intention to point to this name conflict which I wasn't aware. It was just an example (the macro name is not my question ) ...
Let me change it to:
MACRO Write2Register register , data
LD A,{register}
LD BC,#FF64 ; port for register select
OUT (C),A
LD A,{data}
LD BC,#FF63 ; port for data transfer
OUT (C),A
MEND
LD A,#88
Write2Register #10,A
My question was regarding the "LD A,B" conversion of the macro statement "LD A,{data}", if this is a normal procedure to use register B for the second parameter {data}? Am I correct with this assumption?
HAL6128
roudoudou@praline:~/code/rasm$ ./rasm.exe ldmac.asm -map
Pre-processing [ldmac.asm]
Assembling
Bnk|Real|Logic Bytecode [Time] Assembly
-----------------------------------------
| SYNCHRO EQU 256
| IX EQU 0
| IY EQU 0
| RASM_VERSION EQU 2.2
MACRO WRITE2REGISTER,REGISTER,DATA
000|0000 | 3E 00 [02] LD A,#88 (L9:ldmac.asm)
; Macro WRITE2REGISTER expansion with 2 parameters
000|0002 | 3E 00 [02] LD A,#10 (L10:ldmac.asm)
000|0004 | 01 00 00 [03] LD BC,#FF64 (L10:ldmac.asm)
000|0007 | ED 79 [04] OUT (C),A (L10:ldmac.asm)
000|0009 | 7F [01] LD A,A (L10:ldmac.asm)
000|000A | 01 00 00 [03] LD BC,#FF63 (L10:ldmac.asm)
000|000D | ED 79 [04] OUT (C),A (L10:ldmac.asm)
Write binary file rasmoutput.bin (15 bytes)
Quote from: Benedikt on Yesterday at 18:03I am going to use an ATF16V8 with known-working configuration for RAM banking, i.e. copy this aspect of the CPC6128's design.But PAL produces CAS0, CAS1 signals for two parts of RAM. If you want to read 16bit from two banks, the CAS0,1 signals must be modified.
MACRO Write2Register register , data
LD A,{register}
LD BC,#FF64 ; port for register select
OUT (C),A
LD A,{data}
LD BC,#FF63 ; port for data transfer
OUT (C),A
MEND
LD A,#88
Write2Register #10,A
Quote from: Gryzor on Today at 08:26Maybe I should get some more sleep, I don't understand your comment...
Quote from: HAL6128 on Today at 08:43Hi @roudoudou,hi! i'm surprised there is an ouput of this macro as 'write' is a reserved keyword (for Winape compatibility) and is barely ignored
just another understanding question regarding macros in RASM:
I have defined a macro like this:MACRO Write register , data
LD A,{register}
LD BC,#FFxx ; port for register select
OUT (C),A
LD A,{data}
LD BC,#FFxx ; port for data transfer
OUT (C),A
mend
; "calling" the macro
LD A,#88
Write #10,A
shows following code after assembling:LD A,#88
LD A,#10
LD BC,#FFxx
OUT (C),A
LD A,B ; <<<?
LD BC,#FFxx
OUT (C),A
why does the assembler choose LD A,B? (Register B) for the {data} value? Is this the way RASM works within macros?
Thank you in advance.
HAL6128
MACRO Write register , data
LD A,{register}
LD BC,#FFxx ; port for register select
OUT (C),A
LD A,{data}
LD BC,#FFxx ; port for data transfer
OUT (C),A
mend
; "calling" the macro
LD A,#88
Write #10,A
LD A,#88
LD A,#10
LD BC,#FFxx
OUT (C),A
LD A,B ; <<<?
LD BC,#FFxx
OUT (C),A
Page created in 0.030 seconds with 16 queries.