Masm to Fasm
Posted: Sat Nov 10, 2012 7:35 pm
Есть obj, который был слинкован в выходной файл com (MZ, dos)
http://diamond.kolibrios.org/hll/hll.htm
Для допилки предлогается использовать некий doexe.asm следующего содержания:
собственно при попытке компиляции fasmом выдаётся ошибка:
PS: Дополнительные сведения
параметры линковки:
данные о файле:
http://diamond.kolibrios.org/hll/hll.htm
Для допилки предлогается использовать некий doexe.asm следующего содержания:
Code: Select all
virtual at 0
file 'hellos.kos':3Ch,4
load pehea dword from 0
file 'hellos.kos':pehea+0F8h,28h
load physofs dword from 4+14h
load mem dword from 4+8
file 'hellos.kos':physofs+16,4
load sz dword from $-4
end virtual
file 'hellos.kos':physofs,sz
store dword mem at 14h
Вопрос может быть только один, как быть, что править?>fasm doexe.asm
flat assembler version 1.69.31 (1570535 kilobytes memory)
doexe.asm [10]:
file 'hellos.kos':physofs,sz
error: value out of range.
PS: Дополнительные сведения
параметры линковки:
Code: Select all
/force:unresolved /fixed /subsystem:native /base:-0x10000 /align:0x10000 /merge:.data=.text /merge:.rdata=.text /nologo
Spoiler:
Code: Select all
TECHNICAL FILE INFORMATION :
File Type Description : Portable Executable (PE)
FILE CHARACTERISTICS :
Relocation info stripped from file
File is executable (i.e. no unresolved external references)
COFF line numbers have been removed
COFF symbol table entries for local symbols have been removed
Machine based on 32-bit-word architecture
FILE HEADER :
Machine: 014Ch (i386 or later, and compatible)
Number of Sections: 0002h
Time Date Stamp: 509E80DEh -> 10/11/2012 23:29:18
Symbols Pointer: 00000000h
Number Of Symbols: 00000000h
Size Of Optional Header: 00E0h
Flags: 010Fh
OPTIONAL HEADER :
Magic 010Bh ( PE32 : normal 32-bit )
Linker version 5.12
Size of code 00000200h
Size of initialized data 00000200h
Size of uninitialized data 00000000h
Address of Entry Point (RVA) 00000000h
Base of code 00010000h
Base of data 00020000h
Image base FFFF0000h
Section Alignment 00010000h
File Alignment 00000200h
Required OS version 4.00
Image version 0.00
Subsystem version 4.00
Reserved1 0
Size of image 00030000h ( 196608 bytes)
Size of headers 00000200h
Checksum 00005C15h
Subsystem 0001h (Native : Image doesn't require a subsystem)
DLL Characteristics 0000h
Size of Stack Reserve 00100000h
Size of Stack Commit 00001000h
Size of Heap Reserve 00100000h
Size of Heap Commit 00001000h
loader flags 00000000h (obsolete)
Number of Data Directory 00000010h
DATA DIRECTORY (Virtual Address and Size)
Export Directory rva: 00000000h size: 00000000h
Import Directory rva: 00000000h size: 00000000h
Resource Directory rva: 00000000h size: 00000000h
Exception table rva: 00000000h size: 00000000h
Security table rva: 00000000h size: 00000000h
Base Relocation table rva: 00000000h size: 00000000h
Debug Directory rva: 00000000h size: 00000000h
Architecture Specific Data rva: 00000000h size: 00000000h
Global Pointer rva: 00000000h size: 00000000h
TLS Directory rva: 00000000h size: 00000000h
Load config table rva: 00000000h size: 00000000h
Bound Import table rva: 00000000h size: 00000000h
Import Address Table rva: 00000000h size: 00000000h
Delay import descriptor rva: 00000000h size: 00000000h
COM descriptor rva: 00000000h size: 00000000h
unused rva: 00000000h size: 00000000h
SECTION TABLE
01 .text
VirtSize: 00000048h VirtAddr: 00010000h
raw data offs: 00000200h raw data size: 00000200h
relocation offs: 00000000h relocations: 00000000h
line # offs: 00000000h line #'s: 00000000h
characteristics: 60000020h
CODE EXECUTE READ ALIGN_DEFAULT(16)
02 _INIT_
VirtSize: 00000006h VirtAddr: 00020000h
raw data offs: 00000400h raw data size: 00000200h
relocation offs: 00000000h relocations: 00000000h
line # offs: 00000000h line #'s: 00000000h
characteristics: C0000040h
INITIALIZED_DATA READ WRITE ALIGN_DEFAULT(16)
DOS HEADER
Header Information :
Signature : 5A4Dh
Bytes on last page of file : 0090h
Total Pages in File : 0003h
Relocation Items : 0000h
Size of header in paragraphs : 0004h
Minimum Extra Paragraphs : 0000h
Maximum Extra Paragraphs : FFFFh
Initial Stack Segment : 0000h
Initial Stack Pointer : 00B8h
Complemented Checksum : 0000h
Initial Instruction Pointer : 0000h
Initial Code Segment : 0000h
Relocation Table Offset : 0040h
Overlay Number : 0000h
Extra Header Information :
Reserved WORD 0: 0000h
Reserved WORD 1: 0000h
Reserved WORD 2: 0000h
Reserved WORD 3: 0000h
OEM identifier : 0000h
OEM information : 0000h
Reserved WORD 0: 0000h
Reserved WORD 1: 0000h
Reserved WORD 2: 0000h
Reserved WORD 3: 0000h
Reserved WORD 4: 0000h
Reserved WORD 5: 0000h
Reserved WORD 6: 0000h
Reserved WORD 7: 0000h
Reserved WORD 8: 0000h
Reserved WORD 9: 0000h
New Header Address : 000000A8h
Memory Needed : 1680 B ( 1 KB )