Skip to content

v1.1 - Added interactive mode to assembler!

Latest

Choose a tag to compare

@netoe1 netoe1 released this 23 Aug 04:06
· 1 commit to main since this release

Interactive Mode - 16-bit Mini-Architecture Assembler

Description

The interactive mode allows you to use the assembler without creating .asm files in advance. It provides a dynamic prompt where the user types instructions for the 16-bit mini-architecture and immediately receives feedback on the assembled machine code.

This mode is ideal for quick tests, learning, and debugging simple programs without relying on external files.

How to start interactive mode

Run the assembler with the -i or --interactive flag:

./assembler -i

or

./assembler --interactive

Upon starting, the terminal is cleared and a welcome message is displayed along with the instruction guide.

Features

  1. Interactive prompt

    • Each line entered corresponds to an instruction to assemble.
    • The prompt shows the current program memory address, e.g., [00]> LDA R0, 5
  2. Instruction guide

    • Type help (or ajuda) to display all instructions and their formats.
    • Type end (or fim) to finish input and generate the final machine code.
  3. Instruction validation

    • Validates registers (R0 to R7)
    • Validates immediate values or addresses within the limit (0-15)
    • Checks the correct number of operands
    • Displays detailed error messages if an instruction is invalid.
  4. Machine code visualization

    • When input ends, the program shows:
      • Address
      • Hexadecimal code
      • Binary code formatted as Op Rd Rf1 Rf2 Imm
  5. File saving

    • Users can save the assembled machine code to a Logisim-compatible file.
    • Example file format:
      v2.0 raw
      0000
      1005
      2107
      ...
      

Notes

  • Maximum number of instructions in interactive mode: 16
  • Useful for quick tests and learning
  • For larger programs or production use, it is recommended to use .asm files with the -c and -o flags

Documentation generated by ChatGPT (Ely Neto)

Full Changelog: v1.0...v1.1