3void lsl(uint8_t d,
struct CORE *core) {
9 core->
sreg.
C = (core->
gp.
R[d] & 0x80) >> 7;
10 core->
gp.
R[d] = core->
gp.
R[d] << 1;
30 core->
gp.
R[d] = core->
gp.
R[d] >> 1;
46 bool temp = core->
sreg.
C;
47 core->
sreg.
C = (core->
gp.
R[d] & 0x80) >> 7;
48 core->
gp.
R[d] = (core->
gp.
R[d] << 1) | temp;
66 bool temp = core->
sreg.
C;
68 core->
gp.
R[d] = (core->
gp.
R[d] >> 1) | (temp << 7);
86 core->
gp.
R[d] = (core->
gp.
R[d] & 0x80) | (core->
gp.
R[d] >> 1);
101 core->
gp.
R[d] = (core->
gp.
R[d] & 0x0F) << 4 | (core->
gp.
R[d] & 0xF0) >> 4;
109void sbi(uint8_t IO, uint8_t n,
struct CORE *core) {
113 core->
gp.
R[IO] = core->
gp.
R[IO] | (1 << n);
121void cbi(uint8_t IO, uint8_t n,
struct CORE *core) {
125 core->
gp.
R[IO] = core->
gp.
R[IO] & ~(1 << n);
133void bst(uint8_t d, uint8_t b,
struct CORE *core) {
137 core->
sreg.
T = (core->
gp.
R[d] & (1 << b)) >> b;
145void bld(uint8_t d, uint8_t b,
struct CORE *core) {
149 core->
gp.
R[d] = (core->
gp.
R[d] & ~(1 << b)) | (core->
sreg.
T << b);
void cli(struct CORE *core)
Clear Global Interrupt Flag.
void rol(uint8_t d, struct CORE *core)
Rotate Left through Carry.
void seh(struct CORE *core)
Set Half Carry Flag.
void bset(uint8_t s, struct CORE *core)
Set Bit in SREG.
void sei(struct CORE *core)
Set Global Interrupt Flag.
void lsr(uint8_t d, struct CORE *core)
Logical Shift Right.
void cbi(uint8_t IO, uint8_t n, struct CORE *core)
Clear Bit in I/O Register.
void set(struct CORE *core)
Set T Flag.
void sec(struct CORE *core)
Set Carry Flag.
void bld(uint8_t d, uint8_t b, struct CORE *core)
Bit Load from T Flag in SREG to Register.
void clc(struct CORE *core)
Clear Carry Flag.
void swap(uint8_t d, struct CORE *core)
Swap nibbles in a register.
void bclr(uint8_t s, struct CORE *core)
Clear Bit in SREG.
void lsl(uint8_t d, struct CORE *core)
Logical Shift Left.
void cls(struct CORE *core)
Clear Signed Flag.
void ror(uint8_t d, struct CORE *core)
Rotate Right through Carry.
void clh(struct CORE *core)
Clear Half Carry Flag.
void cln(struct CORE *core)
Clear Negative Flag.
void asr(uint8_t d, struct CORE *core)
Arithmetic Shift Right.
void clt(struct CORE *core)
Clear T Flag.
void sez(struct CORE *core)
Set Zero Flag.
void sen(struct CORE *core)
Set Negative Flag.
void clz(struct CORE *core)
Clear Zero Flag.
void clv(struct CORE *core)
Clear Overflow Flag.
void bst(uint8_t d, uint8_t b, struct CORE *core)
Bit Store from Register to T Flag in SREG.
void sbi(uint8_t IO, uint8_t n, struct CORE *core)
Set Bit in I/O Register.
void sev(struct CORE *core)
Set Overflow Flag.
void ses(struct CORE *core)
Set Signed Flag.
Bit testings and manipulations.
void inc_pc(struct CORE *core)
void update_sreg_H(struct CORE *core, bool state)
Update the Half Carry flag (H) in the status register.
void update_sreg_S(struct CORE *core, bool state)
Update the Sign flag (S) in the status register.
void update_sreg_Z(struct CORE *core, bool state)
Update the Zero flag (Z) in the status register.
bool sreg_Z_compute_bool(uint8_t result)
Computes the Z flag as a boolean value.
void update_sreg_V(struct CORE *core, bool state)
Update the Overflow flag (V) in the status register.
void update_sreg_N(struct CORE *core, bool state)
Update the Negative flag (N) in the status register.
bool sreg_S_compute_bool(bool N, bool V)
Computes the S flag as a boolean value.
Core structure containing general purpose registers, program counter, stack pointer,...