diff --git a/capsules/BLOCK_MAP.md b/capsules/BLOCK_MAP.md index 734fbb1..68130f0 100644 --- a/capsules/BLOCK_MAP.md +++ b/capsules/BLOCK_MAP.md @@ -1,5 +1,5 @@ # Capsule Block Manifest — Auto-generated - + diff --git a/disk/artemis.img b/disk/artemis.img index e99f510..31650b4 100644 Binary files a/disk/artemis.img and b/disk/artemis.img differ diff --git a/lfs/amd64/starforth b/lfs/amd64/starforth index 7167862..862dc1b 100755 Binary files a/lfs/amd64/starforth and b/lfs/amd64/starforth differ diff --git a/src/word_source/starforth_words.c b/src/word_source/starforth_words.c index bd50c0b..310c486 100644 --- a/src/word_source/starforth_words.c +++ b/src/word_source/starforth_words.c @@ -793,6 +793,20 @@ static void starforth_word_zuse_authenticate(VM *vm) vm->zuse_session = 1; } +/** + * @brief Read-only accessor for the canonical heartbeat tick counter + * + * Stack effect: ( -- n ) + * Pushes vm->heartbeat.tick_count -- the one clock this project's timing + * measurements are supposed to read, not host wall-clock. Read-only: no + * corresponding store word exists or should exist. + * @param vm Pointer to the VM instance + */ +static void starforth_word_heartbeat_ticks(VM* vm) +{ + vm_push(vm, (cell_t)vm->heartbeat.tick_count); +} + /** * @brief Register StarForth vocabulary words with the VM * @@ -812,6 +826,7 @@ void register_starforth_words(VM* vm) register_word(vm, "RANDOM", starforth_word_random); register_word(vm, "WAIT", starforth_word_wait); register_word(vm, "ZUSE-AUTHENTICATE", starforth_word_zuse_authenticate); + register_word(vm, "HEARTBEAT-TICKS@", starforth_word_heartbeat_ticks); vm_bootstrap_root_vocabulary(vm, "STARFORTH"); STARFORTH_CHECK_ARENA("register_starforth_words:post-root"); @@ -829,6 +844,7 @@ void register_starforth_words(VM* vm) register_word(vm, "RANDOM", starforth_word_random); register_word(vm, "WAIT", starforth_word_wait); register_word(vm, "ZUSE-AUTHENTICATE", starforth_word_zuse_authenticate); + register_word(vm, "HEARTBEAT-TICKS@", starforth_word_heartbeat_ticks); vocabulary_word_forth(vm); vocabulary_word_definitions(vm);