PZ80emu  0.1
Functions
stack.c File Reference
#include "stack.h"
#include "utils.h"
Include dependency graph for stack.c:

Functions

void _ret_flag (struct z80 *cpu, uint8_t *memory, int flag, bool n)
 returns from a call based on state of CPU flag More...
 
void _ret (struct z80 *cpu, uint8_t *memory)
 return from a call More...
 
void _pop (word *reg, struct z80 *cpu, uint8_t *memory)
 pop a value off the stack into a register More...
 
void _call_flag_nn (struct z80 *cpu, uint8_t *memory, int flag, bool n)
 make a function call based on status of CPU flags More...
 
void _call_nn (struct z80 *cpu, uint8_t *memory)
 calls the function at memory address NN More...
 
void _push (word *reg, struct z80 *cpu, uint8_t *memory)
 pushes the value of a register to the stack More...
 
void _rst (struct z80 *cpu, uint8_t *memory, uint16_t pc)
 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()

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