Motorola Axiom CMD11E1 Guía de usuario Pagina 61

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 101
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 60
1 2 ... 56 57 58 59 60 61 62 63 64 65 66 ... 100 101

Comentarios a estos manuales

Sin comentarios