News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Recent posts

#1
avatar_roudoudou
Programming / Re: Rasm Z80 assembler
Last post by roudoudou - Today at 11:46


#2
avatar_HAL6128
Programming / Re: Rasm Z80 assembler
Last post by HAL6128 - Today at 10:40
Damn, yes, you're right. I'm using embedded libraries for the macros, and I changed the wrong one without noticing it. Stupid, stupid... :picard2:
So... the macro in this way makes no sense because A as a second parameter will be overwritten by previous actions...
#3
avatar_roudoudou
Programming / Re: Rasm Z80 assembler
Last post by roudoudou - Today at 10:23
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

i cannot reproduce the issue, the outputed opcode is #7F

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)

#4
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.
#5
avatar_HAL6128
Programming / Re: Rasm Z80 assembler
Last post by HAL6128 - Today at 09:52
Thanks 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
#6
avatar_Gryzor
Off topic / Re: One for my UK friends
Last post by Gryzor - Today at 09:39
What is this Wikipedia thing, I get all my info from Encarta.
#7
avatar_Bryce
Off topic / Re: One for my UK friends
Last post by Bryce - Today at 09:06
Quote from: Gryzor on Today at 08:26Maybe I should get some more sleep, I don't understand your comment...

https://en.wikipedia.org/wiki/Thread_(yarn)

Bryce.
#8
avatar_roudoudou
Programming / Re: Rasm Z80 assembler
Last post by roudoudou - Today at 09:00
Quote from: HAL6128 on Today at 08:43Hi @roudoudou,
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
hi! i'm surprised there is an ouput of this macro as 'write' is a reserved keyword (for Winape compatibility) and is barely ignored

i tested it with -map option and there is no surprise, Write output nothing

will add some check for the macro name and warn about that conflict
#9
avatar_HAL6128
Programming / Re: Rasm Z80 assembler
Last post by HAL6128 - Today at 08:43
Hi @roudoudou,
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
#10
avatar_Gryzor
Off topic / Re: One for my UK friends
Last post by Gryzor - Today at 08:26
Maybe I should get some more sleep, I don't understand your comment...
Powered by SMFPacks Menu Editor Mod