|
uint8_t * | ref_byte_reg (cpu_state *cpu, uint8_t reg_identifier) |
| The bit pattern designating one of the registers A,B,C,D,E,H,L (DDD=destination, SSS=source) 111 -> ACC, 000—101 -> B,C,D,E,H,L. This function returns a reference to the bytes which helps simulate the register. More...
|
|
uint16_t * | ref_short_reg (cpu_state *cpu, uint8_t reg_identifier) |
| The bit pattern designating one of the register pairs B,D,H,SP 00—11 -> B,D,H,SP. This function returns a reference to the short which helps simulate the register. More...
|
|
uint8_t | condition_check (cpu_state *cpu, condition_flags condition_identifier) |
| perform condition check on the cpu register state More...
|
|
void | set_flags (cpu_state *cpu, uint32_t final_state, uint8_t flags) |
| Set the flags PSW status. More...
|
|
void | aux_flag_set_add (cpu_state *cpu, uint32_t base_val, uint32_t diff) |
| sets the aux flag for all operations. Must convert all ops to a addition operation (compressed). Does base_val + diff to recalc the result. So for -ve bass -ve num's 2 complement. More...
|
|
uint8_t | compress_PSW (program_status_word psw) |
| Compress program_status_word into a uint8_t as per flag_bits. More...
|
|
program_status_word | decompress_PSW (uint8_t status) |
| Inflate the uint8_t into a program_status_word by using flag_bits as the mapping. More...
|
|
int | UNDEFINED_OP_WRAP (UNUSED cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Undefined OPCODE Functor. More...
|
|
int | NOP_WRAP (UNUSED cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Wrapper over No Op. More...
|
|
int | LXI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Load register pair immediate. More...
|
|
int | JMP_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (PC) (byte 3) (byte 2) – Control is transferred to the instruction whose address is specified in byte 3 and byte 2 of the current instruction. More...
|
|
int | MVI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Move Immediate. More...
|
|
int | CALL_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| The current PC (pointer to next instruction) is move to the top of SP and the SP is decremented to make space for the pointer. Next, the new start of function address is moved to PC. More...
|
|
int | LDAX_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Load accumulator indirect: The content of the memory location, whose address is in the register pair rp, is moved to register A. More...
|
|
int | MOV_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| All different kinds of move operations: More...
|
|
int | HLT_WRAP (UNUSED cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| The processor is stopped. The registers and flags are unaffected. More...
|
|
int | INX_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Increment register pair) (rh) (rl) <– (rh) (rl) + 1 The content of the register pair rp is incremented by one. More...
|
|
int | DCR_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Decrement Register) The content of register r is decremented by one. More...
|
|
int | JCon_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Conditional JMP statements. More...
|
|
int | RET_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Return) (PCl) ((SP)); (PCH) ((SP) + 1); (SP) (SP) + 2; The content of the memory location whose address is specified in register SP is moved to the low-order eight bits of register PC. More...
|
|
int | RCon_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Conditional version of RET_WRAP More...
|
|
int | CMP_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Comparison operation. More...
|
|
int | CPI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Compare A with(-) (byte 2) More...
|
|
int | PUSH_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| The content of content register, is moved into the memory whose address is specified by the SP. Note: for RP-11b it transforms into PUSH PSW. More...
|
|
int | POP_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| The content of the memory location, whose address is specified by the SP is pused into content Reg. Note: for RP-11b it transforms into POP PSW. More...
|
|
int | DAD_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Add register pair to Hand L) (H) (L) ..- (H) (L) + (rh) (rl) The content of the register pair rp is added to the content of the register pair Hand L. The result is placed in the register pair Hand L. More...
|
|
int | XCHG_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Xchanges HL <--> DE. More...
|
|
int | OUT_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Copies a byte of data from ACC to PORT. More...
|
|
int | IN_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Copies a byte of data from the PORT defined by byte(2) to ACC. More...
|
|
int | STAX_WRAP (cpu_state *cpu, UNUSED UNUSED uint16_t base_PC, uint8_t op_code) |
| Store *(RP) <- A. More...
|
|
int | ANA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (A) = (A) /\ (r) The content of register r is logically anded with the content of the accumulator. The result is placed in the accumulator. The CY flag is cleared More...
|
|
int | LHLD_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (L) <– ((byte 3)(byte 2)) (H) <– ((byte 3) (byte 2) + 1) More...
|
|
int | ANI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (AND immediate) (A) = (A) & (byte 2) More...
|
|
int | STA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| *((byte 3)(byte 2)) = ACC More...
|
|
int | INR_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (increment Reg) (r) <- (r) + 1 More...
|
|
int | RRC_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Rotate Right) (An) <- (An-1); (A7) <- A0 (Cy) <- (A0) More...
|
|
int | LDA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Load Accumulator direct) (A) = *((byte 3)(byte 2)) More...
|
|
int | XRA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Exclusive OR Register) (A) = (A) ^ (r) More...
|
|
int | EI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Enable Interrupts. More...
|
|
int | DI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Disable Interrupts. More...
|
|
int | SHLD_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (L) --> ((byte 3)(byte 2)) (H) --> ((byte 3) (byte 2) + 1) More...
|
|
int | DCX_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (reg pair) = (reg pair) - 1 More...
|
|
int | RLC_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Rotate left) (An+l) <– (An) ; (AO) <– (A7); (CY) <– (A7) More...
|
|
int | RAL_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Rotate left through carry) (An+1) <– (An) ; (CY) <– (A7) ; (AO) <– (CY) More...
|
|
int | RAR_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Rotate right through carry) (An) <– (An+l) ; (CY) <– (AO) ; (A7) <– (CY) More...
|
|
int | CCon_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| Ccondition addr (Condition call) If (CCC), ((SP) -1) (PCH) ((SP) - 2) (PCl) (SP) (SP) - 2 (PC) (byte 3) (byte 2) More...
|
|
int | SBI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Subtract immediate with borrow) (A) <– (A) - (byte 2) - (CY) The contents of the second byte of the instruction and the contents of the CY flag are both subtracted from the accumulator. The result is placed in the accumulator More...
|
|
int | ADD_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Add Register) (A) <– (A) + (r) The content of register r is added to the content of the accumulator. The result is placed in the accumulator. More...
|
|
int | ADI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Add Immediate) (A) <– (A) + (byte 2) The content of the second byte of the instruction is added to the content of the accumulator. The result is placed in the accumulator More...
|
|
int | ADC_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Add Register with carry) (A) <– (A) + (r) + (CY) The content of register r and the content of the carry bit are added to the content of the accumulator. The result is placed in the accumulator More...
|
|
int | ACI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Add immediate with carry) (A) <– (A) + (byte 2) + (CY) The content of the second byte of the instruction and the content of the CY flag are added to the contents of the accumulator. The result is placed in the accumulator More...
|
|
int | SUB_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Subtract Register) (A) <– (A) - (r) The content of register r is subtracted from the content of the accumulator. The result is placed in the accumulator. More...
|
|
int | SUI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Subtract immediate) (A) <– (A) - (byte 2) The content of the second byte of the instruction is subtracted from the content of the accumulator. The result is placed in the accumulator More...
|
|
int | SBB_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Subtract Register with borrow) (A) <– (A) - (r) - (CY) The content of register r and the content of the CY flag are both subtracted from the accumulator. The result is placed in the accumulator. More...
|
|
int | ORA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (OR Register) (A) <– (A) | (r) The content of register r is inclusive-OR'd with the content of the accumulator. The result is placed in the accumulator. The CY and AC flags are cleared. More...
|
|
int | XTHL_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Exchange stack top with Hand L) (L) <--> ((SP)) ; (H) <--> ((SP) + 1) ; More...
|
|
int | PCHL_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Jump Hand l indirect - move Hand L to PC) (PCH) <– (H) (PCl) <– (l) The content of register H is moved to the high-order eight bits of register PC. The content of register l is moved to the low-order eight bits of register PC. More...
|
|
int | ORI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (OR Immediate) (A) <– (A) V (byte 2) The content of the second byte of the instruction is inclusive-OR'd with the content of the accumulator. The result is placed in the accumulator. The CY and AC flags are cleared. More...
|
|
int | XRI_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Exclusive OR Immediate) (A) <– (A) ^ (byte 2) The content of the second byte of the instruction is exclusive-O R'd with the content of the accumu lator. The result is placed in the accumulator. The CY and AC flags are cleared. More...
|
|
int | CMA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Complement accumulator (A) <- (~A) More...
|
|
int | CMC_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Complement carry (CY) <- (!CY) More...
|
|
int | STC_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| Set Carry (CY) <- (1) More...
|
|
int | DAA_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Decimal Adjust Accumulator) More...
|
|
int | RST_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, uint8_t op_code) |
| (Restart) ((SP) - 1) <– (PCH); ((SP) - 2) <– (PCl); (SP) <– (SP) - 2; (PC) <– 8* (NNN); More...
|
|
int | SPHL_WRAP (cpu_state *cpu, UNUSED uint16_t base_PC, UNUSED uint8_t op_code) |
| (Exchange stack top with H and L) (L) <--> ((SP)); (H) <--> ((SP) + 1); The content of the L register is exchanged with the content of the memory location whose address is specified by the content of register SP. The content of the H register is exchanged with the content of the memory location whose address is one more than the content of register SP. More...
|
|