• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号
您的位置:首页 > 程序设计 >汇编语言 > DOS6.0源程序中的硬盘引导记录源程序FDBOOT.ASM

DOS6.0源程序中的硬盘引导记录源程序FDBOOT.ASM

作者:匿名 字体:[增加 减小] 来源:互联网 时间:2017-06-28

匿名通过本文主要向大家介绍了dos6.0,ms dos6.0,dos6.0下载,asm源程序,asm程序等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
</div>

;/*
; * Microsoft Confidential
; * Copyright (C) Microsoft Corporation 1983 - 1991
; * All Rights Reserved.
; */
; BOOT - IBM hard disk boot record 6/8/82
;
;
; This is the standard boot record that will be shipped on all hard disks. It contains:
;
; 1. Code to load (and give control to) the boot record for 1 of 4 possible
; operating systems.
;
; 2. A partition table at the end of the boot record, followed by the required signature.
;
;
_data segment public
assume cs:_data,ds:_data
  org 600h

cli ;no interrupts for now
xor ax,ax
mov ss,ax
mov sp,7c00h ;new stack at 0:7c00
mov si,sp ;where this boot record starts - 0:7c00
push ax
pop es ;seg regs the same
push ax
pop ds
sti ;interrupts ok now
cld
mov di,0600h ;where to relocate this boot record to
mov cx,100h
repnz movsw ;relocate to 0:0600
; jmp entry2
db 0eah
dw $+4,0
entry2:
mov si,offset tab ;partition table
mov bl,4 ;number of table entries
next:
cmp byte ptr[si],80h ;is this a bootable entry?
je boot ;yes
cmp byte ptr[si],0 ;no, is boot indicator zero?
jne bad ;no, it must be x"00" or x"80" to be valid
add si,16 ;yes, go to next entry
dec bl
jnz next
int 18h ;no bootable entries - go to rom basic
boot:
mov dx,[si] ;head and drive to boot from
mov cx,[si+2] ;cyl, sector to boot from
mov bp,si ;save table entry address to pass to partition boot record
next1:
add si,16 ;next table entry
dec bl ;# entries left
jz tabok ;all entries look ok
cmp byte ptr[si],0 ;all remaining entries should begin with zero
je next1 ;this one is ok
bad:
mov si,offset m1 ;oops - found a non-zero entry - the table is bad
msg:
lodsb ;get a message character
cmp al,0
je hold
push si
mov bx,7
mov ah,14
int 10h ;and display it
pop si
jmp msg ;do the entire message
;
hold: jmp hold ;spin here - nothing more to do
tabok:
mov di,5 ;retry count
rdboot:
mov bx,7c00h ;where to read system boot record
mov ax,0201h ;read 1 sector
push di
int 13h ;get the boot record
pop di
jnc goboot ;successful - now give it control
xor ax,ax ;had an error, so
int 13h ;recalibrate
dec di ;reduce retry count
jnz rdboot ;if retry count above zero, go retry
mov si,offset m2 ;all retries done - permanent error - point to message,
jmp msg ;go display message and loop
goboot:
mov si,offset m3 ;prepare for invalid boot record
mov di,07dfeh
cmp word ptr [di],0aa55h ;does the boot record have the
; required signature?
jne msg ;no, display invalid system boot record message
mov si,bp ;yes, pass partition table entry address
db 0eah
dw 7c00h,0

include fdisk5.cl1

org 7beh
tab: ;partition table
dw 0,0 ;partition 1 begin
dw 0,0 ;partition 1 end
dw 0,0 ;partition 1 relative sector (low, high parts)
dw 0,0 ;partition 1 # of sectors (low, high parts)
dw 0,0 ;partition 2 begin
dw 0,0 ;partition 2 end
dw 0,0 ;partition 2 relative sector
dw 0,0 ;partition 2 # of sectors
dw 0,0 ;partition 3 begin
dw 0,0 ;partition 3 end
dw 0,0 ;partition 3 relative sector
dw 0,0 ;partition 3 # of sectors
dw 0,0 ;partition 4 begin
dw 0,0 ;partition 4 end
dw 0,0 ;partition 4 relative sector
dw 0,0 ;partition 4 # of sectors
signa db 55h,0aah ;signature

_data ends
end


</div> </div> </div> </div>
分享到:QQ空间新浪微博腾讯微博微信百度贴吧QQ好友复制网址打印

您可能想查找下面的文章:

  • DOS6.0源程序中的硬盘引导记录源程序FDBOOT.ASM

相关文章

  • 2017-06-28汇编语言学习指南(四)
  • 2017-06-17循环指令
  • 2017-06-17分支程序设计
  • 2017-06-28汇编教程:ODBC基础
  • 2017-06-17变量和标号的属性
  • 2017-06-28关于汇编div/idiv/mul/imul指令的用法
  • 2017-06-28驱动程序的编译和连接
  • 2017-06-28汇编教程之通用控件
  • 2017-06-17存储器和端口
  • 2017-06-28汇编语言套装软件制作

文章分类

  • JavaScript
  • ASP.NET
  • PHP
  • 正则表达式
  • AJAX
  • JSP
  • ASP
  • Flex
  • XML
  • 编程技巧
  • Android
  • swift
  • C#教程
  • vb
  • vb.net
  • C语言
  • Java
  • Delphi
  • 易语言
  • vc/mfc
  • 嵌入式开发
  • 游戏开发
  • ios
  • 编程问答
  • 汇编语言
  • 微信小程序
  • 数据结构
  • OpenGL
  • 架构设计
  • qt
  • 微信公众号

最近更新的内容

    • 循环指令
    • 80386保护方式简介
    • 汇编教程:系统托盘中的快捷图标
    • 80386的异常类型
    • 汇编语言中‘子程序’的设计方法
    • 工具提示控件介绍
    • 汇编源码系列之clr
    • 汇编教程:启动画面
    • 输入输出指令
    • 汇编源码系列之charop

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有