Make extras more consistent.

This commit is contained in:
Brad Nelson
2022-07-13 16:33:51 -07:00
parent 024c51ec7d
commit cef6074851
2 changed files with 16 additions and 0 deletions

View File

@ -12,6 +12,8 @@
\ See the License for the specific language governing permissions and \ See the License for the specific language governing permissions and
\ limitations under the License. \ limitations under the License.
( Define more words that are usually in extra_opcodes.h )
( Fill, Move ) ( Fill, Move )
: cmove ( a a n -- ) for aft >r dup c@ r@ c! 1+ r> 1+ then next 2drop ; : cmove ( a a n -- ) for aft >r dup c@ r@ c! 1+ r> 1+ then next 2drop ;
: cmove> ( a a n -- ) for aft 2dup swap r@ + c@ swap r@ + c! then next 2drop ; : cmove> ( a a n -- ) for aft 2dup swap r@ + c@ swap r@ + c! then next 2drop ;

View File

@ -12,6 +12,20 @@
\ See the License for the specific language governing permissions and \ See the License for the specific language governing permissions and
\ limitations under the License. \ limitations under the License.
( Add more words that are usually in extra_opcodes.h )
: fsqrt ( r -- r ) 1e 20 0 do fover fover f/ f+ 0.5e f* loop fnip ; : fsqrt ( r -- r ) 1e 20 0 do fover fover f/ f+ 0.5e f* loop fnip ;
3.14159265359e fconstant pi 3.14159265359e fconstant pi
: fill32 ( a n v ) swap >r swap r> 0 ?do 2dup ! cell+ loop 2drop ;
( Transfer internals that are extra opcodes )
internals definitions
transfer{
'heap 'context 'latestxt 'notfound
'heap-start 'heap-size 'stack-cells
'boot 'boot-size 'tib
'argc 'argv 'runner fill32
}transfer
forth definitions