;---------------------------------------------------------
; file:         readcan.s
; description:  This file contains the subroutine to read
;               the CAN register.
;
; C Interface: Use readcan.h
; Assemble this file with the ICC11 compiler. 
;---------------------------------------------------------
        .area   text
;---------------------------------------------------------
; subroutine:   qcReadRegister
; description:  This subroutine reads a register from
;               the 82527. 
; input:        B = register
; output:       B = value of register
; uses:         X used as address, stack saved/restored
;
;---------------------------------------------------------
_qcReadRegister::       ; Define as global with double colon
        pshx            ; Save X register
        ldx     #$5000  ;
        abx             ; 
        ldab    0,x     ; Read register
        ldab    $5004   ; Read for the high speed register
        pulx            ; Restore X register
        rts             ; Return from subroutine
