E-mail Address
Password

Register
arasian > support > education > tutorial

Ti-83 and Ti-84 Assembly Programming
Getting Started
     1.1: About This Tutorial
     1.2: About TI-ASM
     1.3: Writing Your First Program
     1.4: Compiling
     1.5: Debugging
ASM Basics
     2.1: Calls and Jumps
     2.2: Registers
     2.3: Displaying Text
System Controls and Calls
     3.1: Data
     3.2: Register Stack
     3.3: If Statements (Comparing)
     3.4: GetKey and GetCSC
     3.5: System Flags
     3.6: Menus
     3.7: Displaying Pictures
     3.8: For Loops (djnz)
     3.9: White Loops
     3.10: OP Registers
Applications
     4.1: Apps vs ASM
     4.5: KeyHooks
Writing Your First Program

We'll start right off with a sample program. This will give you a sample and feel of the language, and teach you how to use the debugger. In the first program, we'll just clear the screen. In DOS (Go to Start, Programs, Accessories, MS-DOS Prompt; or Start, Programs, MS-DOS Prompt). Type "edit myprog.z80". Type in the code below:
.NOLIST
#define   EQU   .equ
#define   equ   .equ
#define   END   .end
#define   end   .end
#include "ti83plus.inc"
.LIST

     .org 9D93h
     .db $BB,$6D
      B_CALL(_ClrLCDFull)
     ret

end
Some notes and a breakdown of the program: The tabs are essential. It doesn't matter if they are tabs or just a space, but it is essential to have some kind of seperation.

.NOLIST
#define   EQU   .equ
#define   equ   .equ
#define   END   .end
#include "ti83plus.inc"
.LIST
This is the header of your program. The .NOLIST and .LIST turn on and off listing (the list is another output file that may be used for debugging). The EQU, equ, and END are being defined as .equ, .equ, and .end respectivley. "#define A B" defines A as B, so you could type A and it would be the same as typing B. #include, as in other programs, includes a file. In this case, it's including ti83plus.inc, which has all the defines and equates that you'll need.

     .org 9D93h
     .db $BB,$6D
This section of the program is also required for every ASM program. The .org 9D93h tells the calculator where the program starts in memory. The .db $BB,$6D is the compiled AsmPrgm token. This tells the calculator that this is an ASM program.

      B_CALL(_ClrLCDFull)
This is the body of your program. Since this is a simple program, we have only one command here. But this is where all the code is put.

     ret

end
This is the end of your program. "ret" returns the program to the Ti-OS. This is a REQUIRED command, and if left out will cause the calculator to crash. The end tells the calculator that this is the end of the program.
Creative Commons License
The text in this tutorial is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License.

Privacy Policy | Contact Us
(c) 1999-2010 Arasian. All rights reserved.