forked from mist64/msbasic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kimrom_extra.s
57 lines (51 loc) · 1.52 KB
/
kimrom_extra.s
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
.segment "EXTRA"
; ----------------------------------------------------------------------------
; SYS - Jump to an address
; ----------------------------------------------------------------------------
SYS:
jsr FRMNUM
jsr GETADR
; Emulate an indirect JSR
lda #>SYS_RETADR
pha
lda #<SYS_RETADR
pha
jmp (LINNUM)
SYS_RETADR = *-1
rts
; --------------------------------------------------------------------------
; CLS - Clear terminal with a form feed
FF := $0C
CLS:
lda #FF
jmp MONCOUT ; will rts for us
; ---------------------------------------------------------------------------
; GET_UPPER - Support case insensitive keywords. Copied from the KBD port
GET_UPPER:
lda INPUTBUFFERX,x
LF430:
cmp #'a'
bcc LF43A
cmp #'z'+1
bcs LF43A
LF438:
sbc #$1F
LF43A:
rts
; ---------------------------------------------------------------------------
; CHKDEL - Make DEL work like BS
;
; Because the KIM-1 uses DEL/RUBOUT to determine TTY baud rate, the user
; TTY needst to be reconfigured to send DEL rather than BS. This converts a
; DEL into a BS and writes the BS back to the TTY to have the same behavior as
; if a BS was received in the first place.
DEL := $7F
BS := $08
CHKDEL:
cmp #DEL
bne CHKDELX
lda #BS
jsr MONCOUT ; Clobbers A
lda #BS
CHKDELX:
rts