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

Potential issue with stack splat in exec16 from *RUN <addr> #101

Open
jackokring opened this issue Oct 22, 2023 · 2 comments
Open

Potential issue with stack splat in exec16 from *RUN <addr> #101

jackokring opened this issue Oct 22, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@jackokring
Copy link

N.B. Is there a stack splat in misc.asm within _exec16 by not setting sp
to some value before call.is? Not for $B0000 loading, but for say
$A0000 loading, as it might need a temp save, set sp, fix splat,
do stuff, put stack back, ret.lis. It would likely be with some recusion
and an almost at the limit 16 bit binary, assuming a high memory stack.
Check splat in mos.c function mos_cmdRUN before exec16?

I mean a $B0000 is likely fine, but a potential future issue. Not really a bug yet.

@jackokring
Copy link
Author

#9 FIX Perhaps a ld.sis sp, 0 or ld.sis sp, $8000 before the CALL.IS (DE): RET
based on the A segment being $0B to prevent global (SPL) clobber by the two byte (SPS) write of call.is?

This maximizes expected global size with confirmed max 32kB *plugin including stack, while making a logical aligned 64 kB segment except in $B0000. cp $0B: jr z, ....

Yes I assume the IX to SP restore is a stack frame thing.

@breakintoprogram
Copy link
Owner

I'll double check - the stacks * should * be set up with sensible defaults but that doesn't necessarily mean I've covered all the bases.

@breakintoprogram breakintoprogram added the bug Something isn't working label Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: No status
Development

No branches or pull requests

2 participants