umouse

umouse.git
git clone git://git.lenczewski.org/umouse.git
Log | Files | Refs | Submodules | README

DPANS14.HTM (7636B)


      1 <HTML><HEAD>
      2 <TITLE>DPANS94</TITLE>
      3 <link disabled rel="stylesheet" href="mpexc6.css">
      4 <style>@import url(mpexc6.css);</style>
      5 </head>
      6 
      7 <BODY>
      8 <table width=100%>
      9 <tr>
     10 <td align=left>
     11 <a href=dpans13.htm><img src=left.gif
     12  width=26 height=26 align=ALIGN border=0></a>
     13 <a href=dpans15.htm><img src=right.gif
     14  width=26 height=26 align=ALIGN border=0></a>
     15 </td>
     16 <td align=right>
     17 <a href=dpans.htm#toc><img src=up.gif 
     18  width=26 height=26 align=ALIGN border=0></a>
     19 <a name=14.>Table of Contents</a>
     20 </td>
     21 </tr>
     22 </table>
     23 <p>
     24 <hr size=4>
     25 
     26 <H1>14. The optional Memory-Allocation word set</H1>
     27 
     28 
     29 <hr>
     30 <A name=14.1>
     31 <H2>14.1 Introduction</H2>
     32 </a>
     33 
     34 <p>
     35 <code>
     36 See:
     37 <a href=dpansa14.htm>A.14</a> The optional Memory-Allocation word set
     38 </code>
     39 <p>
     40 
     41 <hr>
     42 <A name=14.2>
     43 <H2>14.2 Additional terms and notation</H2>
     44 </a>
     45 
     46 None.
     47 <P>
     48 
     49 <hr>
     50 <A name=14.3>
     51 <H2>14.3 Additional usage requirements</H2>
     52 </a>
     53 
     54 
     55 <hr>
     56 <A name=14.3.1>
     57 <H3>14.3.1 I/O Results data type</H3>
     58 </a>
     59 
     60 I/O results are single-cell numbers indicating the result of I/O
     61 operations.  A value of zero indicates that the I/O operation completed
     62 successfully; other values and their meanings are
     63 implementation-defined.
     64 
     65 <P>
     66 
     67 Append table 14.1 to 
     68 <a href=dpans3.htm#table.3.1>table 3.1</a>.
     69 <P>
     70 
     71 Table 14.1 - Data types
     72 
     73 <PRE>
     74 Symbol  Data type       Size on stack
     75 ------  ---------       -------------
     76 ior     I/O results     1 cell
     77 </PRE>
     78 
     79 
     80 <P>
     81 
     82 <hr>
     83 <A name=14.3.2>
     84 <H3>14.3.2 Environmental queries</H3>
     85 </a>
     86 
     87 Append table 14.2 to table 3.5.
     88 <P>
     89 
     90 <code>
     91 See:
     92 <A href=dpans3.htm#3.2.6>3.2.6</a> Environmental queries
     93 </code>
     94 <P>
     95 
     96 Table 14.2 - Environmental query strings
     97 
     98 <PRE>
     99 String             Value data type  Constant?  Meaning
    100 ------             ---------------  ---------  -------
    101 MEMORY-ALLOC       flag             no         memory-allocation word set present
    102 MEMORY-ALLOC-EXT   flag             no         memory-allocation extensions word set present
    103 
    104 </PRE>
    105 
    106 <P>
    107 
    108 <hr>
    109 <A name=14.3.3>
    110 <H3>14.3.3 Allocated regions</H3>
    111 </a>
    112 
    113 A program may address memory in data space regions made available by
    114 <a href=dpans14.htm#14.6.1.0707>ALLOCATE</a> or 
    115 <a href=dpans14.htm#14.6.1.2145>RESIZE</a> and not yet released by 
    116 <a href=dpans14.htm#14.6.1.1605>FREE</a>.
    117 
    118 <P>
    119 
    120 <code>
    121 See:
    122 <A href=dpans3.htm#3.3.3>3.3.3</a> Data space
    123 </code>
    124 <P>
    125 
    126 
    127 <hr>
    128 <A name=14.4>
    129 <H2>14.4 Additional documentation requirements</H2>
    130 </a>
    131 
    132 
    133 <hr>
    134 <A name=14.4.1>
    135 <H3>14.4.1 System documentation</H3>
    136 </a>
    137 
    138 
    139 <hr>
    140 <A name=14.4.1.1>
    141 <H4>14.4.1.1 Implementation-defined options</H4>
    142 </a>
    143 
    144 <UL>
    145 <LI>values and meaning of ior 
    146 (<a href=dpans14.htm#14.3.1>14.3.1</a> I/O Results data type,
    147 <a href=dpans14.htm#14.6.1.0707>14.6.1.0707</a> ALLOCATE, 
    148 <a href=dpans14.htm#14.6.1.1605>14.6.1.1605</a> FREE, 
    149 <a href=dpans14.htm#14.6.1.2145>14.6.1.2145</a> RESIZE).
    150 </UL>
    151 
    152 <P>
    153 
    154 <hr>
    155 <A name=14.4.1.2>
    156 <H4>14.4.1.2 Ambiguous conditions</H4>
    157 </a>
    158 
    159 <UL>
    160 <LI>no additional requirements.
    161 </ul>
    162 
    163 <hr>
    164 <A name=14.4.1.3>
    165 <h4>14.4.1.3 Other system documentation</h4>
    166 </a>
    167 <ul>
    168 <LI>no additional requirements.
    169 </ul>
    170 
    171 <hr>
    172 <A name=14.4.2>
    173 <h3>14.4.2 Program documentation</h3>
    174 </a>
    175 <ul>
    176 <LI>no additional requirements.
    177 </ul>
    178 
    179 <hr>
    180 <A name=14.5>
    181 <h2>14.5 Compliance and labeling</h2>
    182 </a>
    183 
    184 
    185 <P>
    186 
    187 <hr>
    188 <A name=14.5.1>
    189 <H3>14.5.1 ANS Forth systems</H3>
    190 </a>
    191 
    192 The phrase <B>Providing the Memory-Allocation word set</B> shall be
    193 appended to the label of any Standard System that provides all of the
    194 Memory-Allocation word set.
    195 
    196 <P>
    197 
    198 The phrase <B>Providing name(s) from the Memory-Allocation Extensions
    199 word set</B> shall be appended to the label of any Standard System that
    200 provides portions of the Memory-Allocation Extensions word set.
    201 
    202 <P>
    203 
    204 The phrase <B>Providing the Memory-Allocation Extensions word set</B>
    205 shall be appended to the label of any Standard System that provides all
    206 of the Memory-Allocation and Memory-Allocation Extensions word sets.
    207 
    208 <P>
    209 
    210 <hr>
    211 <A name=14.5.2>
    212 <H3>14.5.2 ANS Forth programs</H3>
    213 </a>
    214 
    215 The phrase <B>Requiring the Memory-Allocation word set</B> shall be
    216 appended to the label of Standard Programs that require the system to
    217 provide the Memory-Allocation word set.
    218 
    219 <P>
    220 
    221 The phrase <B>Requiring name(s) from the Memory-Allocation Extensions
    222 word set</B> shall be appended to the label of Standard Programs that
    223 require the system to provide portions of the Memory-Allocation
    224 Extensions word set.
    225 
    226 <P>
    227 
    228 The phrase <B>Requiring the Memory-Allocation Extensions word set</B>
    229 shall be appended to the label of Standard Programs that require the
    230 system to provide all of the Memory-Allocation and Memory-Allocation
    231 Extensions word sets.
    232 
    233 <P>
    234 
    235 <hr>
    236 <A name=14.6>
    237 <H2>14.6 Glossary</H2>
    238 </a>
    239 
    240 <hr>
    241 <A name=14.6.1>
    242 <H3>14.6.1 Memory-Allocation words</H3>
    243 </a>
    244 
    245 <hr>
    246 <A name=14.6.1.0707>
    247 <code>
    248 14.6.1.0707 <b>ALLOCATE</b>
    249 </code>
    250 </a>
    251 <BR>
    252 MEMORY
    253 <BR>
    254 <pre>
    255 	( u -- a-addr ior )
    256 </pre>
    257 <P>
    258 
    259 Allocate u address units of contiguous data space.  The data-space
    260 pointer is unaffected by this operation.  The initial content of the
    261 allocated space is undefined.
    262 
    263 <P>
    264 
    265 If the allocation succeeds, a-addr is the aligned starting address of
    266 the allocated space and ior is zero.
    267 
    268 <P>
    269 
    270 If the operation fails, a-addr does not represent a valid address and
    271 ior is the implementation-defined I/O result code.
    272 
    273 <p>
    274 
    275 <code>
    276 See:    
    277 <A href=dpans6.htm#6.1.1650>6.1.1650 HERE</a> ,
    278 <A href=dpans14.htm#14.6.1.1605>14.6.1.1605 FREE</a> ,
    279 <A href=dpans14.htm#14.6.1.2145>14.6.1.2145 RESIZE</a>
    280 </code>
    281 
    282 <P>
    283 
    284 <hr>
    285 <A name=14.6.1.1605>
    286 <code>
    287 14.6.1.1605 <b>FREE</b>
    288 </code>
    289 </a>
    290 <BR>
    291 MEMORY
    292 <BR>
    293 <pre>
    294 	( a-addr -- ior )
    295 </pre>
    296 <P>
    297 
    298 Return the contiguous region of data space indicated by a-addr to the
    299 system for later allocation.  a-addr shall indicate a region of data
    300 space that was previously obtained by 
    301 <a href=dpans14.htm#14.6.1.0707>ALLOCATE</a> or 
    302 <a href=dpans14.htm#14.6.1.2145>RESIZE</a>.  The
    303 data-space pointer is unaffected by this operation.
    304 <P>
    305 
    306 If the operation succeeds, ior is zero.  If the operation fails, ior is
    307 the implementation-defined I/O result code.
    308 <P>
    309 
    310 <code>
    311 See:    
    312 <A href=dpans6.htm#6.1.1650>6.1.1650 HERE</a>
    313 </code>
    314 
    315 <P>
    316 
    317 <hr>
    318 <A name=14.6.1.2145>
    319 <code>
    320 14.6.1.2145 <b>RESIZE</b>
    321 </code>
    322 </a>
    323 <BR>
    324 MEMORY
    325 <BR>
    326 <pre>
    327 	( a-addr1 u -- a-addr2 ior )
    328 </pre>
    329 <P>
    330 
    331 Change the allocation of the contiguous data space starting at the
    332 address a-addr1, previously allocated by 
    333 <a href=dpans14.htm#14.6.1.0707>ALLOCATE</a> or RESIZE, to u
    334 address units.  u may be either larger or smaller than the current size
    335 of the region.  The data-space pointer is unaffected by this operation.
    336 
    337 <P>
    338 
    339 If the operation succeeds, a-addr2 is the aligned starting address of u
    340 address units of allocated memory and ior is zero.  a-addr2 may be, but
    341 need not be, the same as a-addr1.  If they are not the same, the values
    342 contained in the region at a-addr1 are copied to a-addr2, up to the
    343 minimum size of either of the two regions.  If they are the same, the
    344 values contained in the region are preserved to the minimum of u or the
    345 original size.  If a-addr2 is not the same as a-addr1, the region of
    346 memory at a-addr1 is returned to the system according to the operation
    347 of 
    348 <a href=dpans14.htm#14.6.1.1605>FREE</a>.
    349 
    350 <P>
    351 
    352 If the operation fails, a-addr2 equals a-addr1, the region of memory at
    353 a-addr1 is unaffected, and ior is the implementation-defined I/O result
    354 code.
    355 <P>
    356 
    357 <code>
    358 See:    
    359 <A href=dpans6.htm#6.1.1650>6.1.1650 HERE</a>
    360 </code>
    361 
    362 <P>
    363 
    364 <hr>
    365 <A name=14.6.2>
    366 <h3>14.6.2   Memory-Allocation extension words</h3>
    367 </a>
    368 <p>
    369 
    370 None
    371 <P>
    372 
    373 <hr>
    374 <A href=dpans.htm#toc><IMG   src="up.gif" ></A>    Table of Contents 
    375 <BR>
    376 <A href=dpans15.htm><IMG   src="right.gif" ></A>
    377 Next Section
    378 <P>
    379 </BODY>
    380 </HTML>