[BITS 16] ;Tells the assembler that its a 16 bit code
[ORG 0x7C00] ;Origin, tell the assembler that where the code will
;be in memory after it is been loaded
MOV SI, HelloString ;Store string pointer to SI
CALL PrintString ;Call print string procedure
JMP $ ;Infinite loop, hang it here.
PrintCharacter: ;Procedure to print character on screen
;Assume that ASCII value is in register AL
MOV AH, 0x0E ;Tell BIOS that we need to print one charater on screen.
MOV BH, 0x00 ;Page no.
MOV BL, 0x07 ;Text attribute 0x07 is lightgrey font on black background
INT 0x10 ;Call video interrupt
RET ;Return to calling procedure
PrintString: ;Procedure to print string on screen
;Assume that string starting pointer is in register SI
next_character: ;Lable to fetch next character from string
MOV AL, [SI] ;Get a byte from string and store in AL register
INC SI ;Increment SI pointer
OR AL, AL ;Check if value in AL is zero (end of string)
JZ exit_function ;If end then return
CALL PrintCharacter ;Else print the character which is in AL register
JMP next_character ;Fetch next character from string
exit_function: ;End label
RET ;Return from procedure
;Data
HelloString db 'Hello World', 0 ;HelloWorld string ending with 0
TIMES 510 - ($ - $$) db 0 ;Fill the rest of sector with 0
DW 0xAA55 ;Add boot signature at the end of bootloader
It looks like it would, why not download a VM and try it yourself?
im not advanced enough in assembly to know which line
What do you mean which line, if you mean the line where the OS actually prints something, it is line 16 (the int 010 instruction), however you pass it its parameters in the registers you initialise before that. Also, that only prints one character, AFAIK you cannot print a whole sting in one go with BIOS calls.
Well my assembler is majorly rusty, but that looks about right. Makes me want to brush up on my assembler, but the last one I used was Emu8086 in college. Think I have a copy lying around, but also heard mips is a good one to have under you belt. Either way, your code looks right, but if you don't trust it you can always set up a virtual box to run it on so it doesn't affect anything.
No, ISO files aren't like floppies, they're not a raw format. It's called ISO because it implements the ISO 9660 standard which describes a file system for optical media. To put a file on an ISO image you first need to create the image file, which needs to be at least 32 kiB in size. This makes a 64 kiB one:
Are you using Linux, BSD, Mac OS or Windows with Cygwin/MinGW?
If Linux, you may not have mkisofs installed, but you should definitely have losetup and it should definitely accept the -f argument. The 'f' is for "free", losetup -f should return the first free loop device. You should be able to find a package containing mkisofs with your package manager's search function, e.g. apt-cache search mkisofs. If not, you can download it here: http://freecode.com/projects/mkisofs
If you're using BSD or Mac OS, then there is a different command than losetup (vnconfig), but mkisofs should be the same.
If Cygwin/MinGW, you'll need to install both mkisofs and losetup, but I don't know if they're even available. I imagine they would be, though.