代码着色测试
2011-11-01 10:58
204 查看
代码着色测试
;-----------------------------------------------------------------------
;--===-- FAT12 image file make By G-Spider
;--===-- fasm startOS.asm startOS.img
;-----------------------------------------------------------------------
; here is map of how the FAT12 system is laid out
;|----------------------------------------------------------------------|
;|BootSector| FAT table 1| FAT table 2 | Root Directory| Data Region |
;|512 bytes | 4,608 bytes| 4,608 bytes | 7,168 bytes | 1,457,664 bytes|
;|1 sector | 9 sectors | 9 sectors | 14 sectors | 2,847 sectors |
;|______________________________________________________________________|
struc _DATA
def
{
match d1=,d2=,d3,def
\{
.Data
dw ((d1-1980)
shl 9)
or ((d2
and 0fh)
shl 5) or
(d3 and
1fh)
\}
}
struc _TIME
def
{
match d1:d2:d3,def
\{
.Data
dw (d1
shl 11)
or ((d2
and 3fh)
shl 5) or
((d3 and
0fh)
shr 1)
\}
}
;-----------------------------------------------------------------------
;BootSector
;-----------------------------------------------------------------------
file 'BOOTER.SYS' ;0号扇区 512Byte
;-----------------------------------------------------------------------
;FAT table 1
;-----------------------------------------------------------------------
FATEntry1:
;db 00h,00h,00h,0ffh,0fh ;有效位 奇:0ffh,0fh 偶:0f0h,0ffh
;占用5个扇区2,3,4,5,6
;占用扇区7
db 00h,00h,00h,03h,40h,00h,05h,60h,00h,0ffh,0ffh,0ffh
FATEntrySize =
$-FATEntry1
db 9*512-FATEntrySize
dup (0) ;FAT1 01~09号扇区
;-----------------------------------------------------------------------
;FAT table 2
;-----------------------------------------------------------------------
FATEntry2: rb
FATEntrySize
repeat FATEntrySize
load a
byte from
FATEntry1+%-1
store byte
a at FATEntry2+%-1
end repeat
db 9*512-FATEntrySize
dup (0) ;FAT1 10~18号扇区
;-----------------------------------------------------------------------
;Root Directory 根目录
;-----------------------------------------------------------------------
RootDir1: ;19号扇区
.Name db
"SYSTEM SYS"
.Attr db
20h
.Reserved db
0,0,0,0,0,0,0,0,0,0
.WrtTime _TIME
<21:06:12>
.WrtDate _DATA
<2011,10,27>
.FstClus dw
0002h ;开始簇号2 (对应FAT table 1的第3字节处)
.FileSize dd
LOADERSIZE1
RootDir2: ;19号扇区
.Name db
"EXAMPLE1X3D"
.Attr db
20h
.Reserved db
0,0,0,0,0,0,0,0,0,0
.WrtTime _TIME
<21:06:12>
.WrtDate _DATA
<2011,10,27>
.FstClus dw
0007h ;开始簇号7
.FileSize dd
LOADERSIZE2
db 14*512-($-RootDir1)
dup (0)
;-----------------------------------------------------------------------
;Data Region
;-----------------------------------------------------------------------
LOADER1:
file 'SYSTEM.SYS' ;33号扇区 ;2347字节 占用5个扇区2,3,4,5,6
LOADERSIZE1 =
$-LOADER1
LOADER2:
file 'EXAMPLE1.X3D' ; *号扇区 ;69字节 扇区7
LOADERSIZE2 =
$-LOADER2
db (2880-1-18-14)*512-($-LOADER1)
dup (0)
;-----------------------------------------------------------------------
效果图:
图2:
图3:
;-----------------------------------------------------------------------
;--===-- FAT12 image file make By G-Spider
;--===-- fasm startOS.asm startOS.img
;-----------------------------------------------------------------------
; here is map of how the FAT12 system is laid out
;|----------------------------------------------------------------------|
;|BootSector| FAT table 1| FAT table 2 | Root Directory| Data Region |
;|512 bytes | 4,608 bytes| 4,608 bytes | 7,168 bytes | 1,457,664 bytes|
;|1 sector | 9 sectors | 9 sectors | 14 sectors | 2,847 sectors |
;|______________________________________________________________________|
struc _DATA
def
{
match d1=,d2=,d3,def
\{
.Data
dw ((d1-1980)
shl 9)
or ((d2
and 0fh)
shl 5) or
(d3 and
1fh)
\}
}
struc _TIME
def
{
match d1:d2:d3,def
\{
.Data
dw (d1
shl 11)
or ((d2
and 3fh)
shl 5) or
((d3 and
0fh)
shr 1)
\}
}
;-----------------------------------------------------------------------
;BootSector
;-----------------------------------------------------------------------
file 'BOOTER.SYS' ;0号扇区 512Byte
;-----------------------------------------------------------------------
;FAT table 1
;-----------------------------------------------------------------------
FATEntry1:
;db 00h,00h,00h,0ffh,0fh ;有效位 奇:0ffh,0fh 偶:0f0h,0ffh
;占用5个扇区2,3,4,5,6
;占用扇区7
db 00h,00h,00h,03h,40h,00h,05h,60h,00h,0ffh,0ffh,0ffh
FATEntrySize =
$-FATEntry1
db 9*512-FATEntrySize
dup (0) ;FAT1 01~09号扇区
;-----------------------------------------------------------------------
;FAT table 2
;-----------------------------------------------------------------------
FATEntry2: rb
FATEntrySize
repeat FATEntrySize
load a
byte from
FATEntry1+%-1
store byte
a at FATEntry2+%-1
end repeat
db 9*512-FATEntrySize
dup (0) ;FAT1 10~18号扇区
;-----------------------------------------------------------------------
;Root Directory 根目录
;-----------------------------------------------------------------------
RootDir1: ;19号扇区
.Name db
"SYSTEM SYS"
.Attr db
20h
.Reserved db
0,0,0,0,0,0,0,0,0,0
.WrtTime _TIME
<21:06:12>
.WrtDate _DATA
<2011,10,27>
.FstClus dw
0002h ;开始簇号2 (对应FAT table 1的第3字节处)
.FileSize dd
LOADERSIZE1
RootDir2: ;19号扇区
.Name db
"EXAMPLE1X3D"
.Attr db
20h
.Reserved db
0,0,0,0,0,0,0,0,0,0
.WrtTime _TIME
<21:06:12>
.WrtDate _DATA
<2011,10,27>
.FstClus dw
0007h ;开始簇号7
.FileSize dd
LOADERSIZE2
db 14*512-($-RootDir1)
dup (0)
;-----------------------------------------------------------------------
;Data Region
;-----------------------------------------------------------------------
LOADER1:
file 'SYSTEM.SYS' ;33号扇区 ;2347字节 占用5个扇区2,3,4,5,6
LOADERSIZE1 =
$-LOADER1
LOADER2:
file 'EXAMPLE1.X3D' ; *号扇区 ;69字节 扇区7
LOADERSIZE2 =
$-LOADER2
db (2880-1-18-14)*512-($-LOADER1)
dup (0)
;-----------------------------------------------------------------------
效果图:
图2:
图3:
相关文章推荐
- 博客代码着色测试
- 测试代码着色插件
- 代码着色测试
- 【测试随笔】代码着色测试
- 测试自定义着色代码
- 代码着色测试
- 代码着色测试
- Cobertura 代码覆盖率测试
- 一般安卓手机测试代码和微信代码
- 代码编辑器语法着色功能实现-Java版
- redis集群配置及运行命令(windows和centos)附Python测试范例代码
- idea自动生成junit测试代码配置
- [公告]代码着色功能的一个Bug
- PHP的SQL注入实现(测试代码安全不错)
- LoadRunner测试http接口代码
- 代码测试
- Java HelloWorld代码测试
- 杀毒软件测试代码
- java学习例题:this——标准手机类代码及其测试
- Linux平台代码覆盖率测试工具GCOV相关文件分析