Skip to content

Latest commit

 

History

19 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IMX Assembler/Disassembler

IMX is a simple assembler and disassembler designed for the SDMA RISC CPU of the i.MX6 series. This tool allows developers to convert assembly code into machine code and vice versa, facilitating low-level programming and analysis for the i.MX6's SDMA engine.

⚠️ This repository is an experimental proof-of-concept created while learning to work with the NXP i.MX SDMA engine and to explore how custom scripts interact with peripherals such as SPI and memory.

It is not intended to be production-ready. The main goal was to understand the SDMA instruction set and how to build simple scripts for DMA transfers.

Features

  • Assembler: Converts SDMA assembly code into machine code.
  • Disassembler: Translates machine code back into human-readable assembly.
  • Custom Instruction Set Support: Tailored for the specific instruction set of the SDMA RISC CPU.
  • Command-Line Interface: Easily integrate into scripts and development workflows.

Getting Started

Prerequisites

  • Flex: For lexical analysis.
  • Bison: For parsing.
  • GCC: C compiler.
  • Make: Build automation tool.

Ensure these tools are installed on your system before proceeding.

Building the Project

Clone the repository and build the project using the provided Makefile:

git clone https://github.com/yairgd/imx.git
cd imx
make

This will generate the assembler and disassembler binaries.

Usage

Assembler

To assemble an SDMA assembly file:

./asm input.asm -o output.bin
  • input.asm: Your assembly source file.
  • output.bin: The resulting machine code output.

Disassembler

To disassemble a machine code file:

./disasm input.bin -o output.asm
  • input.bin: Machine code input file.
  • output.asm: The resulting assembly code output.

Project Structure

  • asm.lex: Lexical analyzer definitions for tokenizing assembly code.
  • asm.yacc: Grammar rules for parsing assembly code.
  • instructions.c & instructions.h: Definitions and implementations of the SDMA instruction set.
  • Makefile: Build instructions for compiling the assembler and disassembler.
  • README.md: Project documentation.
  • info.txt: Additional information about the project.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request with your enhancements.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages