Obviously I was being stupid again, it requires looping which we can accomplish:
/me wonders why the string is displayed 9 times????Code:[BITS 16] [ORG 0] ;16-bit real mode jmp start msg db 'Booting a shitty program',13,10,0 displaymsg: lodsb ; load si string into something else or al, al jz return mov ah,0eh ; output character on screen function mov bx,0007h ; bl value = attribute (back/foreground colour), not sure what bh does though...lol int 10h ; call BIOS jmp displaymsg return: ret start: mov ax,0x7c0 mov ds,ax mov si,msg ; display message call displaymsg times 510-($-$$) db 0 ;we need to fill so the binary image will be 512 bytes ;$ = start of instruction ;$$ = start of program dw 0xAA55 ;fills last 2 bytes with 0xAA55 which makes this a valid bootsector ;(the BIOS checks whether it ends with 0xAA55)




Reply With Quote