summaryrefslogtreecommitdiff
path: root/boot/test.asm
blob: 62110b639d9fa56a0f2d5c0443168725f8547172 (plain)
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
[org 0x7c00]

[bits 16]
jmp boot_16 ;start boot process

STR_VERSION:

    db "FoolOs~",0

;print_string routine ([bx])
;this routine will print a null terminated string at [bx] to the screen.
print_string:

    pusha			;push all registers
    mov ah,0x0e

    print_string_loop:

	;check if value at [bx] is "\0" (end of string)
	mov cl,[bx]
	cmp cl,0
	je print_string_finish

	;otherwise instruct BIOS to print the current char
	mov al,cl
	int 0x10

	;proceed with next char
        inc bx
	jmp print_string_loop

    print_string_finish:

    popa			;pop all registers
    ret				;return to caller

boot_16:

    mov bx, STR_VERSION
    call print_string

    jmp boot_16

times 510-($-$$) db 0
dw 0xaa55