-
Notifications
You must be signed in to change notification settings - Fork 0
/
ops_0x5.cpp
35 lines (31 loc) · 900 Bytes
/
ops_0x5.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#include "hw/cpu.hpp"
#include "modrm.hpp"
#include <stdio.h>
void push_r32(Pentium* cpu)
{
uint8_t reg = cpu->bus->read(cpu->getLinearAddr()) - 0x50;
cpu->push32(cpu->gpregs[reg].regs_32);
cpu->ip.regs_32++;
printf("PUSH 0x%x\n", cpu->gpregs[reg].regs_32);
}
void push_r16(Pentium* cpu)
{
uint8_t reg = cpu->bus->read(cpu->getLinearAddr()) - 0x50;
cpu->push16(cpu->gpregs[reg].regs_16);
cpu->ip.regs_32++;
printf("PUSH 0x%x\n", cpu->gpregs[reg].regs_32);
}
void pop_r16(Pentium* cpu)
{
uint8_t reg = cpu->bus->read(cpu->getLinearAddr()) - 0x58;
cpu->gpregs[reg].regs_16 = cpu->pop16();
cpu->ip.regs_32++;
printf("POP 0x%x\n", cpu->gpregs[reg].regs_32);
}
void pop_r32(Pentium* cpu)
{
uint8_t reg = cpu->bus->read(cpu->getLinearAddr()) - 0x58;
cpu->gpregs[reg].regs_32 = cpu->pop32();
printf("Pop 0x%x\n", reg);
cpu->ip.regs_32++;
}