From 5f4c2abec8e830d524e313abe236f0ee1c0721d3 Mon Sep 17 00:00:00 2001 From: Kittycannon Date: Sat, 13 Jun 2026 13:12:06 -0600 Subject: [PATCH] fixed for library use --- makefile | 2 +- src/spider/runtime/instr/Instr_020-03F.cpp | 58 +++++++++++++++++++--- src/spider/runtime/instr/Instr_0E0-0FF.cpp | 8 +++ 3 files changed, 61 insertions(+), 7 deletions(-) diff --git a/makefile b/makefile index 69067c2..1f3d316 100644 --- a/makefile +++ b/makefile @@ -4,7 +4,7 @@ AR := ar ARFLAGS := rcs # The Target Static Library -TARGET := libspider-runtimelib.a +TARGET := libspider-runtime.a #The Directories, Source, Includes, Objects, Binary and Resources SRCDIR := src diff --git a/src/spider/runtime/instr/Instr_020-03F.cpp b/src/spider/runtime/instr/Instr_020-03F.cpp index 2bf7c98..8d500db 100644 --- a/src/spider/runtime/instr/Instr_020-03F.cpp +++ b/src/spider/runtime/instr/Instr_020-03F.cpp @@ -219,7 +219,6 @@ namespace spider { } } - // ── 0x030 — EQ: Dst == Src into Dst ── void CPU::EQ() { fetchOperSrc(); fetchOperDst(); @@ -233,7 +232,6 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } - // ── 0x031 — NE: Dst != Src into Dst ── void CPU::NE() { fetchOperSrc(); fetchOperDst(); @@ -247,7 +245,6 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } - // ── 0x032 — GT: Dst > Src into Dst ── void CPU::GT() { fetchOperSrc(); fetchOperDst(); @@ -261,7 +258,6 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } - // ── 0x033 — GE: Dst >= Src into Dst ── void CPU::GE() { fetchOperSrc(); fetchOperDst(); @@ -275,7 +271,6 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } - // ── 0x034 — LT: Dst < Src into Dst ── void CPU::LT() { fetchOperSrc(); fetchOperDst(); @@ -289,7 +284,6 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } - // ── 0x035 — LE: Dst <= Src into Dst ── void CPU::LE() { fetchOperSrc(); fetchOperDst(); @@ -303,6 +297,58 @@ namespace spider { _dst->_u64 = res ? 1 : 0; } + void CPU::GTU() { + fetchOperSrc(); + fetchOperDst(); + bool res = false; + switch(_size) { + case 0b00: res = (_dst->_u8 > _src->_u8); break; + case 0b01: res = (_dst->_u16 > _src->_u16); break; + case 0b10: res = (_dst->_u32 > _src->_u32); break; + case 0b11: res = (_dst->_u64 > _src->_u64); break; + } + _dst->_u64 = res ? 1 : 0; + } + + void CPU::GEU() { + fetchOperSrc(); + fetchOperDst(); + bool res = false; + switch(_size) { + case 0b00: res = (_dst->_u8 >= _src->_u8); break; + case 0b01: res = (_dst->_u16 >= _src->_u16); break; + case 0b10: res = (_dst->_u32 >= _src->_u32); break; + case 0b11: res = (_dst->_u64 >= _src->_u64); break; + } + _dst->_u64 = res ? 1 : 0; + } + + void CPU::LTU() { + fetchOperSrc(); + fetchOperDst(); + bool res = false; + switch(_size) { + case 0b00: res = (_dst->_u8 < _src->_u8); break; + case 0b01: res = (_dst->_u16 < _src->_u16); break; + case 0b10: res = (_dst->_u32 < _src->_u32); break; + case 0b11: res = (_dst->_u64 < _src->_u64); break; + } + _dst->_u64 = res ? 1 : 0; + } + + void CPU::LEU() { + fetchOperSrc(); + fetchOperDst(); + bool res = false; + switch(_size) { + case 0b00: res = (_dst->_u8 <= _src->_u8); break; + case 0b01: res = (_dst->_u16 <= _src->_u16); break; + case 0b10: res = (_dst->_u32 <= _src->_u32); break; + case 0b11: res = (_dst->_u64 <= _src->_u64); break; + } + _dst->_u64 = res ? 1 : 0; + } + // ── 0x038 — JMP: Dst -> Instruction Register (PC) ── // The IR adds 1 at the end, so we subtract 1 to compensate. void CPU::JMP() { diff --git a/src/spider/runtime/instr/Instr_0E0-0FF.cpp b/src/spider/runtime/instr/Instr_0E0-0FF.cpp index ce71a44..d271b19 100644 --- a/src/spider/runtime/instr/Instr_0E0-0FF.cpp +++ b/src/spider/runtime/instr/Instr_0E0-0FF.cpp @@ -12,6 +12,14 @@ namespace spider { // TODO: Implement UPY } + void CPU::INT_1_SLOT() {} + + void CPU::INT_2_SLOT() {} + + void CPU::INT_3_SLOT() {} + + void CPU::INT_4_SLOT() {} + // ── 0x0F6 — DGANT: "I'm SpiderLang" in a spider web ──────────── void CPU::DGANT() { const char art[] =