Adjust Stack Pointer (ASP)/OP=61

Format

OP AF BF A Syllable

OP = 61

AF must specify a length of six (6) either directly or as an indirect field length or a literal.
BF is unused and reserved. May be specified as indirect.

The A Syllable is the address of the increment field. Address may be indexed, indirect or extended. The final address controller data type must be UN or cause an Invalid Instruction (IEX = 03) fault.

Function

The Adjust Stack Pointer instruction is used to increment the value of the Top Of Stack pointer (located at memory address 40 relative to Base #0) and to detemrine if there is sufficient space between the Top Of Stack pointer and Limit #0.

The sum of the increment value (A) and the value of the Top Of Stack pointer, located at memory address 40 relative to Base #0 and the size of the Hardware Call Statck Frame area (500) is compared to Limit #0.

If the sum is equal to or greater than Limit #0, cause a Stack Overflow fault that stores the address of the failing instruction and terminate the instruction with no further action.

Otherwise, store the sum of the increment value (A) and the vaule of the Top Of Stack pointer into memory address 40 relative to Base #0.

Comparison Flags

The Comparison Flags are not affected by this instruction.

Overlap

There are no overlap restrictions for this instruction.

Examples

Example (1) Allocate 100 digits of stack space

OP AFBF A Syllable
61 A600 =000100
                    BEFORE              AFTER
   A Field         000100             unchanged
   000040          051200              051300
instructions/asp.txt · Last modified: 2008/11/25 16:49 by scott
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki