The basic structure of an assembly program consists of a header, body, data, and end. The header contains the references to include files. These files contan code to address memory on the calculator. You can call predefined subroutines from these that allow you to perform operations and shorten code. The stardard layout is descibed below. This program will not visibly do anything, so it would be useless to compile it. Semicolons denote a comment and can be left in a source file. A standard header would be as follows:
.NOLIST ;Tells TASM not to process lines as codeThe body is what contains the code for your program. A simple body would contain:
#include "ti83plus.inc" ;inserts standard Romcalls
#include "mirage.inc" ;inserts MirageOS Romcalls
.LIST ;Resumes processing
.org 9D95h ;tells processor(program counter) to begin program
ld a,5 ;stores value of 5 into the accumulatorThe data section would include all string values. Here is str1:
ld hl,str1 ;stores address of str1 into hl
ret ;returns to TI Operating System
str1:The end is always two lines:
.db "hello world",0 ;stores "hello world" into a zero terminating string
.end ;tells TASM to endAs review, in this section you saw two new commands:
END ;safety in case tasm skips the first line
ld [register],[value] loads value into registerYou can find any of these commands in the reference section on the left."
ret returns to operating system