Skip to content
/ decgen Public

Decgen is a binary instruction decoder generator, written in C#, but capable of generating source code for any of the C-like languages (C, C++, C#, Java).

License

Notifications You must be signed in to change notification settings

risc26z/decgen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

decgen

Decgen is a binary instruction decoder generator. When given an instruction set specification containing pattern-matching rules, it generates code compatible with the C family of languages (C, C++, C#, and so on).

Instruction decoders are found in virtual machines, simulators, emulators, disassemblers, and similar programs. They are often large and complex, error-prone, and are typically performance hotspots.

Decgen writes them automatically. It can perform a number of optimisations, many of which can be tuned through configuration settings.

Status

This is an early version, and bugs should be expected. Decgen has not been thoroughly tested, but it appears to create correct and efficient decoders.

Although the code is reasonably well commented, little documentation exists.

An example specification is included in the decgen/Test directory.

Example usage

decgen --help

(Prints command line help.)

decgen -s config.json

(Save configuration settings. The settings can now be edited to fit your preferences.)

decgen -l config.json specification.txt decoder.cs

(Load configuration settings, then generate decoder.cs from specification.txt.)

About

Decgen is a binary instruction decoder generator, written in C#, but capable of generating source code for any of the C-like languages (C, C++, C#, Java).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages