📄 readme
字号:
dis88 Beta Release 87/09/01 --- G. M. HARDING POB 4142 Santa Clara CA 95054-0142 "Dis88" is a symbolic disassembler for the Intel 8088 CPU, designed to run under the PC/IX operating system on an IBM XT or fully-compatible clone. Its output is in the format of, and is completely compatible with, the PC/IX assembler, "as". The program is copyrighted by its author, but may be copied and re- distributed freely provided that complete source code, with all copyright notices, accompanies any distribution. This provision also applies to any modifications you may make. You are urged to comment such changes, giving, as a miminum, your name and complete address. This release of the program is a beta release, which means that it has been extensively, but not exhaustively, tested. User comments, recommendations, and bug fixes are welcome. The principal features of the current release are: (a) The ability to disassemble any file in PC/IX object format, making full use of symbol and relocation information if it is present, regardless of whether the file is executable or linkable, and regardless of whether it has continuous or split I/D space; (b) Automatic generation of synthetic labels when no sym- bol table is available; and (c) Optional output of address and object-code informa- tion as assembler comment text. Limitations of the current release are: (a) Numeric co-processor (i.e., 8087) mnemonics are not supported. Instructions for the co-processor are disassembled as CPU escape sequences, or as interrupts, depending on how they were assembled in the first place. This limitation will be addressed in a future release. (b) Symbolic references within the object file's data segment are not supported. Thus, for example, if a data segment location is initialized to point to a text segment address, no reference to a text segment symbol will be detected. This limi- tation is likely to remain in future releases, because object code does not, in most cases, contain sufficient information to allow meaningful interpretation of pure data. (Note, however, that symbolic references to the data segment from within the text segment are always supported.) As a final caveat, be aware that the PC/IX assembler does not recognize the "esc" mnemonic, even though it refers to a completely valid CPU operation which is documented in all the Intel literature. Thus, the corresponding opcodes (0xd8 through 0xdf) are disassembled as .byte directives. For reference, how- ever, the syntactically-correct "esc" instruction is output as a comment. To build the disassembler program, transfer all the source files, together with the Makefile, to a suitable (preferably empty) PC/IX directory. Then, simply type "make". To use dis88, place it in a directory which appears in your $PATH list. It may then be invoked by name from whatever directory you happen to be in. As a minimum, the program must be invoked with one command-line argument: the name of the ob- ject file to be disassembled. (Dis88 will complain if the file specified is not an object file.) Optionally, you may specify an output file; stdout is the default. One command-line switch is available: "-o", which makes the program display addresses and object code along with its mnemonic disassembly. The "-o" option is useful primarily for verifying the cor- rectness of the program's output. In particular, it may be used to check the accuracy of local relative jump opcodes. These jumps often target local labels, which are lost at assembly time; thus, the disassembly may contain cryptic instructions like "jnz .+39". As a user convenience, all relative jump and call opcodes are output with a comment which identifies the physical target address. By convention, the release level of the program as a whole is the SID of the file disrel.c, and this SID string appears in each disassembly. Release 2.1 of the program is the first beta release to be distributed on Usenet..TH dis88 1 LOCAL.SH "NAME"dis88 \- 8088 symbolic disassembler.SH "SYNOPSIS"\fBdis88\fP [ -o ] ifile [ ofile ].SH "DESCRIPTION"Dis88 reads ifile, which must be in PC/IX a.out format.It interprets the binary opcodes and data locations, andwrites corresponding assembler source code to stdout, orto ofile if specified. The program's output is in theformat of, and fully compatible with, the PC/IX assembler,as(1). If a symbol table is present in ifile, labels andreferences will be symbolic in the output. If the inputfile lacks a symbol table, the fact will be noted, and thedisassembly will proceed, with the disassembler generatingsynthetic labels as needed. If the input file has splitI/D space, or if it is executable, the disassembler willmake all necessary adjustments in address-reference calculations..PPIf the "-o" option appears, object code will be includedin comments during disassembly of the text segment. Thisfeature is used primarily for debugging the disassembleritself, but may provide information of passing interestto users..PPThe program always outputs the current machine addressbefore disassembling an opcode. If a symbol table ispresent, this address is output as an assembler comment;otherwise, it is incorporated into the synthetic labelwhich is generated internally. Since relative jumps,especially short ones, may target unlabelled locations,the program always outputs the physical target addressas a comment, to assist the user in following the code..PPThe text segment of an object file is always padded toan even machine address. In addition, if the file hassplit I/D space, the text segment will be padded to aparagraph boundary (i.e., an address divisible by 16).As a result of this padding, the disassembler may producea few spurious, but harmless, instructions at theend of the text segment..PPDisassembly of the data segment is a difficult matter.The information to which initialized data refers cannotbe inferred from context, except in the special caseof an external data or address reference, which will bereflected in the relocation table. Internal data andaddress references will already be resolved in the object file,and cannot be recreated. Therefore, the datasegment is disassembled as a byte stream, with longstretches of null data represented by an appropriate".zerow" pseudo-op. This limitation notwithstanding,labels (as opposed to symbolic references) are alwaysoutput at appropriate points within the data segment..PPIf disassembly of the data segment is difficult, disassembly of thebss segment is quite easy, because uninitialized data is allzero by definition. No datais output in the bss segment, but symbolic labels areoutput as appropriate..PPFor each opcode which takes an operand, a particularsymbol type (text, data, or bss) is appropriate. Thistidy correspondence is complicated somewhat, however,by the existence of assembler symbolic constants andsegment override opcodes. Therefore, the disassembler'ssymbol lookup routine attempts to apply a certain amountof intelligence when it is asked to find a symbol. Ifit cannot match on a symbol of the preferred type, itmay return a symbol of some other type, depending onpreassigned (and somewhat arbitrary) rankings withineach type. Finally, if all else fails, it returns astring containing the address sought as a hex constant;this behavior allows calling routines to use the outputof the lookup function regardless of the success of itssearch..PPIt is worth noting, at this point, that the symbol lookuproutine operates linearly, and has not been optimized inany way. Execution time is thus likely to increasegeometrically with input file size. The disassembler isinternally limited to 1500 symbol table entries and 1500relocation table entries; while these limits are generous(/unix, itself, has fewer than 800 symbols), they are notguaranteed to be adequate in all cases. If the symboltable or the relocation table overflows, the disassemblyaborts..PPFinally, users should be aware of a bug in the assembler,which causes it not to parse the "esc" mnemonic, eventhough "esc" is a completely legitimate opcode which isdocumented in all the Intel literature. To accommodatethis deficiency, the disassembler translates opcodes ofthe "esc" family to .byte directives, but notes thecorrect mnemonic in a comment for reference..PPIn all cases, it should be possible to submit the outputof the disassembler program to the assembler, and assembleit without error. In most cases, the resulting objectcode will be identical to the original; in any event, itwill be functionally equivalent..SH "SEE ALSO"adb(1), as(1), cc(1), ld(1)..br"Assembler Reference Manual" in the PC/IX Programmer'sGuide..SH "DIAGNOSTICS""can't access input file" if the input file cannot befound, opened, or read..sp"can't open output file" if the output file cannot becreated..sp"warning: host/cpu clash" if the program is run on amachine with a different CPU..sp"input file not in object format" if the magic numberdoes not correspond to that of a PC/IX object file..sp"not an 8086/8088 object file" if the CPU ID of thefile header is incorrect..sp"reloc table overflow" if there are more than 1500entries in the relocation table..sp"symbol table overflow" if there are more than 1500entries in the symbol table..sp"lseek error" if the input file is corrupted (shouldnever happen)..sp"warning: no symbols" if the symbol table is missing..sp"can't reopen input file" if the input file is removedor altered during program execution (should never happen)..SH "BUGS"Numeric co-processor (i.e., 8087) mnemonics are not currently supported.Instructions for the co-processor aredisassembled as CPU escape sequences, or as interrupts,depending on how they were assembled in the first place..spDespite the program's best efforts, a symbol retrievedfrom the symbol table may sometimes be different fromthe symbol used in the original assembly..spThe disassembler's internal tables are of fixed size,and the program aborts if they overflow.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -