dos_compilers/DX-FORTH v430/MISER.SCR

1 line
8.0 KiB
Plaintext
Raw Normal View History

2024-07-09 18:07:02 +02:00
\ Miser's Case Extend CASE with Pascal and C style features COND OF ELSE THENS (in DX-Forth kernel) COND EQUAL RANGE WHEN CONTINUE IF See demo screen for usage \ Miser's Case forth definitions decimal cr .( loading Miser's Case ) 2 5 thru \ .( loading Case demo ) 6 load \ Miser's Case application code (equ) bx pop ax pop ax bx cmp 1 $ jz ax push 2 # si add next 1 $: 0 [si] si mov next end-code code (rng) bx pop dx pop ax pop ax cx mov dx cx sub dx bx sub bx cx cmp 1 $ jna ax push 2 # si add next 1 $: 0 [si] si mov next end-code \ Miser's Case system \ Wil Baden's COND THENS (now in DX-FORTH kernel) \ : COND \ cs-mark ; immediate \ : THENS \ begin cs-test while postpone then repeat cs-drop ; \ immediate \ Add Pascal-like features : EQUAL postpone (equ) >mark ; immediate : RANGE postpone (rng) >mark ; immediate