mirror of https://github.com/mgba-emu/mgba.git
Implement ASR(1)
This commit is contained in:
parent
8c03c20019
commit
6b07dd33af
|
@ -127,7 +127,19 @@ DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LSR1,
|
|||
}
|
||||
THUMB_NEUTRAL_S( , , cpu->gprs[rd]);)
|
||||
|
||||
DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1, ARM_STUB)
|
||||
DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(ASR1,
|
||||
if (!immediate) {
|
||||
cpu->cpsr.c = ARM_SIGN(cpu->gprs[rm]);
|
||||
if (cpu->cpsr.c) {
|
||||
cpu->gprs[rd] = 0xFFFFFFFF;
|
||||
} else {
|
||||
cpu->gprs[rd] = 0;
|
||||
}
|
||||
} else {
|
||||
cpu->cpsr.c = cpu->gprs[rm] & (1 << (immediate - 1));
|
||||
cpu->gprs[rd] = cpu->gprs[rm] >> immediate;
|
||||
}
|
||||
THUMB_NEUTRAL_S( , , cpu->gprs[rd]);)
|
||||
|
||||
DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LDR1, cpu->gprs[rd] = cpu->memory->load32(cpu->memory, cpu->gprs[rm] + immediate * 4))
|
||||
DEFINE_IMMEDIATE_5_INSTRUCTION_THUMB(LDRB1, cpu->gprs[rd] = cpu->memory->loadU8(cpu->memory, cpu->gprs[rm] + immediate))
|
||||
|
|
Loading…
Reference in New Issue