As discussed in other parts of this manual, geoSHELL has some built-in text displaying routines. Of these routines, you have access to displaying messages to the user describing such things as errors or how your command might be progressing. It is always good to let the user know what is going on. The main routines for doing this is Message and OtherMessage. You will find yourself using OtherMessage the most, since Message is limited to only the built-in geoSHELL messages.
OtherMessage needs to know where the message is that you wish to display. Point r0 at this null-terminated text string. One other thing it needs is a value loaded into the accumulator telling it how to display your text. You can indent from 1-7 spaces and also add trailing spaces and carriage returns. The routine Message also needs this information loaded into the accumulator. The following are the constants for this:
IN_CR = %10000000 ;initial carriage return.
;otherwise begin at present
;cursor location.
TR_CR = %01000000 ;carriage return after text.
;otherwise leave cursor one
;space past text.
IN_ONE = %00000001 ;one leading space
IN_TWO = %00000010 ;two leading spaces...
IN_THREE = %00000011 ;etc...
IN_FOUR = %00000100
IN_FIVE = %00000101
IN_SIX = %00000110
IN_SEVEN = %00000111
TR_ONE = %00001000 ;one trailing space
TR_TWO = %00010000 ;two trailing spaces...
TR_THREE = %00011000 ;etc...
TR_FOUR = %00100000
TR_FIVE = %00101000
TR_SIX = %00110000
TR_SEVEN = %00111000
;A typical section of a routine might look like this:
LoadW r0,#textToDisplay ;point to the text.
lda #(IN_TWO|TR_CR) ;insert 2 spaces, add a
;carriage return.
jsr OtherMessage ;go display it.
textToDisplay:
.byte "This Text Will Be Displayed!",0
You can also load the accumulator with a zero if you wish to
just print the text right where the cursor is and leave the cursor at the space following the last character that gets displayed on the screen. You will find yourself using this routine quite often.
geoSHELL has some internal messages also that are accessible with the routine Message. Some of these messages are specific to certain routines and may not be of any benefit to you. However, there are also some that will be used quite frequently. You will notice in this listing the ones that look familiar and will realize the useful ones and the not so useful ones. In order to use these, you simply load the x register with the number of the message and load the accumulator just like you would for OtherMessage and then call Message.