forked from ghackwrench/F256_MicroKernel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.asm
More file actions
executable file
·71 lines (62 loc) · 1.18 KB
/
debug.asm
File metadata and controls
executable file
·71 lines (62 loc) · 1.18 KB
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
; This file is part of the TinyCore MicroKernel for the Foenix F256.
; Copyright 2022, 2023 Jessie Oberreuter <[email protected]>.
; SPDX-License-Identifier: GPL-3.0-only
.cpu "6502" ; Try to keep this one generic
.namespace kernel
.section kernel
putch jmp platform.puts
print_cr
php
pha
lda #$0a
jsr putch
pla
plp
rts
print_space
php
pha
lda #' '
jsr putch
pla
plp
rts
print_word
php
pha
lda 1,y
jsr print_byte
lda 0,y
jsr print_byte
pla
plp
rts
print_byte
php
pha
pha
lsr a
lsr a
lsr a
lsr a
jsr print_digit
pla
and #$0f
jsr print_digit
pla
plp
rts
print_digit
php
pha
cmp #10
bcs _hex
adc #'0'
_put jsr putch
pla
plp
rts
_hex adc #'a' - 10 - 1
bcc _put
.send
.endn