I have a TI-86 that I used in high school to play around with some simple assembly. I was hoping to try it again but I've run into some snags. I've rediscovered some great resources for the TI-86 assembly programming, but I can't seem to get an assembler working for generating .86p files, at least I can't get it to work on Windows 10. I tried hacking around some tutorials for the TI-84 with spasm-ng by changing the includes but no dice. I'm hoping to avoid full-on emulation of an older Windows OS just to get it to work. I've seen some suggestion that it might be possible to do it in two steps, first generating a binary and then .86p? Any ideas or would I have to spring for a brand new calculator?
spasm-ng knows how to generate 86p files, so you shouldn't need to do anything particularly special; you just need to use the includes for the 86.

Concretely, the sample program from The Guide with the matching include files should be buildable with spasm-ng test.asm test.86p.
Code:
#include "ti86asm.inc"   ;equate file
.org _asm_exec_ram      ;where it starts
   call _clrLCD      ;clear the screen
   ld bc,$0000      ;at coordinates (0,0)
   ld (_curRow),bc      ;load coodinates
   ld hl,hello_text   ;address of text
   call _puts      ;display it
   call _getkey      ;wait for keypress
   ret         ;exit program
hello_text:   .db "hello",0   ;text to display
.end            ;end of source code
Thanks for your response! So I used the exact program posted above, along with the include file downloaded from The Guide. It throws up hundreds of:

\ti86asm.inc:19: error SE113: Unknown opcode 'equ'

If it makes a difference, I am using Powershell, and used the command spasm64 test.asm test.86.p, as I just used the prebuilt binary from the spasm-ng GitHub. Sure enough, the include file is filled with the 'equ' opcode pretty much everywhere. Do I need to do it differently?
OK as an update, I tried skipping the include file altogether by commenting it out, and replacing the commands like _curRow and _clrLCD with the hex commands directly copied from the corresponding equates in the include file. So the code looks like:

Code:
;#include "ti86asm.inc"   ;equate file
.org 0D748h      ;where it starts
   call 4A7Eh      ;clear the screen
   ld bc,$0000      ;at coordinates (0,0)
   ld (0C00Fh),bc      ;load coodinates
   ld hl,hello_text   ;address of text
   call 4A37h      ;display it
   call 5371h      ;wait for keypress
   ret         ;exit program
hello_text:   .db "hello",0   ;text to display
.end            ;end of source code


This assembles fine and the corresponding .86p file works on my TI-86.

So my guess is something in spasm is not playing well with ti86asm.inc (I guess the 'equ' opcode given the error shown in my above comment?). While I'm happy to have figured this out, the prospect of having to work around this isn't something I'd be exciting about having to do every step of the way.

Is it something that can be fixed easily by adjusting the include file, or something that has to be done in spasm? Appreciate any help.
I remember for TASM we always had to do things to make equ equivalent to .equ, so I'd imagine there's something similar here, e.g. whatever the TASM equivalent of #define equ .equ.
Try putting this definition at the top of your code:


Code:
#define equ .equ
#include "ti86asm.inc"   ;equate file
.org _asm_exec_ram      ;where it starts
   call _clrLCD      ;clear the screen
   ld bc,$0000      ;at coordinates (0,0)
   ld (_curRow),bc      ;load coodinates
   ld hl,hello_text   ;address of text
   call _puts      ;display it
   call _getkey      ;wait for keypress
   ret         ;exit program
hello_text:   .db "hello",0   ;text to display
.end            ;end of source code


EDIT - ninja'd Very Happy
The define statement did it! Thanks for the help!

Any other general stumbling blocks with spasm and older includes like this one? Looking at the TASM docs, I see that it appears that all the assembler directives require a period in front of them. Is that something that will need to be constantly watched?
I'd recommend putting that define in the include file itself (at the top) so you don't have to worry about it for any future files you are working on.

Most important when learning assembly is to familiarise yourself with the hardware platform & memory layout etc. If you haven't alreadyseen, there are some good guides here: https://www.ticalc.org/basics/calculators/ti-86.html
Gotcha, I was wondering if putting it in the include itself was possible.

I'm planning on going through The Guide, which is the most complete-looking TI-86 specific assembly tutorial I've found so far, but I'm open to other suggestions, and I'm sure I'll be returning here for help!
  
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