76 lines
1.4 KiB
C++
76 lines
1.4 KiB
C++
#include "test-common.h"
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
// CNST
|
|
// dst - 0, Direct
|
|
// imm - 0x0005
|
|
//
|
|
// DIVI
|
|
// dst - 0, Direct
|
|
// a - 0, Direct
|
|
// b - 2, Immediate
|
|
{
|
|
foot::Emulator emu = run_instructions({ 0x00200005, 0x0E200220 });
|
|
if (!check(0x0002, emu.register_at(0))) { return 1; }
|
|
}
|
|
|
|
// CNST
|
|
// dst - 0, Direct
|
|
// imm - 0x0007
|
|
//
|
|
// CNST
|
|
// dst - 1, Direct
|
|
// imm = 0xFFF9 (-7)
|
|
//
|
|
// DIVI
|
|
// dst - 0, Direct
|
|
// a - 0, Direct
|
|
// b - 1, Direct
|
|
{
|
|
foot::Emulator emu = run_instructions({ 0x00200007, 0x0021FFF9, 0x0E202120 });
|
|
if (!check(0xFFFF, emu.register_at(0))) { return 1; }
|
|
}
|
|
|
|
// CNST
|
|
// dst - 0, Direct
|
|
// imm - 0xFFF9 (-7)
|
|
//
|
|
// CNST
|
|
// dst - 1, Direct
|
|
// imm = 0xFFF9 (-7)
|
|
//
|
|
// DIVI
|
|
// dst - 0, Direct
|
|
// a - 0, Direct
|
|
// b - 1, Direct
|
|
{
|
|
foot::Emulator emu = run_instructions({ 0x0020FFF9, 0x0021FFF9, 0x0E202120 });
|
|
if (!check(0x1, emu.register_at(0))) { return 1; }
|
|
}
|
|
|
|
// CNST
|
|
// dst - 0, Direct
|
|
// imm - 0x0002 (1)
|
|
//
|
|
// CNST
|
|
// dst - 1, Direct
|
|
// imm = 0x0001 (0.5)
|
|
//
|
|
// CONF
|
|
// dst - X, Immediate
|
|
// a - 1, Immediate
|
|
//
|
|
// MULT
|
|
// dst - 0, Direct
|
|
// a - 0, Direct
|
|
// b - 1, Direct
|
|
{
|
|
foot::Emulator emu = run_instructions({ 0x00200002, 0x00210001, 0x01000401, 0x0E202120 });
|
|
// 0x4 (2)
|
|
if (!check(0x4, emu.register_at(0))) { return 1; }
|
|
}
|
|
|
|
return 0;
|
|
}
|