more changes
This commit is contained in:
parent
b5ff47346c
commit
f177471663
@ -14,6 +14,8 @@ add_executable(r16a
|
|||||||
./asm/assembler.c
|
./asm/assembler.c
|
||||||
./asm/assembler.h
|
./asm/assembler.h
|
||||||
./asm/asm_const.h
|
./asm/asm_const.h
|
||||||
|
./emu/cpu_const.h
|
||||||
|
./emu/cpu_human.h
|
||||||
)
|
)
|
||||||
|
|
||||||
add_executable(r16e
|
add_executable(r16e
|
||||||
|
@ -207,7 +207,7 @@ uint16_t *BinaryInstructionToBin(BinaryInstruction instruction)
|
|||||||
return bin;
|
return bin;
|
||||||
}
|
}
|
||||||
|
|
||||||
int WhereIn2DCharArray(int x, char **array, char *val)
|
int WhereIn2DCharArray(int x, int y, char array[25][4], char* val)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < x; i++)
|
for (int i = 0; i < x; i++)
|
||||||
{
|
{
|
||||||
@ -333,6 +333,7 @@ uint16_t *CompileAsembly(AsmInstructionArray *assembly, AsmLabelArray *labels)
|
|||||||
BinaryInstruction binaryIns;
|
BinaryInstruction binaryIns;
|
||||||
|
|
||||||
int instruction = WhereIn2DCharArray(LEN(CpuInstructionsHumanReadable),
|
int instruction = WhereIn2DCharArray(LEN(CpuInstructionsHumanReadable),
|
||||||
|
LEN(CpuInstructionsHumanReadable[0]),
|
||||||
CpuInstructionsHumanReadable,
|
CpuInstructionsHumanReadable,
|
||||||
assembly->instruction[i].instruction);
|
assembly->instruction[i].instruction);
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
const char demo[] =
|
const char demo[] =
|
||||||
"mov R0, 1\n\
|
"mov R0, 0x1\n\
|
||||||
mov ACU, 0\n\
|
mov ACU, 0x0\n\
|
||||||
loop: add ACU, R0\n\
|
loop: add ACU, R0\n\
|
||||||
out ACU\n\
|
out ACU, 0x0\n\
|
||||||
jmp loop\n";
|
jmp loop, 0x0\n";
|
||||||
|
|
||||||
int main(int argc, char **argv)
|
int main(int argc, char **argv)
|
||||||
{
|
{
|
||||||
|
@ -47,6 +47,7 @@ char CpuInstructionsHumanReadable[25][4] =
|
|||||||
"OUT",
|
"OUT",
|
||||||
"DIN",
|
"DIN",
|
||||||
"DOT",
|
"DOT",
|
||||||
"MOV"};
|
"MOV"
|
||||||
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue
Block a user