-;; Get the location of the STATE variable. It can be set with '!' and read with
-;; '@'.
-forth STATE, 'STATE'
- dq LIT, var_STATE
- dq EXIT
-
-;; Get the location of the LATEST variable. It can be set with '!' and read with
-;; '@'.
-forth LATEST, 'LATEST'
- dq LIT, latest_entry
- dq EXIT
-
-;; Get the location at which compiled words are expected to be added. This
-;; pointer is usually modified automatically when calling ',', but we can also
-;; read it manually with 'HERE'.
-forth HERE, 'HERE'
- dq LIT, here
- dq EXIT
-
-forth COMMA, ','
- dq HERE, GET, PUT ; Set the memory at the address pointed to by HERE
- dq HERE, GET, LIT, 8, PLUS ; Calculate new address for HERE to point to
- dq HERE, PUT ; Update HERE to point to the new address
- dq EXIT
+;; Given two integers a and b on the stack, pushes the quotient and remainder of
+;; division of a by b.
+forth_asm TIMESMOD, '/MOD'
+ pop rbx ; b
+ pop rax ; a
+ mov rdx, 0
+ div rbx
+ push rax ; a / b
+ push rdx ; a % b
+ next