EdouardBERGE / rasm

RASM powerful Z80 assembler
129 stars 16 forks source link

Align odd #25

Closed anrikun closed 2 years ago

anrikun commented 2 years ago

Hi,

Is there a way to align code on an odd address? AFIK, there is no "Align odd".

I would need it for a self modifying code, e.g.: my_smc: ld de,0x10F0 ; 11 F0 10

If this line was odd aligned, F0 10 would be even aligned, and I could navigate between the 2 addresses with INC L/DEC L instead of INC HL/DEC HL.

ld hl,my_smc+1
ld a,(hl)
;;
;; Do sth.
;;
inc l
ld a,(hl)
;;
;; Do sth.
;;
dec l
;;
;; Do sth.
;;
inc l
;;
;; Etc.

Do you know a way to achieve that?

EdouardBERGE commented 2 years ago

You may align on even address then use +1 to be odd

ALIGN 2 : NOP ; same as 'align odd'

Or you can use dedicated instruction for array inc/dec optimisation => CONFINE

You need to "run" in a 5 bytes array? => CONFINE 5

Then Rasm will garantee you that the array will not cross over MSB change

anrikun commented 2 years ago

Thank you Edouard. CONFINE looks really useful but I can't see it in the documentation. Isn't it missing?

EdouardBERGE commented 2 years ago

yes, documentation is often delayed cons available functionnalities :)

take a look at https://github.com/sikorama/rasm-doc/issues (in french)

and to be specific => https://github.com/sikorama/rasm-doc/issues/14

anrikun commented 2 years ago

Nice! Merci beaucoup Edouard!

From: Edouard BERGE Sent: Tuesday, June 28, 2022 9:24 AM To: EdouardBERGE/rasm Cc: Henri MEDOT ; Author Subject: Re: [EdouardBERGE/rasm] Align odd (Issue #25)

yes, documentation is often delayed cons available functionnalities :)

take a look at https://github.com/sikorama/rasm-doc/issues (in french)

and to be specific => sikorama/rasm-doc#14

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>