Tutorial 23
Assembly language shells - Using Ion

Introduction
   
Shells are calculator programs that make it easier to setect and run assembly language shells. Some shells, such as Ion, provide the user with a few special routines, which may make a programmers life easier.

What is Ion?
    Ion is an Assembly Language Shell for the TI-83 and TI-83 Plus written by Joe Wingbermuehle. Some special features about Ion is that you are able to use routines unique only to Ion! Another good thing about Ion is that programs assembled for Ion will run on both the TI-83 and TI-83 Plus. This tutorial will show you how to make a program that runs under Ion.

Things to Know
    Ion is TI-83 Plus Asm. Ion is a shell that runs Asm programs. For Ion to detect an Asm program, it must have the following header at the top of the program. If you look at some very well written Ion games/programs, you will see that there may not be any obvious header. This is okay, as long as the contents is somewhere in there. Ion programs must also use the Ion include file. This is because special Ion routines are located there and using the Ion include file allows the user to assemble the program for the TI-83 and TI-83 Plus. Ion programs also use the bcall() macro to call ROM calls rather than the more familiar B_CALL() macro.

Programming
    All programs that you want displayed by Ion should have the following header at the beginning of every program:

    .nolist
    #include "ion.inc" ;This is the Ion include file that must be used with Ion.
    #ifdef TI83P
    .org progstart-2 ;Program start - 9D95h - As defined in the Ion include file.
    .db $BB,6D
#else
    .org progstart ;Program start for the TI-83 - 9237h
#endif
    ret
    jr nc,Start ;Jump to start label of program
    .db "program name",0 ;This is the name Ion displays

Start: ;Your program begins here


    Here is a sample program written for Ion that displays text on the screen:

.nolist
    #include "ion.inc"
    .list

#ifdef TI83P
    .org progstart-2
    .db $BB,6D
#else
    .org progstart
#endif
    ret
    jr nc,Start
    .db "Display text",0 ;Name of Program
Start: ;Start of the program
    bcall(_clrlcdf) ;Clear Screen
    bcall(_homeup) ;Bring up the home screen
    ld a,0 ;Load 0 to the a register
    ld (CURCOL),a ;Load coordinates to CURCOL
    ld a,0
    ld (CURROW),a
    ld hl,txtDisplay
    bcall(_puts)
    bcall(_getkey) ;Wait for keypress
    bcall(_clrlcdf)
    ret
txtDisplay:
    .db "This is the text "
    .db "that this prgrm"
    .db "will display. "
    .db "Each line can be"
    .db "16 characters "
    .db "long, and can "
    .db "only be 7 lines ",0
.end
END

Assembling Ion programs
    Ion programs, unlike TI-OS Asm programs, need to be compiled using Devpac83 and the Asm.bat batch file included with Ion. More information can be found in the Ion documentation included with Ion.

Conclusion
    Ion is very useful, especially when it comes to assembling Asm programs compatible with both the TI-83 and TI-83 Plus. More advanced uses of Ion's libraries can be found in Matt Hernandez's IonGuru!

 

Tutorial 24

    Click to return to the site's menu... or here to get back to the tutorial's menu.