我一直在尝试为我在Internet上找到的dos编译hemem.sys的源代码,但由于一个警告和一个错误而失败...
...Maked xm286 and xm386 objects without any problem...
H:\OEMSRC>MASM.EXE himem;
Microsoft (R) Macro Assembler Version 5.10A
Copyright (C) Microsoft Corp 1081, 1989. All rights reserved.
xm386.asm(342): warning A4057: Illegal size for operand
48666 + 416309 Bytes symbol space free
1 Warning Errors
0 Severe Errors
H:\OEMSRC>LINK.EXE HIMEM.OBJ XM286.OBJ XM386.OBJ;
Microsoft 8086 Object Linker
Version 3.00 (C) Copyright Microsoft Corp 1983, 1984, 1985
Invalid object module
Input File: HIMEM.OBJ(himem.ASM) pos: C98 Record type: A1
H:\OEMSRC>
有人知道如何修复它们吗?源代码和编译工具:Source Code and Tools
提前感谢。
在这种情况下,ldgt正在加载6字节的ptr(fword)。要摆脱MASM警告:
GDTPtr equ ($+MEM3_Offset) ; no need to declare ptr type here
GDT386 <GDTLen,0,0>
; ...
lgdt fword ptr cs:[GDTPtr] ; use fword ptr
使用链接3.0,我仍然收到对象记录类型为A1的链接错误,但是链接5.6没有报告错误。