From e99038ea514a8703b170689d5a0730c8d2e542e7 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 18 Feb 2019 22:43:01 -0800 Subject: 4982 --- html/subx/063error.subx.html | 93 ++++++++++++++++++++------------------------ 1 file changed, 43 insertions(+), 50 deletions(-) (limited to 'html/subx/063error.subx.html') diff --git a/html/subx/063error.subx.html b/html/subx/063error.subx.html index df3cc424..96fd3c44 100644 --- a/html/subx/063error.subx.html +++ b/html/subx/063error.subx.html @@ -64,56 +64,49 @@ if ('onhashchange' in window) { 5 # . op subop mod rm32 base index scale r32 6 # . 1-3 bytes 3 bits 2 bits 3 bits 3 bits 3 bits 2 bits 2 bits 0/1/2/4 bytes 0/1/2/4 bytes 7 - 8 # main: - 9 e8/call run-tests/disp32 # 'run-tests' is a function created automatically by SubX. It calls all functions that start with 'test-'. -10 # syscall(exit, Num-test-failures) -11 8b/copy 0/mod/indirect 5/rm32/.disp32 . . 3/r32/EBX Num-test-failures/disp32 # copy *Num-test-failures to EBX -12 b8/copy-to-EAX 1/imm32/exit -13 cd/syscall 0x80/imm8 -14 -15 # write(out, "Error: "+msg+"\n") then stop(ed, 1) -16 error: # ed : (address exit-descriptor), out : fd or (address stream), msg : (address array byte) -> <void> -17 # . prolog -18 55/push-EBP -19 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP -20 # write(out, "Error: ") -21 # . . push args -22 68/push "Error: "/imm32 -23 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) -24 # . . call -25 e8/call write/disp32 -26 # . . discard args -27 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -28 # write(out, msg) -29 # . . push args -30 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16) -31 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) -32 # . . call -33 e8/call write/disp32 -34 # . . discard args -35 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -36 # write(out, Newline) -37 # . . push args -38 68/push Newline/imm32 -39 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) -40 # . . call -41 e8/call write/disp32 -42 # . . discard args -43 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP -44 # stop(ed, 1) -45 # . . push args -46 68/push 1/imm32 -47 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) -48 # . . call -49 e8/call stop/disp32 -50 # should never get past this point -51 $error:dead-end: -52 # . epilog -53 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -54 5d/pop-to-EBP -55 c3/return -56 -57 # . . vim:nowrap:textwidth=0 + 8 # write(out, "Error: "+msg+"\n") then stop(ed, 1) + 9 error: # ed : (address exit-descriptor), out : fd or (address stream), msg : (address array byte) -> <void> +10 # . prolog +11 55/push-EBP +12 89/copy 3/mod/direct 5/rm32/EBP . . . 4/r32/ESP . . # copy ESP to EBP +13 # write(out, "Error: ") +14 # . . push args +15 68/push "Error: "/imm32 +16 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) +17 # . . call +18 e8/call write/disp32 +19 # . . discard args +20 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +21 # write(out, msg) +22 # . . push args +23 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0x10/disp8 . # push *(EBP+16) +24 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) +25 # . . call +26 e8/call write/disp32 +27 # . . discard args +28 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +29 # write(out, Newline) +30 # . . push args +31 68/push Newline/imm32 +32 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 0xc/disp8 . # push *(EBP+12) +33 # . . call +34 e8/call write/disp32 +35 # . . discard args +36 81 0/subop/add 3/mod/direct 4/rm32/ESP . . . . . 8/imm32 # add to ESP +37 # stop(ed, 1) +38 # . . push args +39 68/push 1/imm32 +40 ff 6/subop/push 1/mod/*+disp8 5/rm32/EBP . . . . 8/disp8 . # push *(EBP+8) +41 # . . call +42 e8/call stop/disp32 +43 # should never get past this point +44 $error:dead-end: +45 # . epilog +46 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +47 5d/pop-to-EBP +48 c3/return +49 +50 # . . vim:nowrap:textwidth=0 -- cgit 1.4.1-2-gfad0