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

Possible bug in UM/MOD #3

Closed
TG9541 opened this issue Feb 6, 2021 · 4 comments
Closed

Possible bug in UM/MOD #3

TG9541 opened this issue Feb 6, 2021 · 4 comments

Comments

@TG9541
Copy link

TG9541 commented Feb 6, 2021

@MrMarkB found a bug in Dr. Ting's original STM8EF code that's likely also in your code base.

Please refer to TG9541/stm8ef#400

@Picatout
Copy link
Owner

Picatout commented Feb 7, 2021

Bug corrected using umMod.txt
But this path had itself a bug that I corrected replading instruction SRAW X by RRCW X at MMSMb label.

@TG9541
Copy link
Author

TG9541 commented Feb 8, 2021

@Picatout thanks for figuring this and also TG9541/stm8ef#401 out!

@Picatout
Copy link
Owner

Picatout commented Feb 8, 2021

applied applied correction for overflow control solve the issue when the upper part of dividend is == to divisor. udh must be smaller than divisor to avoid overflow. I compared the result with gforth and they agree.

~$ gforth
Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.
Gforth comes with ABSOLUTELY NO WARRANTY; for details type license' Type bye' to exit
hex ok
20000 8000 /mod . . 4 0 ok
20000 ffff /mod . . 2 2 ok
20000 8f00 /mod . . 3 5300 ok
20000 7f00 /mod . . 4 400 ok

@Picatout Picatout closed this as completed Feb 8, 2021
@TG9541
Copy link
Author

TG9541 commented Feb 10, 2021

Thanks for the collaboration!

I've referenced your repository in the Wiki here

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