|
Avr8bit-emulator
An emulator for the Atmel AVR 8-bit microcontroller
|
Bit testings and manipulations. More...


Go to the source code of this file.
Functions | |
| void | lsl (uint8_t d, struct CORE *core) |
| Logical Shift Left. | |
| void | lsr (uint8_t d, struct CORE *core) |
| Logical Shift Right. | |
| void | rol (uint8_t d, struct CORE *core) |
| Rotate Left through Carry. | |
| void | ror (uint8_t d, struct CORE *core) |
| Rotate Right through Carry. | |
| void | asr (uint8_t d, struct CORE *core) |
| Arithmetic Shift Right. | |
| void | swap (uint8_t d, struct CORE *core) |
| Swap nibbles in a register. | |
| void | sbi (uint8_t IO, uint8_t n, struct CORE *core) |
| Set Bit in I/O Register. | |
| void | cbi (uint8_t IO, uint8_t n, struct CORE *core) |
| Clear Bit in I/O Register. | |
| void | bst (uint8_t d, uint8_t b, struct CORE *core) |
| Bit Store from Register to T Flag in SREG. | |
| void | bld (uint8_t d, uint8_t b, struct CORE *core) |
| Bit Load from T Flag in SREG to Register. | |
| void | bset (uint8_t s, struct CORE *core) |
| Set Bit in SREG. | |
| void | bclr (uint8_t s, struct CORE *core) |
| Clear Bit in SREG. | |
| void | sec (struct CORE *core) |
| Set Carry Flag. | |
| void | clc (struct CORE *core) |
| Clear Carry Flag. | |
| void | sen (struct CORE *core) |
| Set Negative Flag. | |
| void | cln (struct CORE *core) |
| Clear Negative Flag. | |
| void | sez (struct CORE *core) |
| Set Zero Flag. | |
| void | clz (struct CORE *core) |
| Clear Zero Flag. | |
| void | sei (struct CORE *core) |
| Set Global Interrupt Flag. | |
| void | cli (struct CORE *core) |
| Clear Global Interrupt Flag. | |
| void | ses (struct CORE *core) |
| Set Signed Flag. | |
| void | cls (struct CORE *core) |
| Clear Signed Flag. | |
| void | sev (struct CORE *core) |
| Set Overflow Flag. | |
| void | clv (struct CORE *core) |
| Clear Overflow Flag. | |
| void | set (struct CORE *core) |
| Set T Flag. | |
| void | clt (struct CORE *core) |
| Clear T Flag. | |
| void | seh (struct CORE *core) |
| Set Half Carry Flag. | |
| void | clh (struct CORE *core) |
| Clear Half Carry Flag. | |
Bit testings and manipulations.
Contains all atomic bit testings and manipulations
Definition in file bit_test.h.
| void asr | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Arithmetic Shift Right.
| d | The register to be shifted. |
| core | Pointer to the CORE structure. |
Definition at line 80 of file bit_test.c.
References SREG::C, CORE::gp, inc_pc(), SREG::N, GP::R, CORE::sreg, sreg_S_compute_bool(), sreg_Z_compute_bool(), update_sreg_N(), update_sreg_S(), update_sreg_V(), update_sreg_Z(), and SREG::V.
| void bclr | ( | uint8_t | s, |
| struct CORE * | core | ||
| ) |
Clear Bit in SREG.
| s | The bit to be cleared. |
| core | Pointer to the CORE structure. |
Definition at line 169 of file bit_test.c.
References inc_pc(), SREG::sreg, and CORE::sreg.
| void bld | ( | uint8_t | d, |
| uint8_t | b, | ||
| struct CORE * | core | ||
| ) |
Bit Load from T Flag in SREG to Register.
| d | The register. |
| b | The bit to be loaded. |
| core | Pointer to the CORE structure. |
Definition at line 145 of file bit_test.c.
References CORE::gp, inc_pc(), GP::R, CORE::sreg, and SREG::T.
| void bset | ( | uint8_t | s, |
| struct CORE * | core | ||
| ) |
Set Bit in SREG.
| s | The bit to be set. |
| core | Pointer to the CORE structure. |
Definition at line 157 of file bit_test.c.
References inc_pc(), SREG::sreg, and CORE::sreg.
| void bst | ( | uint8_t | d, |
| uint8_t | b, | ||
| struct CORE * | core | ||
| ) |
Bit Store from Register to T Flag in SREG.
| d | The register. |
| b | The bit to be stored. |
| core | Pointer to the CORE structure. |
Definition at line 133 of file bit_test.c.
References CORE::gp, inc_pc(), GP::R, CORE::sreg, and SREG::T.
| void cbi | ( | uint8_t | IO, |
| uint8_t | n, | ||
| struct CORE * | core | ||
| ) |
Clear Bit in I/O Register.
| IO | The I/O register. |
| n | The bit to be cleared. |
| core | Pointer to the CORE structure. |
Definition at line 121 of file bit_test.c.
| void clc | ( | struct CORE * | core | ) |
Clear Carry Flag.
| core | Pointer to the CORE structure. |
Definition at line 193 of file bit_test.c.
References SREG::C, inc_pc(), and CORE::sreg.
| void clh | ( | struct CORE * | core | ) |
Clear Half Carry Flag.
| core | Pointer to the CORE structure. |
Definition at line 361 of file bit_test.c.
References SREG::H, inc_pc(), and CORE::sreg.
| void cli | ( | struct CORE * | core | ) |
Clear Global Interrupt Flag.
| core | Pointer to the CORE structure. |
Definition at line 265 of file bit_test.c.
References SREG::I, inc_pc(), and CORE::sreg.
| void cln | ( | struct CORE * | core | ) |
Clear Negative Flag.
| core | Pointer to the CORE structure. |
Definition at line 217 of file bit_test.c.
References inc_pc(), SREG::N, and CORE::sreg.
| void cls | ( | struct CORE * | core | ) |
Clear Signed Flag.
| core | Pointer to the CORE structure. |
Definition at line 289 of file bit_test.c.
References inc_pc(), SREG::S, and CORE::sreg.
| void clt | ( | struct CORE * | core | ) |
Clear T Flag.
| core | Pointer to the CORE structure. |
Definition at line 337 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::T.
| void clv | ( | struct CORE * | core | ) |
Clear Overflow Flag.
| core | Pointer to the CORE structure. |
Definition at line 313 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::V.
| void clz | ( | struct CORE * | core | ) |
Clear Zero Flag.
| core | Pointer to the CORE structure. |
Definition at line 241 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::Z.
| void lsl | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Logical Shift Left.
| d | The register to be shifted. |
| core | Pointer to the CORE structure. |
Definition at line 3 of file bit_test.c.
References SREG::C, CORE::gp, inc_pc(), SREG::N, GP::R, CORE::sreg, sreg_S_compute_bool(), sreg_Z_compute_bool(), update_sreg_H(), update_sreg_N(), update_sreg_S(), update_sreg_V(), update_sreg_Z(), and SREG::V.
| void lsr | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Logical Shift Right.
| d | The register to be shifted. |
| core | Pointer to the CORE structure. |
Definition at line 23 of file bit_test.c.
References SREG::C, CORE::gp, inc_pc(), SREG::N, GP::R, CORE::sreg, sreg_S_compute_bool(), sreg_Z_compute_bool(), update_sreg_N(), update_sreg_S(), update_sreg_V(), update_sreg_Z(), and SREG::V.
| void rol | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Rotate Left through Carry.
| d | The register to be rotated. |
| core | Pointer to the CORE structure. |
Definition at line 41 of file bit_test.c.
References SREG::C, CORE::gp, inc_pc(), SREG::N, GP::R, CORE::sreg, sreg_S_compute_bool(), sreg_Z_compute_bool(), update_sreg_H(), update_sreg_N(), update_sreg_S(), update_sreg_V(), update_sreg_Z(), and SREG::V.
| void ror | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Rotate Right through Carry.
| d | The register to be rotated. |
| core | Pointer to the CORE structure. |
Definition at line 61 of file bit_test.c.
References SREG::C, CORE::gp, inc_pc(), SREG::N, GP::R, CORE::sreg, sreg_S_compute_bool(), sreg_Z_compute_bool(), update_sreg_N(), update_sreg_S(), update_sreg_V(), update_sreg_Z(), and SREG::V.
| void sbi | ( | uint8_t | IO, |
| uint8_t | n, | ||
| struct CORE * | core | ||
| ) |
Set Bit in I/O Register.
| IO | The I/O register. |
| n | The bit to be set. |
| core | Pointer to the CORE structure. |
Definition at line 109 of file bit_test.c.
| void sec | ( | struct CORE * | core | ) |
Set Carry Flag.
| core | Pointer to the CORE structure. |
Definition at line 181 of file bit_test.c.
References SREG::C, inc_pc(), and CORE::sreg.
| void seh | ( | struct CORE * | core | ) |
Set Half Carry Flag.
| core | Pointer to the CORE structure. |
Definition at line 349 of file bit_test.c.
References SREG::H, inc_pc(), and CORE::sreg.
| void sei | ( | struct CORE * | core | ) |
Set Global Interrupt Flag.
| core | Pointer to the CORE structure. |
Definition at line 253 of file bit_test.c.
References SREG::I, inc_pc(), and CORE::sreg.
| void sen | ( | struct CORE * | core | ) |
Set Negative Flag.
| core | Pointer to the CORE structure. |
Definition at line 205 of file bit_test.c.
References inc_pc(), SREG::N, and CORE::sreg.
| void ses | ( | struct CORE * | core | ) |
Set Signed Flag.
| core | Pointer to the CORE structure. |
Definition at line 277 of file bit_test.c.
References inc_pc(), SREG::S, and CORE::sreg.
| void set | ( | struct CORE * | core | ) |
Set T Flag.
| core | Pointer to the CORE structure. |
Definition at line 325 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::T.
| void sev | ( | struct CORE * | core | ) |
Set Overflow Flag.
| core | Pointer to the CORE structure. |
Definition at line 301 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::V.
| void sez | ( | struct CORE * | core | ) |
Set Zero Flag.
| core | Pointer to the CORE structure. |
Definition at line 229 of file bit_test.c.
References inc_pc(), CORE::sreg, and SREG::Z.
| void swap | ( | uint8_t | d, |
| struct CORE * | core | ||
| ) |
Swap nibbles in a register.
| d | The register to be swapped. |
| core | Pointer to the CORE structure. |
Definition at line 97 of file bit_test.c.