From 1eb9cc5679ed70dd2e4eceab8f3a547c8560aeba Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 3 Dec 2018 10:15:24 -0800 Subject: 4822 Fix CI. It's kind of a hassle (and wasteful) that I need to redefine 'main' in every single layer. --- html/subx/061error.subx.html | 87 ++++++++++++++++++++++++-------------------- 1 file changed, 47 insertions(+), 40 deletions(-) (limited to 'html/subx/061error.subx.html') diff --git a/html/subx/061error.subx.html b/html/subx/061error.subx.html index a606c428..984ab7e7 100644 --- a/html/subx/061error.subx.html +++ b/html/subx/061error.subx.html @@ -68,46 +68,53 @@ 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 # 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 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 0x10/disp8 . # push *(EBP+16) -24 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) -41 # . . call -42 e8/call stop/disp32 -43 # should never get past this point -44 # . epilog -45 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP -46 5d/pop-to-EBP -47 c3/return + 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 +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 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 0x10/disp8 . # push *(EBP+16) +31 ff 6/subop/push 1/mod/*+disp8 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 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 4/rm32/sib 5/base/EBP 4/index/none . . 8/disp8 . # push *(EBP+8) +48 # . . call +49 e8/call stop/disp32 +50 # should never get past this point +51 # . epilog +52 89/copy 3/mod/direct 4/rm32/ESP . . . 5/r32/EBP . . # copy EBP to ESP +53 5d/pop-to-EBP +54 c3/return -- cgit 1.4.1-2-gfad0