YehiaShaarawy / Modified-SIC-OnePassAssembler

The one-pass assembler will read the assembly code, allocate memory, and generate the corresponding relocatable machine code for execution on modi-SIC. It will handle symbol resolution, directive processing, and object code generation (HTE) in a single pass.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Modi-SIC One Pass Assembler

It is a program that performs one-pass assembly for the Modified Simple Instruction Computer (modi-SIC).
The assembler will translate assembly code into machine code compatible with the Modified Simplified Instructional Computer.


The modi-SIC architecture retains the instruction set and Format 3 instructions from the original SIC (Simple Instruction Computer).
It also includes the concept of reserving variables in memory using directives such as BYTE, WORD, RESB, and RESW.

Key Modifications and Extensions:

• Format 1 Instructions: Modi-SIC extends its capabilities by introducing Format 1 instructions,expanding the range of supported operations.

• Immediate Instructions (Format 3): Modi-SIC introduces immediate instructions, allowing for the handling of immediate values passed as integers. This provides greater flexibility in executing instructions.

• Relocation: The Modi-SIC also supports relocation by using the masking bits in the text records, where 1 denotes memory location that needs modification and 0 otherwise.

Instructions Handling:

The assembler will process the assembly code in a single pass, generating machine code (HTE records) for execution on the modi-SIC. It will consider both the original SIC Format 3 instructions and the newly introduced Format 1 instructions and immediate instructions

Instruction Set

modisic

Instruction Format

Format 1

OPCODE (8 Bits)

Format 3

All Type 3 instruction could be immediate instructions this is done by a new division of bits of instructions of Type 3 (Format 3) as shown in following table.

OPCODE (7 Bits) Immediate Flag [i] (1 Bit) Indexing Flag [x] (1 Bit) Address (15 Bits)

The modification applied on the opcode as

  1. Only opcode is represented as 7 bits (not 8) as in SIC
  2. The 8th bit of the opcode represents the immediate flag (i) which has two value
    • a. 0 if the instruction without immediate value (has an address)
      b. 1 if the instruction with immediate value

Implementation

Input

It takes as an input a text file (in.txt) that contains modi-SIC assembly program.
Remember that The modi-SIC program includes Format 1 instruction of SIC/XE.

Output

A generated symbol table file (symbolTable.txt) for all the symbols extracted from the program.

A generated complete HTE records (objectcode.txt) which contain ne header, one or more text records (including masking bits) and one end record.

About

The one-pass assembler will read the assembly code, allocate memory, and generate the corresponding relocatable machine code for execution on modi-SIC. It will handle symbol resolution, directive processing, and object code generation (HTE) in a single pass.


Languages

Language:Java 100.0%