Added stuff. Fixed bug.
Data Pointer value now properly displayed in debug mode. Added conditional calls to match conditional branches.
This commit is contained in:
@@ -29,9 +29,13 @@ Instruction instruction_set[] = {
|
||||
{0x11, "BRQ"},
|
||||
{0x12, "BRA"},
|
||||
{0x13, "BRB"},
|
||||
{0x14, "CALL"},
|
||||
{0x15, "RET"},
|
||||
{0x16, "BRC"},
|
||||
{0x14, "BRC"},
|
||||
{0x17, "CALL"},
|
||||
{0x18, "CALLA"},
|
||||
{0x19, "CALLB"},
|
||||
{0x1A, "CALLQ"},
|
||||
{0x1B, "CALLCF"},
|
||||
{0x1F, "RET"},
|
||||
// Register Operations:
|
||||
{0x20, "RSTA"},
|
||||
{0x21, "RSTB"},
|
||||
|
||||
@@ -112,7 +112,7 @@ void populateOutputBuffers(intermediateElement *intermediateArray, int arraySize
|
||||
Program[(*programCount)++] = intermediateArray[i].byteValue;
|
||||
|
||||
// Check if it's a branch instruction.
|
||||
if (((intermediateArray[i].byteValue & 0xF0) == 0x10) && (intermediateArray[i].byteValue != 0x15)){
|
||||
if (((intermediateArray[i].byteValue & 0xF0) == 0x10) && (intermediateArray[i].byteValue != 0x1F)){
|
||||
if (intermediateArray[i + 1].type != LABEL) {
|
||||
fprintf(stderr, RED "Error: Branch without label.\n" RESET);
|
||||
printf("File: %s at line %d.\n", intermediateArray[i].fileName, intermediateArray[i].lineNumber);
|
||||
|
||||
Reference in New Issue
Block a user