aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/data.s46
-rw-r--r--include/main_exit.s3
2 files changed, 7 insertions, 42 deletions
diff --git a/include/data.s b/include/data.s
index c3f113f..452018e 100644
--- a/include/data.s
+++ b/include/data.s
@@ -81,48 +81,10 @@ BLE_info_table:
cell 0
BLE_code:
# if we hit this, we've got a pure loop in a program, and it is never
- # going to actually progress. So let's just shoot it down with a
- # helpful message or so.
- mov 010(%rbp), %r15
-
- mov $1, %rdi #stdout
-
- mov $14, %rdx
- mov $BLE_msg, %rsi
- mov $1, %rax #write
- syscall
-
- mov $1, %rdx
- BLE_loop:
- mov %r15, %rcx
- and $0xf, %rcx
- mov $BLE_hex, %rsi
- add %rcx, %rsi
- mov $1, %rax
- syscall
- shr $4, %r15
- jnz BLE_loop
-
- mov $BLE_nl, %rsi
- mov $1, %rax
- syscall
-
- # shot self down (and retry if it doesn't succeed)
- BLE_retry_sigkill:
- mov $39, %rax
- syscall # getpid
- mov %rax, %rdi
- mov $6, %rsi # SIGABRT
- mov $62, %rax # kill
- syscall
- jmp BLE_retry_sigkill
-
-BLE_msg:
- .ascii "diverged at 0x"
-BLE_hex:
- .ascii "0123456789abcdef"
-BLE_nl:
- .ascii "\n"
+ # going to actually progress. So let's just shoot it down.
+ mov 0, %rax
+ jmp BLE_code
+ # this might eventually generate an actual IO-style exception or something.
# List
# | ptr | 0 | # [] case
diff --git a/include/main_exit.s b/include/main_exit.s
index 5ce6c76..3982e32 100644
--- a/include/main_exit.s
+++ b/include/main_exit.s
@@ -6,5 +6,8 @@ _main_exit_s_file:
mov 010(%rsi), %rdi # result INT goes to syscall exitcode
mov $60, %rax # exit=60
syscall # exit %rdi
+ # syscall might also die; at that point let's die more elaborately
+ mov 0, %rax
+ jmp main_exit
.endif # _main_exit_s_file