-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathteletype.asm
More file actions
55 lines (35 loc) · 697 Bytes
/
teletype.asm
File metadata and controls
55 lines (35 loc) · 697 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
BITS 16
%INCLUDE "jobos.inc"
ORG 0x8000
start:
mov si, tele_prompt
call os_clear_screen
call os_print_string
.read: ; commands we should support - ls - list available programs/actions, run something
; wait for input
call os_read_char
.check_back:
cmp dl, 8
jne .check_esc
mov al, dl
push cx
call os_write_char
mov al, 0
call os_write_char
mov al, 8
call os_write_char
pop cx
jmp .read
.check_esc:
cmp dl, 27
jne .write
jmp exit
.write:
mov al, dl
push cx
call os_write_char ; prints char at the cursor position
pop cx
jmp .read ; keep getting chars
exit:
ret
tele_prompt db "Welcome to Teletype - Press ESC to exit", 13, 10, 0