nybbleForth icon indicating copy to clipboard operation
nybbleForth copied to clipboard

Consider replacing + primitive with 2*

Open larsbrinkhoff opened this issue 7 years ago • 0 comments

A single left shift ought to be smaller in hardware than an adder.

+ would be defined approximately as:

: +    begin ?dup while 2dup xor -rot and 2* repeat ;

Since this depends on xor, it would have to be recoded without +:

: xor   2dup nand dup >r nand swap r> nand nand ;

larsbrinkhoff avatar Jun 16 '17 07:06 larsbrinkhoff