Format and Compiling
z80 » Beginner
Before you can really start learning to program you are going to have to have some basic tools.
- TI-GRAPHLINK (Texas Instruments)
- Assembly Studio 86 (Assembly Coders Zenith)
#include "ti86asm.inc" . . . . . . (aliases and defines) . . . . . . .org _asm_exec_ram . . . . . . (program code) . . . . . . (variables) . . . . . . .end
Those are the two tools I have so those are what I will be referring to. It is definitely possible to program with a homemade link and some freeware linking software, but Assembly Studio is nice because it combines all aspects of programming into one program. You don't have to use MS-DOS EDIT to edit the file, another MS-DOS program to compile it, your linking software to send it, and then overwrite the file if you already have it on the calculator.
Asm Studio also lets you select options so that all you do is his [Ctrl] and [F5] and Asm Studio sends the file to your calculator and overwrites the previous version. Asm Studio just takes care of the bottlenecks, not to mention adding several features that you will wonder how you could ever have lived without.
Later on in programming you will want to have a complete set of include files for your code downloaded and in your include search path directory. If you have Asm Studio, that directory would be "Include". You will also want to start collecting your own library of reference material. Check out the Download Section for my current stash of files. Start collecting now so you can get all the weird files on all the weird stuff there is with asm programming.
To start you off getting comfortable with Asm Studio, we're going to try to compile something and send it to your TI86.
- Make sure your calculator is plugged into the graph link and turned on.
- From inside Asm Studio select File | New. We'll need to copy and paste the following section of code into the new document, overwriting everything already in 'Document 1'. To do that, hold down the [Shift] key while dragging your mouse from the top to the bottom of this example program.
- While holding down [Ctrl] hit [C] to copy the code from this page.
- Go into Asm Studio and, while holding down [Ctrl], hit [A] to select all the text in the window.
- Paste the code with [CTRL] [V].
- Save the file as
practice1in the 'Programs' directory of your Asm Studio folder. Asm Studio will automatically save it with an
Nbeing some number.
#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
You need to have your TI86 plugged into your Graph Link, turned on, and at the homescreen. If you have errors, go to the Asm Studio Help section "Troubleshooting". To run your program, once it has been sent to the TI86, type the following:
Asm(arg1)Where arg1 is type the name of the program. You can get
Asm(from the TI86's Catalogue, and you can go get the name of your program through the Program Menues. Hit [ENTER] to startup your program.
Let's say you saved your above program as
hello.asm and assembled it as
hello.86p. You would send the
*.86p file to your calculator and type in the following at the homescreen.
Make sure you put a Tab at the start of every line in your code that has an instruction on it. The assembler will then recognize them as instructions and not labels.
More from z80 » Beginner
Aliases // Convert from decimal to hexadecimal or binary // Flags and Conditions // Format and Compiling // Instructions // Math // Number Bases // Oh, No! It Crashed! // Registers // TI-BASIC to Asm Comparisons // TI86 Specifications // Two's Compliment // z80 Processor