Avr8bit-emulator
An emulator for the Atmel AVR 8-bit microcontroller
|
#include "data_transfer.h"
Go to the source code of this file.
Functions | |
void | mov (uint8_t d, uint8_t r, struct CORE *core) |
Move data from register r to register d. | |
void | movw (uint8_t d, uint8_t r, struct CORE *core) |
Move word from register pair r to register pair d. | |
void | ldi (uint8_t d, uint8_t K, struct CORE *core) |
Load immediate value K into register d. | |
void | lds (uint8_t d, int16_t k, struct CORE *core, union DATA_SPACE *data_space) |
Load direct from data space using 16-bit address. | |
void | ld_x (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using X register. | |
void | ld_x_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using X register and post-increment. | |
void | ld_x_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using X register and pre-decrement. | |
void | ld_y (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using Y register. | |
void | ld_y_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using Y register and post-increment. | |
void | ld_y_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space using Y register and pre-decrement. | |
void | ldd_y (uint8_t d, uint8_t q, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space to register using Y pointer with displacement. | |
void | ld_z (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space to register using Z pointer. | |
void | ld_z_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space to register using Z pointer and post-increment. | |
void | ld_z_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space to register using Z pointer and pre-decrement. | |
void | ldd_z (uint8_t d, uint8_t q, struct CORE *core, union DATA_SPACE *data_space) |
Load indirect from data space to register using Z pointer with displacement. | |
void | sts (int16_t k, uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store direct from register to data space. | |
void | st_x (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store indirect from register to data space using X pointer. | |
void | st_x_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store indirect from register to data space using X pointer and post-increment. | |
void | st_x_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store indirect from register to data space using X pointer and pre-decrement. | |
void | st_y (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store indirect from register to data space using Y pointer. | |
void | st_y_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Y pointer and post-increment Y. | |
void | st_y_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Y pointer and pre-decrement Y. | |
void | std_y (uint8_t d, uint8_t q, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Y pointer with displacement. | |
void | st_z (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Z pointer. | |
void | st_z_inc (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Z pointer and post-increment Z. | |
void | st_z_dec (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Z pointer and pre-decrement Z. | |
void | std_z (uint8_t d, uint8_t q, struct CORE *core, union DATA_SPACE *data_space) |
Store register to data space using Z pointer with displacement. | |
void | lpm_0 (struct CORE *core, union PROGMEM_SPACE *progmem_space) |
Load program memory into register using Z pointer. | |
void | lpm_z (uint8_t d, struct CORE *core, union PROGMEM_SPACE *progmem_space) |
Load program memory into register using Z pointer. | |
void | lpm_z_inc (uint8_t d, struct CORE *core, union PROGMEM_SPACE *progmem_space) |
Load program memory and post-increment Z register. | |
void | in (uint8_t d, uint8_t A, struct CORE *core, union DATA_SPACE *data_space) |
Read from I/O space into register. | |
void | out (uint8_t A, uint8_t r, struct CORE *core, union DATA_SPACE *data_space) |
Write from register to I/O space. | |
void | push (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Push register onto stack. | |
void | pop (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Pop register from stack. | |
void | xch (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Exchange register with data space. | |
void | las (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load and set data space. | |
void | lac (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load and clear data space. | |
void | lat (uint8_t d, struct CORE *core, union DATA_SPACE *data_space) |
Load and toggle data space. | |
void in | ( | uint8_t | d, |
uint8_t | A, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Read from I/O space into register.
d | Destination register. |
A | I/O address. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 451 of file data_transfer.c.
References CORE::gp, inc_pc(), DATA_SPACE::io_reg, and GP::R.
void lac | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load and clear data space.
d | Register to load and clear. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 546 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void las | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load and set data space.
d | Register to load and set. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 527 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void lat | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load and toggle data space.
d | Register to load and toggle. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 565 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void ld_x | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using X register.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 61 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void ld_x_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using X register and pre-decrement.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 91 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void ld_x_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using X register and post-increment.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 75 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void ld_y | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using Y register.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 107 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void ld_y_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using Y register and pre-decrement.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 137 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void ld_y_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space using Y register and post-increment.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 121 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void ld_z | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space to register using Z pointer.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 167 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void ld_z_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space to register using Z pointer and pre-decrement.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 197 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void ld_z_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space to register using Z pointer and post-increment.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 181 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void ldd_y | ( | uint8_t | d, |
uint8_t | q, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space to register using Y pointer with displacement.
d | Destination register. |
q | Displacement value. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 153 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void ldd_z | ( | uint8_t | d, |
uint8_t | q, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load indirect from data space to register using Z pointer with displacement.
d | Destination register. |
q | Displacement value. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 213 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void ldi | ( | uint8_t | d, |
uint8_t | K, | ||
struct CORE * | core | ||
) |
Load immediate value K into register d.
d | Destination register. |
K | Immediate value. |
core | Pointer to the CORE structure. |
Definition at line 33 of file data_transfer.c.
void lds | ( | uint8_t | d, |
int16_t | k, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Load direct from data space using 16-bit address.
d | Destination register. |
k | 16-bit address in data space. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 47 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), and GP::R.
void lpm_0 | ( | struct CORE * | core, |
union PROGMEM_SPACE * | progmem_space | ||
) |
Load program memory into register using Z pointer.
core | Pointer to the CORE structure. |
progmem_space | Pointer to the PROGMEM_SPACE union. |
Definition at line 407 of file data_transfer.c.
References PROGMEM_SPACE::data, CORE::gp, inc_pc(), GP::R0, and GP::Z.
void lpm_z | ( | uint8_t | d, |
struct CORE * | core, | ||
union PROGMEM_SPACE * | progmem_space | ||
) |
Load program memory into register using Z pointer.
d | The register to load into. |
core | Pointer to the CORE structure. |
progmem_space | Pointer to the PROGMEM_SPACE union. |
Definition at line 421 of file data_transfer.c.
References PROGMEM_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void lpm_z_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union PROGMEM_SPACE * | progmem_space | ||
) |
Load program memory and post-increment Z register.
d | Destination register. |
core | Pointer to the CORE structure. |
progmem_space | Pointer to the PROGMEM_SPACE union. |
Definition at line 435 of file data_transfer.c.
References PROGMEM_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void mov | ( | uint8_t | d, |
uint8_t | r, | ||
struct CORE * | core | ||
) |
Move data from register r to register d.
d | Destination register. |
r | Source register. |
core | Pointer to the CORE structure. |
Definition at line 3 of file data_transfer.c.
void movw | ( | uint8_t | d, |
uint8_t | r, | ||
struct CORE * | core | ||
) |
Move word from register pair r to register pair d.
d | Destination register pair. |
r | Source register pair. |
core | Pointer to the CORE structure. |
Definition at line 17 of file data_transfer.c.
void out | ( | uint8_t | A, |
uint8_t | r, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Write from register to I/O space.
A | I/O address. |
r | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 465 of file data_transfer.c.
References CORE::gp, inc_pc(), DATA_SPACE::io_reg, and GP::R.
void pop | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Pop register from stack.
d | Destination register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 495 of file data_transfer.c.
References CORE::gp, inc_pc(), GP::R, CORE::SP, and DATA_SPACE::sram.
void push | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Push register onto stack.
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 479 of file data_transfer.c.
References CORE::gp, inc_pc(), GP::R, CORE::SP, and DATA_SPACE::sram.
void st_x | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store indirect from register to data space using X pointer.
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 241 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void st_x_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store indirect from register to data space using X pointer and pre-decrement.
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 271 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void st_x_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store indirect from register to data space using X pointer and post-increment.
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 255 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::X.
void st_y | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store indirect from register to data space using Y pointer.
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 287 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void st_y_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Y pointer and pre-decrement Y.
d | The register to store. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 317 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void st_y_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Y pointer and post-increment Y.
d | The register to store. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 301 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void st_z | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Z pointer.
d | The register to store. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 347 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void st_z_dec | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Z pointer and pre-decrement Z.
d | The register to store. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 377 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void st_z_inc | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Z pointer and post-increment Z.
d | The register to store. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 361 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void std_y | ( | uint8_t | d, |
uint8_t | q, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Y pointer with displacement.
d | The register to store. |
q | The displacement value. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 333 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Y.
void std_z | ( | uint8_t | d, |
uint8_t | q, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store register to data space using Z pointer with displacement.
d | The register to store. |
q | The displacement value. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 393 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.
void sts | ( | int16_t | k, |
uint8_t | d, | ||
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Store direct from register to data space.
k | Address in data space. |
d | Source register. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 227 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), and GP::R.
void xch | ( | uint8_t | d, |
struct CORE * | core, | ||
union DATA_SPACE * | data_space | ||
) |
Exchange register with data space.
d | Register to exchange. |
core | Pointer to the CORE structure. |
data_space | Pointer to the DATA_SPACE union. |
Definition at line 511 of file data_transfer.c.
References DATA_SPACE::data, CORE::gp, inc_pc(), GP::R, and GP::Z.