Avr8bit-emulator
An emulator for the Atmel AVR 8-bit microcontroller
Loading...
Searching...
No Matches
branch.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 "sram.h"
17#include "data_space.h"
18#include "sreg_utils.h"
19#include "emulator.h"
20
27void rjmp(uint8_t k, struct CORE *core);
28
34void ijmp(struct CORE *core);
35
42void jmp(uint32_t k, struct CORE *core);
43
51void rcall(uint8_t k, struct CORE *core, struct SRAM *sram);
52
59void icall(struct CORE *core, struct SRAM *sram);
60
67void eicall(struct CORE *core, struct SRAM *sram);
68
75void ret(struct CORE *core, struct SRAM *sram);
76
83void reti(struct CORE *core, struct SRAM *sram);
84
92void cpse(uint8_t d, uint8_t r, struct CORE *core);
93
101void cp(uint8_t d, uint8_t r, struct CORE *core);
102
110void cpc(uint8_t d, uint8_t r, struct CORE *core);
111
119void cpi(uint8_t d, uint8_t K, struct CORE *core);
120
128void sbrc(uint8_t r, uint8_t b, struct CORE *core);
129
137void sbrs(uint8_t r, uint8_t b, struct CORE *core);
138
147void sbic(uint8_t A, uint8_t b, struct CORE *core, union DATA_SPACE *data_space);
148
157void sbis(uint8_t A, uint8_t b, struct CORE *core, union DATA_SPACE *data_space);
158
166void brbs(uint8_t s, uint8_t k, struct CORE *core);
167
175void brbc(uint8_t s, uint8_t k, struct CORE *core);
176
183void breq(uint8_t k, struct CORE *core);
184
191void brne(uint8_t k, struct CORE *core);
192
199void brcs(uint8_t k, struct CORE *core);
200
207void brcc(uint8_t k, struct CORE *core);
208
215void brsh(uint8_t k, struct CORE *core);
216
223void brlo(uint8_t k, struct CORE *core);
224
231void brmi(uint8_t k, struct CORE *core);
232
239void brpl(uint8_t k, struct CORE *core);
240
247void brge(uint8_t k, struct CORE *core);
248
255void brlt(uint8_t k, struct CORE *core);
256
263void brhs(uint8_t k, struct CORE *core);
264
271void brhc(uint8_t k, struct CORE *core);
272
279void brts(uint8_t k, struct CORE *core);
280
287void brtc(uint8_t k, struct CORE *core);
288
295void brvs(uint8_t k, struct CORE *core);
296
303void brvc(uint8_t k, struct CORE *core);
304
311void brie(uint8_t k, struct CORE *core);
312
319void brid(uint8_t k, struct CORE *core);
void brsh(uint8_t k, struct CORE *core)
Branch if same or higher.
Definition branch.c:332
void sbis(uint8_t A, uint8_t b, struct CORE *core, union DATA_SPACE *data_space)
Skip if bit in I/O register is set.
Definition branch.c:211
void brbs(uint8_t s, uint8_t k, struct CORE *core)
Branch if status flag is set.
Definition branch.c:230
void ret(struct CORE *core, struct SRAM *sram)
Return from a subroutine.
Definition branch.c:73
void brvc(uint8_t k, struct CORE *core)
Branch if overflow cleared.
Definition branch.c:519
void brbc(uint8_t s, uint8_t k, struct CORE *core)
Branch if status flag is cleared.
Definition branch.c:247
void breq(uint8_t k, struct CORE *core)
Branch if equal.
Definition branch.c:264
void brts(uint8_t k, struct CORE *core)
Branch if T flag set.
Definition branch.c:468
void brlt(uint8_t k, struct CORE *core)
Branch if less than.
Definition branch.c:417
void brie(uint8_t k, struct CORE *core)
Branch if interrupts enabled.
Definition branch.c:536
void brvs(uint8_t k, struct CORE *core)
Branch if overflow set.
Definition branch.c:502
void brhc(uint8_t k, struct CORE *core)
Branch if half carry cleared.
Definition branch.c:451
void jmp(uint32_t k, struct CORE *core)
Perform an absolute jump.
Definition branch.c:27
void brge(uint8_t k, struct CORE *core)
Branch if greater or equal.
Definition branch.c:400
void brid(uint8_t k, struct CORE *core)
Branch if interrupts disabled.
Definition branch.c:553
void brtc(uint8_t k, struct CORE *core)
Branch if T flag cleared.
Definition branch.c:485
void brlo(uint8_t k, struct CORE *core)
Branch if lower.
Definition branch.c:349
void brne(uint8_t k, struct CORE *core)
Branch if not equal.
Definition branch.c:281
void brcc(uint8_t k, struct CORE *core)
Branch if carry cleared.
Definition branch.c:315
void cpc(uint8_t d, uint8_t r, struct CORE *core)
Compare two registers with carry.
Definition branch.c:132
void brcs(uint8_t k, struct CORE *core)
Branch if carry set.
Definition branch.c:298
void eicall(struct CORE *core, struct SRAM *sram)
Perform an extended indirect call to a subroutine.
void reti(struct CORE *core, struct SRAM *sram)
Return from an interrupt.
Definition branch.c:87
void cp(uint8_t d, uint8_t r, struct CORE *core)
Compare two registers.
Definition branch.c:120
void icall(struct CORE *core, struct SRAM *sram)
Perform an indirect call to a subroutine.
Definition branch.c:54
void cpse(uint8_t d, uint8_t r, struct CORE *core)
Compare and skip if equal.
Definition branch.c:102
void cpi(uint8_t d, uint8_t K, struct CORE *core)
Compare register with an immediate value.
Definition branch.c:144
void brpl(uint8_t k, struct CORE *core)
Branch if plus.
Definition branch.c:383
void brhs(uint8_t k, struct CORE *core)
Branch if half carry set.
Definition branch.c:434
void sbrc(uint8_t r, uint8_t b, struct CORE *core)
Skip if bit in register is cleared.
Definition branch.c:156
void rjmp(uint8_t k, struct CORE *core)
Perform a relative jump.
Definition branch.c:3
void sbrs(uint8_t r, uint8_t b, struct CORE *core)
Skip if bit in register is set.
Definition branch.c:174
void sbic(uint8_t A, uint8_t b, struct CORE *core, union DATA_SPACE *data_space)
Skip if bit in I/O register is cleared.
Definition branch.c:192
void brmi(uint8_t k, struct CORE *core)
Branch if minus.
Definition branch.c:366
void ijmp(struct CORE *core)
Perform an indirect jump.
Definition branch.c:15
void rcall(uint8_t k, struct CORE *core, struct SRAM *sram)
Perform a relative call to a subroutine.
Definition branch.c:39
Functions for manipulating the Status Register (SREG)
Core structure containing general purpose registers, program counter, stack pointer,...
Definition core.h:67
Definition sram.h:7
Represents the data space in the AVR emulator.
Definition data_space.h:13