Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instructions for setting the cpu error or clearing it in programs #13

Merged
merged 5 commits into from
Nov 14, 2023

Conversation

DerelictDrone
Copy link
Member

@DerelictDrone DerelictDrone commented Nov 11, 2023

Adds two new instructions

STERR (X),(Y) and CLERR

STERR(opcode 150) sets the CPU error output in a similar manner to actual errors, where X is the error code(equivalent to LINT) and Y is the error parameter(equivalent to LADD), but doesn't trigger an interrupt or set LINT/LADD on use, for example:
STERR 1,65536 would display 1.065536 as the error from the CPU

CLERR(opcode 151) sets the CPU error to 0 without resetting the actual CPU, but doesn't change the LINT/LADD registers internally(they can be changed via CPUSET anyway)

This is primarily aimed at users who want to display custom error codes, or those who would like to clear the error from the CPU on successfully handled errors/interrupts, like the ones that may frequently occur through hardware signalling with external interrupts.

lua/wire/zvm/zvm_opcodes.lua Outdated Show resolved Hide resolved
@DerelictDrone DerelictDrone force-pushed the controlled-cpu-error-output branch from e76eee0 to d3e59a0 Compare November 14, 2023 02:24
@thegrb93 thegrb93 merged commit 587d4ed into wiremod:master Nov 14, 2023
1 check failed
@DerelictDrone DerelictDrone deleted the controlled-cpu-error-output branch November 18, 2023 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants