diff options
| author | Paul Oliver <contact@pauloliver.dev> | 2026-07-14 17:29:02 +0200 |
|---|---|---|
| committer | Paul Oliver <contact@pauloliver.dev> | 2026-08-30 16:24:48 +0200 |
| commit | 1961b4b237083f4cfac9ca6b249c1d6cb665d149 (patch) | |
| tree | fd9fc8260360e2ac30be9747ca558bcfc824a4c4 /test/ui/v1/addrs | |
Diffstat (limited to 'test/ui/v1/addrs')
| -rw-r--r-- | test/ui/v1/addrs/links.json | 1 | ||||
| -rw-r--r-- | test/ui/v1/addrs/ui.c | 58 |
2 files changed, 59 insertions, 0 deletions
diff --git a/test/ui/v1/addrs/links.json b/test/ui/v1/addrs/links.json new file mode 100644 index 0000000..fe51488 --- /dev/null +++ b/test/ui/v1/addrs/links.json @@ -0,0 +1 @@ +[] diff --git a/test/ui/v1/addrs/ui.c b/test/ui/v1/addrs/ui.c new file mode 100644 index 0000000..eb4361c --- /dev/null +++ b/test/ui/v1/addrs/ui.c @@ -0,0 +1,58 @@ +// file : test/ui/v1/addrs/ui.c +// project : Salis-VM +// author : Paul Oliver <contact@pauloliver.dev> + +#include <assert.h> +#include <stdint.h> +#include <threads.h> +#include <zlib.h> + +#include "arch_spec.h" +#include "arch_inst.h" +#include "compress.h" +#include "salis.h" + +static void check_found(uint64_t addr, uint64_t lok, uint64_t regi) { + assert(mvec_get_inst(g_cores, addr - 1) == (regi % 2 == 0 ? adrf : adrb)); + assert(mvec_get_inst(g_cores, (&g_cores->pvec->r0x)[regi]) == lok); +} + +int main(void) { + uint64_t regi = 0; + + salis_init(); + + while (mvec_is_proc_owner(g_cores, g_cores->pvec->ip, g_cores->pcur)) { + uint8_t inst = mvec_get_inst(g_cores, g_cores->pvec->ip); + + switch (inst) { +#define CASE(id) \ + case key##id: \ + check_found(g_cores->pvec->ip, lok##id, regi); \ + regi = (regi + 1) % 4; \ + break; + CASE(a) + CASE(b) + CASE(c) + CASE(d) + CASE(e) + CASE(f) + CASE(g) + CASE(h) + CASE(i) + CASE(j) + CASE(k) + CASE(l) + CASE(m) + CASE(n) + CASE(o) + CASE(p) +#undef CASE + } + + salis_step(1); + } + + salis_save_and_free(); + return 0; +} |
