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

Fix stub functions #1

Open
nonarkitten opened this issue Apr 19, 2022 · 3 comments
Open

Fix stub functions #1

nonarkitten opened this issue Apr 19, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@nonarkitten
Copy link
Owner

Some opcodes like BCD may require the stack (check) and if so, will need to be rewritten.

@nonarkitten nonarkitten added the bug Something isn't working label Apr 19, 2022
@nonarkitten
Copy link
Owner Author

nonarkitten commented Apr 19, 2022

So yes they do. So right now, BCD opcodes look like this:

        .global opcode_4803
	.syntax unified
	@ NBCD #,D3
opcode_4803:
	push    {lr}
	ldrsb   r0, [r5,#12]
	bl      handle_nbcd
	strb    r0, [r5,#12]
	pop     {pc}

The push and pop are now illegal for PJIT; what we'll have to do is do a plain branch to handle_nbcd and let it write-back the result. This may mean needing a unique handle_nbcd for each addressing mode.

@nonarkitten
Copy link
Owner Author

nonarkitten commented Apr 19, 2022

Perhaps something like

opcode_4803:
        add     r1, r5,#12 @ precompure EA write-back
        ldrsb   r0, [r1]
        b       handle_nbcd_ea

@nonarkitten
Copy link
Owner Author

Note that this is also used for the division routines.

@nonarkitten nonarkitten transferred this issue from another repository Jul 5, 2022
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
None yet
Development

No branches or pull requests

1 participant