Karma Universe - demuynck.org Lesson 8
TI-82 ASM Corner :: Programming Guide :: Lesson 8 Back | Home | Search
Lesson 8 : More about text

In this lesson, we will learn you a little bit more about displaying inverted text, displaying to the screen or to the GRAPH_MEM,...
There is also an explanation on the difference between ROM_CALL and call.

System Flags | Notes | ROM_CALL

Text System Flags

Below is a list of most of the commands that will have an effect on how text is written to the screen.

System flags that affect text.
Command Effect
SET 3,(IY+$05) Make it so text will be displayed white on black
RES 3,(IY+$05) Make it so text will be displayed black on white
SET 1,(IY+$0D) Affect text memory. This means that when you write text to the screen, the TEXT_MEM will also be updated. This could destroy your variables, so be carefull using this.
RES 1,(IY+$0D) Don't affect text memory. This way your variables won't get messed up. Ash 3.0 and CrASH 1.6 do this for you.
SET 2,(IY+$0D) Make the window scroll if you write on the last line
RES 2,(IY+$0D) Make it so the window does not scroll if you write on the last line
SET 7,(IY+$14) Write menu text to the GRAPH_MEM only and not to the LCD
RES 7,(IY+$14) Write menu text to the LCD only and not to GRAPH_MEM
SET 1,(IY+$05) Erase the pixel line below menu font
RES 1,(IY+$05) Do not erase the pixel line below menu font


Some notes about the normal font and the menu font:

- After writing a string, HL points to the byte after the zero byte when using D_ZT_STR or D_ZM_STR and to the byte immediately after the string when using D_LT_STR and D_LM_STR.

- When you write text in normal font and it doesn't fit on the line, the text will continue on the next line. With menu font, this is not the case. The string will be displayed until it is not longer possible and then the routine returns with the address where the string was cut in half in HL.

ROM_CALL() and call

In the previous lessons, I often used ROM_CALL in examples. I also used call sometimes. You might now easily think that a ROM_CALL is a call to the rom and a call is a call to the RAM. Well, that is wrong. Take for example call GET_KEY: this is also a call to the ROM.

The reason why ROM_CALLs are used is the following: not all the TI-82's have exactly the same ROM. Some have ROM version 16, others 17,18,19 or others. The latest ROM version is 19.0.

With these different ROMs, some routines have been moved. To make these routines available with one simple call, the ROM_CALL() macro is included in the Ash and CrASH shells. First, a call is made to a routine inside the Ash program. There, the actual address of the routine is calculated (how that calculation is done will be explained in a later lesson) and the routine is called.

Other functions are on the same place in all known ROM versions, e.g. call CP_HL_DE

Previous lesson | Contents | Next lesson