foot/emulator/tests/addi-instruction.cpp
shylie f3773fc82b
All checks were successful
Test / build (push) Successful in 12s
Add more tests, fix division and modulus
2025-07-08 15:54:54 -04:00

37 lines
670 B
C++

#include "test-common.h"
int main(int argc, char** argv)
{
// CNST
// dst - 0, Direct
// imm - 0x4567
//
// ADDI
// dst - 0, Direct
// a - 0, Direct
// b - 2, Immediate
{
foot::Emulator emu = run_instructions({ 0x00204567, 0x09200220 });
if (!check(0x4569, emu.register_at(0))) { return 1; }
}
// CNST
// dst - 0, Direct
// imm - 0x4567
//
// CNST
// dst - 1, Direct
// imm = 0xFFFE (-2)
//
// ADDI
// dst - 0, Direct
// a - 0, Direct
// b - 1, Direct
{
foot::Emulator emu = run_instructions({ 0x00204567, 0x0021FFFE, 0x09202120 });
if (!check(0x4565, emu.register_at(0))) { return 1; }
}
return 0;
}