ppc: Add RTAS rtas-version property
[openbios/afaerber.git] / kernel / primitives.c
blobb433dcd462987833045de277dbfec71087ba11b6
1 /* tag: the main file which includes all the prim code headers
3 * Copyright (C) 2003 Patrick Mauritz, Stefan Reinauer
5 * see the file "COPYING" for further information about
6 * the copyright and warranty status of this work.
7 */
9 #include "config.h"
10 #include "sysinclude.h"
11 #include "kernel/stack.h"
12 #include "kernel/kernel.h"
13 #include "dict.h"
16 * cross platform abstraction
19 #include "cross.h"
22 * Code Field Address (CFA) definitions (DOCOL and the like)
25 #include "internal.c"
27 /* include forth primitives needed to set up
28 * all the words described in IEEE1275-1994.
31 #include "forth.c"
33 /* words[] is a function array of all native code functions used by
34 * the dictionary, i.e. CFAs and primitives.
35 * Any change here needs a matching change in the primitive word's
36 * name list that is kept for bootstrapping in kernel/bootstrap.c
38 * NOTE: THIS LIST SHALL NOT CHANGE (EXCEPT MANDATORY ADDITIONS AT
39 * THE END). ANY OTHER CHANGE WILL BREAK COMPATIBILITY TO OLDER
40 * BINARY DICTIONARIES.
42 static forth_word * const words[] = {
44 * CFAs and special words
46 semis,
47 docol,
48 lit,
49 docon,
50 dovar,
51 dodefer,
52 dodoes,
53 dodo,
54 doisdo,
55 doloop,
56 doplusloop,
57 doival,
58 doivar,
59 doidefer,
62 * primitives
64 fdup, /* dup */
65 twodup, /* 2dup */
66 isdup, /* ?dup */
67 over, /* over */
68 twoover, /* 2over */
69 pick, /* pick */
70 drop, /* drop */
71 twodrop, /* 2drop */
72 nip, /* nip */
73 roll, /* roll */
74 rot, /* rot */
75 minusrot, /* -rot */
76 swap, /* swap */
77 twoswap, /* 2swap */
78 tor, /* >r */
79 rto, /* r> */
80 rfetch, /* r@ */
81 depth, /* depth */
82 depthwrite, /* depth! */
83 rdepth, /* rdepth */
84 rdepthwrite, /* rdepth! */
85 plus, /* + */
86 minus, /* - */
87 mult, /* * */
88 umult, /* u* */
89 mudivmod, /* mu/mod */
90 forthabs, /* abs */
91 negate, /* negate */
92 max, /* max */
93 min, /* min */
94 lshift, /* lshift */
95 rshift, /* rshift */
96 rshifta, /* >>a */
97 and, /* and */
98 or, /* or */
99 xor, /* xor */
100 invert, /* invert */
101 dplus, /* d+ */
102 dminus, /* d- */
103 mmult, /* m* */
104 ummult, /* um* */
105 fetch, /* @ */
106 cfetch, /* c@ */
107 wfetch, /* w@ */
108 lfetch, /* l@ */
109 store, /* ! */
110 plusstore, /* +! */
111 cstore, /* c! */
112 wstore, /* w! */
113 lstore, /* l! */
114 equals, /* = */
115 greater, /* > */
116 less, /* < */
117 ugreater, /* u> */
118 uless, /* u< */
119 spfetch, /* sp@ */
120 fmove, /* move */
121 ffill, /* fill */
122 emit, /* emit */
123 iskey, /* key? */
124 key, /* key */
125 execute, /* execute */
126 here, /* here */
127 herewrite, /* here! */
128 dobranch, /* dobranch */
129 docbranch, /* do?branch */
130 unalignedwordread, /* unaligned-w@ */
131 unalignedwordwrite, /* unaligned-w! */
132 unalignedlongread, /* unaligned-l@ */
133 unalignedlongwrite, /* unaligned-l! */
134 iocfetch, /* ioc@ */
135 iowfetch, /* iow@ */
136 iolfetch, /* iol@ */
137 iocstore, /* ioc! */
138 iowstore, /* iow! */
139 iolstore, /* iol! */
140 loop_i, /* i */
141 loop_j, /* j */
142 call, /* call */
143 sysdebug, /* sys-debug */
144 do_include, /* $include */
145 do_encode_file, /* $encode-file */
146 do_debug_xt, /* (debug */
147 do_debug_off, /* (debug-off) */