-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathboot.asm
More file actions
47 lines (36 loc) · 678 Bytes
/
boot.asm
File metadata and controls
47 lines (36 loc) · 678 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
[org 0x7c00]
; create the buffer
; create 1 bit buffer
; record keys
; if key is enter
; print buffer
; add char to buffer
; increment buffer pointer
mov bx, buffer ; initialise buffer
start:
mov ah, 0 ; i dont understand this
int 0x16 ; record keys
cmp al, 0x0D ; representation of enter key
je printBuffer
mov ah, 0x0e
int 0x10
mov [bx], al
inc bx
jmp start
printBuffer:
mov bx, buffer
mov ah, 0x0e
loop:
mov al, [bx]
cmp al, 0
je exit
int 0x10 ;print
inc bx
jmp loop
exit:
mov bx, buffer
jmp start
buffer:
db 0
times 510 - ($-$$) db 0
db 0x55, 0xaa