Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align odd #25

Closed
anrikun opened this issue Jun 27, 2022 · 4 comments
Closed

Align odd #25

anrikun opened this issue Jun 27, 2022 · 4 comments

Comments

@anrikun
Copy link

anrikun commented Jun 27, 2022

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
Copy link
Owner

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
Copy link
Author

anrikun commented Jun 28, 2022

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

@EdouardBERGE
Copy link
Owner

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

@anrikun
Copy link
Author

anrikun commented Jun 28, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants