您的位置:逆风者 汇编技术 正文
原作者:www.upwinder.com 添加时间:2007-09-02 原文发表:2007-08-31 人气:13 来源:未知

;/*
;*MicrosoftConfidential
;*Copyright(C)MicrosoftCorporation1983-1991
;*AllRightsReserved.
;*/
;BOOT-IBMharddiskbootrecord6/8/82
;
;
;Thisisthestandardbootrecordthatwillbeshippedonallharddisks.Itcontains:
逆@风@者
;
;1.Codetoload(andgivecontrolto)thebootrecordfor1of4possible
;operatingsystems.
;
;2.Apartitiontableattheendofthebootrecord,followedbytherequiredsignature.
;
;
_datasegmentpublic
assumecs:_data,ds:_data
org600h
cli;nointerruptsfornow
xorax,ax
movss,ax
movsp,7c00h;newstackat0:7c00
movsi,sp;wherethisbootrecordstarts-0:7c00
pushax
popes;segregsthesame
pushax
popds
sti;interruptsoknow
cld
movdi,0600h;wheretorelocatethisbootrecordto
movcx,100h
repnzmovsw;relocateto0:0600
;jmpentry2
db0eah
dw$ 4,0
entry2:
movsi,offsettab;partitiontable
movbl,4;numberoftableentries
next:
cmpbyteptr[si],80h;isthisabootableentry?
jeboot;yes
cmpbyteptr[si],0;no,isbootindicatorzero?
jnebad;no,itmustbex"00"orx"80"tobevalid
addsi,16;yes,gotonextentry
decbl
jnznext
int18h;nobootableentries-gotorombasic
boot:
movdx,[si];headanddrivetobootfrom
movcx,[si 2];cyl,sectortobootfrom
movbp,si;savetableentryaddresstopasstopartitionbootrecord
next1:
addsi,16;nexttableentry
decbl;#entriesleft
jztabok;allentrieslookok
cmpbyteptr[si],0;allremainingentriesshouldbeginwithzero
jenext1;thisoneisok
bad:
movsi,offsetm1;oops-foundanon-zeroentry-thetableisbad
msg:
lodsb;getamessagecharacter
cmpal,0
jehold
pushsi
movbx,7
movah,14
int10h;anddisplayit
popsi
jmpmsg;dotheentiremessage
;
hold:jmphold;spinhere-nothingmoretodo
tabok:
movdi,5;retrycount
rdboot:
movbx,7c00h;wheretoreadsystembootrecord
movax,0201h;read1sector
pushdi
int13h;getthebootrecord
popdi
jncgoboot;successful-nowgiveitcontrol
xorax,ax;hadanerror,so
int13h;recalibrate
decdi;reduceretrycount
jnzrdboot;ifretrycountabovezero,goretry
movsi,offsetm2;allretriesdone-permanenterror-pointtomessage,
jmpmsg;godisplaymessageandloop
goboot:
movsi,offsetm3;prepareforinvalidbootrecord
movdi,07dfeh
cmpwordptr[di],0aa55h;doesthebootrecordhavethe
;requiredsignature?
jnemsg;no,displayinvalidsystembootrecordmessage
movsi,bp;yes,passpartitiontableentryaddress
db0eah
dw7c00h,0
includefdisk5.cl1
org7beh
tab:;partitiontable
dw0,0;partition1begin
dw0,0;partition1end
dw0,0;partition1relativesector(low,highparts)
dw0,0;partition1#ofsectors(low,highparts)
dw0,0;partition2begin
dw0,0;partition2end
dw0,0;partition2relativesector
dw0,0;partition2#ofsectors
dw0,0;partition3begin
dw0,0;partition3end
dw0,0;partition3relativesector
dw0,0;partition3#ofsectors
dw0,0;partition4begin
dw0,0;partition4end
dw0,0;partition4relativesector
dw0,0;partition4#ofsectors
signadb55h,0aah;signature
_dataends
end


相关文章

汇编语言制作的光带菜单及源程序(1.0)
GET TIME OF DAY(获取时间)
一个有趣的打字游戏
汇编源码--CLR
汇编源码--drives
汇编源码--cdcheck
汇编源码--gameport
侦测CPU型号
汇编源码--free
通用的图形字模和汉字字模汇编程序
汇编源码--sound
输入10进制,输出2进制
汇编源码--drivesex
获得操作系统版本的汇编源代码
MAKE SOUNDS (发声)
汇编源码--break
V86模式切换程序
汇编源码--CALC
汇编源码--CLOCK
FASTREBOOT V1.0

相关评论


本文章所属分类:首页 汇编技术

  热门关键字:
进制数据输出的通用程序 2007-09-12
汇编源码--showmem 2007-08-31
汇编源码--CLEAN 2007-08-31
汇编源码--hdr 2007-08-31
汇编源码--basload 2007-08-31
汇编源码--CHAR 2007-08-31
汇编源码--fxn 2007-08-31
汇编源码--alarm 2007-08-31
汇编源码--getsect 2007-08-31
汇编源码--DEV 2007-08-31
汇编源码--getspace 2007-08-31
汇编源码--frespace 2007-08-31
CIH文件型病毒检测消除程序 2007-08-31
Mixer Volume Ctrler V1.0 2007-08-31
汇编源码--COMINT 2007-08-31
自己用汇编语言写的一个病毒(源码... 2007-08-31
汇编源码--col 2007-08-31
汇编源码--BURNOUT 2007-08-31