VolksForth/sources/generic/case/case.fb

1 line
12 KiB
Plaintext
Raw Normal View History

2021-01-04 09:51:00 +00:00
\ CASE OF ENDOF END-CASE BREAK jrg 30mai89 : CASE ( n -- n n ) dup ; restrict : OF [compile] IF compile drop ; immediate restrict : ENDOF [compile] ELSE 4+ ; immediate restrict : ENDCASE compile drop BEGIN 3 case? WHILE >resolve REPEAT ; immediate restrict : BREAK compile exit [compile] THEN ; immediate restrict \ =or jrg 06okt88 code =or ( n1 f1 n2 -- n1 f2 ) A D xchg D pop S W mov W ) A cmp 0= ?[ -1 # D mov ]? next end-code \ : =or ( n1 f1 n2 -- n1 f2 ) 2 pick = or ;