Skip to content

Implementation of Assembler and Emulator for a custom assembly language.

Notifications You must be signed in to change notification settings

maheshmb13/Assembler-Emulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Assembler-Emulator


C language implementation of Assembler and Emulator for a custom assembly language

View Assembly Language » for the language definitions.

About The Project

Diagnoses Label errors - No such Label, Bogus label, etc.
Produces Listing file
Advanced Listing file - Instructions displayed beside each memory
Op-table is created in the form of the struct. Retrieving is done through open-chain hashing.
SET instruction - Assigned a temporary opcode

Process:

  • Assembler generates three files - object file (machine readable), listing file and logfile(for errors and warnings)
  • The object file is passed into emulator to generate trace, memory dump, memory writes, memory reads, instructions set architecture etc.

Getting Started

Run the assembler using gcc - Produces listing file, object file and log file

gcc asm.c -o asm
./asm filename.asm

Emulator

  1. Copy the object file into the directory of emulator and run emu.c
  2. gcc emu.c -o emu
    ./emu [options] filename.o
    The following options are available
    -trace   | show instruction trace
    -read    | show memory reads
    -write   | show memory writes
    -before  | show memory dump before execution
    -after   | show memory dump after execution
    -wipe    | wipe written flags before execution
    -isa     | display instruction set architecture

A text file is generated using the option given.

Some example test files and the generated files are given in the respective folders

About

Implementation of Assembler and Emulator for a custom assembly language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published