Memory abstraction for 8080 cpu.
More...
#include <inttypes.h>
Go to the source code of this file.
|
| 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...
|
| |
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
◆ 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
-
| offset | from the base ptr in bytes |
| mem | cpu'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
-
| offset | from the base ptr in bytes |
| mem | cpu'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
-
| offset | from the base ptr in bytes |
| val | to write onto memory |
| mem | cpu'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
-
| offset | from the base ptr in bytes |
| mem | cpu'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
-
| offset | from the base ptr in bytes |
| val | to write onto memory |
| mem | cpu's memeory context under exec |