Add output enable to example

This commit is contained in:
Curt Spark 2025-11-06 19:11:25 +00:00
parent 74ea060849
commit b0f92beaed
2 changed files with 3 additions and 2 deletions

View File

@ -26,7 +26,7 @@ The instructions can be split into 4 categories, which can be distinguished by t
* Immediate 🔴🔴🟤🟤🟤🟤🟤🟤 * Immediate 🔴🔴🟤🟤🟤🟤🟤🟤
These instructions represent a number between 0 and 63 (inclusive), which will be put into register 0 These instructions represent a number between 0 and 63 (inclusive), which will be put into register 0
Assembly Mnemonics ** Assembly Mnemonics
Generally, these instructions are represented directly by using the value (a number between 0 and 63) directly, since they represent the actual number. Generally, these instructions are represented directly by using the value (a number between 0 and 63) directly, since they represent the actual number.
* Calculate 🔴🟢🟤🟤🟤🟤🟤🟤 * Calculate 🔴🟢🟤🟤🟤🟤🟤🟤

3
main.c
View File

@ -252,6 +252,7 @@ void cpu_diagnostics(overture* cpu) {
printf("input: %d\n", cpu->input); printf("input: %d\n", cpu->input);
printf("output: %d\n", cpu->output); printf("output: %d\n", cpu->output);
printf("Output enabled?: %d\n", cpu->output_enable);
printf("Current instruction: %d\n\n", cpu->current_instruction); printf("Current instruction: %d\n\n", cpu->current_instruction);
} }
@ -283,7 +284,7 @@ void overture_start_clock(overture* cpu, uint8_t rom[256]) {
} }
int main() { int main() {
uint8_t rom[256] = { 63, 129, 7, 130, 68 }; uint8_t rom[256] = { 63, 129, 7, 130, 68 , 158 };
overture cpu = { overture cpu = {
.step_mode = true, .step_mode = true,
.clock_speed_hz = 1, .clock_speed_hz = 1,