Motorola Axiom CMD11E1 Betriebsanweisung Seite 41

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 101
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 40
3.7. CLEARING BITS 41
SETBIT4
PSHA
LDAA $00
ORAA #%00010000
STAA $00
PULA
RTS
;; INSERT THE CODE FOR FUNCTIONS RAND AND PRBINARY HERE
ORG $D000
;; ALL THE DATA ITEMS GO HERE.
;;;;;;;;;;;;;;;;;;;;;;;end of code ;;;;;;;;;;;;;;;;;;;;;;;;
3.7 Clearing bits
We will now write a function that will clear a particular bit in some memory
location. The function should modify the value in the memory in such a way that
it only affects the specific bit without changing any other bit. For definiteness,
we will clear bit #4 in memory location $00. To clear a bit, we use the AND
instruction. Write the following program, and test it by repeating the call to
$C100 from the BUFFALO prompt.
;;;;;;;;;;;;;;;;;;;;;;;start of code ;;;;;;;;;;;;;;;;;;;;;;;;
;; Insert standard buffalo equates here
ORG $C100
JSR OUTCRLF *NEED THIS FOR OUTPUTS TO LINE UP!
JSR RAND
STAA $00
JSR PRBINARY *PRINT BEFORE
JSR SETBIT4
LDAA $00
JSR PRBINARY *PRINT AFTER SET
Seitenansicht 40
1 2 ... 36 37 38 39 40 41 42 43 44 45 46 ... 100 101

Kommentare zu diesen Handbüchern

Keine Kommentare