程序功能:将特定功能的指令写到软盘第一扇区,开机cpu执行软盘里面的指令
实现
1:启动硬盘系统、硬盘第一扇区
2:重启计算机、
3:显示系统时间、
4:修改系统时间。
要是想要实现裸机加载运行的话,得使用U盘启动工具,另外写一个程序将下面的代码写到U盘的引导位置
assume cs:code
code segment
get_input:
push bx
push es
push ax
mov ax,0b800h
mov es,ax
gi_s:
mov ah,4
call my_boot
mov ah,0
int 16h
cmp ah,3bh ;-input is f1
jne next0
call change_color
next0:
cmp ah,02H ;--input is 1
jne next1
mov ah,0
call my_boot
jmp gi_s
next1:
cmp ah,03H ;--input is 2
jne next2
mov ah,1
call my_boot
jmp gi_s
next2:
cmp ah,04H ;--input is 3
jne next3
mov ah,2
call my_boot
jmp gi_s
next3:
cmp ah,05H ;--input is 4
jne next4
mov ah,3
call my_boot
jmp gi_s
next4:
jmp gi_s
pop es
pop bx
pop ax