Git Product home page Git Product logo

8086-disassembler's Introduction

8086 Disassembler

An x86 disassembler which supports the original Intel 8086/8088 instructions.

This disassembler was written in x86 Assembly language during the first semester of Software Engineering programme in Vilnius University (VU).

Features

  • Supports every instruction from the original Intel 8086/8088 instruction set
  • Small executable file size (less than 6KB)
  • Fully-buffered file I/O
  • Reads from and writes to files whose names are give as command-line arguments
  • Prints helpful error messages for various different I/O errors

Todos

  • Output the results in a more-readable DOS Debug format
  • Translate error messages from Lithuanian language (original) to English
  • Add comments in the code
  • Print a usage message when command-line arguments are supplied incorrectly

Usage

This program was written for Turbo Assembler (TASM) and uses TASM specific features, so it should be Assembled with TASM.

The Assembled executable should be run with two positional arguments: input file name and output file name:
disasm <input_file_name> <output_file_name>

For example, to disassemble an executable test.com and output the disassembly result into test.asm, run:
disasm test.com test.asm

Notes

  • This program was intended to be used with COM files, hence the starting 0x0100 offset.
  • The author Assembled this program with Turbo Assembler 3.1 and linked with Turbo Link 3.0. All tests were run in a DOSBOX 0.74-3 environment.

8086-disassembler's People

Contributors

gzili avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

8086-disassembler's Issues

Handling of invalid opcodes & C translation

The "invalid opcode" message may cut off the assembly code generation in mid-stream. A better way to handle it is how DEBUG.EXE originally handled it: which is to treat it as a byte constant, e.g. "db 0fh" for opcode 0f. So, "db" should be added as a pseudo-mnemonic and the table entries set to that, instead of to "nop".

There's no reason to treat the floating point escapes specially - their format is standard, essentially the same as opcodes 84h or 85h (to cite the two most typical cases). In octal, the opcode sequences is \33D \xrm [ExtraBytes], which is "escape D" with (nominal) "register" r=0,1,2,3,4,5,6,7 and (nominal) "address mode" (x,m) and "ExtraBytes" dictated by the values of the octal digits x=0,1,2,3 and m=0,1,2,3,4,5,6,7.

Similarly, "aam" and "aad" do not really need to be treated specially, but could be treated the same way as "int P" (opcode \315, i.e. 0cdh).

I translated what you have - without any of the above-mentioned changes - straight into C. I'll fork off of your version, add the C translation, and then do continual upgrade on it from there. You're welcome to copy back the C translation (or any of its upward revisions), when I put it up.

Edit: 2023-07-18: I forked and put it up on GitHub.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.