Thank you all for you replies. I managed to get it working before my question was put up after review, by going through another thread about the BIOS corrupting the BPB. and it looks like I ended up clearing the direction flag on accident anyways. I'll post my new code below.
Code:
BITS 16
org 0x7C00
jmp 0x0000:Boot
times 0x5a db 0
Boot:
cli
xor ax, ax
mov ds, ax
mov es, ax
mov ss, ax
mov sp, 0x9000
cld
sti
mov si, Msg
call Print_String
jmp $
Print_String:
lodsb
or al, al
jz .done
mov ah, 0x0E
int 0x10
jmp Print_String
.done:
ret
Msg: db "Hello!", 0x0D, 0x0A, 0
times 510-($-$$) db 0
dw 0xAA55
I still have a few questions though.
First the padding. Klakap you indicate the padding should be "times 0x3E db 0" In the thread I found on this topic the suggestion was "times 0x5A db 0" is the amount arbitrary?
This may not be an easy question to answer but this code works fine on my custom built PC's, however I have two Dell Optiplex's here and both register the USB drive as being inserted but says it's not a valid boot drive. The bios is set to Legacy not UEFI and the only boot device selected is the USB stick any thoughts as to why this is? Is there something special about booting with a Dell BIOS?
Thanks all.