Avr8bit-emulator
An emulator for the Atmel AVR 8-bit microcontroller
Loading...
Searching...
No Matches
arithm_logic.h
Go to the documentation of this file.
1
11#pragma once
12#include <stdint.h>
13#include <stdbool.h>
14
15#include "core.h"
16#include "sreg_utils.h"
17
24void add(uint8_t d, uint8_t r, struct CORE *core);
25
33void adc(uint8_t d, uint8_t r, struct CORE *core);
34
42void adiw(uint8_t d, uint8_t K, struct CORE *core);
43
51void sub(uint8_t d, uint8_t r, struct CORE *core);
52
60void subi(uint8_t d, uint8_t K, struct CORE *core);
61
69void sbc(uint8_t d, uint8_t r, struct CORE *core);
70
78void sbci(uint8_t d, uint8_t K, struct CORE *core);
79
87void sbiw(uint8_t d, uint8_t K, struct CORE *core);
88
96void and(uint8_t d, uint8_t r, struct CORE *core);
97
105void andi(uint8_t d, uint8_t K, struct CORE *core);
106
114void or(uint8_t d, uint8_t r, struct CORE *core);
115
123void ori(uint8_t d, uint8_t K, struct CORE *core);
124
132void eor(uint8_t d, uint8_t r, struct CORE *core);
133
140void com(uint8_t d, struct CORE *core);
141
148void neg(uint8_t d, struct CORE *core);
149
157void sbr(uint8_t d, uint8_t K, struct CORE *core);
158
166void cbr(uint8_t d, uint8_t K, struct CORE *core);
167
174void inc(uint8_t d, struct CORE *core);
175
182void dec(uint8_t d, struct CORE *core);
183
190void tst(uint8_t d, struct CORE *core);
191
198void clr(uint8_t d, struct CORE *core);
199
206void ser(uint8_t d, struct CORE *core);
214void mul(uint8_t d, uint8_t r, struct CORE *core);
215
223void muls(uint8_t d, uint8_t r, struct CORE *core);
224
232void mulsu(uint8_t d, uint8_t r, struct CORE *core);
233
241void fmul(uint8_t d, uint8_t r, struct CORE *core);
242
250void fmuls(uint8_t d, uint8_t r, struct CORE *core);
251
259void fmulsu(uint8_t d, uint8_t r, struct CORE *core);
void mul(uint8_t d, uint8_t r, struct CORE *core)
Multiplies two unsigned 8-bit integers and stores the result in the CORE structure.
void adc(uint8_t d, uint8_t r, struct CORE *core)
Add with carry.
void subi(uint8_t d, uint8_t K, struct CORE *core)
Subtract immediate.
void sub(uint8_t d, uint8_t r, struct CORE *core)
Subtract.
void tst(uint8_t d, struct CORE *core)
Test for zero or minus after AND operation.
void inc(uint8_t d, struct CORE *core)
Increment the value of a register.
void add(uint8_t d, uint8_t r, struct CORE *core)
Add without carry.
Definition arithm_logic.c:3
void ser(uint8_t d, struct CORE *core)
Set all bits in a register.
void fmul(uint8_t d, uint8_t r, struct CORE *core)
Multiplies two unsigned 8-bit integers with fractional representation and stores the result in the CO...
void dec(uint8_t d, struct CORE *core)
Decrement the value of a register.
void muls(uint8_t d, uint8_t r, struct CORE *core)
Multiplies two signed 8-bit integers and stores the result in the CORE structure.
void andi(uint8_t d, uint8_t K, struct CORE *core)
Logical AND with immediate.
void eor(uint8_t d, uint8_t r, struct CORE *core)
Perform bitwise exclusive OR between two registers.
void sbr(uint8_t d, uint8_t K, struct CORE *core)
Set bits in a register.
void clr(uint8_t d, struct CORE *core)
Clear a register (set to zero).
void ori(uint8_t d, uint8_t K, struct CORE *core)
Logical OR with immediate.
void sbci(uint8_t d, uint8_t K, struct CORE *core)
Subtract immediate with carry.
void mulsu(uint8_t d, uint8_t r, struct CORE *core)
Multiplies a signed 8-bit integer with an unsigned 8-bit integer and stores the result in the CORE st...
void fmulsu(uint8_t d, uint8_t r, struct CORE *core)
Multiplies a signed 8-bit integer with an unsigned 8-bit integer with fractional representation and s...
void or(uint8_t d, uint8_t r, struct CORE *core)
Logical OR.
void cbr(uint8_t d, uint8_t K, struct CORE *core)
Clear bits in a register.
void com(uint8_t d, struct CORE *core)
Perform one's complement on a register.
void fmuls(uint8_t d, uint8_t r, struct CORE *core)
Multiplies two signed 8-bit integers with fractional representation and stores the result in the CORE...
void and(uint8_t d, uint8_t r, struct CORE *core)
Logical AND.
void neg(uint8_t d, struct CORE *core)
Perform two's complement (negation) on a register.
void adiw(uint8_t d, uint8_t K, struct CORE *core)
Add immediate to word.
void sbc(uint8_t d, uint8_t r, struct CORE *core)
Subtract with carry.
void sbiw(uint8_t d, uint8_t K, struct CORE *core)
Subtract immediate from word.
Functions for manipulating the Status Register (SREG)
Core structure containing general purpose registers, program counter, stack pointer,...
Definition core.h:67