This is mostly a rant about my failures with assembly programming. I'd welcome any advice, but I wouldn't want to just post my code and say, "What's wrong with this 3kb program I made as my very first foray into Assembler?"

So, I've got a TI-86, and being thatKindOfGuy, I decided to find an RPN (Reverse Polish Notation) program for it, so I could use that instead of fiddling with ANS and the Entry key. And there was one on TI-Calc! So I installed that, and while it had some great features, it has some severe limitations I wanted to remedy:
1. Having used RPN on other calculators, I knew I needed at least a 5-level stack.
2. The Enter key for some reason pushed the Entry number to the stack twice (to X and Y), which is unacceptable
3. The temporary algebraic mode (where the calculator would return to EOS and operate EOS as normal) is exited with CLEAR, when 2nd[Quit] would be more reasonable.

So, rather than dealing with those, I took a look at the source code included in the project. However, after spending some time with it, and trying numerous times to assemble it to a .86p program, I came to the conclusion that there seemed to be something wrong with the source code provided. So in the end, using the original code as a base, I decided to try and re-write the whole thing to have the features I sought.

Well, I first had to start by learning assembly. Which was probably not the best place to start from, but I read up, and I seem to have gotten the basics (being aware of what it was, and having experience in other programming languages helped), then set to work on my task.

Ultimately, it took about a day, all of Sunday, to be precise, and ultimately I came out with a 3kb-ish program with a few include files and a whole lot of "Hmmm, I don't know what this seemingly very important Call does, do I'll include it and put a few ??? in a comment." In the end, I'd say I grasp about 95% of the program, but not all of it.

Then came the part I dreaded, which despite being so easy still felt monumental. I assembled it and sent it to WabbitEMU, and... to absolutely nobody's surprise, I messed something up, and it didn't even make it to the _puts calls. After a bit of fenangling, I at least made it through the installer (the program starts by running a little hook to copy the main program code to the HOME SQRTProgram), but now I'm stuck trying to figure it out from there, as it seems to, for some reason, end up in an infinite loop of ROM calls. It's late, and I have another busy day tomorrow, but I'm feeling all stuck. Fun!
Great that you're getting into 86 dev, it's not something you see too much of these days.

Unfortunately many past tutorials and tools are discontinued or not working, so I'm glad you managed to build your src.

Feel free to post a link to your code as I'm sure there will be people here who can assist.
Ooh the TI-86.. yes definitely if you're open to it, feel free to post the source and I'm sure there will be a couple of us more than happy to have a look and see if there's anything obvious that sticks out.

Either way, congrats on taking the plunge into Assembly, it can be daunting!
Well, thank you both for the quick congratulations. I had always thought about doing it, and I guess I just needed the impetus to actually dive into it!

I found one bad call by hand (I'm using a little VSCode extension for development, but it seems to be finicky as to how it wants to behave), and now it's doing... *something* different (It's just crashing on a Syntax error, which is better), but I'm short on time right now. If you all want the SRC, here's the repo which I just created:
https://github.com/HobbitJack/TIRPN-86
tr1p1ea wrote:
Unfortunately many past tutorials and tools are discontinued or not working, so I'm glad you managed to build your src.


I actually only figured out building it because of your comment in the other TI-86 Assembly post from last April.
I know i'm a bit late to the party but i just downloaded your source and got it assembling (the main program is "hook.z80", for anyone else looking into this in the future). I've never used RPN so am not familiar with that, but i am familiar with z80 assembly and should be able to help you troubleshoot things if you're still interested in working on it!

Edit: So it looks like it sets up a hook (a [Sqrt]HOME program, so it basically takes the place of the home screen). It seems like your code creates a program, loads the data there, then exits. When it exits back to the home screen, it freezes. I'm thinking you're probably not building the [Sqrt]HOME program properly. For one, it seems like a lot of those system calls use 24-bit sizes/addresses (putting the highest 8 bits in A) and you're not clearing it. I'll spend some time looking through it as i get time this week.

I found this site which has a wealth of information on the TI-86:
http://jgmalcolm.com/z80/
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement