PZ80emu  0.1
Functions
stack.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include "z80.h"
Include dependency graph for stack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

__BEGIN_DECLS void _ret_flag (struct z80 *, uint8_t *, int, bool)
 returns from a call based on state of CPU flag More...
 
void _ret (struct z80 *, uint8_t *)
 return from a call More...
 
void _pop (word *, struct z80 *, uint8_t *)
 pop a value off the stack into a register More...
 
void _call_flag_nn (struct z80 *, uint8_t *, int, bool)
 make a function call based on status of CPU flags More...
 
void _call_nn (struct z80 *, uint8_t *)
 calls the function at memory address NN More...
 
void _push (word *, struct z80 *, uint8_t *)
 pushes the value of a register to the stack More...
 
void _rst (struct z80 *, uint8_t *, uint16_t)
 saves PC to the stack, then sets a new PC More...
 

Detailed Description

Author
Peter H. Ezetta

Function Documentation

◆ _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

Parameters
cpuz80 CPU object
memorypointer to allocated memory block
flagCPU flag to check before calling function
nstate of checked flag

◆ _call_nn()

void _call_nn ( struct z80 cpu,
uint8_t *  memory 
)

calls the function at memory address NN

Parameters
cpuz80 CPU object
memorypointer to allocated memory block

◆ _pop()

void _pop ( word reg,
struct z80 cpu,
uint8_t *  memory 
)

pop a value off the stack into a register

Parameters
regregister to pop value from stack into
cpuz80 CPU object
memorypointer to allocated memory block

◆ _push()

void _push ( word reg,
struct z80 cpu,
uint8_t *  memory 
)

pushes the value of a register to the stack

Parameters
regregister to push
cpuz80 CPU object
memorypointer to allocated memory

◆ _ret()

void _ret ( struct z80 cpu,
uint8_t *  memory 
)

return from a call

Parameters
cpuz80 CPU object
memorypointer to allocated memory block

◆ _ret_flag()

__BEGIN_DECLS void _ret_flag ( struct z80 cpu,
uint8_t *  memory,
int  flag,
bool  n 
)

returns from a call based on state of CPU flag

Parameters
cpuz80 CPU object
memorypointer to allocated memory block
flagCPU flag to check for condition
nstate of CPU flag

◆ _rst()

void _rst ( struct z80 cpu,
uint8_t *  memory,
uint16_t  pc 
)

saves PC to the stack, then sets a new PC

Parameters
cpuz80 CPU object
memorypointer to allocated memory
pcnew memory address to place in PC