From 0ca1da81b138645060f2a8b8b71cb5c534d8d91e Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Tue, 14 Nov 2023 21:14:45 +0000 Subject: [PATCH] Assembly code: Fixed a bug where the compiler would print a null byte which was masked by the verilog simulators --- boot_code/brainfuck_compiler_v1.asm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/boot_code/brainfuck_compiler_v1.asm b/boot_code/brainfuck_compiler_v1.asm index 717cc56..791e4cf 100644 --- a/boot_code/brainfuck_compiler_v1.asm +++ b/boot_code/brainfuck_compiler_v1.asm @@ -31,10 +31,12 @@ mov bx,#compiling mov ah,#0x02 print2: mov dl,[bx] +cmp dl,#0 +je exit int #0x21 inc bx -cmp dl,#0 -jne print2 +jmp print2 +exit: MOV SI,#prog MOV DI,#output_program