aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bf.s6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bf.s b/src/bf.s
index 2d904e6..b989afa 100644
--- a/src/bf.s
+++ b/src/bf.s
@@ -14,7 +14,8 @@ default rel
%define SYS_exit 0x3c
section .rodata
- max_codesize equ 32768 ; must be an integral multiple of the page size
+ ; max_codesize must be an integral multiple of the page size
+ max_codesize equ 528 * 4096
error_input_str db "usage: bf file.b", 0x0a
error_input_str_len equ $ - error_input_str
error_open_failed db "bf: failed to open file", 0x0a
@@ -57,7 +58,7 @@ _start:
mov rdx, 0x1 ; prot = PROT_READ
mov rsi, max_codesize ; length
xor rdi, rdi ; addr = 0
- mov rax, SYS_mmap ; no munmap because rbp is used until exit
+ mov rax, SYS_mmap ; no munmap because the file is used until exit
syscall
mov rbp, rax ; rbp = instructions
@@ -69,6 +70,7 @@ _start:
.main_loop:
; switch [instruction]
+ ; TODO: use a jump table instead
.case1:
cmp bl, '>'