Overview
We're
going to recognize and identify the parts of a program.
What belongs
where in a program?
Look
at the format of an Asm program, just follow along. Just to let
you know a ; (semicolon) means anything on that line is a remark.
Remarks are used to make comments in a program. Remarks are not
read by the assembler or calculator. A note when writing Asm
programs, indentations are required, they help the TASM assembler
read the program so it can understand.
#define B_CALL(xxxx)
rst 28h \ .dw xxxx ;THE HEADER
#define B_JUMP(xxxx) call 50h \ .dw xxxx
;
;
;
;DEFINES AND EQUATES (Part of the HEADER)
;
;
;
.org 9D95h ;THE PROGRAM START
;
;
;THE BODY
;
;
.end
;THE END
END
The HEADER
There
is not much to know about this section except that it goes into
every Asm program you write. what you should know about this
section is that it defines the two macros B_CALL and B_JUMP.
These macros call
ROM calls. If you use an
include
file,
this section is not necessary.
The DEFINES AND
EQUATES (Part of the HEADER)
This
section allows you to define each call you use in your program.
Again, if you use an include file and know that the commands you
are using are covered in there, you do not have to define them
again. To incorporate an include file to define calls, type in #include
"XXX.inc". Where XXX is the name of the
include file. An include file is a file that has ROM calls or
routines defined in them. The #include statement
just saves you time by copying the contents of the include file
to the program.
The PROGRAM
START
This
tells the calculator where to start running the program in memory.
With the TI-83 Plus, the program always starts at the address 9D95h.
The BODY
The
body of the program is where you write the calls and functions (routines)
you want the program to do. It can be as long as you want. You
must call each call or function using the B_CALL(xxxx) statement.
Where xxxx is the command you wish to run. Make sure you define
each ROM call in the Defines and Equates section when you use
them in your program. Or make sure that the specific ROM call is
in the include file if you are using one.
The END
Simply
stated. The END of the program. This must always be at the end of
every program. Don't change anything in this section, all you
need is the .end and END.
Click to return to the site's menu... or here to get back to the tutorial's menu.