This commit is contained in:
Kartik K. Agaram 2021-04-22 09:03:20 -07:00
parent 8bbf7ad455
commit 4e70cac998
2 changed files with 39 additions and 0 deletions

View File

@ -81,6 +81,42 @@ $debug-print:end:
5d/pop-to-ebp
c3/return
debug-print?: # -> _/eax: boolean
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
#
8b/-> *Really-debug-print 0/r32/eax
$debug-print?:end:
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return
turn-on-debug-print:
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
#
c7 0/subop/copy *Really-debug-print 1/imm32/true
$turn-on-debug-print:end:
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return
turn-off-debug-print:
# . prologue
55/push-ebp
89/<- %ebp 4/r32/esp
#
c7 0/subop/copy *Really-debug-print 0/imm32/false
$turn-off-debug-print:end:
# . epilogue
89/<- %esp 5/r32/ebp
5d/pop-to-ebp
c3/return
== data
Really-debug-print:
0/imm32/false

3
400.mu
View File

@ -27,6 +27,9 @@ sig check-strings-equal s: (addr array byte), expected: (addr array byte), msg:
sig check-stack
sig show-stack-state
sig debug-print x: (addr array byte), fg: int, bg: int
sig debug-print? -> _/eax: boolean
sig turn-on-debug-print
sig turn-off-debug-print
# streams
sig clear-stream f: (addr stream _)