mirror of
https://github.com/emptyynes/LIVM.git
synced 2025-01-02 14:42:24 +03:00
435 lines
23 KiB
C
435 lines
23 KiB
C
/*
|
|
(C) M. Ærþ.
|
|
*/
|
|
|
|
// control
|
|
case 0: 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: uram64[args[0]] = sp; break;
|
|
case 8: dp = uram64[args[0]]; ram = (void*)((uint64_t*)raw_ram + dp); break;
|
|
case 9: uram64[args[0]] = dp; break;
|
|
case 10: goto end; break;
|
|
case 11: uram64[sp + (++uram64[sp])] = (uint64_t)uram64[args[0]];
|
|
case 12: uram64[sp + (++uram64[sp])] = (uint64_t)ram64[args[0]];
|
|
case 13: uram64[sp + (++uram64[sp])] = (uint64_t)ramd[args[0]];
|
|
case 14: uram64[sp + (++uram64[sp])] = (uint64_t)uram32[args[0]];
|
|
case 15: uram64[sp + (++uram64[sp])] = (uint64_t)ram32[args[0]];
|
|
case 16: uram64[sp + (++uram64[sp])] = (uint64_t)ramf[args[0]];
|
|
case 17: uram64[sp + (++uram64[sp])] = (uint64_t)uram16[args[0]];
|
|
case 18: uram64[sp + (++uram64[sp])] = (uint64_t)ram16[args[0]];
|
|
case 19: uram64[sp + (++uram64[sp])] = (uint64_t)uram8[args[0]];
|
|
case 20: uram64[sp + (++uram64[sp])] = (uint64_t)ram8[args[0]];
|
|
case 21: uram64[args[0]] = (uint64_t)uram64[sp + (uram64[sp]--)];
|
|
case 22: ram64[args[0]] = (int64_t)uram64[sp + (uram64[sp]--)];
|
|
case 23: ramd[args[0]] = (double)uram64[sp + (uram64[sp]--)];
|
|
case 24: uram32[args[0]] = (uint32_t)uram64[sp + (uram64[sp]--)];
|
|
case 25: ram32[args[0]] = (int32_t)uram64[sp + (uram64[sp]--)];
|
|
case 26: ramf[args[0]] = (float)uram64[sp + (uram64[sp]--)];
|
|
case 27: uram16[args[0]] = (uint16_t)uram64[sp + (uram64[sp]--)];
|
|
case 28: ram16[args[0]] = (int16_t)uram64[sp + (uram64[sp]--)];
|
|
case 29: uram8[args[0]] = (uint8_t)uram64[sp + (uram64[sp]--)];
|
|
case 30: ram8[args[0]] = (int8_t)uram64[sp + (uram64[sp]--)];
|
|
// math
|
|
// u64
|
|
case 31: uram64[args[0]] += uram64[args[1]]; break;
|
|
case 32: uram64[args[0]] -= uram64[args[1]]; break;
|
|
case 33: uram64[args[0]] *= uram64[args[1]]; break;
|
|
case 34: uram64[args[0]] /= uram64[args[1]]; break;
|
|
case 35: uram64[args[0]] %= uram64[args[1]]; break;
|
|
case 36: uram64[args[0]] |= uram64[args[1]]; break;
|
|
case 37: uram64[args[0]] &= uram64[args[1]]; break;
|
|
case 38: uram64[args[0]] = uram64[args[1]] + uram64[args[2]]; break;
|
|
case 39: uram64[args[0]] = uram64[args[1]] - uram64[args[2]]; break;
|
|
case 40: uram64[args[0]] = uram64[args[1]] * uram64[args[2]]; break;
|
|
case 41: uram64[args[0]] = uram64[args[1]] / uram64[args[2]]; break;
|
|
case 42: uram64[args[0]] = uram64[args[1]] % uram64[args[2]]; break;
|
|
case 43: uram64[args[0]] = uram64[args[1]] | uram64[args[2]]; break;
|
|
case 44: uram64[args[0]] = uram64[args[1]] & uram64[args[2]]; break;
|
|
case 45: uram64[args[0]] = !uram64[args[1]]; break;
|
|
// 64
|
|
case 46: ram64[args[0]] += ram64[args[1]]; break;
|
|
case 47: ram64[args[0]] -= ram64[args[1]]; break;
|
|
case 48: ram64[args[0]] *= ram64[args[1]]; break;
|
|
case 49: ram64[args[0]] /= ram64[args[1]]; break;
|
|
case 50: ram64[args[0]] %= ram64[args[1]]; break;
|
|
case 51: ram64[args[0]] |= ram64[args[1]]; break;
|
|
case 52: ram64[args[0]] &= ram64[args[1]]; break;
|
|
case 53: ram64[args[0]] = ram64[args[1]] + ram64[args[2]]; break;
|
|
case 54: ram64[args[0]] = ram64[args[1]] - ram64[args[2]]; break;
|
|
case 55: ram64[args[0]] = ram64[args[1]] * ram64[args[2]]; break;
|
|
case 56: ram64[args[0]] = ram64[args[1]] / ram64[args[2]]; break;
|
|
case 57: ram64[args[0]] = ram64[args[1]] % ram64[args[2]]; break;
|
|
case 58: ram64[args[0]] = ram64[args[1]] | ram64[args[2]]; break;
|
|
case 59: ram64[args[0]] = ram64[args[1]] & ram64[args[2]]; break;
|
|
case 60: ram64[args[0]] = !ram64[args[1]]; break;
|
|
// d
|
|
case 61: ramd[args[0]] += ramd[args[1]]; break;
|
|
case 62: ramd[args[0]] -= ramd[args[1]]; break;
|
|
case 63: ramd[args[0]] *= ramd[args[1]]; break;
|
|
case 64: ramd[args[0]] /= ramd[args[1]]; break;
|
|
case 65: ramd[args[0]] = ramd[args[1]] + ramd[args[2]]; break;
|
|
case 66: ramd[args[0]] = ramd[args[1]] - ramd[args[2]]; break;
|
|
case 67: ramd[args[0]] = ramd[args[1]] * ramd[args[2]]; break;
|
|
case 68: ramd[args[0]] = ramd[args[1]] / ramd[args[2]]; break;
|
|
case 69: ramd[args[0]] = !ramd[args[1]]; break;
|
|
// u32
|
|
case 70: uram32[args[0]] += uram32[args[1]]; break;
|
|
case 71: uram32[args[0]] -= uram32[args[1]]; break;
|
|
case 72: uram32[args[0]] *= uram32[args[1]]; break;
|
|
case 73: uram32[args[0]] /= uram32[args[1]]; break;
|
|
case 74: uram32[args[0]] %= uram32[args[1]]; break;
|
|
case 75: uram32[args[0]] |= uram32[args[1]]; break;
|
|
case 76: uram32[args[0]] &= uram32[args[1]]; break;
|
|
case 77: uram32[args[0]] = uram32[args[1]] + uram32[args[2]]; break;
|
|
case 78: uram32[args[0]] = uram32[args[1]] - uram32[args[2]]; break;
|
|
case 79: uram32[args[0]] = uram32[args[1]] * uram32[args[2]]; break;
|
|
case 80: uram32[args[0]] = uram32[args[1]] / uram32[args[2]]; break;
|
|
case 81: uram32[args[0]] = uram32[args[1]] % uram32[args[2]]; break;
|
|
case 82: uram32[args[0]] = uram32[args[1]] | uram32[args[2]]; break;
|
|
case 83: uram32[args[0]] = uram32[args[1]] & uram32[args[2]]; break;
|
|
case 84: uram32[args[0]] = !uram32[args[1]]; break;
|
|
// 32
|
|
case 85: ram32[args[0]] += ram32[args[1]]; break;
|
|
case 86: ram32[args[0]] -= ram32[args[1]]; break;
|
|
case 87: ram32[args[0]] *= ram32[args[1]]; break;
|
|
case 88: ram32[args[0]] /= ram32[args[1]]; break;
|
|
case 89: ram32[args[0]] %= ram32[args[1]]; break;
|
|
case 90: ram32[args[0]] |= ram32[args[1]]; break;
|
|
case 91: ram32[args[0]] &= ram32[args[1]]; break;
|
|
case 92: ram32[args[0]] = ram32[args[1]] + ram32[args[2]]; break;
|
|
case 93: ram32[args[0]] = ram32[args[1]] - ram32[args[2]]; break;
|
|
case 94: ram32[args[0]] = ram32[args[1]] * ram32[args[2]]; break;
|
|
case 95: ram32[args[0]] = ram32[args[1]] / ram32[args[2]]; break;
|
|
case 96: ram32[args[0]] = ram32[args[1]] % ram32[args[2]]; break;
|
|
case 97: ram32[args[0]] = ram32[args[1]] | ram32[args[2]]; break;
|
|
case 98: ram32[args[0]] = ram32[args[1]] & ram32[args[2]]; break;
|
|
case 99: ram32[args[0]] = !ram32[args[1]]; break;
|
|
// f
|
|
case 100: ramf[args[0]] += ramf[args[1]]; break;
|
|
case 101: ramf[args[0]] -= ramf[args[1]]; break;
|
|
case 102: ramf[args[0]] *= ramf[args[1]]; break;
|
|
case 103: ramf[args[0]] /= ramf[args[1]]; break;
|
|
case 104: ramf[args[0]] = ramf[args[1]] + ramf[args[2]]; break;
|
|
case 105: ramf[args[0]] = ramf[args[1]] - ramf[args[2]]; break;
|
|
case 106: ramf[args[0]] = ramf[args[1]] * ramf[args[2]]; break;
|
|
case 107: ramf[args[0]] = ramf[args[1]] / ramf[args[2]]; break;
|
|
case 108: ramf[args[0]] = !ramf[args[1]]; break;
|
|
// u16
|
|
case 109: uram16[args[0]] += uram16[args[1]]; break;
|
|
case 110: uram16[args[0]] -= uram16[args[1]]; break;
|
|
case 111: uram16[args[0]] *= uram16[args[1]]; break;
|
|
case 112: uram16[args[0]] /= uram16[args[1]]; break;
|
|
case 113: uram16[args[0]] %= uram16[args[1]]; break;
|
|
case 114: uram16[args[0]] |= uram16[args[1]]; break;
|
|
case 115: uram16[args[0]] &= uram16[args[1]]; break;
|
|
case 116: uram16[args[0]] = uram16[args[1]] + uram16[args[2]]; break;
|
|
case 117: uram16[args[0]] = uram16[args[1]] - uram16[args[2]]; break;
|
|
case 118: uram16[args[0]] = uram16[args[1]] * uram16[args[2]]; break;
|
|
case 119: uram16[args[0]] = uram16[args[1]] / uram16[args[2]]; break;
|
|
case 120: uram16[args[0]] = uram16[args[1]] % uram16[args[2]]; break;
|
|
case 121: uram16[args[0]] = uram16[args[1]] | uram16[args[2]]; break;
|
|
case 122: uram16[args[0]] = uram16[args[1]] & uram16[args[2]]; break;
|
|
case 123: uram16[args[0]] = !uram16[args[1]]; break;
|
|
// 16
|
|
case 124: ram16[args[0]] += ram16[args[1]]; break;
|
|
case 125: ram16[args[0]] -= ram16[args[1]]; break;
|
|
case 126: ram16[args[0]] *= ram16[args[1]]; break;
|
|
case 127: ram16[args[0]] /= ram16[args[1]]; break;
|
|
case 128: ram16[args[0]] %= ram16[args[1]]; break;
|
|
case 129: ram16[args[0]] |= ram16[args[1]]; break;
|
|
case 130: ram16[args[0]] &= ram16[args[1]]; break;
|
|
case 131: ram16[args[0]] = ram16[args[1]] + ram16[args[2]]; break;
|
|
case 132: ram16[args[0]] = ram16[args[1]] - ram16[args[2]]; break;
|
|
case 133: ram16[args[0]] = ram16[args[1]] * ram16[args[2]]; break;
|
|
case 134: ram16[args[0]] = ram16[args[1]] / ram16[args[2]]; break;
|
|
case 135: ram16[args[0]] = ram16[args[1]] % ram16[args[2]]; break;
|
|
case 136: ram16[args[0]] = ram16[args[1]] | ram16[args[2]]; break;
|
|
case 137: ram16[args[0]] = ram16[args[1]] & ram16[args[2]]; break;
|
|
case 138: ram16[args[0]] = !ram16[args[1]]; break;
|
|
// u8
|
|
case 139: uram8[args[0]] += uram8[args[1]]; break;
|
|
case 140: uram8[args[0]] -= uram8[args[1]]; break;
|
|
case 141: uram8[args[0]] *= uram8[args[1]]; break;
|
|
case 142: uram8[args[0]] /= uram8[args[1]]; break;
|
|
case 143: uram8[args[0]] %= uram8[args[1]]; break;
|
|
case 144: uram8[args[0]] |= uram8[args[1]]; break;
|
|
case 145: uram8[args[0]] &= uram8[args[1]]; break;
|
|
case 146: uram8[args[0]] = uram8[args[1]] + uram8[args[2]]; break;
|
|
case 147: uram8[args[0]] = uram8[args[1]] - uram8[args[2]]; break;
|
|
case 148: uram8[args[0]] = uram8[args[1]] * uram8[args[2]]; break;
|
|
case 149: uram8[args[0]] = uram8[args[1]] / uram8[args[2]]; break;
|
|
case 150: uram8[args[0]] = uram8[args[1]] % uram8[args[2]]; break;
|
|
case 151: uram8[args[0]] = uram8[args[1]] | uram8[args[2]]; break;
|
|
case 152: uram8[args[0]] = uram8[args[1]] & uram8[args[2]]; break;
|
|
case 153: uram8[args[0]] = !uram8[args[1]]; break;
|
|
// 8
|
|
case 154: ram8[args[0]] += ram8[args[1]]; break;
|
|
case 155: ram8[args[0]] -= ram8[args[1]]; break;
|
|
case 156: ram8[args[0]] *= ram8[args[1]]; break;
|
|
case 157: ram8[args[0]] /= ram8[args[1]]; break;
|
|
case 158: ram8[args[0]] %= ram8[args[1]]; break;
|
|
case 159: ram8[args[0]] |= ram8[args[1]]; break;
|
|
case 160: ram8[args[0]] &= ram8[args[1]]; break;
|
|
case 161: ram8[args[0]] = ram8[args[1]] + ram8[args[2]]; break;
|
|
case 162: ram8[args[0]] = ram8[args[1]] - ram8[args[2]]; break;
|
|
case 163: ram8[args[0]] = ram8[args[1]] * ram8[args[2]]; break;
|
|
case 164: ram8[args[0]] = ram8[args[1]] / ram8[args[2]]; break;
|
|
case 165: ram8[args[0]] = ram8[args[1]] % ram8[args[2]]; break;
|
|
case 166: ram8[args[0]] = ram8[args[1]] | ram8[args[2]]; break;
|
|
case 167: ram8[args[0]] = ram8[args[1]] & ram8[args[2]]; break;
|
|
case 168: ram8[args[0]] = !ram8[args[1]]; break;
|
|
// ==
|
|
case 169: cmp = uram64[args[0]] == uram64[args[1]]; break;
|
|
case 170: cmp = ram64[args[0]] == ram64[args[1]]; break;
|
|
case 171: cmp = ramd[args[0]] == ramd[args[1]]; break;
|
|
case 172: cmp = uram32[args[0]] == uram32[args[1]]; break;
|
|
case 173: cmp = ram32[args[0]] == ram32[args[1]]; break;
|
|
case 174: cmp = ramf[args[0]] == ramf[args[1]]; break;
|
|
case 175: cmp = uram16[args[0]] == uram16[args[1]]; break;
|
|
case 176: cmp = ram16[args[0]] == ram16[args[1]]; break;
|
|
case 177: cmp = uram8[args[0]] == uram8[args[1]]; break;
|
|
case 178: cmp = ram8[args[0]] == ram8[args[1]]; break;
|
|
// !=
|
|
case 179: cmp = uram64[args[0]] != uram64[args[1]]; break;
|
|
case 180: cmp = ram64[args[0]] != ram64[args[1]]; break;
|
|
case 181: cmp = ramd[args[0]] != ramd[args[1]]; break;
|
|
case 182: cmp = uram32[args[0]] != uram32[args[1]]; break;
|
|
case 183: cmp = ram32[args[0]] != ram32[args[1]]; break;
|
|
case 184: cmp = ramf[args[0]] != ramf[args[1]]; break;
|
|
case 185: cmp = uram16[args[0]] != uram16[args[1]]; break;
|
|
case 186: cmp = ram16[args[0]] != ram16[args[1]]; break;
|
|
case 187: cmp = uram8[args[0]] != uram8[args[1]]; break;
|
|
case 188: cmp = ram8[args[0]] != ram8[args[1]]; break;
|
|
// >
|
|
case 189: cmp = uram64[args[0]] > uram64[args[1]]; break;
|
|
case 190: cmp = ram64[args[0]] > ram64[args[1]]; break;
|
|
case 191: cmp = ramd[args[0]] > ramd[args[1]]; break;
|
|
case 192: cmp = uram32[args[0]] > uram32[args[1]]; break;
|
|
case 193: cmp = ram32[args[0]] > ram32[args[1]]; break;
|
|
case 194: cmp = ramf[args[0]] > ramf[args[1]]; break;
|
|
case 195: cmp = uram16[args[0]] > uram16[args[1]]; break;
|
|
case 196: cmp = ram16[args[0]] > ram16[args[1]]; break;
|
|
case 197: cmp = uram8[args[0]] > uram8[args[1]]; break;
|
|
case 198: cmp = ram8[args[0]] > ram8[args[1]]; break;
|
|
// <
|
|
case 199: cmp = uram64[args[0]] < uram64[args[1]]; break;
|
|
case 200: cmp = ram64[args[0]] < ram64[args[1]]; break;
|
|
case 201: cmp = ramd[args[0]] < ramd[args[1]]; break;
|
|
case 202: cmp = uram32[args[0]] < uram32[args[1]]; break;
|
|
case 203: cmp = ram32[args[0]] < ram32[args[1]]; break;
|
|
case 204: cmp = ramf[args[0]] < ramf[args[1]]; break;
|
|
case 205: cmp = uram16[args[0]] < uram16[args[1]]; break;
|
|
case 206: cmp = ram16[args[0]] < ram16[args[1]]; break;
|
|
case 207: cmp = uram8[args[0]] < uram8[args[1]]; break;
|
|
case 208: cmp = ram8[args[0]] < ram8[args[1]]; break;
|
|
// >=
|
|
case 209: cmp = uram64[args[0]] >= uram64[args[1]]; break;
|
|
case 210: cmp = ram64[args[0]] >= ram64[args[1]]; break;
|
|
case 211: cmp = ramd[args[0]] >= ramd[args[1]]; break;
|
|
case 212: cmp = uram32[args[0]] >= uram32[args[1]]; break;
|
|
case 213: cmp = ram32[args[0]] >= ram32[args[1]]; break;
|
|
case 214: cmp = ramf[args[0]] >= ramf[args[1]]; break;
|
|
case 215: cmp = uram16[args[0]] >= uram16[args[1]]; break;
|
|
case 216: cmp = ram16[args[0]] >= ram16[args[1]]; break;
|
|
case 217: cmp = uram8[args[0]] >= uram8[args[1]]; break;
|
|
case 218: cmp = ram8[args[0]] >= ram8[args[1]]; break;
|
|
// <=
|
|
case 219: cmp = uram64[args[0]] <= uram64[args[1]]; break;
|
|
case 220: cmp = ram64[args[0]] <= ram64[args[1]]; break;
|
|
case 221: cmp = ramd[args[0]] <= ramd[args[1]]; break;
|
|
case 222: cmp = uram32[args[0]] <= uram32[args[1]]; break;
|
|
case 223: cmp = ram32[args[0]] <= ram32[args[1]]; break;
|
|
case 224: cmp = ramf[args[0]] <= ramf[args[1]]; break;
|
|
case 225: cmp = uram16[args[0]] <= uram16[args[1]]; break;
|
|
case 226: cmp = ram16[args[0]] <= ram16[args[1]]; break;
|
|
case 227: cmp = uram8[args[0]] <= uram8[args[1]]; break;
|
|
case 228: cmp = ram8[args[0]] <= ram8[args[1]]; break;
|
|
// ++
|
|
case 229: uram64[args[0]]++; break;
|
|
case 230: ram64[args[0]]++; break;
|
|
case 231: ramd[args[0]]++; break;
|
|
case 232: uram32[args[0]]++; break;
|
|
case 233: ram32[args[0]]++; break;
|
|
case 234: ramf[args[0]]++; break;
|
|
case 235: uram16[args[0]]++; break;
|
|
case 236: ram16[args[0]]++; break;
|
|
case 237: uram8[args[0]]++; break;
|
|
case 238: ram8[args[0]]++; break;
|
|
// --
|
|
case 239: uram64[args[0]]--; break;
|
|
case 240: ram64[args[0]]--; break;
|
|
case 241: ramd[args[0]]--; break;
|
|
case 242: uram32[args[0]]--; break;
|
|
case 243: ram32[args[0]]--; break;
|
|
case 244: ramf[args[0]]--; break;
|
|
case 245: uram16[args[0]]--; break;
|
|
case 246: ram16[args[0]]--; break;
|
|
case 247: uram8[args[0]]--; break;
|
|
case 248: ram8[args[0]]--; break;
|
|
// a = b
|
|
case 249: uram64[args[0]] = (uint64_t)args[1]; break;
|
|
case 250: ram64[args[0]] = (int64_t)args[1]; break;
|
|
case 251: ramd[args[0]] = (int64_t)args[1]; break;
|
|
case 252: uram32[args[0]] = (uint32_t)args[1]; break;
|
|
case 253: ram32[args[0]] = (int32_t)args[1]; break;
|
|
case 254: ramf[args[0]] = (int32_t)args[1]; break;
|
|
case 255: uram16[args[0]] = (uint16_t)args[1]; break;
|
|
case 256: ram16[args[0]] = (int16_t)args[1]; break;
|
|
case 257: uram8[args[0]] = (uint8_t)args[1]; break;
|
|
case 258: ram8[args[0]] = (int8_t)args[1]; break;
|
|
// a = *b
|
|
case 259: uram64[args[0]] = uram64[args[1]]; break;
|
|
case 260: ram64[args[0]] = ram64[args[1]]; break;
|
|
case 261: ramd[args[0]] = ramd[args[1]]; break;
|
|
case 262: uram32[args[0]] = uram32[args[1]]; break;
|
|
case 263: ram32[args[0]] = ram32[args[1]]; break;
|
|
case 264: ramf[args[0]] = ramf[args[1]]; break;
|
|
case 265: uram16[args[0]] = uram16[args[1]]; break;
|
|
case 266: ram16[args[0]] = ram16[args[1]]; break;
|
|
case 267: uram8[args[0]] = uram8[args[1]]; break;
|
|
case 268: ram8[args[0]] = ram8[args[1]]; break;
|
|
// a = **b
|
|
case 269: uram64[args[0]] = uram64[uram64[args[1]]]; break;
|
|
case 270: ram64[args[0]] = ram64[uram64[args[1]]]; break;
|
|
case 271: ramd[args[0]] = ramd[uram64[args[1]]]; break;
|
|
case 272: uram32[args[0]] = uram32[uram64[args[1]]]; break;
|
|
case 273: ram32[args[0]] = ram32[uram64[args[1]]]; break;
|
|
case 274: ramf[args[0]] = ramf[uram64[args[1]]]; break;
|
|
case 275: uram16[args[0]] = uram16[uram64[args[1]]]; break;
|
|
case 276: ram16[args[0]] = ram16[uram64[args[1]]]; break;
|
|
case 277: uram8[args[0]] = uram8[uram64[args[1]]]; break;
|
|
case 278: ram8[args[0]] = ram8[uram64[args[1]]]; break;
|
|
// *a = b
|
|
case 279: uram64[uram64[args[0]]] = (uint64_t) args[1]; break;
|
|
case 280: ram64[uram64[args[0]]] = (int64_t) args[1]; break;
|
|
case 281: ramd[uram64[args[0]]] = (double) args[1]; break;
|
|
case 282: uram32[uram64[args[0]]] = (uint32_t) args[1]; break;
|
|
case 283: ram32[uram64[args[0]]] = (int32_t) args[1]; break;
|
|
case 284: ramf[uram64[args[0]]] = (float) args[1]; break;
|
|
case 285: uram16[uram64[args[0]]] = (uint16_t) args[1]; break;
|
|
case 286: ram16[uram64[args[0]]] = (int16_t) args[1]; break;
|
|
case 287: uram8[uram64[args[0]]] = (uint8_t) args[1]; break;
|
|
case 288: ram8[uram64[args[0]]] = (int8_t) args[1]; break;
|
|
// *a = *b
|
|
case 289: uram64[uram64[args[0]]] = uram64[args[1]]; break;
|
|
case 290: ram64[uram64[args[0]]] = ram64[args[1]]; break;
|
|
case 291: ramd[uram64[args[0]]] = ramd[args[1]]; break;
|
|
case 292: uram32[uram64[args[0]]] = uram32[args[1]]; break;
|
|
case 293: ram32[uram64[args[0]]] = ram32[args[1]]; break;
|
|
case 294: ramf[uram64[args[0]]] = ramf[args[1]]; break;
|
|
case 295: uram16[uram64[args[0]]] = uram16[args[1]]; break;
|
|
case 296: ram16[uram64[args[0]]] = ram16[args[1]]; break;
|
|
case 297: uram8[uram64[args[0]]] = uram8[args[1]]; break;
|
|
case 298: ram8[uram64[args[0]]] = ram8[args[1]]; break;
|
|
// *a = **b
|
|
case 299: uram64[uram64[args[0]]] = uram64[uram64[args[1]]]; break;
|
|
case 300: ram64[uram64[args[0]]] = ram64[uram64[args[1]]]; break;
|
|
case 301: ramd[uram64[args[0]]] = ramd[uram64[args[1]]]; break;
|
|
case 302: uram32[uram64[args[0]]] = uram32[uram64[args[1]]]; break;
|
|
case 303: ram32[uram64[args[0]]] = ram32[uram64[args[1]]]; break;
|
|
case 304: ramf[uram64[args[0]]] = ramf[uram64[args[1]]]; break;
|
|
case 305: uram16[uram64[args[0]]] = uram16[uram64[args[1]]]; break;
|
|
case 306: ram16[uram64[args[0]]] = ram16[uram64[args[1]]]; break;
|
|
case 307: uram8[uram64[args[0]]] = uram8[uram64[args[1]]]; break;
|
|
case 308: ram8[uram64[args[0]]] = ram8[uram64[args[1]]]; break;
|
|
// cast
|
|
case 309: uram64[args[0]] = (uint64_t)ram64[args[1]]; break;
|
|
case 310: uram64[args[0]] = (uint64_t)ramd[args[1]]; break;
|
|
case 311: uram64[args[0]] = (uint64_t)uram32[args[1]]; break;
|
|
case 312: uram64[args[0]] = (uint64_t)ram32[args[1]]; break;
|
|
case 313: uram64[args[0]] = (uint64_t)ramf[args[1]]; break;
|
|
case 314: uram64[args[0]] = (uint64_t)uram16[args[1]]; break;
|
|
case 315: uram64[args[0]] = (uint64_t)ram16[args[1]]; break;
|
|
case 316: uram64[args[0]] = (uint64_t)uram8[args[1]]; break;
|
|
case 317: uram64[args[0]] = (uint64_t)ram8[args[1]]; break;
|
|
case 318: ram64[args[0]] = (int64_t)uram64[args[1]]; break;
|
|
case 319: ram64[args[0]] = (int64_t)ramd[args[1]]; break;
|
|
case 320: ram64[args[0]] = (int64_t)uram32[args[1]]; break;
|
|
case 321: ram64[args[0]] = (int64_t)ram32[args[1]]; break;
|
|
case 322: ram64[args[0]] = (int64_t)ramf[args[1]]; break;
|
|
case 323: ram64[args[0]] = (int64_t)uram16[args[1]]; break;
|
|
case 324: ram64[args[0]] = (int64_t)ram16[args[1]]; break;
|
|
case 325: ram64[args[0]] = (int64_t)uram8[args[1]]; break;
|
|
case 326: ram64[args[0]] = (int64_t)ram8[args[1]]; break;
|
|
case 327: ramd[args[0]] = (double)uram64[args[1]]; break;
|
|
case 328: ramd[args[0]] = (double)ram64[args[1]]; break;
|
|
case 329: ramd[args[0]] = (double)uram32[args[1]]; break;
|
|
case 330: ramd[args[0]] = (double)ram32[args[1]]; break;
|
|
case 331: ramd[args[0]] = (double)ramf[args[1]]; break;
|
|
case 332: ramd[args[0]] = (double)uram16[args[1]]; break;
|
|
case 333: ramd[args[0]] = (double)ram16[args[1]]; break;
|
|
case 334: ramd[args[0]] = (double)uram8[args[1]]; break;
|
|
case 335: ramd[args[0]] = (double)ram8[args[1]]; break;
|
|
case 336: uram32[args[0]] = (uint32_t)uram64[args[1]]; break;
|
|
case 337: uram32[args[0]] = (uint32_t)ram64[args[1]]; break;
|
|
case 338: uram32[args[0]] = (uint32_t)ramd[args[1]]; break;
|
|
case 339: uram32[args[0]] = (uint32_t)ram32[args[1]]; break;
|
|
case 340: uram32[args[0]] = (uint32_t)ramf[args[1]]; break;
|
|
case 341: uram32[args[0]] = (uint32_t)uram16[args[1]]; break;
|
|
case 342: uram32[args[0]] = (uint32_t)ram16[args[1]]; break;
|
|
case 343: uram32[args[0]] = (uint32_t)uram8[args[1]]; break;
|
|
case 344: uram32[args[0]] = (uint32_t)ram8[args[1]]; break;
|
|
case 345: ram32[args[0]] = (int32_t)uram64[args[1]]; break;
|
|
case 346: ram32[args[0]] = (int32_t)ram64[args[1]]; break;
|
|
case 347: ram32[args[0]] = (int32_t)ramd[args[1]]; break;
|
|
case 348: ram32[args[0]] = (int32_t)uram32[args[1]]; break;
|
|
case 349: ram32[args[0]] = (int32_t)ramf[args[1]]; break;
|
|
case 350: ram32[args[0]] = (int32_t)uram16[args[1]]; break;
|
|
case 351: ram32[args[0]] = (int32_t)ram16[args[1]]; break;
|
|
case 352: ram32[args[0]] = (int32_t)uram8[args[1]]; break;
|
|
case 353: ram32[args[0]] = (int32_t)ram8[args[1]]; break;
|
|
case 354: ramf[args[0]] = (float)uram64[args[1]]; break;
|
|
case 355: ramf[args[0]] = (float)ram64[args[1]]; break;
|
|
case 356: ramf[args[0]] = (float)ramd[args[1]]; break;
|
|
case 357: ramf[args[0]] = (float)uram32[args[1]]; break;
|
|
case 358: ramf[args[0]] = (float)ram32[args[1]]; break;
|
|
case 359: ramf[args[0]] = (float)uram16[args[1]]; break;
|
|
case 360: ramf[args[0]] = (float)ram16[args[1]]; break;
|
|
case 361: ramf[args[0]] = (float)uram8[args[1]]; break;
|
|
case 362: ramf[args[0]] = (float)ram8[args[1]]; break;
|
|
case 363: uram16[args[0]] = (uint16_t)uram64[args[1]]; break;
|
|
case 364: uram16[args[0]] = (uint16_t)ram64[args[1]]; break;
|
|
case 365: uram16[args[0]] = (uint16_t)ramd[args[1]]; break;
|
|
case 366: uram16[args[0]] = (uint16_t)uram32[args[1]]; break;
|
|
case 367: uram16[args[0]] = (uint16_t)ram32[args[1]]; break;
|
|
case 368: uram16[args[0]] = (uint16_t)ramf[args[1]]; break;
|
|
case 369: uram16[args[0]] = (uint16_t)ram16[args[1]]; break;
|
|
case 370: uram16[args[0]] = (uint16_t)uram8[args[1]]; break;
|
|
case 371: uram16[args[0]] = (uint16_t)ram8[args[1]]; break;
|
|
case 372: ram16[args[0]] = (int16_t)uram64[args[1]]; break;
|
|
case 373: ram16[args[0]] = (int16_t)ram64[args[1]]; break;
|
|
case 374: ram16[args[0]] = (int16_t)ramd[args[1]]; break;
|
|
case 375: ram16[args[0]] = (int16_t)uram32[args[1]]; break;
|
|
case 376: ram16[args[0]] = (int16_t)ram32[args[1]]; break;
|
|
case 377: ram16[args[0]] = (int16_t)ramf[args[1]]; break;
|
|
case 378: ram16[args[0]] = (int16_t)uram16[args[1]]; break;
|
|
case 379: ram16[args[0]] = (int16_t)uram8[args[1]]; break;
|
|
case 380: ram16[args[0]] = (int16_t)ram8[args[1]]; break;
|
|
case 381: uram8[args[0]] = (uint8_t)uram64[args[1]]; break;
|
|
case 382: uram8[args[0]] = (uint8_t)ram64[args[1]]; break;
|
|
case 383: uram8[args[0]] = (uint8_t)ramd[args[1]]; break;
|
|
case 384: uram8[args[0]] = (uint8_t)uram32[args[1]]; break;
|
|
case 385: uram8[args[0]] = (uint8_t)ram32[args[1]]; break;
|
|
case 386: uram8[args[0]] = (uint8_t)ramf[args[1]]; break;
|
|
case 387: uram8[args[0]] = (uint8_t)uram16[args[1]]; break;
|
|
case 388: uram8[args[0]] = (uint8_t)ram16[args[1]]; break;
|
|
case 389: uram8[args[0]] = (int8_t)ram8[args[1]]; break;
|
|
case 390: ram8[args[0]] = (int8_t)uram64[args[1]]; break;
|
|
case 391: ram8[args[0]] = (int8_t)ram64[args[1]]; break;
|
|
case 392: ram8[args[0]] = (int8_t)ramd[args[1]]; break;
|
|
case 393: ram8[args[0]] = (int8_t)uram32[args[1]]; break;
|
|
case 394: ram8[args[0]] = (int8_t)ram32[args[1]]; break;
|
|
case 395: ram8[args[0]] = (int8_t)ramf[args[1]]; break;
|
|
case 396: ram8[args[0]] = (int8_t)uram16[args[1]]; break;
|
|
case 397: ram8[args[0]] = (int8_t)ram16[args[1]]; break;
|
|
case 398: ram8[args[0]] = (int8_t)uram8[args[1]]; break;
|
|
// io dev
|
|
case 399: devices[args[0]].write(vm, uram8 + args[1] * 8, uram64[args[2]]); break;
|
|
case 400: devices[args[0]].out(vm); break;
|
|
case 401: devices[args[0]].read(vm, uram8 + args[1] * 8, args[2], args[3]); break;
|
|
case 402: devices[args[0]].wait(vm, uram64[args[1]]); break;
|