-
Notifications
You must be signed in to change notification settings - Fork 7
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
Possibility set ADL offset for non-ADL code #78
Comments
The LD.LIL HL, (Mmn) opcode expects a 24-bit address to access the ADL space outside the non-ADL boundary of 64KB that the assembler works with in non-ADL mode. |
It's up to the programmer to specify an outside address, potentially derived from an outside-of-the assembler source. |
Let me show you on example: https://github.com/nihirash/ZINC/ I'm working on CP/M emulation layer for MOS and you can check my code 😸 For example, if I'll make something like(
It should work as I expect but it breaks on function table in Why I need ADL pointers? Cause MOS still have ADL only functions in file api and I need to provide full 24-bit address for them like for fread/fwrite( I'll be glad to any solution if it will make my code less magical. But if it'll break usual use cases - I can keep this parts the same as now. |
I'm sure that your ask is legitimate, however it's still not clear to me what exactly it is you are asking. |
I need compile non ADL code with possibility use full prefixed full addressing commands(like here: https://github.com/nihirash/ZINC/blob/1ef1c1025fac78c328a38a7c74e3ee31378b39ac/src/edos/disk.asm#L209 ) I've spend some time with thinking about it and found that best way will be allow truncating addresses in ADL=0 mode to words(for this: https://github.com/nihirash/ZINC/blob/1ef1c1025fac78c328a38a7c74e3ee31378b39ac/src/edos/core.asm#L72 usage). You can produce warning about truncating value to just 16 bit but allow storing them as words(in ADL=0 mode at least). If I'll specify in ADL=1 mode full address obviously - it will be correct way to use it in prefixed mode and don't produce corner cases. And after switching ADL off, I'd like have possibility store 16 bit pointers to links(warning here is ok). For making things a bit more clear I've prepared isolated test-case:
Sorry for unclear explanation |
I think I understand what you are trying to do. Let me ponder how to best approach this |
fixed in 24b86a9 |
Fix confirmed! |
Sometimes, if you're writing code for legacy mode, you'll need use prefixed commands like LD.LIL for example:
And current version will built binary with zero offset but MOS applications use
$40000
base offset for all addresses and some of my code works in next page(with base offset$50000
).Currently, I'm using workaround with adding numeric constant for basic address offset like:
But if we'll introduce possibility compile non ADL programs with specified MB-offset - it will be great!
The text was updated successfully, but these errors were encountered: