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
| ;-----------------------------------------------
; nasm bootsect.asm -f bin -o bootsect.img -l bootsect.lst
;-----------------------------------------------
org 0h
; Initialisation des registres de segment
mov ax, 0x07C0
mov ds, ax
mov es, ax
mov ax, 0x8000
mov ss, ax
mov sp, 0xF000
; Afficher le message
mov si, hellomessage
call display_zstr
infini:
jmp infini
;-----------------------------------------------
; Fonction d'affichage de chaine à zéro final
;-----------------------------------------------
display_zstr:
push ax
push bx
.beg:
lodsb
cmp al, 0
jz .end
mov ah, 0x0E
mov bx, 0x0007
int 0x10
jmp .beg
.end:
pop bx
pop ax
ret
hellomessage:
db "Tout petit petit système d'exploitation !", 13, 10, 0
times 510 - ($ - $$) db 0x90
dw 0xAA55
times (1 * 18 * 512) - 512 db 0 |
Partager