ALRIGHT SO here is a thingamabob to your question
In order to load the string, you must move it into si (don't really want to go to deep but just do it). Next in order to load a character into the register AL use lodsb. Next, we must print it so use int 10h mov ah, 0Eh. Int 10h handles the video and ah tells BIOS to print whatever we have in al (aka lodsb). Next, we must have an ending loading char so we just don't loop forever. Me personally I use 0x00 however you use 0. 0x00 is much better in my case because not only can u use 0, 0x00 does not print anything so why would u ever need it?
ALRIGHT so we got everything done and going here is the code:
mov si, message ;The message location *you can change this*
call print ;CALL tells the pc to jump back here when done
print:
mov ah, 0Eh ;Set function
.run:
lodsb ;Get the char
; cmp al, 0x00 ;I would use this but ya know u dont so use:
cmp al, 0 ;0 has a HEX code of 0x48 so its not 0x00
je .done ;Jump to done if ending code is found
int 10h ;Else print
jmp .run ; and jump back to .run
.done:
ret ;Return
message db 'Hello, world', 0 ;IF you use 0x00
;message db 'Hello, world', 0x00
ORG 0x7c00
. Possible you used-f bin
when assembling with NASM and it used a default ORG of 0x0000. Although that won't be your issue. Int 10h/ah=0eh prints one character at a time, and doesn't take a memory address in BXjmp $
. Placing it before the JMP will cause the processor to decode the data inHELLO
as instructions and could lead to unexpected behaviour.print_string
in this tutorial may be of use: mikeos.sourceforge.net/write-your-own-os.html_print_string
function that loops through a null terminated string printing each character one by one using INT 10h/AH=0eh.