-
Notifications
You must be signed in to change notification settings - Fork 8
/
motor.asm
30 lines (21 loc) · 793 Bytes
/
motor.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
; 2021.01.03
;
; marcel timm, rhinodevel
cas_moto = $e813 ; bit 3 (0 = motor on, 1 = motor off).
ordmask = 8 ; or mask. bit 3 on <=> motor off.
ordmaskn = 1 not ordmask ; and mask. bit 3 off <=> motor on.
*=634
sei
loop lda cas_moto ; disable motor signal (by enabling bit 3).
ora #ordmask ;
sta cas_moto ;
ldx #$ff ; vice says: #20 => 101 cycles.
initmota dex ; (motor signal takes its time..)
bne initmota
lda cas_moto ; motor signal pulse.
and #ordmaskn ; disable bit => motor signal to high.
sta cas_moto ;
ldx #$ff ; vice says: #20 => 101 cycles.
initmotb dex ; (motor signal takes its time..)
bne initmotb
jmp loop