diff --git a/src/assemble.c b/src/assemble.c index ef1b06d..0a8687d 100755 --- a/src/assemble.c +++ b/src/assemble.c @@ -19,7 +19,7 @@ int main(int argc, char **argv) { // Parse the source file a64inst_instruction *instructions = parse(source, lineCount); - + // First Pass: Create the symbol table st *table = firstPass(instructions, lineCount); diff --git a/src/parser.h b/src/parser.h index 2d7f382..81885af 100644 --- a/src/parser.h +++ b/src/parser.h @@ -1,6 +1,6 @@ #include "a64instruction/a64instruction.h" #define OPERAND_DELIMITER ", " -#define HALT_ASM_CMD "and x0, x0, x0" +#define HALT_ASM_CMD "and x0, x0, x0\n" a64inst_instruction *parse(char **asmLines, int lineCount); diff --git a/src/twopassassembly.c b/src/twopassassembly.c index 36942b4..34e379d 100644 --- a/src/twopassassembly.c +++ b/src/twopassassembly.c @@ -4,6 +4,8 @@ #include #include +#define HALT_BINARY 2315255808 + // Generates assembled code based on the two-pass assembly method word assembleBranch(a64inst_instruction *instr) { @@ -209,7 +211,7 @@ word *secondPass(a64inst_instruction instrs[], int numInstrs, st* table) { index++; break; case a64inst_HALT: - arr[index] = 69U * (1 << 25); + arr[index] = HALT_BINARY; index++; break; case a64inst_LABEL: