CALL and RET instructions.

Changed PSHP and POPP into CALL and RET, streamlining their use for subroutine calls.
Updated Assembler and Emulator.
New demonstration programs.
This commit is contained in:
Anachronaut
2024-10-27 19:18:54 -04:00
committed by GitHub
parent 78f827e9dc
commit 992e44ca12
7 changed files with 152 additions and 54 deletions
+2 -2
View File
@@ -112,9 +112,9 @@ void populateOutputBuffers(intermediateElement *intermediateArray, int arraySize
Program[(*programCount)++] = intermediateArray[i].byteValue;
// Check if it's a branch instruction.
if ((intermediateArray[i].byteValue & 0xF0) == 0x10) {
if (((intermediateArray[i].byteValue & 0xF0) == 0x10) && (intermediateArray[i].byteValue != 0x15)){
if (intermediateArray[i + 1].type != LABEL) {
fprintf(stderr, "Error: Branch without label.\n");
fprintf(stderr, RED "Error: Branch without label.\n" RESET);
printf("File: %s at line %d.\n", intermediateArray[i].fileName, intermediateArray[i].lineNumber);
exit(1);
}