Motorola Axiom CMD11E1 Betriebsanweisung Seite 32

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 31
32 CHAPTER 3. FUNCTIONS AND BIT MANIPULATIONS
most often used sentinels are zero (also known as ASCII-Z string), 26 (also known
as CONTROL-Z string, or old DOS string), 4 (EOT string).
The programmers of BUFFALO use EOT string and you have one of two
choices: rewrite BUFFALO routine and use some other sentinel, or use 4 as the
sentinel and remember to place it after each string. The rest of the lab assumes
that you will use the EOT string. Two functions that BUFFALO provides for
printing strings are OUTSTRG at location $FFC7 and OUTSTRGO at location $FFCA.
The difference between them is that the former will print the string on a new line,
while the latter will continue the string from wherever the cursor happens to be.
Both these functions must be told where the string is. You do this by loading the
X register with the starting address where the string is stored before calling the
function. To enter strings in memory, we use FCC directive. The label associated
with the FCC will be automatically EQUated to the starting address of the string.
Type the following code and verify that OUTSTRG does indeed print a string.
;;;;;;;;;;;;;;;;;;;;;;;start of code ;;;;;;;;;;;;;;;;;;;;;;;;
OUTSTRG EQU $FFC7
OUTSTRGO EQU $FFCA
; program section. set origin to $C100
ORG $C100
LDX #ABOUTME *STARTING ADDRESS OF THE STRING
JSR OUTSTRG
SWI
; data section. set origin to $D000
ORG $D000
ABOUTME FCC /Hello, my name is ===your name =====/
FCB 4 ;dont forget this
;;;;;;;;;;;;;;;;;;;;;;;end of code ;;;;;;;;;;;;;;;;;;;;;;;;
3.4 Writing your first function
Before you write your first function, you should observe some standard conven-
tions. Your programs should always start at location $C100, or as specified by
your TA. Your data should always start at location $D000 or as specified by your
TA. A small amount of data can be stored starting at location $0000 (Page 0), but
you do not have too much space, 30 bytes or so. It is a matter of taste whether
you write the data section first or the program section first. You can not mix and
match. I personally prefer the following order: Page 0 section first, data section
Seitenansicht 31
1 2 ... 27 28 29 30 31 32 33 34 35 36 37 ... 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare