Post by jfmateos on Jan 19, 2015 10:43:33 GMT -5
This is the code of the moveto_d BIOS sub
But i cannot understand the purpose of this section
Could anyone explain it?
Thanks
;-----------------------------------------------------------------------;
; F312 Moveto_d ;
; ;
; This routine uses the current scale factor, and moves the pen to the ;
; (y,x) position specified in D register. ;
; ;
; ENTRY DP = $D0 ;
; A-reg = Y coordinate ;
; B-reg = X coordinate ;
; ;
; D-reg trashed ;
;-----------------------------------------------------------------------;
Moveto_d: STA <VIA_port_a ;Store Y in D/A register
CLR <VIA_port_b ;Enable mux
PSHS D ;Save D-register on stack
LF318: LDA #$CE ;Blank low, zero high?
STA <VIA_cntl
CLR <VIA_shift_reg ;Clear shift regigster
INC <VIA_port_b ;Disable mux
STB <VIA_port_a ;Store X in D/A register
CLR <VIA_t1_cnt_hi ;timer 1 count high
PULS D ;Get back D-reg
JSR Abs_a_b
STB -1,S
ORA -1,S
LDB #$40
CMPA #$40
BLS LF345
CMPA #$64
BLS LF33B
LDA #$08
BRA LF33D
LF33B: LDA #$04 ;Wait for timer 1
LF33D: BITB <VIA_int_flags
BEQ LF33D
LF341: DECA ;Delay a moment
BNE LF341
RTS
LF345: BITB <VIA_int_flags ;Wait for timer 1
BEQ LF345
RTS
But i cannot understand the purpose of this section
PULS D ;Get back D-reg
JSR Abs_a_b
STB -1,S
ORA -1,S
LDB #$40
CMPA #$40
BLS LF345
CMPA #$64
BLS LF33B
LDA #$08
BRA LF33D
LF33B: LDA #$04 ;Wait for timer 1
LF33D: BITB <VIA_int_flags
BEQ LF33D
LF341: DECA ;Delay a moment
BNE LF341
RTS
LF345: BITB <VIA_int_flags ;Wait for timer 1
BEQ LF345
RTS
Could anyone explain it?
Thanks