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

Re. note in DB.4th, "DEFINE UM* and UM/MOD" #1

Open
marktmiller opened this issue Sep 24, 2024 · 2 comments
Open

Re. note in DB.4th, "DEFINE UM* and UM/MOD" #1

marktmiller opened this issue Sep 24, 2024 · 2 comments

Comments

@marktmiller
Copy link

Hi,

Not opening an issue, just a comment.

I got here through the Antic Atari 8-bit podcast "Are the Grandkids Listening?!". I've been working in APX Extended Fig-Forth for a while. I was looking through your code, and saw in DB.4th that you need implementations for UM* and UM/MOD. It just so happens I have implementations for both, but perhaps you've already been working on your own.

UM* is pretty simple (if I understand it correctly):

: UM* ( n1 n2 — d) M* DABS ;

I wrote up an implementation of SM/REM in Forth assembler. UM/MOD uses it. If you'd like, I can post the code for SM/REM and UM/MOD here in a comment.

@BartGo
Copy link
Owner

BartGo commented Oct 2, 2024

Wow, thank you (and thanks to Kay)!

I will appreciate any tunings for this Forth, as well as your FP words.

@marktmiller
Copy link
Author

I'm remembering now, I wrote SM/REM in assembler, but realized after I got it done that APX Forth already has it, but calls it M/. So, you can just write an alias for it:

: SM/REM M/ ;

(n2 = remainder n3 = quotient)
: UM/MOD ( d1 n1 — n2 n3)
SM/REM ABS ;

I've been meaning to put my Forth code on Github. The FP listing is rather lengthy, and I need to do more testing. I ported all of the FP functions from Turbo Basic. Plus, I've rewritten, and added FP comparison operators, mostly in assembly. I'll see what I can do.

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