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

xas99 pragma for starting data definition directives on even addresses #39

Open
MirrorPusher opened this issue Jun 28, 2022 · 2 comments

Comments

@MirrorPusher
Copy link

Would be cool to have a pragma that allows one to start data definition directives on even addresses.
That would be especially useful if you for example have a sequence of multiple stri, text or byte directives.
Would save one from having a bunch of even directives littering the source code.

Example:

        stri ' '
        even
        byte    35
        byte    1,1,1,1,1,1,1,1,1,1,1,1,1
        text    ' Cursor '
        byte    1,1,1,1,1,1,1,1,1,1,1,1,1,1
        even                          
        stri 'Fctn s        Left'             : Some pragma for even addresses instead of 'even' on every 2nd line
        even
        stri 'Fctn d        Right'
        even
        stri 'Fctn e        Up'
        even
        stri 'Fctn x        Down'
        even
        stri 'Fctn h        Home'
        even
        stri 'Fctn l        End'
        even
        stri 'Fctn j        Prev word'
        ...
@MirrorPusher MirrorPusher changed the title pragma for starting data definition directives on even addresses xas99 pragma for starting data definition directives on even addresses Jun 28, 2022
@endlos99
Copy link
Owner

That'll be possible, but may I ask why you actually want to start each string on an even address?

Note that in your example, the first cluster from byte 35 to byte 1,1,... would then have three additional evens inserted. Also, is this per statement, or per string:

 text 'FOO', 'BAR'   # even between FOO and BAR?

@MirrorPusher
Copy link
Author

Starting strings or other data definition statements on even addresses allows the use of mov statements instead of movb.
Also do not need to check for uneven addresses.

So in this use case, it's basically keeping the display or memory copy statements trivial on the expense of wasting some memory space, but with for example the benefit of improved speed. (and with the final grom, SAMS and similar devices memory pressure is becoming a mood point).

Could imagine that for game development, it may be beneficial if you could specify the boundary as a multiple of 2 (2,4,8,16,..) but that's probably something for the game devs to judge.

To the question if this would be per statement or per string.
I have to say that so far I always had a new statement for each string. But looking at it from a more general perspective, perhaps it'd make sense to have it for each item instead of for each statement.

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