Here's the code for the .asm (BEFORE PUT INTO ISO)
(BOOTLOADER)
hello_world.asm
Code: Select all
[bits 16] ; tell assembler that working in real mode(16 bit mode)
[org 0x7c00] ; organize from 0x7C00 memory location where BIOS will load us
start: ; start label from where our code starts
MOV AX,0600H ;06 TO SCROLL & 00 FOR FULLJ SCREEN
MOV BH,70H ;ATTRIBUTE 7 FOR BACKGROUND AND 0 FOR FOREGROUND
MOV CX,0000H ;STARTING COORDINATES
MOV DX,184FH ;ENDING COORDINATES
INT 10H ;FOR VIDEO DISPLAY
MOV AH,4CH ;RETURN TO DOS MODE
INT 21H
xor ax,ax ; set ax register to 0
mov ds,ax ; set data segment(ds) to 0
mov es,ax ; set extra segment(es) to 0
mov bx,0x8000
mov si, hello_world ; point hello_world to source index
call print_string ; call print different color string function
hello_world db 'Loading.',13,0 ;First Text
print_string:
mov ah, 0x0E ; value to tell interrupt handler that take value from al & print it
.repeat_next_char:
lodsb ; get character from string
cmp al, 0 ; cmp al with end of string
je .done_print ; if char is zero, end of string
int 0x10 ; otherwise, print it
jmp .repeat_next_char ; jmp to .repeat_next_char if not 0
.done_print:
ret ;return
times (510 - ($ - $$)) db 0x00 ;set 512 bytes for boot sector which are necessary
dw 0xAA55 ; boot signature 0xAA & 0x55