8080-Emulator  0.1
An Intel 8080 emulator for Space Invaders
Classes | Functions
memory_8080.h File Reference

Memory abstraction for 8080 cpu. More...

#include <inttypes.h>
Include dependency graph for memory_8080.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  v_memory
 Memory wrapper. More...
 

Functions

void * mem_ref (v_memory *mem, uint16_t offset)
 plain reference to the memory location More...
 
uint8_t mem_read (v_memory *mem, uint16_t offset)
 Lowest level memory read access abstraction. Typecasts the offset to void* + base to get the actual pointer. Return the value. More...
 
uint16_t short_mem_read (v_memory *mem, uint16_t offset)
 Wrapper over memory access primitives to read a byte off the base offset void* + base. Returns the value. More...
 
void mem_write (v_memory *mem, uint16_t offset, uint8_t val)
 Lowest level memory write access abstraction. Typecasts the offset to void* + base to get the actual pointer. Populates from val into the memory. More...
 
void short_mem_write (v_memory *mem, uint16_t offset, uint16_t val)
 Wrapper over memory access primitives to read a byte off the base offset void* + base. Populates from val into the memory. More...
 

Detailed Description

Memory abstraction for 8080 cpu.

Author
Pranay Garg (prana.nosp@m.yga@.nosp@m.andre.nosp@m.w.cm.nosp@m.u.edu)
Version
0.1
Date
2020-12-24

Function Documentation

◆ mem_read()

uint8_t mem_read ( v_memory mem,
uint16_t  offset 
)

Lowest level memory read access abstraction. Typecasts the offset to void* + base to get the actual pointer. Return the value.

Parameters
offsetfrom the base ptr in bytes
memcpu's memeory context under exec
Returns
uint8_t, byte read from the memory

◆ mem_ref()

void* mem_ref ( v_memory mem,
uint16_t  offset 
)

plain reference to the memory location

Parameters
offsetfrom the base ptr in bytes
memcpu's memeory context under exec
Returns
void*, memory reference to the target location

◆ mem_write()

void mem_write ( v_memory mem,
uint16_t  offset,
uint8_t  val 
)

Lowest level memory write access abstraction. Typecasts the offset to void* + base to get the actual pointer. Populates from val into the memory.

Parameters
offsetfrom the base ptr in bytes
valto write onto memory
memcpu's memeory context under exec

◆ short_mem_read()

uint16_t short_mem_read ( v_memory mem,
uint16_t  offset 
)

Wrapper over memory access primitives to read a byte off the base offset void* + base. Returns the value.

Parameters
offsetfrom the base ptr in bytes
memcpu's memeory context under exec
Returns
uint16_t, short read from the memory

◆ short_mem_write()

void short_mem_write ( v_memory mem,
uint16_t  offset,
uint16_t  val 
)

Wrapper over memory access primitives to read a byte off the base offset void* + base. Populates from val into the memory.

Parameters
offsetfrom the base ptr in bytes
valto write onto memory
memcpu's memeory context under exec