202607291656
This commit is contained in:
1 parent
564c90479c
commit
e2091dbd78
3 files changed
+8
-8
No files matched your search
@@ -8,10 +8,10 @@
|
|||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
using r8asm_label = uint32_t;
|
using r8asm_label = uint32_t;
|
||||||
using r8asm_cell_size = uint8_t;
|
using r8asm_cell = uint8_t;
|
||||||
using r8asm_cell_offset = int32_t;
|
using r8asm_cell_offset = int32_t;
|
||||||
using r8asm_mem_size = uint32_t;
|
using r8asm_mem = uint32_t;
|
||||||
using r8asm_argc = r8asm_mem_size;
|
using r8asm_argc = r8asm_mem;
|
||||||
|
|
||||||
using r8asm_data = int32_t;
|
using r8asm_data = int32_t;
|
||||||
|
|
||||||
@@ -63,11 +63,11 @@ struct R8Instruction {
|
|||||||
extern std::map<std::string, r8asm_label>
|
extern std::map<std::string, r8asm_label>
|
||||||
r8asm_labelmap; // TODO:sections support
|
r8asm_labelmap; // TODO:sections support
|
||||||
extern std::map<std::string, r8asm_data> r8asm_datamap;
|
extern std::map<std::string, r8asm_data> r8asm_datamap;
|
||||||
extern r8asm_mem_size rot8_dataptr;
|
extern r8asm_mem rot8_dataptr;
|
||||||
|
|
||||||
extern std::map<std::string, R8MetaOp> r8asm_insmap;
|
extern std::map<std::string, R8MetaOp> r8asm_insmap;
|
||||||
|
|
||||||
extern r8asm_cell_size CELL_SIZE;
|
extern r8asm_cell CELL_SIZE;
|
||||||
#define CELL_MAX (((uint64_t)1 << CELL_SIZE) - 1)
|
#define CELL_MAX (((uint64_t)1 << CELL_SIZE) - 1)
|
||||||
#define ROL_STEP (CELL_SIZE - 1)
|
#define ROL_STEP (CELL_SIZE - 1)
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ r8asm_data read_opr(R8Operand arg,
|
|||||||
void expand_xor(std::vector<rot8_bytecode> &tape, R8Operand arg) {
|
void expand_xor(std::vector<rot8_bytecode> &tape, R8Operand arg) {
|
||||||
r8asm_data real_arg = read_opr(arg);
|
r8asm_data real_arg = read_opr(arg);
|
||||||
|
|
||||||
for (r8asm_cell_size i = 0; i < CELL_SIZE; i++) {
|
for (r8asm_cell i = 0; i < CELL_SIZE; i++) {
|
||||||
if ((real_arg & 1) == 1)
|
if ((real_arg & 1) == 1)
|
||||||
tape.push_back(rot8_bytecode::FLB);
|
tape.push_back(rot8_bytecode::FLB);
|
||||||
tape.push_back(rot8_bytecode::ROR);
|
tape.push_back(rot8_bytecode::ROR);
|
||||||
|
|||||||
+2
-2
@@ -1,6 +1,6 @@
|
|||||||
#include "r8asm/r8asm_core.hh"
|
#include "r8asm/r8asm_core.hh"
|
||||||
r8asm_cell_size CELL_SIZE = DEFAULT_CELL_SIZE;
|
r8asm_cell CELL_SIZE = DEFAULT_CELL_SIZE;
|
||||||
r8asm_mem_size rot8_dataptr = 0;
|
r8asm_mem rot8_dataptr = 0;
|
||||||
|
|
||||||
std::map<std::string, r8asm_label> r8asm_labelmap = {{std::string("main"), 0}};
|
std::map<std::string, r8asm_label> r8asm_labelmap = {{std::string("main"), 0}};
|
||||||
std::map<std::string, r8asm_data> r8asm_datamap = {
|
std::map<std::string, r8asm_data> r8asm_datamap = {
|
||||||
|
|||||||
Reference in new issue
Block a user