-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunctions_16.asm
More file actions
38 lines (30 loc) · 916 Bytes
/
functions_16.asm
File metadata and controls
38 lines (30 loc) · 916 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
; Various sub-routines that will be useful to the boot loader code
; Output Carriage-Return/Line-Feed (CRLF) sequence to screen using BIOS
Console_Write_CRLF:
mov ah, 0Eh ; Output CR
mov al, 0Dh
int 10h
mov al, 0Ah ; Output LF
int 10h
ret
; Write to the console using BIOS.
;
; Input: SI points to a null-terminated string
Console_Write_16:
mov ah, 0Eh ; BIOS call to output value in AL to screen
Console_Write_16_Repeat:
mov al, [si]
inc si
test al, al ; If the byte is 0, we are done
je Console_Write_16_Done
int 10h ; Output character to screen
jmp Console_Write_16_Repeat
Console_Write_16_Done:
ret
; Write string to the console using BIOS followed by CRLF
;
; Input: SI points to a null-terminated string
Console_WriteLine_16:
call Console_Write_16
call Console_Write_CRLF
ret