Motorola Axiom CMD11E1 Podręcznik Użytkownika Strona 63

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 101
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 62
5.5. WORKING WITH TABLES 63
org $2100
ldx #preamble
jsr outstrg
mainloop
jsr inchar
ldx #vowels
ldab #nvowels
jsr lookup
bcs isvowel
ldx #nostr
jsr outstrgo
bra mainloop
isvowel ldx #yesstr
jsr outstrgo
bra mainloop
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; 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
Przeglądanie stron 62
1 2 ... 58 59 60 61 62 63 64 65 66 67 68 ... 100 101

Komentarze do niniejszej Instrukcji

Brak uwag