mirror of
https://github.com/rkujawa/rk65c02.git
synced 2024-12-11 18:49:16 +00:00
Better comments.
This commit is contained in:
parent
0df6387a41
commit
2608ab5846
@ -126,9 +126,10 @@ emul_bbr(rk65c02emu_t *e, void *id, instruction_t *i, uint8_t bit)
|
|||||||
{
|
{
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
|
|
||||||
|
/* read value from zero page */
|
||||||
val = instruction_data_read_1(e, (instrdef_t *) id, i);
|
val = instruction_data_read_1(e, (instrdef_t *) id, i);
|
||||||
|
|
||||||
/* is bit is clear then branch */
|
/* if bit is clear then branch */
|
||||||
if (!(BIT(val, bit)))
|
if (!(BIT(val, bit)))
|
||||||
program_counter_branch(e, (int8_t) i->op2);
|
program_counter_branch(e, (int8_t) i->op2);
|
||||||
else
|
else
|
||||||
@ -182,9 +183,10 @@ emul_bbs(rk65c02emu_t *e, void *id, instruction_t *i, uint8_t bit)
|
|||||||
{
|
{
|
||||||
uint8_t val;
|
uint8_t val;
|
||||||
|
|
||||||
|
/* read value from zero page */
|
||||||
val = instruction_data_read_1(e, (instrdef_t *) id, i);
|
val = instruction_data_read_1(e, (instrdef_t *) id, i);
|
||||||
|
|
||||||
/* is bit is set then branch */
|
/* if bit is set then branch */
|
||||||
if (BIT(val, bit))
|
if (BIT(val, bit))
|
||||||
program_counter_branch(e, (int8_t) i->op2);
|
program_counter_branch(e, (int8_t) i->op2);
|
||||||
else
|
else
|
||||||
@ -245,6 +247,7 @@ emul_bit(rk65c02emu_t *e, void *id, instruction_t *i)
|
|||||||
else
|
else
|
||||||
e->regs.P |= P_ZERO;
|
e->regs.P |= P_ZERO;
|
||||||
|
|
||||||
|
/* immediate addressing does not affect the overflow flag */
|
||||||
if ( ((instrdef_t *)id)->mode != IMMEDIATE) {
|
if ( ((instrdef_t *)id)->mode != IMMEDIATE) {
|
||||||
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
|
if (BIT(instruction_data_read_1(e, (instrdef_t *) id, i), 6))
|
||||||
e->regs.P |= P_SIGN_OVERFLOW;
|
e->regs.P |= P_SIGN_OVERFLOW;
|
||||||
@ -685,7 +688,7 @@ emul_plx(rk65c02emu_t *e, void *id, instruction_t *i)
|
|||||||
e->regs.X = stack_pop(e);
|
e->regs.X = stack_pop(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* PLY - pull from stack to X */
|
/* PLY - pull from stack to Y */
|
||||||
void
|
void
|
||||||
emul_ply(rk65c02emu_t *e, void *id, instruction_t *i)
|
emul_ply(rk65c02emu_t *e, void *id, instruction_t *i)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user