hello im making my own operating system and im trying to compile it with nasm but theres is some error and ive checked the code and i think iv’e typed it right
here is my assembly code:
org 0x7C00
bits 16
%define ENDL 0x10, 0x0A
start:
jmp main
;
;prints a string to the screen
;params:
; -ds:si points to string
puts:
;save registers we will modify
push si
push ax
.loop:
lodsb ;loads next character in al
or al, al ;verify if next character is null?
if .done
mov ah, 0x0e
mov bh,0
int 0x10
jmp .loop
.done:
pop ax
pop si
main:
;setup data segments
mov ax, 0 ;can't write to ds/es directly
mov ds, ax
mov es, ax
;setup stack
mov ss, ax
mov sp, 0x7C00 ;stack grows downwards from where we are loaded in memory
;print message
mov si, msg_hello
call puts
hlt
.halt:
jmp .halt
msg_hello: db “hello world!”, ENDL, 0
times 510-($-$$) db 0
dw 0AA55h
the error i get from the nasm console is:
boot.asm:23: error: parser: instruction expected
New contributor
1