PZ80emu  0.1
stack.h
Go to the documentation of this file.
1 
6 #ifndef __PZ80EMU_STACK__
7 #define __PZ80EMU_STACK__
8 
9 #include <stdbool.h>
10 #include <stdint.h>
11 
12 #include "z80.h"
13 
14 __BEGIN_DECLS
15 void _ret_flag(struct z80 *, uint8_t *, int, bool);
16 void _ret(struct z80 *, uint8_t *);
17 void _pop(word *, struct z80 *, uint8_t *);
18 void _call_flag_nn(struct z80 *, uint8_t *, int, bool);
19 void _call_nn(struct z80 *, uint8_t *);
20 void _push(word *, struct z80 *, uint8_t *);
21 void _rst(struct z80 *, uint8_t *, uint16_t);
22 __END_DECLS
23 
24 #endif
z80::sp
word sp
Definition: z80.h:65
memory
z80 memory class
Definition: memory.h:19
z80::pc
word pc
Definition: z80.h:53
_ret
void _ret(struct z80 *cpu, uint8_t *memory)
return from a call
Definition: stack.c:50
_push
void _push(word *reg, struct z80 *cpu, uint8_t *memory)
pushes the value of a register to the stack
Definition: stack.c:138
_call_nn
void _call_nn(struct z80 *, uint8_t *)
calls the function at memory address NN
Definition: stack.c:117
_call_nn
void _call_nn(struct z80 *cpu, uint8_t *memory)
calls the function at memory address NN
Definition: stack.c:117
_rst
void _rst(struct z80 *, uint8_t *, uint16_t)
saves PC to the stack, then sets a new PC
Definition: stack.c:153
_push
void _push(word *, struct z80 *, uint8_t *)
pushes the value of a register to the stack
Definition: stack.c:138
_ret
void _ret(struct z80 *, uint8_t *)
return from a call
Definition: stack.c:50
z80
Definition: z80.h:51
utils.h
Utility macros.
_ret_flag
void _ret_flag(struct z80 *cpu, uint8_t *memory, int flag, bool n)
returns from a call based on state of CPU flag
Definition: stack.c:17
z80.h
z80 CPU data structure and functions
word::l
uint8_t l
low order byte
Definition: z80.h:31
word::h
uint8_t h
high order byte
Definition: z80.h:32
word::B
struct word::@0 B
Combination of High and Low bytes in correct order for endianness.
_pop
void _pop(word *, struct z80 *, uint8_t *)
pop a value off the stack into a register
Definition: stack.c:69
_call_flag_nn
void _call_flag_nn(struct z80 *, uint8_t *, int, bool)
make a function call based on status of CPU flags
Definition: stack.c:85
_pop
void _pop(word *reg, struct z80 *cpu, uint8_t *memory)
pop a value off the stack into a register
Definition: stack.c:69
_rst
void _rst(struct z80 *cpu, uint8_t *memory, uint16_t pc)
saves PC to the stack, then sets a new PC
Definition: stack.c:153
z80::af
word af
Definition: z80.h:54
_ret_flag
__BEGIN_DECLS void _ret_flag(struct z80 *, uint8_t *, int, bool)
returns from a call based on state of CPU flag
Definition: stack.c:17
word::W
uint16_t W
16-bit pair
Definition: z80.h:22
_call_flag_nn
void _call_flag_nn(struct z80 *cpu, uint8_t *memory, int flag, bool n)
make a function call based on status of CPU flags
Definition: stack.c:85
word
type to deal with endianness and access of high/low bits
Definition: z80.h:21
IS_SET
#define IS_SET(val, bit)
Determines if a bit is set or not.
Definition: utils.h:17
stack.h