Divise le classi, boilerplate
This commit is contained in:
parent
bea0edfd10
commit
a0cd944080
22
cpp/vmas.cpp
Normal file
22
cpp/vmas.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include "vmas.h"
|
||||||
|
#include "debug.h"
|
||||||
|
|
||||||
|
void VMAddrSpace::insCode(uint8_t * buf, uint8_t size) {
|
||||||
|
DBG_INFO(("Copying buffer into code section.\n"));
|
||||||
|
memcpy(&this->code, buf, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VMAddrSpace::insStack(uint8_t * buf, uint8_t size) {
|
||||||
|
DBG_INFO(("Copying buffer into code section.\n"));
|
||||||
|
memcpy(&this->stack, buf, size);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void VMAddrSpace::insData(uint8_t * buf, uint8_t size) {
|
||||||
|
DBG_INFO(("Copying buffer into data section.\n"));
|
||||||
|
memcpy(&this->data, buf, size);
|
||||||
|
return;
|
||||||
|
}
|
14
cpp/vmas.h
Normal file
14
cpp/vmas.h
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef VMAS_H
|
||||||
|
#define VMAS_H
|
||||||
|
|
||||||
|
class VMAddrSpace {
|
||||||
|
uint8_t stack[0x100], code[0x300], data[0x500];
|
||||||
|
|
||||||
|
public:
|
||||||
|
void assemble(void);
|
||||||
|
void insStack(uint8_t *buf, uint8_t size);
|
||||||
|
void insCode(uint8_t *buf, uint8_t size);
|
||||||
|
void insData(uint8_t *buf, uint8_t size);
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user