-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathboot.asm
More file actions
64 lines (46 loc) · 705 Bytes
/
Copy pathboot.asm
File metadata and controls
64 lines (46 loc) · 705 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
bits 16
org 0x7c00
; mov si, 0
start:
mov si, message
call print_string
call read_string
mov si, user_input
call print_string
jmp $
print_string:
mov ah, 0x0E
.next_char:
lodsb
cmp al, 0
je .done
int 0x10
jmp .next_char
.done:
ret
read_string:
mov si, user_input
.read_loop:
mov ah, 0x01
int 0x16
cmp al, 0x0D
je .done_input
stosb
jmp .read_loop
.done_input:
mov byte [si], 0
ret
; print:
; mov ah, 0x0e
; mov al, [hello + si]
; int 0x10
; add si, 1
; cmp byte [hello + si], 0
; jne print
; jmp $
; hello:
; db "Hello World!", 0
message db "Please enter your name: ", 0
user_input db 20 dup(0)
times 510 - ($ - $$) db 0
dw 0xAA55