-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrt0.s
More file actions
74 lines (71 loc) · 800 Bytes
/
Copy pathcrt0.s
File metadata and controls
74 lines (71 loc) · 800 Bytes
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
65
66
67
68
69
70
71
72
73
74
.setcpu 6800
; .zp
; .export hireg
; .export zero
; .export one
;
.org $00e0
hireg: .word 0
zero: .byte 0 ; overlaps 1
one: .word 0
;
; .export tmp
; .export tmp2
; .export tmp3
; .export tmp4
; .export tmp5
;
tmp: .word 0
tmp2: .word 0
tmp3: .word 0
tmp4: .word 0
tmp5: .word 0
savesp: .word 0
.code ; (at 0x4000)
start:
sts @savesp
lds #$8FFF
clrb
clra
stab @zero+1
staa @zero
incb
stab @one+1
staa @one
psha ; dummy argc
pshb
psha ; dummy argv
pshb
jsr _main
; return and exit (value is in XA)
lds @savesp
rts
.export _printchar
.export _putch
.export _getch
.export _crt_clear
_putch:
_printchar:
tsx
ldaa 3,x
jsr $F015
ldx 0,x
ins
ins
ins
ins
jmp 0,x
_getch:
jsr $F012
tab
clra
rts
_crt_clear:
ldx #$100
clrb
c1:
stb 0,x
inx
cpx #$400
bne c1
rts