/
serial-1.asm
64 lines (55 loc) · 1.14 KB
/
serial-1.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
.cr 6809
.tf serial-1.bin,BIN
.lf serial-1.lst
;
.in monoboard9.inc ; system stuff
;
.sm RAM
.or $0000
; vars and temps here
;
.sm CODE
.or $E000
.bs $1000, $FF
;
;
main:
lds #SYSTEM_STACK
ldu #USER_STACK
; the simplest possible char outgoing transmission
; ACIA init
; 9600,8,N,1
lda #$0E
sta ACIA+CTLREG
lda #$08
sta ACIA+CMDREG
.here:
lda #'Q'
sta ACIA+TDR
jsr delay
jmp .here ; while(1);
;-----------------------------------------------------------------------
delay:
pshu X,B ; save X & B
ldb #10 ; outer loop
.delay1:
ldx #10000 ; inner loop
.delay2:
dex ; x--
bne .delay2 ; until x != 0
decb ; b--
bne .delay1 ; until b != 0
pulu X,B ; restore
rts
;
; system jump table, must be in this particular order
>DEF_SYS_JUMP RESERVED, UNDEFINED
>DEF_SYS_JUMP SWI3____, UNDEFINED
>DEF_SYS_JUMP SWI2____, UNDEFINED
>DEF_SYS_JUMP FIRQ____, UNDEFINED
>DEF_SYS_JUMP IRQ_____, UNDEFINED
>DEF_SYS_JUMP SWI_____, UNDEFINED
>DEF_SYS_JUMP NMI_____, UNDEFINED
>DEF_SYS_JUMP RESET___, main
;
; :-)