//
// Created by bruno on 2.2.2025.
//

#ifndef RISCB_MEMORY_H
#define RISCB_MEMORY_H

#include <stdint.h>
#include "../cpu/core.h"
#include "../peripherals/peripheraldata.h"

uint8_t write_mem32(CPU *cpu, uint32_t addr, uint32_t value);

uint8_t write_mem16(CPU *cpu, uint32_t addr, uint16_t value);

uint32_t read_mem32(CPU *cpu, uint32_t addr);

uint32_t read_address_argument(CPU *cpu);

void read_stack(CPU *cpu);

void write_stack(CPU *cpu);

uint8_t read_reg_number(CPU *cpu);

uint8_t read_reg(CPU *cpu, uint8_t number);

uint8_t write_reg(CPU *cpu, uint8_t number, uint8_t value);

uint16_t read_mem16(CPU *cpu, uint32_t addr);

uint8_t read_mem(CPU *cpu, uint32_t addr);

uint8_t write_mem(CPU *cpu, uint32_t addr, uint8_t value);

uint8_t read_register_argument(CPU *cpu);


#endif //RISCB_MEMORY_H
