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