From f002ba6880cb7aba57056c08cc76b48e179f7c80 Mon Sep 17 00:00:00 2001 From: AlmiriQ <50090571+AlmiriQ@users.noreply.github.com> Date: Wed, 16 Feb 2022 01:55:22 +0700 Subject: [PATCH] Add files via upload --- devices.c | 55 ++++ livm.c | 167 +++++++++--- main.c | 35 ++- xcase.c | 768 +++++++++++++++++++++++++++--------------------------- 4 files changed, 607 insertions(+), 418 deletions(-) create mode 100644 devices.c diff --git a/devices.c b/devices.c new file mode 100644 index 0000000..5a51df1 --- /dev/null +++ b/devices.c @@ -0,0 +1,55 @@ +#define DEV_C 1 + +void c_write(struct VMinst* vm, void* data, uint64_t length) { + uint16_t* write_bс = ((uint16_t*)vm->devices[0].buffer); + uint8_t* write_b = (uint8_t*)(vm->devices[0].buffer + 2); + for (uint64_t i = 0; i < length; ++i) { + if (*write_bс == 5120) return; + write_b[(*write_bс)++] = ((uint8_t*)data)[i]; + } +} + +void c_out(struct VMinst* vm) { + puts((char*)(vm->devices[0].buffer + 2)); +} + +void c_read(struct VMinst* vm, void* buffer, uint64_t length, uint64_t where) { + uint16_t* read_bс = ((uint16_t*)(vm->devices[0].buffer + 5120)); + uint8_t* read_b = ((uint8_t*)(vm->devices[0].buffer + 5120) + where) + 2; + for (uint64_t i = 0; i < length; ++i) { + ((uint8_t*)buffer)[i] = read_b[i + 1]; + } + *read_bс = 0; +} + +void c_wait(struct VMinst* vm, uint64_t data) { + uint16_t* read_bс = ((uint16_t*)(vm->devices[0].buffer + 5120)); + uint8_t* read_b = ((uint8_t*)vm->devices[0].buffer + 5120); + for (uint64_t i = 0; i < data; i++) { + if (*read_bс == 5120) return; + read_b[++(*read_bс)] = getchar(); + } +} + +void c_poweroff(struct VMinst* vm) { + free(vm->devices[0].buffer); +} + +void setup_console(struct VMinst* vm) { + vm->devices[0].buffer = malloc(10240); + vm->devices[0].write = &c_write; + vm->devices[0].out = &c_out; + vm->devices[0].read = &c_read; + vm->devices[0].wait = &c_wait; + vm->devices[0].poweroff = &c_poweroff; +} + +void dev_init(struct VMinst* vm) { + vm->devices = (struct IODevice*)malloc(sizeof(struct IODevice) * 1); + setup_console(vm); +} + +void dev_delete(struct VMinst* vm) { + for (uint64_t d = 0; d < DEV_C; d++) vm->devices[d].poweroff(vm); + free(vm->devices); +} \ No newline at end of file diff --git a/livm.c b/livm.c index 06da6fc..ecc73f3 100644 --- a/livm.c +++ b/livm.c @@ -1,46 +1,151 @@ -void* ram; - int8_t* ram8; - uint8_t* uram8; - int16_t* ram16; -uint16_t* uram16; - int32_t* ram32; -uint32_t* uram32; - int64_t* ram64; -uint64_t* uram64; - float* ramf; - double* ramd; +/* +(C) M. Ærþ. +*/ -void createVM(uint64_t ram_size) { - ram = (malloc(ram_size)); - ram8 = (int8_t*) ((ram)); - uram8 = (uint8_t*) ((ram)); - ram16 = (int16_t*) ((ram)); - uram16 = (uint16_t*)((ram)); - ram32 = (int32_t*) ((ram)); - uram32 = (uint32_t*)((ram)); - ram64 = (int64_t*) ((ram)); - uram64 = (uint64_t*)((ram)); - ramf = (float*) ((ram)); - ramd = (double*) ((ram)); +struct VMinst; +struct IODevice; + +struct IODevice { // input/output device + void* buffer; + void (*write)(struct VMinst* vm, void* data, uint64_t length); + void (*out)(struct VMinst* vm); + void (*read)(struct VMinst* vm, void* buffer, uint64_t length, uint64_t where); + void (*wait)(struct VMinst* vm, uint64_t data); + void (*poweroff)(struct VMinst* vm); +}; + +struct VMinst { + void* ram; + int8_t* ram8; + uint8_t* uram8; + int16_t* ram16; + uint16_t* uram16; + int32_t* ram32; + uint32_t* uram32; + int64_t* ram64; + uint64_t* uram64; + float* ramf; + double* ramd; + + uint64_t ip; + uint64_t sp; + uint64_t dp; + + struct IODevice* devices; +}; + +#ifdef LIVMDEBUG +# define LIVMCREATION printf("LIVM instance [%p] created.\n", &vm); +# define LIVMSTARTWORK printf("LIVM instance [%p] started.\n", vm) +# define LIVMENDWORK printf("LIVM instance [%p] ended it's work.\n", vm) +# define LIVMDELETING printf("LIVM instance [%p] was deleted.\n", &vm) +# define LIVMARGOVERFLOW { printf("ERROR: arg overflow at [ip=%ld, op=%ld]\n", ip, op); continue; } +#else +# define LIVMCREATION +# define LIVMSTARTWORK +# define LIVMENDWORK +# define LIVMDELETING +# define LIVMARGOVERFLOW continue; +#endif + +#include "devices.c" + +struct VMinst createVM(uint64_t ram_size) { + struct VMinst vm; + vm.ram = malloc(ram_size); + if (vm.ram == NULL) exit(-1); + vm.ram8 = (int8_t*) vm.ram; + vm.uram8 = (uint8_t*) vm.ram; + vm.ram16 = (int16_t*) vm.ram; + vm.uram16 = (uint16_t*)vm.ram; + vm.ram32 = (int32_t*) vm.ram; + vm.uram32 = (uint32_t*)vm.ram; + vm.ram64 = (int64_t*) vm.ram; + vm.uram64 = (uint64_t*)vm.ram; + vm.ramf = (float*) vm.ram; + vm.ramd = (double*) vm.ram; + LIVMCREATION + dev_init(&vm); + return vm; } -void deleteVM() { - free(ram); +struct VMinst* loadRAM(struct VMinst* vm, uint64_t* RAM, uint64_t length) { + for (uint64_t i = 0; i < length; ++i) vm->uram64[i] = RAM[i]; + return vm; } -void runVM() { - register uint64_t ip = 0, sp = 0, dp = 0; +struct VMinst* deleteVM(struct VMinst* vm) { + LIVMDELETING; + free(vm->ram); + return vm; +} + +struct VMinst* runVM(struct VMinst* vm) { + LIVMSTARTWORK; + register uint64_t ip = vm->ip, + sp = vm->sp, + dp = vm->dp; + register uint64_t op = 0; register uint8_t cmp = 0; + + register uint8_t argc = 0; + register uint8_t cargc = 0; uint64_t args[8]; + + register int8_t* ram8 = vm->ram8; + register uint8_t* uram8 = vm->uram8; + register int16_t* ram16 = vm->ram16; + register uint16_t* uram16 = vm->uram16; + register int32_t* ram32 = vm->ram32; + register uint32_t* uram32 = vm->uram32; + register int64_t* ram64 = vm->ram64; + register uint64_t* uram64 = vm->uram64; + register float* ramf = vm->ramf; + register double* ramd = vm->ramd; + + struct IODevice* devices = vm->devices; + while (1) { + #ifdef LLLIVMDEBUG + printf("%ld\t|\t", ip); + #endif op = uram64[ip++]; - args[0] = 0; - while((args[0]++ < 6) && (uram64[ip])) - args[args[0]] = uram64[ip++]; + #ifdef LLLIVMDEBUG + printf("%ld <- %ld -> %ld\t", uram64[ip - 2], op, uram64[ip + 1]); + #endif + argc = uram64[ip++]; + #ifdef LLLIVMDEBUG + printf("c=%d\t[", argc); + #endif + cargc = 0; + + if (argc > 8) LIVMARGOVERFLOW; + + while(cargc < argc) + args[cargc++] = uram64[ip++]; + + #ifdef LLLIVMDEBUG + for (register uint8_t x = 0; x < (argc - 1); x++) + printf("%ld, ", args[x]); + printf("%ld]\n", args[argc - 1]); + #endif switch (op) { #include "xcase.c" } + #ifdef LLLIVMDEBUG + getchar(); + #endif } - end:; + end: LIVMENDWORK; + vm->ip = ip; + vm->sp = sp; + vm->dp = dp; + return vm; } + +# undef LIVMCREATION +# undef LIVMSTARTWORK +# undef LIVMENDWORK +# undef LIVMDELETING +# undef LIVMARGOVERFLOW \ No newline at end of file diff --git a/main.c b/main.c index 973f7da..f2ce0a8 100644 --- a/main.c +++ b/main.c @@ -1,14 +1,33 @@ +/* +(C) M. Ærþ. +*/ + #include #include #include #include -#include "livm.c" // FUUUUCK +//#define LIVMDEBUG +//#define LLLIVMDEBUG +#include "livm.c" -int main() { // FUCK FUCK FUCK, FUCK - createVM(100); // alloc 100 bytes - uram64[0] = 11; // poweroff opcode - runVM(); // run this fucking fuck - deleteVM(); // delete this shit, oh finally - return 0; // fuck all this code -} \ No newline at end of file + +int main() { + struct VMinst vm = createVM(256); // alloc 256 bytes + uint64_t vmram[] = { // "proper" way to write out "Hello, LIVM!" + // start: + 1, 1, 8, 0, // goto code + // data: + 0x4c202c6f6c6c6548, 0x00000000214d5649, 0, 0, // "Hello, LIVM!" + // code: + 381, 3, 0, 32, 12, // device.write(console, "Hello, LIVM!", 12) - write string (char*) to console's buffer + 382, 1, 0, // device.out(console) - write out console's buffer + 12, 0 // stop VM + }; + loadRAM(&vm, vmram, sizeof vmram / sizeof(uint64_t)); + //uint64_t dt[] = {5485433203209299272, 7810728294139909705, 0}; + //puts(((char*)dt)); + runVM(&vm); + deleteVM(&vm); + return 0; +} diff --git a/xcase.c b/xcase.c index a187750..6d1397c 100644 --- a/xcase.c +++ b/xcase.c @@ -1,407 +1,417 @@ +/* +(C) M. Ærþ. +*/ + // control case 0: break; -case 1: ip = args[1]; break; -case 2: ip = cmp * args[1]; break; // if -case 3: ip = cmp * args[1] + (1 - cmp) * args[2]; break; // if-else -case 4: uram64[args[1]] = ip; break; -case 5: sp = uram64[args[1]]; break; -case 6: sp = args[1]; break; -case 7: uram64[args[1]] = sp; break; -case 8: dp = uram64[args[1]]; break; -case 9: dp = args[1]; break; -case 10: uram64[args[1]] = dp; break; -case 11: goto end; break; +case 1: ip = args[0]; break; +case 2: ip = cmp * args[0]; break; +case 3: ip = cmp * args[0] + (1 - cmp) * args[1]; break; +case 4: ip = (1 - cmp) * args[0]; break; +case 5: uram64[args[0]] = ip; break; +case 6: sp = uram64[args[0]]; break; +case 7: sp = args[0]; break; +case 8: uram64[args[0]] = sp; break; +case 9: dp = uram64[args[0]]; break; +case 10: dp = args[0]; break; +case 11: uram64[args[0]] = dp; break; +case 12: goto end; break; // math // u64 -case 12: uram64[args[1]] += uram64[args[2]]; break; -case 13: uram64[args[1]] -= uram64[args[2]]; break; -case 14: uram64[args[1]] *= uram64[args[2]]; break; -case 15: uram64[args[1]] /= uram64[args[2]]; break; -case 16: uram64[args[1]] %= uram64[args[2]]; break; -case 17: uram64[args[1]] |= uram64[args[2]]; break; -case 18: uram64[args[1]] &= uram64[args[2]]; break; -case 19: uram64[args[1]] = uram64[args[2]] + uram64[args[3]]; break; -case 20: uram64[args[1]] = uram64[args[2]] - uram64[args[3]]; break; -case 21: uram64[args[1]] = uram64[args[2]] * uram64[args[3]]; break; -case 22: uram64[args[1]] = uram64[args[2]] / uram64[args[3]]; break; -case 23: uram64[args[1]] = uram64[args[2]] % uram64[args[3]]; break; -case 24: uram64[args[1]] = uram64[args[2]] | uram64[args[3]]; break; -case 25: uram64[args[1]] = uram64[args[2]] & uram64[args[3]]; break; -case 26: uram64[args[1]] = !uram64[args[2]]; break; +case 13: uram64[args[0]] += uram64[args[1]]; break; +case 14: uram64[args[0]] -= uram64[args[1]]; break; +case 15: uram64[args[0]] *= uram64[args[1]]; break; +case 16: uram64[args[0]] /= uram64[args[1]]; break; +case 17: uram64[args[0]] %= uram64[args[1]]; break; +case 18: uram64[args[0]] |= uram64[args[1]]; break; +case 19: uram64[args[0]] &= uram64[args[1]]; break; +case 20: uram64[args[0]] = uram64[args[1]] + uram64[args[2]]; break; +case 21: uram64[args[0]] = uram64[args[1]] - uram64[args[2]]; break; +case 22: uram64[args[0]] = uram64[args[1]] * uram64[args[2]]; break; +case 23: uram64[args[0]] = uram64[args[1]] / uram64[args[2]]; break; +case 24: uram64[args[0]] = uram64[args[1]] % uram64[args[2]]; break; +case 25: uram64[args[0]] = uram64[args[1]] | uram64[args[2]]; break; +case 26: uram64[args[0]] = uram64[args[1]] & uram64[args[2]]; break; +case 27: uram64[args[0]] = !uram64[args[1]]; break; // 64 -case 27: ram64[args[1]] += ram64[args[2]]; break; -case 28: ram64[args[1]] -= ram64[args[2]]; break; -case 29: ram64[args[1]] *= ram64[args[2]]; break; -case 30: ram64[args[1]] /= ram64[args[2]]; break; -case 31: ram64[args[1]] %= ram64[args[2]]; break; -case 32: ram64[args[1]] |= ram64[args[2]]; break; -case 33: ram64[args[1]] &= ram64[args[2]]; break; -case 34: ram64[args[1]] = ram64[args[2]] + ram64[args[3]]; break; -case 35: ram64[args[1]] = ram64[args[2]] - ram64[args[3]]; break; -case 36: ram64[args[1]] = ram64[args[2]] * ram64[args[3]]; break; -case 37: ram64[args[1]] = ram64[args[2]] / ram64[args[3]]; break; -case 38: ram64[args[1]] = ram64[args[2]] % ram64[args[3]]; break; -case 39: ram64[args[1]] = ram64[args[2]] | ram64[args[3]]; break; -case 40: ram64[args[1]] = ram64[args[2]] & ram64[args[3]]; break; -case 41: ram64[args[1]] = !ram64[args[2]]; break; +case 28: ram64[args[0]] += ram64[args[1]]; break; +case 29: ram64[args[0]] -= ram64[args[1]]; break; +case 30: ram64[args[0]] *= ram64[args[1]]; break; +case 31: ram64[args[0]] /= ram64[args[1]]; break; +case 32: ram64[args[0]] %= ram64[args[1]]; break; +case 33: ram64[args[0]] |= ram64[args[1]]; break; +case 34: ram64[args[0]] &= ram64[args[1]]; break; +case 35: ram64[args[0]] = ram64[args[1]] + ram64[args[2]]; break; +case 36: ram64[args[0]] = ram64[args[1]] - ram64[args[2]]; break; +case 37: ram64[args[0]] = ram64[args[1]] * ram64[args[2]]; break; +case 38: ram64[args[0]] = ram64[args[1]] / ram64[args[2]]; break; +case 39: ram64[args[0]] = ram64[args[1]] % ram64[args[2]]; break; +case 40: ram64[args[0]] = ram64[args[1]] | ram64[args[2]]; break; +case 41: ram64[args[0]] = ram64[args[1]] & ram64[args[2]]; break; +case 42: ram64[args[0]] = !ram64[args[1]]; break; // d -case 42: ramd[args[1]] += ramd[args[2]]; break; -case 43: ramd[args[1]] -= ramd[args[2]]; break; -case 44: ramd[args[1]] *= ramd[args[2]]; break; -case 45: ramd[args[1]] /= ramd[args[2]]; break; -case 46: ramd[args[1]] = ramd[args[2]] + ramd[args[3]]; break; -case 47: ramd[args[1]] = ramd[args[2]] - ramd[args[3]]; break; -case 48: ramd[args[1]] = ramd[args[2]] * ramd[args[3]]; break; -case 49: ramd[args[1]] = ramd[args[2]] / ramd[args[3]]; break; -case 50: ramd[args[1]] = !ramd[args[2]]; break; +case 43: ramd[args[0]] += ramd[args[1]]; break; +case 44: ramd[args[0]] -= ramd[args[1]]; break; +case 45: ramd[args[0]] *= ramd[args[1]]; break; +case 46: ramd[args[0]] /= ramd[args[1]]; break; +case 47: ramd[args[0]] = ramd[args[1]] + ramd[args[2]]; break; +case 48: ramd[args[0]] = ramd[args[1]] - ramd[args[2]]; break; +case 49: ramd[args[0]] = ramd[args[1]] * ramd[args[2]]; break; +case 50: ramd[args[0]] = ramd[args[1]] / ramd[args[2]]; break; +case 51: ramd[args[0]] = !ramd[args[1]]; break; // u32 -case 51: uram32[args[1]] += uram32[args[2]]; break; -case 52: uram32[args[1]] -= uram32[args[2]]; break; -case 53: uram32[args[1]] *= uram32[args[2]]; break; -case 54: uram32[args[1]] /= uram32[args[2]]; break; -case 55: uram32[args[1]] %= uram32[args[2]]; break; -case 56: uram32[args[1]] |= uram32[args[2]]; break; -case 57: uram32[args[1]] &= uram32[args[2]]; break; -case 58: uram32[args[1]] = uram32[args[2]] + uram32[args[3]]; break; -case 59: uram32[args[1]] = uram32[args[2]] - uram32[args[3]]; break; -case 60: uram32[args[1]] = uram32[args[2]] * uram32[args[3]]; break; -case 61: uram32[args[1]] = uram32[args[2]] / uram32[args[3]]; break; -case 62: uram32[args[1]] = uram32[args[2]] % uram32[args[3]]; break; -case 63: uram32[args[1]] = uram32[args[2]] | uram32[args[3]]; break; -case 64: uram32[args[1]] = uram32[args[2]] & uram32[args[3]]; break; -case 65: uram32[args[1]] = !uram32[args[2]]; break; +case 52: uram32[args[0]] += uram32[args[1]]; break; +case 53: uram32[args[0]] -= uram32[args[1]]; break; +case 54: uram32[args[0]] *= uram32[args[1]]; break; +case 55: uram32[args[0]] /= uram32[args[1]]; break; +case 56: uram32[args[0]] %= uram32[args[1]]; break; +case 57: uram32[args[0]] |= uram32[args[1]]; break; +case 58: uram32[args[0]] &= uram32[args[1]]; break; +case 59: uram32[args[0]] = uram32[args[1]] + uram32[args[2]]; break; +case 60: uram32[args[0]] = uram32[args[1]] - uram32[args[2]]; break; +case 61: uram32[args[0]] = uram32[args[1]] * uram32[args[2]]; break; +case 62: uram32[args[0]] = uram32[args[1]] / uram32[args[2]]; break; +case 63: uram32[args[0]] = uram32[args[1]] % uram32[args[2]]; break; +case 64: uram32[args[0]] = uram32[args[1]] | uram32[args[2]]; break; +case 65: uram32[args[0]] = uram32[args[1]] & uram32[args[2]]; break; +case 66: uram32[args[0]] = !uram32[args[1]]; break; // 32 -case 66: ram32[args[1]] += ram32[args[2]]; break; -case 67: ram32[args[1]] -= ram32[args[2]]; break; -case 68: ram32[args[1]] *= ram32[args[2]]; break; -case 69: ram32[args[1]] /= ram32[args[2]]; break; -case 70: ram32[args[1]] %= ram32[args[2]]; break; -case 71: ram32[args[1]] |= ram32[args[2]]; break; -case 72: ram32[args[1]] &= ram32[args[2]]; break; -case 73: ram32[args[1]] = ram32[args[2]] + ram32[args[3]]; break; -case 74: ram32[args[1]] = ram32[args[2]] - ram32[args[3]]; break; -case 75: ram32[args[1]] = ram32[args[2]] * ram32[args[3]]; break; -case 76: ram32[args[1]] = ram32[args[2]] / ram32[args[3]]; break; -case 77: ram32[args[1]] = ram32[args[2]] % ram32[args[3]]; break; -case 78: ram32[args[1]] = ram32[args[2]] | ram32[args[3]]; break; -case 79: ram32[args[1]] = ram32[args[2]] & ram32[args[3]]; break; -case 80: ram32[args[1]] = !ram32[args[2]]; break; +case 67: ram32[args[0]] += ram32[args[1]]; break; +case 68: ram32[args[0]] -= ram32[args[1]]; break; +case 69: ram32[args[0]] *= ram32[args[1]]; break; +case 70: ram32[args[0]] /= ram32[args[1]]; break; +case 71: ram32[args[0]] %= ram32[args[1]]; break; +case 72: ram32[args[0]] |= ram32[args[1]]; break; +case 73: ram32[args[0]] &= ram32[args[1]]; break; +case 74: ram32[args[0]] = ram32[args[1]] + ram32[args[2]]; break; +case 75: ram32[args[0]] = ram32[args[1]] - ram32[args[2]]; break; +case 76: ram32[args[0]] = ram32[args[1]] * ram32[args[2]]; break; +case 77: ram32[args[0]] = ram32[args[1]] / ram32[args[2]]; break; +case 78: ram32[args[0]] = ram32[args[1]] % ram32[args[2]]; break; +case 79: ram32[args[0]] = ram32[args[1]] | ram32[args[2]]; break; +case 80: ram32[args[0]] = ram32[args[1]] & ram32[args[2]]; break; +case 81: ram32[args[0]] = !ram32[args[1]]; break; // f -case 81: ramf[args[1]] += ramf[args[2]]; break; -case 82: ramf[args[1]] -= ramf[args[2]]; break; -case 83: ramf[args[1]] *= ramf[args[2]]; break; -case 84: ramf[args[1]] /= ramf[args[2]]; break; -case 85: ramf[args[1]] = ramf[args[2]] + ramf[args[3]]; break; -case 86: ramf[args[1]] = ramf[args[2]] - ramf[args[3]]; break; -case 87: ramf[args[1]] = ramf[args[2]] * ramf[args[3]]; break; -case 88: ramf[args[1]] = ramf[args[2]] / ramf[args[3]]; break; -case 89: ramf[args[1]] = !ramf[args[2]]; break; +case 82: ramf[args[0]] += ramf[args[1]]; break; +case 83: ramf[args[0]] -= ramf[args[1]]; break; +case 84: ramf[args[0]] *= ramf[args[1]]; break; +case 85: ramf[args[0]] /= ramf[args[1]]; break; +case 86: ramf[args[0]] = ramf[args[1]] + ramf[args[2]]; break; +case 87: ramf[args[0]] = ramf[args[1]] - ramf[args[2]]; break; +case 88: ramf[args[0]] = ramf[args[1]] * ramf[args[2]]; break; +case 89: ramf[args[0]] = ramf[args[1]] / ramf[args[2]]; break; +case 90: ramf[args[0]] = !ramf[args[1]]; break; // u16 -case 90: uram16[args[1]] += uram16[args[2]]; break; -case 91: uram16[args[1]] -= uram16[args[2]]; break; -case 92: uram16[args[1]] *= uram16[args[2]]; break; -case 93: uram16[args[1]] /= uram16[args[2]]; break; -case 94: uram16[args[1]] %= uram16[args[2]]; break; -case 95: uram16[args[1]] |= uram16[args[2]]; break; -case 96: uram16[args[1]] &= uram16[args[2]]; break; -case 97: uram16[args[1]] = uram16[args[2]] + uram16[args[3]]; break; -case 98: uram16[args[1]] = uram16[args[2]] - uram16[args[3]]; break; -case 99: uram16[args[1]] = uram16[args[2]] * uram16[args[3]]; break; -case 100: uram16[args[1]] = uram16[args[2]] / uram16[args[3]]; break; -case 101: uram16[args[1]] = uram16[args[2]] % uram16[args[3]]; break; -case 102: uram16[args[1]] = uram16[args[2]] | uram16[args[3]]; break; -case 103: uram16[args[1]] = uram16[args[2]] & uram16[args[3]]; break; -case 104: uram16[args[1]] = !uram16[args[2]]; break; +case 91: uram16[args[0]] += uram16[args[1]]; break; +case 92: uram16[args[0]] -= uram16[args[1]]; break; +case 93: uram16[args[0]] *= uram16[args[1]]; break; +case 94: uram16[args[0]] /= uram16[args[1]]; break; +case 95: uram16[args[0]] %= uram16[args[1]]; break; +case 96: uram16[args[0]] |= uram16[args[1]]; break; +case 97: uram16[args[0]] &= uram16[args[1]]; break; +case 98: uram16[args[0]] = uram16[args[1]] + uram16[args[2]]; break; +case 99: uram16[args[0]] = uram16[args[1]] - uram16[args[2]]; break; +case 100: uram16[args[0]] = uram16[args[1]] * uram16[args[2]]; break; +case 101: uram16[args[0]] = uram16[args[1]] / uram16[args[2]]; break; +case 102: uram16[args[0]] = uram16[args[1]] % uram16[args[2]]; break; +case 103: uram16[args[0]] = uram16[args[1]] | uram16[args[2]]; break; +case 104: uram16[args[0]] = uram16[args[1]] & uram16[args[2]]; break; +case 105: uram16[args[0]] = !uram16[args[1]]; break; // 16 -case 105: ram16[args[1]] += ram16[args[2]]; break; -case 106: ram16[args[1]] -= ram16[args[2]]; break; -case 107: ram16[args[1]] *= ram16[args[2]]; break; -case 108: ram16[args[1]] /= ram16[args[2]]; break; -case 109: ram16[args[1]] %= ram16[args[2]]; break; -case 110: ram16[args[1]] |= ram16[args[2]]; break; -case 111: ram16[args[1]] &= ram16[args[2]]; break; -case 112: ram16[args[1]] = ram16[args[2]] + ram16[args[3]]; break; -case 113: ram16[args[1]] = ram16[args[2]] - ram16[args[3]]; break; -case 114: ram16[args[1]] = ram16[args[2]] * ram16[args[3]]; break; -case 115: ram16[args[1]] = ram16[args[2]] / ram16[args[3]]; break; -case 116: ram16[args[1]] = ram16[args[2]] % ram16[args[3]]; break; -case 117: ram16[args[1]] = ram16[args[2]] | ram16[args[3]]; break; -case 118: ram16[args[1]] = ram16[args[2]] & ram16[args[3]]; break; -case 119: ram16[args[1]] = !ram16[args[2]]; break; +case 106: ram16[args[0]] += ram16[args[1]]; break; +case 107: ram16[args[0]] -= ram16[args[1]]; break; +case 108: ram16[args[0]] *= ram16[args[1]]; break; +case 109: ram16[args[0]] /= ram16[args[1]]; break; +case 110: ram16[args[0]] %= ram16[args[1]]; break; +case 111: ram16[args[0]] |= ram16[args[1]]; break; +case 112: ram16[args[0]] &= ram16[args[1]]; break; +case 113: ram16[args[0]] = ram16[args[1]] + ram16[args[2]]; break; +case 114: ram16[args[0]] = ram16[args[1]] - ram16[args[2]]; break; +case 115: ram16[args[0]] = ram16[args[1]] * ram16[args[2]]; break; +case 116: ram16[args[0]] = ram16[args[1]] / ram16[args[2]]; break; +case 117: ram16[args[0]] = ram16[args[1]] % ram16[args[2]]; break; +case 118: ram16[args[0]] = ram16[args[1]] | ram16[args[2]]; break; +case 119: ram16[args[0]] = ram16[args[1]] & ram16[args[2]]; break; +case 120: ram16[args[0]] = !ram16[args[1]]; break; // u8 -case 120: uram8[args[1]] += uram8[args[2]]; break; -case 121: uram8[args[1]] -= uram8[args[2]]; break; -case 122: uram8[args[1]] *= uram8[args[2]]; break; -case 123: uram8[args[1]] /= uram8[args[2]]; break; -case 124: uram8[args[1]] %= uram8[args[2]]; break; -case 125: uram8[args[1]] |= uram8[args[2]]; break; -case 126: uram8[args[1]] &= uram8[args[2]]; break; -case 127: uram8[args[1]] = uram8[args[2]] + uram8[args[3]]; break; -case 128: uram8[args[1]] = uram8[args[2]] - uram8[args[3]]; break; -case 129: uram8[args[1]] = uram8[args[2]] * uram8[args[3]]; break; -case 130: uram8[args[1]] = uram8[args[2]] / uram8[args[3]]; break; -case 131: uram8[args[1]] = uram8[args[2]] % uram8[args[3]]; break; -case 132: uram8[args[1]] = uram8[args[2]] | uram8[args[3]]; break; -case 133: uram8[args[1]] = uram8[args[2]] & uram8[args[3]]; break; -case 134: uram8[args[1]] = !uram8[args[2]]; break; +case 121: uram8[args[0]] += uram8[args[1]]; break; +case 122: uram8[args[0]] -= uram8[args[1]]; break; +case 123: uram8[args[0]] *= uram8[args[1]]; break; +case 124: uram8[args[0]] /= uram8[args[1]]; break; +case 125: uram8[args[0]] %= uram8[args[1]]; break; +case 126: uram8[args[0]] |= uram8[args[1]]; break; +case 127: uram8[args[0]] &= uram8[args[1]]; break; +case 128: uram8[args[0]] = uram8[args[1]] + uram8[args[2]]; break; +case 129: uram8[args[0]] = uram8[args[1]] - uram8[args[2]]; break; +case 130: uram8[args[0]] = uram8[args[1]] * uram8[args[2]]; break; +case 131: uram8[args[0]] = uram8[args[1]] / uram8[args[2]]; break; +case 132: uram8[args[0]] = uram8[args[1]] % uram8[args[2]]; break; +case 133: uram8[args[0]] = uram8[args[1]] | uram8[args[2]]; break; +case 134: uram8[args[0]] = uram8[args[1]] & uram8[args[2]]; break; +case 135: uram8[args[0]] = !uram8[args[1]]; break; // 8 -case 135: ram8[args[1]] += ram8[args[2]]; break; -case 136: ram8[args[1]] -= ram8[args[2]]; break; -case 137: ram8[args[1]] *= ram8[args[2]]; break; -case 138: ram8[args[1]] /= ram8[args[2]]; break; -case 139: ram8[args[1]] %= ram8[args[2]]; break; -case 140: ram8[args[1]] |= ram8[args[2]]; break; -case 141: ram8[args[1]] &= ram8[args[2]]; break; -case 142: ram8[args[1]] = ram8[args[2]] + ram8[args[3]]; break; -case 143: ram8[args[1]] = ram8[args[2]] - ram8[args[3]]; break; -case 144: ram8[args[1]] = ram8[args[2]] * ram8[args[3]]; break; -case 145: ram8[args[1]] = ram8[args[2]] / ram8[args[3]]; break; -case 146: ram8[args[1]] = ram8[args[2]] % ram8[args[3]]; break; -case 147: ram8[args[1]] = ram8[args[2]] | ram8[args[3]]; break; -case 148: ram8[args[1]] = ram8[args[2]] & ram8[args[3]]; break; -case 149: ram8[args[1]] = !ram8[args[2]]; break; +case 136: ram8[args[0]] += ram8[args[1]]; break; +case 137: ram8[args[0]] -= ram8[args[1]]; break; +case 138: ram8[args[0]] *= ram8[args[1]]; break; +case 139: ram8[args[0]] /= ram8[args[1]]; break; +case 140: ram8[args[0]] %= ram8[args[1]]; break; +case 141: ram8[args[0]] |= ram8[args[1]]; break; +case 142: ram8[args[0]] &= ram8[args[1]]; break; +case 143: ram8[args[0]] = ram8[args[1]] + ram8[args[2]]; break; +case 144: ram8[args[0]] = ram8[args[1]] - ram8[args[2]]; break; +case 145: ram8[args[0]] = ram8[args[1]] * ram8[args[2]]; break; +case 146: ram8[args[0]] = ram8[args[1]] / ram8[args[2]]; break; +case 147: ram8[args[0]] = ram8[args[1]] % ram8[args[2]]; break; +case 148: ram8[args[0]] = ram8[args[1]] | ram8[args[2]]; break; +case 149: ram8[args[0]] = ram8[args[1]] & ram8[args[2]]; break; +case 150: ram8[args[0]] = !ram8[args[1]]; break; // == -case 150: cmp = uram64[args[1]] == uram64[args[2]]; break; -case 151: cmp = ram64[args[1]] == ram64[args[2]]; break; -case 152: cmp = ramd[args[1]] == ramd[args[2]]; break; -case 153: cmp = uram32[args[1]] == uram32[args[2]]; break; -case 154: cmp = ram32[args[1]] == ram32[args[2]]; break; -case 155: cmp = ramf[args[1]] == ramf[args[2]]; break; -case 156: cmp = uram16[args[1]] == uram16[args[2]]; break; -case 157: cmp = ram16[args[1]] == ram16[args[2]]; break; -case 158: cmp = uram8[args[1]] == uram8[args[2]]; break; -case 159: cmp = ram8[args[1]] == ram8[args[2]]; break; +case 151: cmp = uram64[args[0]] == uram64[args[1]]; break; +case 152: cmp = ram64[args[0]] == ram64[args[1]]; break; +case 153: cmp = ramd[args[0]] == ramd[args[1]]; break; +case 154: cmp = uram32[args[0]] == uram32[args[1]]; break; +case 155: cmp = ram32[args[0]] == ram32[args[1]]; break; +case 156: cmp = ramf[args[0]] == ramf[args[1]]; break; +case 157: cmp = uram16[args[0]] == uram16[args[1]]; break; +case 158: cmp = ram16[args[0]] == ram16[args[1]]; break; +case 159: cmp = uram8[args[0]] == uram8[args[1]]; break; +case 160: cmp = ram8[args[0]] == ram8[args[1]]; break; // != -case 160: cmp = uram64[args[1]] != uram64[args[2]]; break; -case 161: cmp = ram64[args[1]] != ram64[args[2]]; break; -case 162: cmp = ramd[args[1]] != ramd[args[2]]; break; -case 163: cmp = uram32[args[1]] != uram32[args[2]]; break; -case 164: cmp = ram32[args[1]] != ram32[args[2]]; break; -case 165: cmp = ramf[args[1]] != ramf[args[2]]; break; -case 166: cmp = uram16[args[1]] != uram16[args[2]]; break; -case 167: cmp = ram16[args[1]] != ram16[args[2]]; break; -case 168: cmp = uram8[args[1]] != uram8[args[2]]; break; -case 169: cmp = ram8[args[1]] != ram8[args[2]]; break; +case 161: cmp = uram64[args[0]] != uram64[args[1]]; break; +case 162: cmp = ram64[args[0]] != ram64[args[1]]; break; +case 163: cmp = ramd[args[0]] != ramd[args[1]]; break; +case 164: cmp = uram32[args[0]] != uram32[args[1]]; break; +case 165: cmp = ram32[args[0]] != ram32[args[1]]; break; +case 166: cmp = ramf[args[0]] != ramf[args[1]]; break; +case 167: cmp = uram16[args[0]] != uram16[args[1]]; break; +case 168: cmp = ram16[args[0]] != ram16[args[1]]; break; +case 169: cmp = uram8[args[0]] != uram8[args[1]]; break; +case 170: cmp = ram8[args[0]] != ram8[args[1]]; break; // > -case 170: cmp = uram64[args[1]] > uram64[args[2]]; break; -case 171: cmp = ram64[args[1]] > ram64[args[2]]; break; -case 172: cmp = ramd[args[1]] > ramd[args[2]]; break; -case 173: cmp = uram32[args[1]] > uram32[args[2]]; break; -case 174: cmp = ram32[args[1]] > ram32[args[2]]; break; -case 175: cmp = ramf[args[1]] > ramf[args[2]]; break; -case 176: cmp = uram16[args[1]] > uram16[args[2]]; break; -case 177: cmp = ram16[args[1]] > ram16[args[2]]; break; -case 178: cmp = uram8[args[1]] > uram8[args[2]]; break; -case 179: cmp = ram8[args[1]] > ram8[args[2]]; break; +case 171: cmp = uram64[args[0]] > uram64[args[1]]; break; +case 172: cmp = ram64[args[0]] > ram64[args[1]]; break; +case 173: cmp = ramd[args[0]] > ramd[args[1]]; break; +case 174: cmp = uram32[args[0]] > uram32[args[1]]; break; +case 175: cmp = ram32[args[0]] > ram32[args[1]]; break; +case 176: cmp = ramf[args[0]] > ramf[args[1]]; break; +case 177: cmp = uram16[args[0]] > uram16[args[1]]; break; +case 178: cmp = ram16[args[0]] > ram16[args[1]]; break; +case 179: cmp = uram8[args[0]] > uram8[args[1]]; break; +case 180: cmp = ram8[args[0]] > ram8[args[1]]; break; // < -case 180: cmp = uram64[args[1]] < uram64[args[2]]; break; -case 181: cmp = ram64[args[1]] < ram64[args[2]]; break; -case 182: cmp = ramd[args[1]] < ramd[args[2]]; break; -case 183: cmp = uram32[args[1]] < uram32[args[2]]; break; -case 184: cmp = ram32[args[1]] < ram32[args[2]]; break; -case 185: cmp = ramf[args[1]] < ramf[args[2]]; break; -case 186: cmp = uram16[args[1]] < uram16[args[2]]; break; -case 187: cmp = ram16[args[1]] < ram16[args[2]]; break; -case 188: cmp = uram8[args[1]] < uram8[args[2]]; break; -case 189: cmp = ram8[args[1]] < ram8[args[2]]; break; +case 181: cmp = uram64[args[0]] < uram64[args[1]]; break; +case 182: cmp = ram64[args[0]] < ram64[args[1]]; break; +case 183: cmp = ramd[args[0]] < ramd[args[1]]; break; +case 184: cmp = uram32[args[0]] < uram32[args[1]]; break; +case 185: cmp = ram32[args[0]] < ram32[args[1]]; break; +case 186: cmp = ramf[args[0]] < ramf[args[1]]; break; +case 187: cmp = uram16[args[0]] < uram16[args[1]]; break; +case 188: cmp = ram16[args[0]] < ram16[args[1]]; break; +case 189: cmp = uram8[args[0]] < uram8[args[1]]; break; +case 190: cmp = ram8[args[0]] < ram8[args[1]]; break; // >= -case 190: cmp = uram64[args[1]] >= uram64[args[2]]; break; -case 191: cmp = ram64[args[1]] >= ram64[args[2]]; break; -case 192: cmp = ramd[args[1]] >= ramd[args[2]]; break; -case 193: cmp = uram32[args[1]] >= uram32[args[2]]; break; -case 194: cmp = ram32[args[1]] >= ram32[args[2]]; break; -case 195: cmp = ramf[args[1]] >= ramf[args[2]]; break; -case 196: cmp = uram16[args[1]] >= uram16[args[2]]; break; -case 197: cmp = ram16[args[1]] >= ram16[args[2]]; break; -case 198: cmp = uram8[args[1]] >= uram8[args[2]]; break; -case 199: cmp = ram8[args[1]] >= ram8[args[2]]; break; +case 191: cmp = uram64[args[0]] >= uram64[args[1]]; break; +case 192: cmp = ram64[args[0]] >= ram64[args[1]]; break; +case 193: cmp = ramd[args[0]] >= ramd[args[1]]; break; +case 194: cmp = uram32[args[0]] >= uram32[args[1]]; break; +case 195: cmp = ram32[args[0]] >= ram32[args[1]]; break; +case 196: cmp = ramf[args[0]] >= ramf[args[1]]; break; +case 197: cmp = uram16[args[0]] >= uram16[args[1]]; break; +case 198: cmp = ram16[args[0]] >= ram16[args[1]]; break; +case 199: cmp = uram8[args[0]] >= uram8[args[1]]; break; +case 200: cmp = ram8[args[0]] >= ram8[args[1]]; break; // <= -case 200: cmp = uram64[args[1]] <= uram64[args[2]]; break; -case 201: cmp = ram64[args[1]] <= ram64[args[2]]; break; -case 202: cmp = ramd[args[1]] <= ramd[args[2]]; break; -case 203: cmp = uram32[args[1]] <= uram32[args[2]]; break; -case 204: cmp = ram32[args[1]] <= ram32[args[2]]; break; -case 205: cmp = ramf[args[1]] <= ramf[args[2]]; break; -case 206: cmp = uram16[args[1]] <= uram16[args[2]]; break; -case 207: cmp = ram16[args[1]] <= ram16[args[2]]; break; -case 208: cmp = uram8[args[1]] <= uram8[args[2]]; break; -case 209: cmp = ram8[args[1]] <= ram8[args[2]]; break; +case 201: cmp = uram64[args[0]] <= uram64[args[1]]; break; +case 202: cmp = ram64[args[0]] <= ram64[args[1]]; break; +case 203: cmp = ramd[args[0]] <= ramd[args[1]]; break; +case 204: cmp = uram32[args[0]] <= uram32[args[1]]; break; +case 205: cmp = ram32[args[0]] <= ram32[args[1]]; break; +case 206: cmp = ramf[args[0]] <= ramf[args[1]]; break; +case 207: cmp = uram16[args[0]] <= uram16[args[1]]; break; +case 208: cmp = ram16[args[0]] <= ram16[args[1]]; break; +case 209: cmp = uram8[args[0]] <= uram8[args[1]]; break; +case 210: cmp = ram8[args[0]] <= ram8[args[1]]; break; // ++ -case 210: uram64[args[1]]++; break; -case 211: ram64[args[1]]++; break; -case 212: ramd[args[1]]++; break; -case 213: uram32[args[1]]++; break; -case 214: ram32[args[1]]++; break; -case 215: ramf[args[1]]++; break; -case 216: uram16[args[1]]++; break; -case 217: ram16[args[1]]++; break; -case 218: uram8[args[1]]++; break; -case 219: ram8[args[1]]++; break; +case 211: uram64[args[0]]++; break; +case 212: ram64[args[0]]++; break; +case 213: ramd[args[0]]++; break; +case 214: uram32[args[0]]++; break; +case 215: ram32[args[0]]++; break; +case 216: ramf[args[0]]++; break; +case 217: uram16[args[0]]++; break; +case 218: ram16[args[0]]++; break; +case 219: uram8[args[0]]++; break; +case 220: ram8[args[0]]++; break; // -- -case 220: uram64[args[1]]--; break; -case 221: ram64[args[1]]--; break; -case 222: ramd[args[1]]--; break; -case 223: uram32[args[1]]--; break; -case 224: ram32[args[1]]--; break; -case 225: ramf[args[1]]--; break; -case 226: uram16[args[1]]--; break; -case 227: ram16[args[1]]--; break; -case 228: uram8[args[1]]--; break; -case 229: ram8[args[1]]--; break; +case 221: uram64[args[0]]--; break; +case 222: ram64[args[0]]--; break; +case 223: ramd[args[0]]--; break; +case 224: uram32[args[0]]--; break; +case 225: ram32[args[0]]--; break; +case 226: ramf[args[0]]--; break; +case 227: uram16[args[0]]--; break; +case 228: ram16[args[0]]--; break; +case 229: uram8[args[0]]--; break; +case 230: ram8[args[0]]--; break; // a = b -case 230: uram64[args[1]] = (uint64_t)args[2]; break; -case 231: ram64[args[1]] = (int64_t)args[2]; break; -case 232: ramd[args[1]] = (int64_t)args[2]; break; -case 233: uram32[args[1]] = (uint32_t)args[2]; break; -case 234: ram32[args[1]] = (int32_t)args[2]; break; -case 235: ramf[args[1]] = (int32_t)args[2]; break; -case 236: uram16[args[1]] = (uint16_t)args[2]; break; -case 237: ram16[args[1]] = (int16_t)args[2]; break; -case 238: uram8[args[1]] = (uint8_t)args[2]; break; -case 239: ram8[args[1]] = (int8_t)args[2]; break; +case 231: uram64[args[0]] = (uint64_t)args[1]; break; +case 232: ram64[args[0]] = (int64_t)args[1]; break; +case 233: ramd[args[0]] = (int64_t)args[1]; break; +case 234: uram32[args[0]] = (uint32_t)args[1]; break; +case 235: ram32[args[0]] = (int32_t)args[1]; break; +case 236: ramf[args[0]] = (int32_t)args[1]; break; +case 237: uram16[args[0]] = (uint16_t)args[1]; break; +case 238: ram16[args[0]] = (int16_t)args[1]; break; +case 239: uram8[args[0]] = (uint8_t)args[1]; break; +case 240: ram8[args[0]] = (int8_t)args[1]; break; // a = *b -case 240: uram64[args[1]] = uram64[args[2]]; break; -case 241: ram64[args[1]] = ram64[args[2]]; break; -case 242: ramd[args[1]] = ramd[args[2]]; break; -case 243: uram32[args[1]] = uram32[args[2]]; break; -case 244: ram32[args[1]] = ram32[args[2]]; break; -case 245: ramf[args[1]] = ramf[args[2]]; break; -case 246: uram16[args[1]] = uram16[args[2]]; break; -case 247: ram16[args[1]] = ram16[args[2]]; break; -case 248: uram8[args[1]] = uram8[args[2]]; break; -case 249: ram8[args[1]] = ram8[args[2]]; break; +case 241: uram64[args[0]] = uram64[args[1]]; break; +case 242: ram64[args[0]] = ram64[args[1]]; break; +case 243: ramd[args[0]] = ramd[args[1]]; break; +case 244: uram32[args[0]] = uram32[args[1]]; break; +case 245: ram32[args[0]] = ram32[args[1]]; break; +case 246: ramf[args[0]] = ramf[args[1]]; break; +case 247: uram16[args[0]] = uram16[args[1]]; break; +case 248: ram16[args[0]] = ram16[args[1]]; break; +case 249: uram8[args[0]] = uram8[args[1]]; break; +case 250: ram8[args[0]] = ram8[args[1]]; break; // a = **b -case 250: uram64[args[1]] = uram64[uram64[args[2]]]; break; -case 251: ram64[args[1]] = ram64[uram64[args[2]]]; break; -case 252: ramd[args[1]] = ramd[uram64[args[2]]]; break; -case 253: uram32[args[1]] = uram32[uram64[args[2]]]; break; -case 254: ram32[args[1]] = ram32[uram64[args[2]]]; break; -case 255: ramf[args[1]] = ramf[uram64[args[2]]]; break; -case 256: uram16[args[1]] = uram16[uram64[args[2]]]; break; -case 257: ram16[args[1]] = ram16[uram64[args[2]]]; break; -case 258: uram8[args[1]] = uram8[uram64[args[2]]]; break; -case 259: ram8[args[1]] = ram8[uram64[args[2]]]; break; +case 251: uram64[args[0]] = uram64[uram64[args[1]]]; break; +case 252: ram64[args[0]] = ram64[uram64[args[1]]]; break; +case 253: ramd[args[0]] = ramd[uram64[args[1]]]; break; +case 254: uram32[args[0]] = uram32[uram64[args[1]]]; break; +case 255: ram32[args[0]] = ram32[uram64[args[1]]]; break; +case 256: ramf[args[0]] = ramf[uram64[args[1]]]; break; +case 257: uram16[args[0]] = uram16[uram64[args[1]]]; break; +case 258: ram16[args[0]] = ram16[uram64[args[1]]]; break; +case 259: uram8[args[0]] = uram8[uram64[args[1]]]; break; +case 260: ram8[args[0]] = ram8[uram64[args[1]]]; break; // **a = b -case 260: uram64[uram64[args[1]]] = (uint64_t) args[2]; break; -case 261: ram64[uram64[args[1]]] = (int64_t) args[2]; break; -case 262: ramd[uram64[args[1]]] = (double) args[2]; break; -case 263: uram32[uram64[args[1]]] = (uint32_t) args[2]; break; -case 264: ram32[uram64[args[1]]] = (int32_t) args[2]; break; -case 265: ramf[uram64[args[1]]] = (float) args[2]; break; -case 266: uram16[uram64[args[1]]] = (uint16_t) args[2]; break; -case 267: ram16[uram64[args[1]]] = (int16_t) args[2]; break; -case 268: uram8[uram64[args[1]]] = (uint8_t) args[2]; break; -case 269: ram8[uram64[args[1]]] = (int8_t) args[2]; break; +case 261: uram64[uram64[args[0]]] = (uint64_t) args[1]; break; +case 262: ram64[uram64[args[0]]] = (int64_t) args[1]; break; +case 263: ramd[uram64[args[0]]] = (double) args[1]; break; +case 264: uram32[uram64[args[0]]] = (uint32_t) args[1]; break; +case 265: ram32[uram64[args[0]]] = (int32_t) args[1]; break; +case 266: ramf[uram64[args[0]]] = (float) args[1]; break; +case 267: uram16[uram64[args[0]]] = (uint16_t) args[1]; break; +case 268: ram16[uram64[args[0]]] = (int16_t) args[1]; break; +case 269: uram8[uram64[args[0]]] = (uint8_t) args[1]; break; +case 270: ram8[uram64[args[0]]] = (int8_t) args[1]; break; // **a = *b -case 270: uram64[uram64[args[1]]] = uram64[args[2]]; break; -case 271: ram64[uram64[args[1]]] = ram64[args[2]]; break; -case 272: ramd[uram64[args[1]]] = ramd[args[2]]; break; -case 273: uram32[uram64[args[1]]] = uram32[args[2]]; break; -case 274: ram32[uram64[args[1]]] = ram32[args[2]]; break; -case 275: ramf[uram64[args[1]]] = ramf[args[2]]; break; -case 276: uram16[uram64[args[1]]] = uram16[args[2]]; break; -case 277: ram16[uram64[args[1]]] = ram16[args[2]]; break; -case 278: uram8[uram64[args[1]]] = uram8[args[2]]; break; -case 279: ram8[uram64[args[1]]] = ram8[args[2]]; break; +case 271: uram64[uram64[args[0]]] = uram64[args[1]]; break; +case 272: ram64[uram64[args[0]]] = ram64[args[1]]; break; +case 273: ramd[uram64[args[0]]] = ramd[args[1]]; break; +case 274: uram32[uram64[args[0]]] = uram32[args[1]]; break; +case 275: ram32[uram64[args[0]]] = ram32[args[1]]; break; +case 276: ramf[uram64[args[0]]] = ramf[args[1]]; break; +case 277: uram16[uram64[args[0]]] = uram16[args[1]]; break; +case 278: ram16[uram64[args[0]]] = ram16[args[1]]; break; +case 279: uram8[uram64[args[0]]] = uram8[args[1]]; break; +case 280: ram8[uram64[args[0]]] = ram8[args[1]]; break; // **a = **b -case 280: uram64[uram64[args[1]]] = uram64[uram64[args[2]]]; break; -case 281: ram64[uram64[args[1]]] = ram64[uram64[args[2]]]; break; -case 282: ramd[uram64[args[1]]] = ramd[uram64[args[2]]]; break; -case 283: uram32[uram64[args[1]]] = uram32[uram64[args[2]]]; break; -case 284: ram32[uram64[args[1]]] = ram32[uram64[args[2]]]; break; -case 285: ramf[uram64[args[1]]] = ramf[uram64[args[2]]]; break; -case 286: uram16[uram64[args[1]]] = uram16[uram64[args[2]]]; break; -case 287: ram16[uram64[args[1]]] = ram16[uram64[args[2]]]; break; -case 288: uram8[uram64[args[1]]] = uram8[uram64[args[2]]]; break; -case 289: ram8[uram64[args[1]]] = ram8[uram64[args[2]]]; break; +case 281: uram64[uram64[args[0]]] = uram64[uram64[args[1]]]; break; +case 282: ram64[uram64[args[0]]] = ram64[uram64[args[1]]]; break; +case 283: ramd[uram64[args[0]]] = ramd[uram64[args[1]]]; break; +case 284: uram32[uram64[args[0]]] = uram32[uram64[args[1]]]; break; +case 285: ram32[uram64[args[0]]] = ram32[uram64[args[1]]]; break; +case 286: ramf[uram64[args[0]]] = ramf[uram64[args[1]]]; break; +case 287: uram16[uram64[args[0]]] = uram16[uram64[args[1]]]; break; +case 288: ram16[uram64[args[0]]] = ram16[uram64[args[1]]]; break; +case 289: uram8[uram64[args[0]]] = uram8[uram64[args[1]]]; break; +case 290: ram8[uram64[args[0]]] = ram8[uram64[args[1]]]; break; // cast -case 290: uram64[args[1]] = (uint64_t)ram64[args[2]]; break; -case 291: uram64[args[1]] = (uint64_t)ramd[args[2]]; break; -case 292: uram64[args[1]] = (uint64_t)uram32[args[2]]; break; -case 293: uram64[args[1]] = (uint64_t)ram32[args[2]]; break; -case 294: uram64[args[1]] = (uint64_t)ramf[args[2]]; break; -case 295: uram64[args[1]] = (uint64_t)uram16[args[2]]; break; -case 296: uram64[args[1]] = (uint64_t)ram16[args[2]]; break; -case 297: uram64[args[1]] = (uint64_t)uram8[args[2]]; break; -case 298: uram64[args[1]] = (uint64_t)ram8[args[2]]; break; -case 299: ram64[args[1]] = (int64_t)uram64[args[2]]; break; -case 300: ram64[args[1]] = (int64_t)ramd[args[2]]; break; -case 301: ram64[args[1]] = (int64_t)uram32[args[2]]; break; -case 302: ram64[args[1]] = (int64_t)ram32[args[2]]; break; -case 303: ram64[args[1]] = (int64_t)ramf[args[2]]; break; -case 304: ram64[args[1]] = (int64_t)uram16[args[2]]; break; -case 305: ram64[args[1]] = (int64_t)ram16[args[2]]; break; -case 306: ram64[args[1]] = (int64_t)uram8[args[2]]; break; -case 307: ram64[args[1]] = (int64_t)ram8[args[2]]; break; -case 308: ramd[args[1]] = (double)uram64[args[2]]; break; -case 309: ramd[args[1]] = (double)ram64[args[2]]; break; -case 310: ramd[args[1]] = (double)uram32[args[2]]; break; -case 311: ramd[args[1]] = (double)ram32[args[2]]; break; -case 312: ramd[args[1]] = (double)ramf[args[2]]; break; -case 313: ramd[args[1]] = (double)uram16[args[2]]; break; -case 314: ramd[args[1]] = (double)ram16[args[2]]; break; -case 315: ramd[args[1]] = (double)uram8[args[2]]; break; -case 316: ramd[args[1]] = (double)ram8[args[2]]; break; -case 317: uram32[args[1]] = (uint32_t)uram64[args[2]]; break; -case 318: uram32[args[1]] = (uint32_t)ram64[args[2]]; break; -case 319: uram32[args[1]] = (uint32_t)ramd[args[2]]; break; -case 320: uram32[args[1]] = (uint32_t)ram32[args[2]]; break; -case 321: uram32[args[1]] = (uint32_t)ramf[args[2]]; break; -case 322: uram32[args[1]] = (uint32_t)uram16[args[2]]; break; -case 323: uram32[args[1]] = (uint32_t)ram16[args[2]]; break; -case 324: uram32[args[1]] = (uint32_t)uram8[args[2]]; break; -case 325: uram32[args[1]] = (uint32_t)ram8[args[2]]; break; -case 326: ram32[args[1]] = (int32_t)uram64[args[2]]; break; -case 327: ram32[args[1]] = (int32_t)ram64[args[2]]; break; -case 328: ram32[args[1]] = (int32_t)ramd[args[2]]; break; -case 329: ram32[args[1]] = (int32_t)uram32[args[2]]; break; -case 330: ram32[args[1]] = (int32_t)ramf[args[2]]; break; -case 331: ram32[args[1]] = (int32_t)uram16[args[2]]; break; -case 332: ram32[args[1]] = (int32_t)ram16[args[2]]; break; -case 333: ram32[args[1]] = (int32_t)uram8[args[2]]; break; -case 334: ram32[args[1]] = (int32_t)ram8[args[2]]; break; -case 335: ramf[args[1]] = (float)uram64[args[2]]; break; -case 336: ramf[args[1]] = (float)ram64[args[2]]; break; -case 337: ramf[args[1]] = (float)ramd[args[2]]; break; -case 338: ramf[args[1]] = (float)uram32[args[2]]; break; -case 339: ramf[args[1]] = (float)ram32[args[2]]; break; -case 340: ramf[args[1]] = (float)uram16[args[2]]; break; -case 341: ramf[args[1]] = (float)ram16[args[2]]; break; -case 342: ramf[args[1]] = (float)uram8[args[2]]; break; -case 343: ramf[args[1]] = (float)ram8[args[2]]; break; -case 344: uram16[args[1]] = (uint16_t)uram64[args[2]]; break; -case 345: uram16[args[1]] = (uint16_t)ram64[args[2]]; break; -case 346: uram16[args[1]] = (uint16_t)ramd[args[2]]; break; -case 347: uram16[args[1]] = (uint16_t)uram32[args[2]]; break; -case 348: uram16[args[1]] = (uint16_t)ram32[args[2]]; break; -case 349: uram16[args[1]] = (uint16_t)ramf[args[2]]; break; -case 350: uram16[args[1]] = (uint16_t)ram16[args[2]]; break; -case 351: uram16[args[1]] = (uint16_t)uram8[args[2]]; break; -case 352: uram16[args[1]] = (uint16_t)ram8[args[2]]; break; -case 353: ram16[args[1]] = (int16_t)uram64[args[2]]; break; -case 354: ram16[args[1]] = (int16_t)ram64[args[2]]; break; -case 355: ram16[args[1]] = (int16_t)ramd[args[2]]; break; -case 356: ram16[args[1]] = (int16_t)uram32[args[2]]; break; -case 357: ram16[args[1]] = (int16_t)ram32[args[2]]; break; -case 358: ram16[args[1]] = (int16_t)ramf[args[2]]; break; -case 359: ram16[args[1]] = (int16_t)uram16[args[2]]; break; -case 360: ram16[args[1]] = (int16_t)uram8[args[2]]; break; -case 361: ram16[args[1]] = (int16_t)ram8[args[2]]; break; -case 362: uram8[args[1]] = (uint8_t)uram64[args[2]]; break; -case 363: uram8[args[1]] = (uint8_t)ram64[args[2]]; break; -case 364: uram8[args[1]] = (uint8_t)ramd[args[2]]; break; -case 365: uram8[args[1]] = (uint8_t)uram32[args[2]]; break; -case 366: uram8[args[1]] = (uint8_t)ram32[args[2]]; break; -case 367: uram8[args[1]] = (uint8_t)ramf[args[2]]; break; -case 368: uram8[args[1]] = (uint8_t)uram16[args[2]]; break; -case 369: uram8[args[1]] = (uint8_t)ram16[args[2]]; break; -case 370: uram8[args[1]] = (int8_t)ram8[args[2]]; break; -case 371: ram8[args[1]] = (int8_t)uram64[args[2]]; break; -case 372: ram8[args[1]] = (int8_t)ram64[args[2]]; break; -case 373: ram8[args[1]] = (int8_t)ramd[args[2]]; break; -case 374: ram8[args[1]] = (int8_t)uram32[args[2]]; break; -case 375: ram8[args[1]] = (int8_t)ram32[args[2]]; break; -case 376: ram8[args[1]] = (int8_t)ramf[args[2]]; break; -case 377: ram8[args[1]] = (int8_t)uram16[args[2]]; break; -case 378: ram8[args[1]] = (int8_t)ram16[args[2]]; break; -case 379: ram8[args[1]] = (int8_t)uram8[args[2]]; break; +case 291: uram64[args[0]] = (uint64_t)ram64[args[1]]; break; +case 292: uram64[args[0]] = (uint64_t)ramd[args[1]]; break; +case 293: uram64[args[0]] = (uint64_t)uram32[args[1]]; break; +case 294: uram64[args[0]] = (uint64_t)ram32[args[1]]; break; +case 295: uram64[args[0]] = (uint64_t)ramf[args[1]]; break; +case 296: uram64[args[0]] = (uint64_t)uram16[args[1]]; break; +case 297: uram64[args[0]] = (uint64_t)ram16[args[1]]; break; +case 298: uram64[args[0]] = (uint64_t)uram8[args[1]]; break; +case 299: uram64[args[0]] = (uint64_t)ram8[args[1]]; break; +case 300: ram64[args[0]] = (int64_t)uram64[args[1]]; break; +case 301: ram64[args[0]] = (int64_t)ramd[args[1]]; break; +case 302: ram64[args[0]] = (int64_t)uram32[args[1]]; break; +case 303: ram64[args[0]] = (int64_t)ram32[args[1]]; break; +case 304: ram64[args[0]] = (int64_t)ramf[args[1]]; break; +case 305: ram64[args[0]] = (int64_t)uram16[args[1]]; break; +case 306: ram64[args[0]] = (int64_t)ram16[args[1]]; break; +case 307: ram64[args[0]] = (int64_t)uram8[args[1]]; break; +case 308: ram64[args[0]] = (int64_t)ram8[args[1]]; break; +case 309: ramd[args[0]] = (double)uram64[args[1]]; break; +case 310: ramd[args[0]] = (double)ram64[args[1]]; break; +case 311: ramd[args[0]] = (double)uram32[args[1]]; break; +case 312: ramd[args[0]] = (double)ram32[args[1]]; break; +case 313: ramd[args[0]] = (double)ramf[args[1]]; break; +case 314: ramd[args[0]] = (double)uram16[args[1]]; break; +case 315: ramd[args[0]] = (double)ram16[args[1]]; break; +case 316: ramd[args[0]] = (double)uram8[args[1]]; break; +case 317: ramd[args[0]] = (double)ram8[args[1]]; break; +case 318: uram32[args[0]] = (uint32_t)uram64[args[1]]; break; +case 319: uram32[args[0]] = (uint32_t)ram64[args[1]]; break; +case 320: uram32[args[0]] = (uint32_t)ramd[args[1]]; break; +case 321: uram32[args[0]] = (uint32_t)ram32[args[1]]; break; +case 322: uram32[args[0]] = (uint32_t)ramf[args[1]]; break; +case 323: uram32[args[0]] = (uint32_t)uram16[args[1]]; break; +case 324: uram32[args[0]] = (uint32_t)ram16[args[1]]; break; +case 325: uram32[args[0]] = (uint32_t)uram8[args[1]]; break; +case 326: uram32[args[0]] = (uint32_t)ram8[args[1]]; break; +case 327: ram32[args[0]] = (int32_t)uram64[args[1]]; break; +case 328: ram32[args[0]] = (int32_t)ram64[args[1]]; break; +case 329: ram32[args[0]] = (int32_t)ramd[args[1]]; break; +case 330: ram32[args[0]] = (int32_t)uram32[args[1]]; break; +case 331: ram32[args[0]] = (int32_t)ramf[args[1]]; break; +case 332: ram32[args[0]] = (int32_t)uram16[args[1]]; break; +case 333: ram32[args[0]] = (int32_t)ram16[args[1]]; break; +case 334: ram32[args[0]] = (int32_t)uram8[args[1]]; break; +case 335: ram32[args[0]] = (int32_t)ram8[args[1]]; break; +case 336: ramf[args[0]] = (float)uram64[args[1]]; break; +case 337: ramf[args[0]] = (float)ram64[args[1]]; break; +case 338: ramf[args[0]] = (float)ramd[args[1]]; break; +case 339: ramf[args[0]] = (float)uram32[args[1]]; break; +case 340: ramf[args[0]] = (float)ram32[args[1]]; break; +case 341: ramf[args[0]] = (float)uram16[args[1]]; break; +case 342: ramf[args[0]] = (float)ram16[args[1]]; break; +case 343: ramf[args[0]] = (float)uram8[args[1]]; break; +case 344: ramf[args[0]] = (float)ram8[args[1]]; break; +case 345: uram16[args[0]] = (uint16_t)uram64[args[1]]; break; +case 346: uram16[args[0]] = (uint16_t)ram64[args[1]]; break; +case 347: uram16[args[0]] = (uint16_t)ramd[args[1]]; break; +case 348: uram16[args[0]] = (uint16_t)uram32[args[1]]; break; +case 349: uram16[args[0]] = (uint16_t)ram32[args[1]]; break; +case 350: uram16[args[0]] = (uint16_t)ramf[args[1]]; break; +case 351: uram16[args[0]] = (uint16_t)ram16[args[1]]; break; +case 352: uram16[args[0]] = (uint16_t)uram8[args[1]]; break; +case 353: uram16[args[0]] = (uint16_t)ram8[args[1]]; break; +case 354: ram16[args[0]] = (int16_t)uram64[args[1]]; break; +case 355: ram16[args[0]] = (int16_t)ram64[args[1]]; break; +case 356: ram16[args[0]] = (int16_t)ramd[args[1]]; break; +case 357: ram16[args[0]] = (int16_t)uram32[args[1]]; break; +case 358: ram16[args[0]] = (int16_t)ram32[args[1]]; break; +case 359: ram16[args[0]] = (int16_t)ramf[args[1]]; break; +case 360: ram16[args[0]] = (int16_t)uram16[args[1]]; break; +case 361: ram16[args[0]] = (int16_t)uram8[args[1]]; break; +case 362: ram16[args[0]] = (int16_t)ram8[args[1]]; break; +case 363: uram8[args[0]] = (uint8_t)uram64[args[1]]; break; +case 364: uram8[args[0]] = (uint8_t)ram64[args[1]]; break; +case 365: uram8[args[0]] = (uint8_t)ramd[args[1]]; break; +case 366: uram8[args[0]] = (uint8_t)uram32[args[1]]; break; +case 367: uram8[args[0]] = (uint8_t)ram32[args[1]]; break; +case 368: uram8[args[0]] = (uint8_t)ramf[args[1]]; break; +case 369: uram8[args[0]] = (uint8_t)uram16[args[1]]; break; +case 370: uram8[args[0]] = (uint8_t)ram16[args[1]]; break; +case 371: uram8[args[0]] = (int8_t)ram8[args[1]]; break; +case 372: ram8[args[0]] = (int8_t)uram64[args[1]]; break; +case 373: ram8[args[0]] = (int8_t)ram64[args[1]]; break; +case 374: ram8[args[0]] = (int8_t)ramd[args[1]]; break; +case 375: ram8[args[0]] = (int8_t)uram32[args[1]]; break; +case 376: ram8[args[0]] = (int8_t)ram32[args[1]]; break; +case 377: ram8[args[0]] = (int8_t)ramf[args[1]]; break; +case 378: ram8[args[0]] = (int8_t)uram16[args[1]]; break; +case 379: ram8[args[0]] = (int8_t)ram16[args[1]]; break; +case 380: ram8[args[0]] = (int8_t)uram8[args[1]]; break; +// io dev +case 381: devices[args[0]].write(vm, uram8 + args[1], args[2]); break; +case 382: devices[args[0]].out(vm); break; +case 383: devices[args[0]].read(vm, uram8 + args[1], args[2], args[3]); break; +case 384: devices[args[0]].wait(vm, args[1]); break;