Code: Select all
#make_boot#
org 7c00h ; set location counter.
; directive to create BOOT file:
#MAKE_BOOT#
; Boot record is loaded at 0000:7C00,
; so inform compiler to make required
; corrections:
ORG 7C00h
; 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 100, 10
msg DB ' ------------------------------------ '
DB new_line, '| |'
DB new_line, '| Trip OS |'
DB new_line, '| (c)2006 Created by |'
DB new_line, '| James Brooks |'
DB new_line, '| Dean Hassall |'
DB new_line, '| |'
DB new_line, ' ------------------------------------ '
DB new_line, 'Press any key to reboot', 0
INT 19h ; reboot
Code: Select all
msg DB ' ------------------------------------ '
DB new_line, '| |'
DB new_line, '| Trip OS |'
DB new_line, '| (c)2006 Created by |'
DB new_line, '| James Brooks |'
DB new_line, '| Dean Hassall |'
DB new_line, '| |'
DB new_line, ' ----------------------------------- '
DB new_line, 'Press any key to reboot', 0