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

Divide by zero occuring in _UDivMod32 (68000) assembly function #52

Open
djipi opened this issue Nov 29, 2024 · 3 comments
Open

Divide by zero occuring in _UDivMod32 (68000) assembly function #52

djipi opened this issue Nov 29, 2024 · 3 comments

Comments

@djipi
Copy link

djipi commented Nov 29, 2024

The occurrence appears at the divide low part after the 10$ label in the lib/lowlevel integer.s source.

The division by zero leads to undefined results.
it may be good to add a stub in the library and to set the 68000 exception vector so we can catch this issue the way we want to?
Or to do a reference about this in the documentation?

@hth313
Copy link
Owner

hth313 commented Dec 3, 2024

Is the divisor input zero?
Installing a vector is highly specific to the execution environment and is probably best done by the application. Are you on TOS?

@djipi
Copy link
Author

djipi commented Dec 3, 2024

Is the divisor input zero?

Yes.

Installing a vector is highly specific to the execution environment and is probably best done by the application.

My emulator catches the exception now and stop executing.
Also, the same code compiled with different 68000 compilers don't create a divide by zero, so I may have a hidden bug in my code too.

Are you on TOS?

No, my code runs on Atari Jaguar, 68000 based system without Operating system. It can be considered as a bare-metal system.

@hth313
Copy link
Owner

hth313 commented Dec 4, 2024

OK, I will leave this one open for now, but not so much I can do at this point. 🤔

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