Skip to content

Commit a739be5

Browse files
committed
Changes
1 parent c8a1c19 commit a739be5

141 files changed

Lines changed: 6930 additions & 6930 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/Integration/EmulatorCore/CPU/CPU_ADC.cpp

Lines changed: 208 additions & 208 deletions
Large diffs are not rendered by default.

tests/Integration/EmulatorCore/CPU/CPU_ADD.cpp

Lines changed: 208 additions & 208 deletions
Large diffs are not rendered by default.

tests/Integration/EmulatorCore/CPU/CPU_AND.cpp

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

tests/Integration/EmulatorCore/CPU/CPU_ANDN.cpp

Lines changed: 104 additions & 104 deletions
Large diffs are not rendered by default.

tests/Integration/EmulatorCore/CPU/CPU_BSWAP.cpp

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ static constexpr std::uint64_t QWORD_DATA1 = 0x1234567812345678;
1616
static std::uint64_t QWORD_RESULT = HyperCPU::byteswap(QWORD_DATA1);
1717

1818
TEST_F(CPU_TEST, INSTR_BSWAP_R_b8) {
19-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::BSWAP);
20-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b8, HyperCPU::OperandTypes::R));
21-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::XLLL0);
22-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
23-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
19+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::BSWAP);
20+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b8, HyperCPU::OperandTypes::R));
21+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::XLLL0);
22+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
23+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
2424
*cpu.xlll0 = BYTE_DATA1;
2525

2626
cpu.Run();
@@ -29,11 +29,11 @@ TEST_F(CPU_TEST, INSTR_BSWAP_R_b8) {
2929
}
3030

3131
TEST_F(CPU_TEST, INSTR_BSWAP_R_b16) {
32-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::BSWAP);
33-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b16, HyperCPU::OperandTypes::R));
34-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::XLL0);
35-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
36-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
32+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::BSWAP);
33+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b16, HyperCPU::OperandTypes::R));
34+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::XLL0);
35+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
36+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
3737
*cpu.xll0 = WORD_DATA1;
3838

3939
cpu.Run();
@@ -42,11 +42,11 @@ TEST_F(CPU_TEST, INSTR_BSWAP_R_b16) {
4242
}
4343

4444
TEST_F(CPU_TEST, INSTR_BSWAP_R_b32) {
45-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::BSWAP);
46-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b32, HyperCPU::OperandTypes::R));
47-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::XL0);
48-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
49-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
45+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::BSWAP);
46+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b32, HyperCPU::OperandTypes::R));
47+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::XL0);
48+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
49+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
5050
*cpu.xl0 = DWORD_DATA1;
5151

5252
cpu.Run();
@@ -55,11 +55,11 @@ TEST_F(CPU_TEST, INSTR_BSWAP_R_b32) {
5555
}
5656

5757
TEST_F(CPU_TEST, INSTR_BSWAP_R_b64) {
58-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::BSWAP);
59-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
60-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
61-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
62-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
58+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::BSWAP);
59+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
60+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
61+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
62+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
6363
*cpu.x0 = QWORD_DATA1;
6464

6565
cpu.Run();

tests/Integration/EmulatorCore/CPU/CPU_CALL.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "tests/fixtures.hpp"
55

66
TEST_F(CPU_TEST, INSTR_CALL_R) {
7-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALL);
8-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
10-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
11-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
7+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALL);
8+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
10+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
11+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
1212
*cpu.xbp = 512;
1313
*cpu.xsp = *cpu.xbp;
1414
*cpu.x0 = 1536;
@@ -19,11 +19,11 @@ TEST_F(CPU_TEST, INSTR_CALL_R) {
1919
}
2020

2121
TEST_F(CPU_TEST, INSTR_CALL_IMM) {
22-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALL);
23-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
24-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
25-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
26-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
22+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALL);
23+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
24+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
25+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
26+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
2727
*cpu.xbp = 512;
2828
*cpu.xsp = *cpu.xbp;
2929

tests/Integration/EmulatorCore/CPU/CPU_CALLE.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "tests/fixtures.hpp"
55

66
TEST_F(CPU_TEST, INSTR_CALLE_R_TRUE) {
7-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLE);
8-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
10-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
11-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
7+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLE);
8+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
10+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
11+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
1212
*cpu.xbp = 512;
1313
*cpu.xsp = *cpu.xbp;
1414
*cpu.x0 = 1536;
@@ -20,13 +20,13 @@ TEST_F(CPU_TEST, INSTR_CALLE_R_TRUE) {
2020
}
2121

2222
TEST_F(CPU_TEST, INSTR_CALLE_R_FALSE) {
23-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLE);
24-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
25-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
26-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
27-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
28-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
29-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
23+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLE);
24+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
25+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
26+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
27+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
28+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
29+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
3030
*cpu.xbp = 512;
3131
*cpu.xsp = *cpu.xbp;
3232
*cpu.x0 = 1536;
@@ -37,11 +37,11 @@ TEST_F(CPU_TEST, INSTR_CALLE_R_FALSE) {
3737
}
3838

3939
TEST_F(CPU_TEST, INSTR_CALLE_IMM_TRUE) {
40-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLE);
41-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
43-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
44-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
40+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLE);
41+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
43+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
44+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
4545
*cpu.xbp = 512;
4646
*cpu.xsp = *cpu.xbp;
4747
cpu.zrf = 1;
@@ -52,13 +52,13 @@ TEST_F(CPU_TEST, INSTR_CALLE_IMM_TRUE) {
5252
}
5353

5454
TEST_F(CPU_TEST, INSTR_CALLE_IMM_FALSE) {
55-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLE);
56-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
57-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
58-
cpu.mem_controller->Load16(*cpu.xip + 11, HyperCPU::Opcode::HALT);
59-
cpu.mem_controller->Load8(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
60-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
61-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
55+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLE);
56+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
57+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
58+
cpu.mem_controller->Load(*cpu.xip + 11, HyperCPU::Opcode::HALT);
59+
cpu.mem_controller->Load(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
60+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
61+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
6262
*cpu.xbp = 512;
6363
*cpu.xsp = *cpu.xbp;
6464

tests/Integration/EmulatorCore/CPU/CPU_CALLGR.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "tests/fixtures.hpp"
55

66
TEST_F(CPU_TEST, INSTR_CALLGR_R_TRUE) {
7-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLGR);
8-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
10-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
11-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
7+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLGR);
8+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
10+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
11+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
1212
*cpu.xbp = 512;
1313
*cpu.xsp = *cpu.xbp;
1414
*cpu.x0 = 1536;
@@ -19,13 +19,13 @@ TEST_F(CPU_TEST, INSTR_CALLGR_R_TRUE) {
1919
}
2020

2121
TEST_F(CPU_TEST, INSTR_CALLGR_R_FALSE) {
22-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLGR);
23-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
24-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
25-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
26-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
27-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
28-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
22+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLGR);
23+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
24+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
25+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
26+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
27+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
28+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
2929
*cpu.xbp = 512;
3030
*cpu.xsp = *cpu.xbp;
3131
*cpu.x0 = 1536;
@@ -37,11 +37,11 @@ TEST_F(CPU_TEST, INSTR_CALLGR_R_FALSE) {
3737
}
3838

3939
TEST_F(CPU_TEST, INSTR_CALLGR_IMM_TRUE) {
40-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLGR);
41-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
43-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
44-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
40+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLGR);
41+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
43+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
44+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
4545
*cpu.xbp = 512;
4646
*cpu.xsp = *cpu.xbp;
4747

@@ -51,13 +51,13 @@ TEST_F(CPU_TEST, INSTR_CALLGR_IMM_TRUE) {
5151
}
5252

5353
TEST_F(CPU_TEST, INSTR_CALLGR_IMM_FALSE) {
54-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLGR);
55-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
56-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
57-
cpu.mem_controller->Load16(*cpu.xip + 11, HyperCPU::Opcode::HALT);
58-
cpu.mem_controller->Load8(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
59-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
60-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
54+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLGR);
55+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
56+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
57+
cpu.mem_controller->Load(*cpu.xip + 11, HyperCPU::Opcode::HALT);
58+
cpu.mem_controller->Load(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
59+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
60+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
6161
*cpu.xbp = 512;
6262
*cpu.xsp = *cpu.xbp;
6363
cpu.zrf = 1;

tests/Integration/EmulatorCore/CPU/CPU_CALLL.cpp

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
#include "tests/fixtures.hpp"
55

66
TEST_F(CPU_TEST, INSTR_CALLL_R_TRUE) {
7-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLL);
8-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
10-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
11-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
7+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLL);
8+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
9+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
10+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
11+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
1212
*cpu.xbp = 512;
1313
*cpu.xsp = *cpu.xbp;
1414
*cpu.x0 = 1536;
@@ -20,13 +20,13 @@ TEST_F(CPU_TEST, INSTR_CALLL_R_TRUE) {
2020
}
2121

2222
TEST_F(CPU_TEST, INSTR_CALLL_R_FALSE) {
23-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLL);
24-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
25-
cpu.mem_controller->Load8(*cpu.xip + 3, HyperCPU::Reg::X0);
26-
cpu.mem_controller->Load16(*cpu.xip + 4, HyperCPU::Opcode::HALT);
27-
cpu.mem_controller->Load8(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
28-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
29-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
23+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLL);
24+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::R));
25+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Reg::X0);
26+
cpu.mem_controller->Load(*cpu.xip + 4, HyperCPU::Opcode::HALT);
27+
cpu.mem_controller->Load(*cpu.xip + 6, HyperCPU::OperandTypes::NONE);
28+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
29+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
3030
*cpu.xbp = 512;
3131
*cpu.xsp = *cpu.xbp;
3232
*cpu.x0 = 1536;
@@ -37,11 +37,11 @@ TEST_F(CPU_TEST, INSTR_CALLL_R_FALSE) {
3737
}
3838

3939
TEST_F(CPU_TEST, INSTR_CALLL_IMM_TRUE) {
40-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLL);
41-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
43-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
44-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
40+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLL);
41+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
42+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
43+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
44+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
4545
*cpu.xbp = 512;
4646
*cpu.xsp = *cpu.xbp;
4747
cpu.crf = 1;
@@ -52,13 +52,13 @@ TEST_F(CPU_TEST, INSTR_CALLL_IMM_TRUE) {
5252
}
5353

5454
TEST_F(CPU_TEST, INSTR_CALLL_IMM_FALSE) {
55-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CALLL);
56-
cpu.mem_controller->Load8(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
57-
cpu.mem_controller->Load64(*cpu.xip + 3, 1536);
58-
cpu.mem_controller->Load16(*cpu.xip + 11, HyperCPU::Opcode::HALT);
59-
cpu.mem_controller->Load8(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
60-
cpu.mem_controller->Load16(1536, HyperCPU::Opcode::HALT);
61-
cpu.mem_controller->Load8(1538, HyperCPU::OperandTypes::NONE);
55+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CALLL);
56+
cpu.mem_controller->Load(*cpu.xip + 2, EncodeTestFlags(HyperCPU::Mode::b64, HyperCPU::OperandTypes::IMM));
57+
cpu.mem_controller->Load(*cpu.xip + 3, 1536);
58+
cpu.mem_controller->Load(*cpu.xip + 11, HyperCPU::Opcode::HALT);
59+
cpu.mem_controller->Load(*cpu.xip + 13, HyperCPU::OperandTypes::NONE);
60+
cpu.mem_controller->Load(1536, HyperCPU::Opcode::HALT);
61+
cpu.mem_controller->Load(1538, HyperCPU::OperandTypes::NONE);
6262
*cpu.xbp = 512;
6363
*cpu.xsp = *cpu.xbp;
6464

tests/Integration/EmulatorCore/CPU/CPU_CCRF.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
#include "tests/fixtures.hpp"
55

66
TEST_F(CPU_TEST, INSTR_CCRF_SET) {
7-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CCRF);
8-
cpu.mem_controller->Load8(*cpu.xip + 2, HyperCPU::OperandTypes::NONE);
9-
cpu.mem_controller->Load16(*cpu.xip + 3, HyperCPU::Opcode::HALT);
10-
cpu.mem_controller->Load8(*cpu.xip + 5, HyperCPU::OperandTypes::NONE);
7+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CCRF);
8+
cpu.mem_controller->Load(*cpu.xip + 2, HyperCPU::OperandTypes::NONE);
9+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Opcode::HALT);
10+
cpu.mem_controller->Load(*cpu.xip + 5, HyperCPU::OperandTypes::NONE);
1111
cpu.crf = true;
1212

1313
cpu.Run();
@@ -16,10 +16,10 @@ TEST_F(CPU_TEST, INSTR_CCRF_SET) {
1616
}
1717

1818
TEST_F(CPU_TEST, INSTR_CCRF_NOTSET) {
19-
cpu.mem_controller->Load16(*cpu.xip, HyperCPU::Opcode::CCRF);
20-
cpu.mem_controller->Load8(*cpu.xip + 2, HyperCPU::OperandTypes::NONE);
21-
cpu.mem_controller->Load16(*cpu.xip + 3, HyperCPU::Opcode::HALT);
22-
cpu.mem_controller->Load8(*cpu.xip + 5, HyperCPU::OperandTypes::NONE);
19+
cpu.mem_controller->Load(*cpu.xip, HyperCPU::Opcode::CCRF);
20+
cpu.mem_controller->Load(*cpu.xip + 2, HyperCPU::OperandTypes::NONE);
21+
cpu.mem_controller->Load(*cpu.xip + 3, HyperCPU::Opcode::HALT);
22+
cpu.mem_controller->Load(*cpu.xip + 5, HyperCPU::OperandTypes::NONE);
2323
cpu.crf = false;
2424

2525
cpu.Run();

0 commit comments

Comments
 (0)