Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

v0.2.0 - Rewrite Update

Latest
Compare
Choose a tag to compare
@TaromaruYuki TaromaruYuki released this 03 Jul 18:34
275c5a7

What's Changed

A lot of new instructions created!

  • JSR / RET
    • Call a label that you can return from. Pushes the return address to the stack than jumps to the label. RET to go back to the program.
  • RET
    • Return from a label, popping the return address off the stack.
  • MOV
    • The previous behavior of LD has been moved to MOV. MOV loads a value into a register while LD loads a value from memory.
  • AND / OR / XOR / LSH / RSH
    • Bitwise operations. Should be pretty simple to use. Example: AND R1, R3
  • INT / REI
    • Interrupts! Those will be mentioned later.

Assembler has been reworked to be way less buggy! This means that the assembly has changed a little as well.

Rust's Clap has been implemented instead of reading args manually. This makes the CLI way more user friendly to use. CLI also got two new commands. opcode-table generates an opcode table, mainly used for the docs. instruction gives you info about an instruction, which is the following: Binary, Hex, and instruction modes with their binary and hex.

Subroutines:
You can now define subroutines. They work like labels, but you can call them and return back to the main program. Just define a label like usual, with whatever code you want, then when you want to return use RET to return back to the main program.

Interrupts:
Interrupts have been added! To pair an interrupt number with a label, add .int 0xXX LABEL at the top of your file. Then when that number is called with INT 0xXX, or the interrupt number is a part of a physical event, like a keyboard, your program will stop, save the jump address, registers, and flags, and jump to the label.

When you need to return, use REI to return from the interrupt. All registers, flags, and addresses will be returned back to normal. The keyboard interrupt is 0x01. Interrupts can go up to 0xFF.

Other notes

I have not compiled 32-bit versions of the program, as I could not get the Linux version to compile. I'm pretty sure it's a library problem with the graphics library port I'm using. Hopefully that will be fixed if I want to switch to RayLib.

Docs should be pretty up to date, just no instruction info. That is added into the CLI.

Full Changelog: 0.1.0...0.2.0