mirror of
https://github.com/holub/mame
synced 2025-10-06 09:00:04 +03:00
[patinho] Implement SUS instruction
This commit is contained in:
parent
9729ebc804
commit
cc0ff74b62
@ -424,6 +424,19 @@ void patinho_feio_cpu_device::execute_instruction()
|
||||
if (ACC == 0)
|
||||
PC = addr;
|
||||
return;
|
||||
case 0xE0:
|
||||
//SUS = "Subtrai um ou Salta": Subtract one from the data in the given address
|
||||
// or, if the data is zero, then simply skip a couple bytes.
|
||||
addr = compute_effective_address((opcode & 0x0F) << 8 | READ_BYTE_PATINHO(PC));
|
||||
INCREMENT_PC_4K;
|
||||
value = READ_BYTE_PATINHO(addr);
|
||||
if (value > 0){
|
||||
WRITE_BYTE_PATINHO(addr, value-1);
|
||||
} else {
|
||||
INCREMENT_PC_4K;
|
||||
INCREMENT_PC_4K;
|
||||
}
|
||||
return;
|
||||
case 0xF0:
|
||||
//PUG = "Pula e guarda": Jump and store.
|
||||
// It stores the return address to addr and addr+1
|
||||
|
Loading…
Reference in New Issue
Block a user