Using bit 15 to encode a subroutine call has only one drawback–it can only call subroutines in the lower 32K word in the main memory. The upper 32K word addressable memory cannot be used to store executable programs. This was a very serious trade-off in the design of NC4000. The most important argument to justify this trade-off is that Forth programs written for NC4000 can be extremely compact due to the single cycle subroutine calls and the condensation of many Forth words into a single instruction. Many large programs are needed to fill up the 32K word program space. By the time memory requirements exceed 32K words, you will probably have a 32 bit Novix chip to accommodate these stupendous programs resulting from the lazy-minded or uncommunicative programming teams.Footsteps, pg. 23
This model only approximates the functioning of NC4000, because NC4000 was designed not based on this kind of models, but by a large set of logic equations compiled into gate array patterns. Many special functions in NC4000 are impossible to represent in simple graphical models.Footsteps, pg. 34
Instruction execution is actually the least complicated part of the design; memory and I/O organization should be tackled first.simh controller doc, pg. 7
: MAX ( n1 n2 -- n1 ; n2 )
OVER OVER - n1 - n2 0< IF
BEGIN SWAP DROP n1 < n2, drop n1. Otherwise, jump
to THEN in MIN and drop n2.
: MIN ( n1 n2 -- n1 ; n2 )
OVER OVER - n1 - n2
UNTIL n1 > n2, jump to BEGIN in MAX and drop n1.
THEN DROP Otherwise, drop n1.
The funny IF-BEGIN… UNTIL-THEN structure spanning over two definitionsFootsteps, pg. 63
MAX and MIN lets two definitions executing two alternate pieces of code,
SWAP DROP or DROP. Chuck can do tricks like this because cmForth does
not have compiler security and protection. Not recommended for general
Co-routines on steroids. If this were conventional assembler, we’d never notice. Crossing into compilation adds another dimension.