Motorola Axiom CMD11E1 Betriebsanweisung Seite 44

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 43
44 CHAPTER 3. FUNCTIONS AND BIT MANIPULATIONS
ORG $D000
;; ALL THE DATA ITEMS GO HERE.$
;;;;;;;;;;;;;;;;;;;;;;;end of code ;;;;;;;;;;;;;;;;;;;;;;;;
3.9 Testing bits
Often we have to take a decision based on whether a bit is set or not in memory.
To test if one or more bits are set, we clear all other bits and see if the result is
zero. If so, none of these bits are set. If not, at least one of them was set. The
following program will print YES if bit #4 in memory location $00 is set. Or else
it will print NO.
;;;;;;;;;;;;;;;;;;;;;;;start of code ;;;;;;;;;;;;;;;;;;;;;;;;
;; Insert standard buffalo equates here
BIT4 EQU %00010000 ; THIS EQUATE MAKES THE CODE MORE READABLE
ORG $C100
JSR OUTCRLF *NEED THIS FOR OUTPUTS TO LINE UP!
JSR RAND
STAA $00
JSR PRBINARY *PRINT BEFORE
LDAA $00
ANDA #BIT4
BEQ NOPE
LDX #YESSTR
JSR OUTSTRG
SWI
NOPE
LDX #NOSTR
JSR OUTSTRG
SWI
;; INSERT THE CODE FOR CLRBIT4 SETBIT4 RAND AND PRBINARY HERE
ORG $D000
;; ALL THE DATA ITEMS GO HERE.$
YESSTR FCC /YES/
FCB 4
Seitenansicht 43
1 2 ... 39 40 41 42 43 44 45 46 47 48 49 ... 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare