Hello,
I want to write a *.bin(Assembly compiled file) to an floppy drive, but i don't know how to do this, remember that i have to write to the cylinder 0, head 0 and sector 1, because it's an boot program, only if needed here is the code:
; directive to create BOOT file:
#make_boot#
; Boot record is loaded at 0000:7C00,
; so inform compiler to make required
; corrections:
ORG 7C00h
PUSH CS ; make sure DS=CS
POP DS
; load message address into SI register:
LEA SI, msg
; teletype function id:
MOV AH, 0Eh
print: MOV AL, [SI]
CMP AL, 0
JZ done
INT 10h ; print using teletype.
INC SI
JMP print
; wait for 'any key':
done: MOV AH, 0
INT 16h
; store magic value at 0040h:0072h:
; 0000h - cold boot.
; 1234h - warm boot.
MOV AX, 0040h
MOV DS, AX
MOV w.[0072h], 0000h ; cold boot.
JMP 0FFFFh:0000h ; reboot!
new_line EQU 13, 10
msg DB 'Hello This is My First Boot Program!'
DB new_line, 'Press any key to reboot', 0
Thanks,
Nathan Paulino Campos