diff --git a/wipforth.ws b/wipforth.ws index 2e84e8b..aedca4b 100644 --- a/wipforth.ws +++ b/wipforth.ws @@ -9,6 +9,9 @@ .def RXHEAD 48h .def RXTAIL 4Ch +;; Mirror of registers for profiler to sample +.def PROF_DATA 58h + .def DICT_START 0200h .def RSP_INIT 10000h @@ -2073,6 +2076,13 @@ KERNEL_DEFS_END: .func trampoline loop iter global.get fn call_indirect codeword codewords + + i32.const PROF_DATA + global.get ip i64.extend_i32_u + global.get rsp i64.extend_i32_u + i64.const 32 i64.shl i64.or + i64.atomic.store 3 0 + global.get run br_if iter end