Port Intel .asm to GAS S

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@7557 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
gikidy
2009-02-20 08:22:04 +00:00
parent 01f1138afe
commit ccec4c3969
3 changed files with 1517 additions and 4 deletions

View File

@@ -15,6 +15,10 @@
#*
#------------------------------------------------------------------------------
.equ FAT_DIRECTORY_ENTRY_SIZE, 0x020
.equ FAT_DIRECTORY_ENTRY_SHIFT, 5
@@ -149,9 +153,9 @@ FatChainLoop:
shrw %ax # FatOffset = ClusterNumber*3 / 2
pushw %si # Save si
movw %ax, %si # si = FatOffset
shrw %ax # ax = FatOffset >> BLOCK_SHIFT
shrw $BLOCK_SHIFT, %ax # ax = FatOffset >> BLOCK_SHIFT
addw ReservedSectors(%bp), %ax # ax = FatSectorNumber = ReservedSectors + (FatOffset >> BLOCK_OFFSET)
andw BLOCK_MASK,%si # si = FatOffset & BLOCK_MASK
andw $BLOCK_MASK,%si # si = FatOffset & BLOCK_MASK
cmpw %dx, %ax # Compare FatSectorNumber to CachedFatSectorNumber
je SkipFatRead
movw $2, %bx
@@ -279,7 +283,7 @@ NotCrossing64KBoundry:
DiskError:
pushw %cs
popw %ds
leaw %cs:ErrorString, %si
leaw ErrorString, %si
movw $7, %cx
jmp PrintStringAndHalt
@@ -295,7 +299,7 @@ Halt:
ErrorString:
.byte 'S', 0x0c, 'E', 0x0c, 'r', 0x0c, 'r', 0x0c, 'o', 0x0c, 'r', 0x0c, '!',0x0c
#.org 0x0242 # For Code size overflow, Modified this just for pass build
.org 0x0241 # For Code size overflow, Modified this just for pass build
LBAOffsetForBootSector:
.long 0x0