WEB开发网
开发学院软件开发汇编语言 自己编程实现多引导 阅读

自己编程实现多引导

 2009-10-12 09:36:44 来源:WEB开发网   
核心提示:模块二功能相对简单,其源程序如下:;硬盘多引导安装程序(SYSGUIDE.EXE)模块二DATA SEGMENTD1 DB 'choose'D2 DB 'Please choose the number (1)Install the SYSGUIDE',0dh,0ah,' DB

模块二功能相对简单,其源程序如下:

;硬盘多引导安装程序(SYSGUIDE.EXE)模块二
DATA SEGMENT
D1 DB 'choose'
D2 DB 'Please choose the number (1)Install the SYSGUIDE',0dh,0ah,' DB ‘ (2) Delete the SYSGUIDE',0dh,'$'
D3 DB 'SYSGUIDE.DAT',00H
D4 DB 'Can not find file (SYSGUIDE.DAT)',0dh,0ah,'$'
  D5 DB 0dh,0ah
DB 0dh,0ah
DB 0dh,0ah
DB ' ----------# MUCH SYSTEM GUIDE #------------',0dh,0ah
DB ' E-mail:tyhhyf@hotmail.com',0dh,0ah
DB ' OICQ:86633320',0dh,0ah,'$'
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE,DS:DATA,ES:DATA
START:
MOV AX,DATA
MOV DS,AX
MOV ES,AX
MOV DX,OFFSET D5
MOV AH,09H
INT 21H
MOV AH,00H
INT 16H
MOV DX,OFFSET D2
MOV AH,09H
INT 21H
readkey:
MOV AH,00H
INT 16H
cmp al,'1'
je key1
cmp al,'2'
je key2
jmp readkey
key1:
MOV AX,0201H ;读0 0 1扇区
MOV CX,0001H
MOV DX,0080H
MOV BX,0F000H
INT 13H
MOVSI,offset D1
MOVDI,0F020H
MOVCX,0003H
REPZ CMPSW
JZEXIT ;字符串相同则跳转
mov ax,0301h ;将原MBS区备份一个到0 0 6 扇
mov cx,0006h
mov dx,0080h
int 13h
MOV AH,3DH
MOV DX,OFFSET D3
MOV AL,00H
INT 21H ;打开文件SYSGUIDE.DAT
JB OPERERROR
PUSH AX
MOV AH,3FH
MOV DX,0F000H
MOV CX,018DH
POP BX
INT 21H
MOV AX,0301H ;将SYSGUIDE.DAT写到0 0 1扇,替代原来的MBR
MOV CX,0001H
MOV DX,0080H
MOV BX,0F000H
INT 13H
JMP EXIT
key2:
MOV AX,0201H;读0 0 1扇区
MOV CX,0001H
MOV DX,0080H
MOV BX,0F000H
INT 13H
MOVSI,offset D1
MOVDI,0F020H
MOVCX,0003H
REPZ CMPSW
JNZEXIT ;字符串相同则跳转
MOV AX,0201H ;读0 0 6扇区
MOV CX,0006H
MOV DX,0080H
MOV BX,0F000H
INT 13H
MOV AX,0301H ;写0 0 1扇区
MOV CX,0001H
MOV DX,0080H
MOV BX,0F000H
INT 13H
JMP EXIT
OPERERROR:
MOV AH,09H
MOV DX,OFFSET D4
INT 21H
EXIT:
MOV AH,4Ch
INT 21h
CODE ENDS
END START

上一页  1 2 3 4  下一页

Tags:自己 编程 实现

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接