; ; Definitions of Host-Bus Control and Status registers in the FPGA. ; ; ELMO: equ $8 ;Control and Status register for Motor Amplifier and DSP ; ; ; The ELMO and DSP status register bit definitions: ; DSPtio: equ 7 ;ELMO status: DSP Timer TIO status bit DSPlock: equ 6 ;ELMO status: DSP PLL LOCK status bit DSPhack: equ 5 ;ELMO status: DSP Host Acknowledge (~HACK) DSPhreq: equ 4 ;ELMO status: DSP Host Request (~HREQ) ElmoAOK: equ 3 ;ELMO status: amplifier status bit AOK ElmoSO1: equ 2 ;ELMO status: amplifier status bit SO1 ElmoSO2: equ 1 ;ELMO status: amplifier status bit SO2 ElmoSO3: equ 0 ;ELMO status: amplifier status bit SO3 ; ; DSPtio_m: equ %10000000 ;ELMO status: DSP Timer TIO status mask DSPlock_m: equ %01000000 ;ELMO status: DSP PLL LOCK status mask DSPhack_m: equ %00100000 ;ELMO status: DSP Host Acknowledge (~HACK) mask DSPhreq_m: equ %00010000 ;ELMO status: DSP Host Request (~HREQ) mask ; AmpOK_m: equ $07 ;Elmo code for "Amplifier OK" ; ;
bclr DSPtio,ELMO ;clear the timer flag
rocco wrote:
I always use a "_m" on the mask, so that I can have macros append it automatically, and just use the name without the "_m" in the macro call.
Thanks, Mac, I like that. I may have to stay up all night changing 400 source files to that syntax.
bigmac wrote:
Here is a slightly different way of defining the mask values - shown for CW assembler.
; ; Macros for Bitset and Bitclr outside of page zero ; ; Syntax: BitClr bitname,location ; BitSet: macro lda #\1_m ora \2 sta \2 endm ; ; BitClr: macro lda #~\1_m and \2 sta \2 endm ; ;Appending the "_m" to the macro-parameter allows me to call out the bit, but the instruction uses the mask. From what I learned today, I could now do it that way (which I tried to post, but the shift operation gave me HTML errors).
Message Edited by bigmac on 2006-09-09 01:44 AM