Changeset 2112
- Timestamp:
- Jan 18, 2011 9:25:30 PM (2 years ago)
- Files:
-
- 7 edited
-
cpu/arm/kerncode.fth (modified) (1 diff)
-
cpu/arm/kernel.bth (modified) (1 diff)
-
cpu/mips/kerncode.fth (modified) (1 diff)
-
cpu/ppc/kerncode.fth (modified) (1 diff)
-
cpu/x86/kerncode.fth (modified) (1 diff)
-
forth/kernel/kernel.fth (modified) (2 diffs)
-
forth/lib/decomp.fth (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cpu/arm/kerncode.fth
r2014 r2112 133 133 134 134 meta definitions 135 136 code isdefer ( xt -- ) 137 ldr r0,[ip],1cell \ Get CFA of target word 138 ldr r0,[r0,1cell] \ Get user number 139 str tos,[r0,up] \ Store value 140 pop tos,sp \ Fix stack 141 c; 142 code isvalue ( n -- ) 143 ldr r0,[ip],1cell \ Get CFA of target word 144 ldr r0,[r0,1cell] \ Get user number 145 str tos,[r0,up] \ Store value 146 pop tos,sp \ Fix stack 147 c; 148 code isuser ( n -- ) 149 ldr r0,[ip],1cell \ Get CFA of target word 150 ldr r0,[r0,1cell] \ Get user number 151 str tos,[r0,up] \ Store value 152 pop tos,sp \ Fix stack 153 c; 154 code isconstant ( n -- ) 155 ldr r0,[ip],1cell \ Get CFA of target word 156 str tos,[r0,1cell] \ Store value 157 pop tos,sp \ Fix stack 158 c; 159 code isvariable ( n -- ) 160 ldr r0,[ip],1cell \ Get CFA of target word 161 str tos,[r0,1cell] \ Store value 162 pop tos,sp \ Fix stack 163 c; 135 164 136 165 code (lit) ( -- lit ) -
cpu/arm/kernel.bth
r1041 r2112 32 32 33 33 [ifndef] arm-assembler \ Make sure we have the ARM assembler 34 order cr35 34 only forth also definitions 36 35 -
cpu/mips/kerncode.fth
r1294 r2112 207 207 208 208 meta definitions 209 210 code isdefer ( xt -- ) 211 ip t0 get 212 ip ainc 213 214 t0 4 t0 lw \ Get user number 215 t0 up t0 addu \ User area address 216 tos base tos subu \ relocate xt 217 tos t0 0 sw \ Store value 218 sp ainc \ finish popping stack 219 c; 220 221 code isuser ( xt -- ) 222 ip t0 get 223 ip ainc 224 225 t0 4 t0 lw \ Get user number 226 t0 up t0 addu \ User area address 227 tos t0 0 sw \ Store value 228 sp ainc \ finish popping stack 229 c; 230 231 code isvalue ( xt -- ) 232 ip t0 get 233 ip ainc 234 235 t0 4 t0 lw \ Get user number 236 t0 up t0 addu \ User area address 237 tos t0 0 sw \ Store value 238 sp ainc \ finish popping stack 239 c; 240 241 code isconstant ( xt -- ) 242 ip t0 get 243 ip ainc 244 245 tos t0 4 sw \ Store value 246 sp ainc \ finish popping stack 247 c; 248 249 code isvariable ( xt -- ) 250 ip t0 get 251 ip ainc 252 253 tos t0 4 sw \ Store value 254 sp ainc \ finish popping stack 255 c; 209 256 210 257 \ dovariable constant dovariable -
cpu/ppc/kerncode.fth
r1494 r2112 190 190 191 191 meta definitions 192 193 code isdefer ( xt -- ) 194 literal-to-t0 195 lwz t0,/cf(t0) \ User number in t0 196 stwx tos,t0,up 197 pop-tos 198 c; 199 200 code isvalue ( n -- ) 201 literal-to-t0 202 lwz t0,/cf(t0) \ User number in t0 203 stwx tos,t0,up 204 pop-tos 205 c; 206 207 code isuser ( n -- ) 208 literal-to-t0 209 lwz t0,/cf(t0) \ User number in t0 210 stwx tos,t0,up 211 pop-tos 212 c; 213 214 code isconstant ( n -- ) 215 literal-to-t0 216 stw tos,/cf(t0) 217 pop-tos 218 c; 219 220 code isvariable ( n -- ) 221 literal-to-t0 222 stw tos,/cf(t0) 223 pop-tos 224 c; 192 225 193 226 \ dovariable constant dovariable -
cpu/x86/kerncode.fth
r1294 r2112 161 161 162 162 \ ---- Run-time words compiled by compiling words. 163 164 code isdefer ( xt -- ) 165 0 [ip] ax mov ip ainc /cf [ax] ax mov ?bswap-ax up ax add \ data address in ax 166 [ifdef] big-endian-t 167 ax bx mov ax pop ?bswap-ax ax 0 [bx] mov 168 [else] 169 bx pop bx 0 [ax] mov 170 [then] 171 c; 172 code isvalue ( n -- ) 173 0 [ip] ax mov ip ainc /cf [ax] ax mov ?bswap-ax up ax add \ data address in ax 174 [ifdef] big-endian-t 175 ax bx mov ax pop ?bswap-ax ax 0 [bx] mov 176 [else] 177 bx pop bx 0 [ax] mov 178 [then] 179 c; 180 code isuser ( n -- ) 181 0 [ip] ax mov ip ainc /cf [ax] ax mov ?bswap-ax up ax add \ data address in ax 182 [ifdef] big-endian-t 183 ax bx mov ax pop ?bswap-ax ax 0 [bx] mov 184 [else] 185 bx pop bx 0 [ax] mov 186 [then] 187 c; 188 code isconstant ( n -- ) 189 0 [ip] bx mov ip ainc 190 ax pop ?bswap-ax ax /cf [bx] mov 191 c; 192 code isvariable ( n -- ) 193 0 [ip] bx mov ip ainc 194 ax pop ?bswap-ax ax /cf [bx] mov 195 c; 163 196 164 197 code bswap (s n1 -- n2 ) -
forth/kernel/kernel.fth
r1865 r2112 1913 1913 ' ! token,-t \ variable 1914 1914 1915 create is-ops 1916 ' isdefer token,-t \ defer 1917 ' isuser token,-t \ user variable 1918 ' isvalue token,-t \ value 1919 ' isconstant token,-t \ constant 1920 ' isvariable token,-t \ variable 1921 1915 1922 : associate ( acf -- true | index false ) 1916 1923 word-type ( n ) … … 1958 1965 1959 1966 : do-is ( data acf -- ) 1960 dup kerntype? if ( [data] acf ) 1961 state @ if compile (is) token, else (is then 1962 else ( [data] acf ) 1967 dup associate if ( [data] acf ) 1963 1968 to-hook 1964 then 1969 else ( [data] acf index ) 1970 state @ if ( acf index ) 1971 is-ops swap ta+ token@ ( acf is-token ) 1972 token, token, ( ) 1973 else ( data acf index ) 1974 tuck data-locs +execute ( data index data-adr ) 1975 swap !ops +execute ( ) 1976 then ( ) 1977 then ( ) 1965 1978 ; 1966 1979 \ is is the word that is actually used by applications -
forth/lib/decomp.fth
r1294 r2112 301 301 : skip-(') ( ip -- ip' ) ta1+ ta1+ ; 302 302 headerless 303 : .is ( ip -- ip' ) . cworddup token@ .name ta1+ ;303 : .is ( ip -- ip' ) ." to " ta1+ dup token@ .name ta1+ ; 304 304 : .string-tail ( ip -- ip' ) dup count type +str ; 305 305 : .string ( ip -- ip' ) .cword .string-tail put" ; … … 323 323 324 324 \ Common constant for sizing the three classes: 325 d# 3 0constant #decomp-classes325 d# 36 constant #decomp-classes 326 326 327 327 #decomp-classes tassociative: execution-class ( token -- index ) … … 338 338 ( 20 ) [compile] ("s) ( 21 ) [compile] (is) 339 339 ( 22 ) [compile] (dlit) ( 23 ) [compile] (llit) 340 ( 24 ) [compile] (n") ( 25 ) [compile] dummy 341 ( 26 ) [compile] dummy ( 27 ) [compile] dummy 342 ( 28 ) [compile] dummy ( 29 ) [compile] dummy 340 ( 24 ) [compile] (n") ( 25 ) [compile] isdefer 341 ( 26 ) [compile] isuser ( 27 ) [compile] isvalue 342 ( 28 ) [compile] isconstant ( 29 ) [compile] isvariable 343 ( 30 ) [compile] dummy ( 31 ) [compile] dummy 344 ( 32 ) [compile] dummy ( 33 ) [compile] dummy 345 ( 34 ) [compile] dummy ( 35 ) [compile] dummy 343 346 344 347 \ Print a word which has been classified by execution-class … … 356 359 ( 20 ) .pstring ( 21 ) .is 357 360 ( 22 ) .dlit ( 23 ) .llit 358 ( 24 ) .nstring ( 25 ) dummy 359 ( 26 ) dummy ( 27 ) dummy 360 ( 28 ) dummy ( 29 ) dummy 361 ( 24 ) .nstring ( 25 ) .is 362 ( 26 ) .is ( 27 ) .is 363 ( 28 ) .is ( 29 ) .is 364 ( 30 ) dummy ( 31 ) dummy 365 ( 32 ) dummy ( 32 ) dummy 366 ( 34 ) dummy ( 35 ) dummy 361 367 ( default ) .word 362 368 ; … … 377 383 ( 20 ) skip-string ( 21 ) skip-word 378 384 ( 22 ) skip-dlit ( 23 ) skip-llit 379 ( 24 ) skip-nstring ( 25 ) dummy 380 ( 26 ) dummy ( 27 ) dummy 381 ( 28 ) dummy ( 29 ) dummy 385 ( 24 ) skip-nstring ( 25 ) skip-word 386 ( 26 ) skip-word ( 27 ) skip-word 387 ( 28 ) skip-word ( 29 ) skip-word 388 ( 30 ) dummy ( 31 ) dummy 389 ( 32 ) dummy ( 32 ) dummy 390 ( 34 ) dummy ( 35 ) dummy 382 391 ( default ) skip-word 383 392 ;
Note: See TracChangeset
for help on using the changeset viewer.
