source: trunk/mioboot.asm@ 3

Last change on this file since 3 was 2, checked in by Mattia Monga, 13 years ago

Importazione sorgenti

File size: 1.4 KB
Line 
1;Copyright (C) 2008 by Mattia Monga <mattia.monga@unimi.it>
2bits 16 ; 16 bit real mode
3org 0x7C00 ; origine indirizzo 0000:7C00
4
5start:
6 cld ; clears direction flag (index regs incremented)
7 mov si, boot
8 call message
9working:
10 mov si, work
11 call message
12
13 call waitenter
14 jmp working
15
16message:
17 lodsb ; carica un byte da [DS:SI] in AL e inc SI
18 cmp al, 0
19 jz done
20 mov ah, 0x0E ; write char to screen in text mode
21 mov bx, 0 ; BH page number BL foreground color
22 int 0x10 ; write AL to screen (BIOS)
23 jmp message
24done: ret
25
26boot: db "Loading unuseful system...." , 10, 13, 0
27work: db "I've done my unuseful stuff!" , 10, 13, 0
28cont: db "Hit ENTER to continue...", 10, 13, 0
29wow: db "Great! Hello world!" , 10, 13, 0
30
31waitenter: mov si, cont
32 call message
33 mov ah, 0
34 int 0x16 ; Wait for keypress (BIOS)
35 cmp al, 'm'
36 jz egg
37 cmp al, 'b'
38 jz basic
39 cmp al, 13
40 jnz waitenter
41 ret
42egg: mov si, wow
43 call message
44 jmp waitenter
45basic: int 0x18 ; basic (BIOS)
46 hlt
47
48 times 510-($-$$) db 0
49 dw 0xAA55
Note: See TracBrowser for help on using the repository browser.