Instructions

8-Bit Assembler Simulator

Designed by LionTion

Simulator

UNFINISHED, will write more


What does each RAM Bank do?


Each RAM Bank has a different purpose in this simulator. You can switch between the banks with the SB operation. For example, if you wanted to switch to the Text RAM Bank (the fifth RAM Bank, index 4), you would execute:

SB 4

The simulator has 5 RAM Banks:

  1. Code

    Contains the program code, which the CPU runs. The IP register only points into- and works with this bank.

  2. Data

    General data can be stored here like Strings, Bytes, etc. The SB (Select Bank) register starts pointing to this bank at start.

  3. Stack

    The SP register operates here. It begins pointing at 0xFF in this RAM Bank and with each PUSH operation, it stores the byte at the currently pointing cell and decrements. Each POP operation, the current byte the SP Register points to in this RAM Bank will be written into the specified register and the SP register is incremented.

  4. Color

    Contains the color data for the display. A color byte has the following format:


    Bit 8 (MSB)

    Bit 7

    Bit 6

    Bit 5

    Bit 4

    Bit 3

    Bit 2

    Bit 1 (LSB)

    BLT Independence

    Text Color

    2 Bits for the Blue Component

    2 Bits for the Green Component

    2 Bits for the Red Component


    BLT Independence means that the BLT operation is not needed to update that pixel on the display, if set to 1. Else the pixels with a zero in this bit will only update if the BLT operation is executed.


    The Text Color Bit defines if the color specified at this pixel should be used to color the text character on the same pixel instead.


    NOTE: This can be paired with the Black Text Bit from the Text RAM Bank, because if the Text Color Bit from the Color Bank and the Black Text Bit from the Text Bank are both set to 1 on the same pixel, the background color changes to white at that pixel, while coloring the text character. This special case was added to allow to choose a brighter background for darker colored text on the display.

  5. Text

    Renders ASCII characters onto the display. The unused ( Bit 8 (MSB) ) Bit is used to declare if the character should be rendered as black text. If this special bit and the Text Color bit in the corresponding address of the Color RAM Bank are set to 1, the background color will be set to white and the character will be colored by the values in the Color RAM Bank.


    NOTE: If the BLT Independence Bit is not set to 1 inside of the Color RAM Bank, you will need to use the BLT operation whenever you are done "writing" or want to update your text onto the display.


Moving values around


You can copy a value around with the MOV operation.

write about the general structure, point out labels, regs, pointers, etc. mention read-only regs

Arithmetic Operations


add addi etc and explain flags DEC INC

Other stuff


idk some about DD DC DT DB offsets and labels


Jumping


how to jump like ja je and what it means depending on the flags also mention the ji jump CMP

Binary Operations


shifting or not and xor

Subroutines


CALL RET

Working with the Stack


PUSH POP SP reg

Getting interactive


JI IN and explain how it flushes

Lastly...


I hope you have fun playing around with my 8-Bit Assembler Simulator! If you find any bugs or want to provide some feedback: Send an E-Mail to contact@lions-heart.de