-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.asm
More file actions
79 lines (66 loc) · 797 Bytes
/
Copy pathutils.asm
File metadata and controls
79 lines (66 loc) · 797 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
75
76
%define enterKey 0xD
%define escKey 0x1B
%define backspaceKey 0x8
printText:
mov ah, 0x0e
mov al, [bx]
int 0x10
inc bx
cmp al, 0
jne printText
ret
readChar:
mov ah, 0x01
int 0x16
jz loop
xor ah, ah
int 0x16
ret
printChar:
call checkChar
mov ah, 0x0e
int 0x10
ret
readAndPrintChar:
call readChar
call printChar
ret
checkChar:
cmp al, enterKey
je entr
cmp al, backspaceKey
je backSpace
ret
entr:
call getCursor
inc dh
call setCursor
ret
backSpace:
mov al, 0
call printCharToCursor
call getCursor
dec dl
dec dl
call setCursor
ret
getCursor:
mov ah, 0x03
mov bh, 0
int 0x10
ret
setCursor:
mov ah, 0x02
mov bh, 0
int 10h
ret
clearScreen:
mov ah, 0x00
mov ax, 3
int 0x10
ret
printCharToCursor:
mov ah, 0xA
mov bx, 0
mov cx,1
ret