Motorola Axiom CMD11E1 Guía de usuario Pagina 40

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 101
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 39
40 CHAPTER 3. FUNCTIONS AND BIT MANIPULATIONS
JSR RAND
JSR PRBINARY
SWI
;;; INSERT YOUR CODE FOR PRBINARY HERE
;;; INSERT YOUR CODE FOR RAND HERE
ORG $D000
;;; INSERT ALL YOUR DATA (FCB, FCC, RMB etc.) here
ABOUTME FCC / INFORMATION ABOUT YOU /
FCB 4
SEED FCB 0
;;;;;;;;;;;;;;;;;;;;;;;end of code ;;;;;;;;;;;;;;;;;;;;;;;;
3.6 Setting bits
We will now write a function that will set 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
set bit #4 in memory location $00. Recall that the bits are numbered right to left
starting with bit #0. To set a bit, we use the ORA 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
SWI
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Function: SETBIT4
; Purpose: SETS bit #4 in memory location $00
; Registers modified none
;
Vista de pagina 39
1 2 ... 35 36 37 38 39 40 41 42 43 44 45 ... 100 101

Comentarios a estos manuales

Sin comentarios