Motorola Axiom CMD11E1 Podręcznik Użytkownika Strona 61

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 101
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 60
5.5. WORKING WITH TABLES 61
a Yes/No value. A convenient way to return a Yes/No value is to use a hardware
flag. Let us use the Carry flag. The function will set the flag if the answer is yes;
or else it will clear the carry.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; lookup: Function to lookup a value in a table
; Checks if the value in A register is in the table
;
; Entry: Starting address in X, size in B, value in A
; Exit: Carry set if the value in A is in the table;
; cleared if not in the table
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
lookup
lkploop
tstb
beq notthere *this is the basic counting loop
cmpa 0,x
beq foundit
inx
decb
bra lkploop
notthere
clc
rts
foundit
sec
rts
Here is a program that uses the function:
;Name:
;email:
;date:
;
; Standard buffalo equates
; Make sure you have ALL the equates in the file.
;
ucase equ $ffa0
wchek equ $ffa3
dchek equ $ffa6
Przeglądanie stron 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 100 101

Komentarze do niniejszej Instrukcji

Brak uwag