Skip to content
Snippets Groups Projects
cache1.vmg 1.75 KiB
Newer Older
Anton Ertl's avatar
Anton Ertl committed
\ stack cache setup

Anton Ertl's avatar
Anton Ertl committed
\ Copyright (C) 2003,2004,2007,2019 Free Software Foundation, Inc.
Anton Ertl's avatar
Anton Ertl committed

\ This file is part of Gforth.

\ Gforth is free software; you can redistribute it and/or
\ modify it under the terms of the GNU General Public License
\ as published by the Free Software Foundation, either version 3
Anton Ertl's avatar
Anton Ertl committed
\ of the License, or (at your option) any later version.

\ This program is distributed in the hope that it will be useful,
\ but WITHOUT ANY WARRANTY; without even the implied warranty of
\ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
\ GNU General Public License for more details.

\ You should have received a copy of the GNU General Public License
\ along with this program. If not, see http://www.gnu.org/licenses/.
Anton Ertl's avatar
Anton Ertl committed

\E register IPTOS Cell
\E register spb Cell
\E register spc Cell
Anton Ertl's avatar
Anton Ertl committed

\E create IPregs IPTOS ,
\E create regs spc , spb , spTOS ,
\ \E create regs spTOS ,
Anton Ertl's avatar
Anton Ertl committed

\E IPregs 1 0 stack-state IPss1
Anton Ertl's avatar
Anton Ertl committed
\E regs 3 th 0  -1 stack-state ss0
\E regs 2 th 1  0 stack-state ss1
\E regs 1 th 2  1 stack-state ss2
\ \E regs 0 th 3  2 stack-state ss3
\ \E regs 1 th 0 -1 stack-state ss0
\ \E regs           1  0 stack-state ss1

\ the first of these is the default state (for now)
Anton Ertl's avatar
Anton Ertl committed
\E state S1
\E state S2
\E ss0 data-stack S0 set-ss
Anton Ertl's avatar
Anton Ertl committed
\E ss1 data-stack S1 set-ss
\E ss2 data-stack S2 set-ss
\  \E ss3 data-stack S3 set-ss
\E IPss1 inst-stream S0 set-ss
Anton Ertl's avatar
Anton Ertl committed
\E IPss1 inst-stream S1 set-ss
\E IPss1 inst-stream S2 set-ss
\  \E IPss1 inst-stream S3 set-ss
Anton Ertl's avatar
Anton Ertl committed

\E data-stack to cache-stack
\E here 3 cache-states 2! s0 , s1 , s2 ,
\ \E here 2 cache-states 2! s0 , s1 ,
Anton Ertl's avatar
Anton Ertl committed

\ !! the following should be automatic
Anton Ertl's avatar
Anton Ertl committed
\E state-default to state-in
\E state-default to state-out