in - Stacks

52
PERQ QCode Reference Manual Miles A. Barel John P. Strait Three Rivers Computer Corporation September 3, 1980 Three Rivers Computer Corporation 160 North Craig Street Pittsburgh, PA 15213 (412) 621-6250 The information in this document is subject to change without notice and should not be construed as a commitment by Three Rivers Computer Corporation. Three Rivers Computer Corporation assumes no responsibility for any errors that may appear in this document.

Transcript of in - Stacks

Page 1: in - Stacks

PERQ QCode Reference Manual

Miles A. BarelJohn P. Strait

Three Rivers Computer Corporation

September 3, 1980

Three Rivers Computer Corporation160 North Craig StreetPittsburgh, PA 15213(412) 621-6250

The information in this document is subject to changewithout notice and should not be construed as a commitmentby Three Rivers Computer Corporation. Three Rivers ComputerCorporation assumes no responsibility for any errors thatmay appear in this document.

Page 2: in - Stacks

Table of Contents

4.A. 5 Record and Array Indexing and Assignment4.A. 6 Dynamic Variable Allocation and De-allocation

44444444

4

4

B8.l8.28.38.48.58.68.7

C

D

Top of Stack ArithmeticLogicalIntegerRealsSetsStringsByte ArraysArray and Record Comparisons

Jumps

Routine Calls and Returns

and Comparisons

1. Q-Machine Architecture

I.A Definitions

1.8 Memory Organization1.8.l Memory Organization at the Process Level1 .8.1 .a Global Data1 .8.1 .b Local Data1.8.1.c Run-Time Stack Organization1.8. 2 Memory Organization at the System Level1.8. 2. a System Segment Address Table1.8.2.b System Segment Information Table1.8.2.C Code Segment Organization

I.C Error Handling and Fault Conditions

2. Instruction Format

3. Pointers

4. QCode Descriptions

4.A Variable Fetching, Indexing, Storing and Transferrin4.A.1 Loads and Stores of One Word4.A.1.a Constant One Word Loads4.A.1.b Local One Word Loads and Stores4.A. 1.c Own One Word Loads and Stores4.A.1.d Global One Word Loads and Stores4.A.1.c Intermediate One Word Loads and Stores4.A.1.f Indirect One Word Loads and Stores4.A. 2 Loads and Stores of Multiple Words4.A. 2. a Double Word Loads and Stores4.A.2.b Multiple Word Loads and Stores4 .A. 3 Byte Arrays4.A. 4 Strings

Page 3: in - Stacks

Systems Programs Support Procedures4.E

Page 4: in - Stacks

\

V

PERQ QCode Reference ManualQ-Machine Architecture

1. Q-Machine Architecture

I.A Definitions

Segment - A segment is the underlying structure of PERQ'svirtual memory system. It is the largest area ofcontiguous memory, and also the unit of swappabili ty .Segments come in two types: code segments, which arebyte-addressed, read-only, and fixed in size with amaximum size of 64K bytes (32K words); and datasegments, which are word-addressed, read-write, andvariable in size with a maximum size of 64K words.

MSTACK - Memory Stack. A data segment which contains theuser run-time stack.

ESTACK - Expression Stack. A 16 level expression evaluationstack (internal to the PERQ processor).

MTOS - Top of MSTACK. MTOS refers to the virtual address ofthe top of the memory stack. (MTOS) denotes the itemon the top of the MSTACK.

ETOS - Top of ESTACK. (ETOS) denotes the item on the top ofthe ESTACK.

Activation Record - Stack segment fragment for a singleroutine containing local variables, parameters,function result, temporaries (anonymous variables),other housekeeping values (Activation Control Block -defined below) , and a copy of the EStack at the timethe activation record is created.

CB Code Base (register). Physical adddress of the baseof the current code segment.

SB Stack Base (register). Physical address of the baseof the current stack segment.

PC Program Counter (register). Physical address of thecurrent instruction.

GDB - Global Data Block. A GDB contains the globalvariables for a particular module. GDBs are alwaysbegin on a double-word boundary.

ISN - Internal Segment Number (compiler-generated).

SSN - System Segment Number (system-generated). Note,System' Segment 0 is reserved and may never be used.

LL Lexical Level. Note: the Lexical Level of the mainbody of a process is always 0.

Page 5: in - Stacks

r

i

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 2

Routine Number (register) . RN contains the ordinalnumber of the current routine. Note: RN must lie inthe range 0 to 255.

RN

Code Segment (register). CS contains the systemsegment number (SSN) for the current code segment.This segment must be resident in physical memory for aprocess to be runnable.

CS

Stack Segment (register). SS contains the systemsegment number (SSN) for the current stack segment.This segment must be resident in physical memory for aprocess to be runnable.

SS

Auxilary Segment 0 (register). SO , if non-zero,contains the system segment number (SSN) for asegment, other than the code and stack segments, whichis needed for a process to be runnable. Note: SSN 0is reserved for the system segment address table,which is always resident; hence if S0 contains 0,this indicates that no auxilary segment is needed.

S0

SI

PS

Auxilary Segment 1 (register). Same as S0

Parameter Size. PS is the number of words in anactivation record which are used for parameters.

RPS - Result + Parameter Size. This is the number of wordsin an activation record which are used for functionresult and parameters.

Local + Temporary Sizean activation recordtemporaries (anonymousa main program body is

LTS is the number of words inwhich are used for locals and

LTS

variables). (Note: the LTS ofalways forced to 0.)

AP Activation Pointer (register). AP contains thephysical address of the current activation record.

DL Dynamic Link. This is the AP of the caller,respresented as an offset from SB.

Static Link. This is the AP of the surroundingroutine, represented as an offset from SB.

SL

Top Pointer (register) . TP contains the physicalTPaddress of the top of the run-time MStack

TL Top Link. TP of the caller, represented as an offsetfrom SB.

GP Global Pointer (register). Physical address of theGDB for the current code segment.

Page 6: in - Stacks

"i

vPERQ QCode Reference ManualQ-Machine Architecture

PAGE 3

GL Global Link. GP of the caller, represented as anoffset from SB.

LP Local Pointer (register). Physical address of thecurrent activation record. When the LP is stored inan activation control block (ACB) , it is representedas an offset from SB. Unlike other values in the ACB,the LP value is the current value of the LocalPointer, not some previous value.

XGP external Global Pointer. Pointer to another codesegment's GDB, represented as an offset from SB.

XST external Segment Table. For a given program module,the XST translates ISNs to SSNs and XGPs.

RS

RA

RR

RD

Return Segment. RS is the CS of the caller.Return Address. PC of the caller, represented as anoffset from CB.

Return Routine. RN of the caller.

Routine Dictionary. Each code segment contains aroutine dictionary which is indexed by RN. For eachroutine, the routine dictionary gives the lexicallevel (LL) , entry address, exit address, parametersize (PS) , result + parameter size (RPS) , and local +temporary size (LTS) .

ACB Activation Control Block. The ACB containshousekeeping values in the activation record. Itcontains the SL, LP, DL, GL, RS , RA, and RR. In theACB, the DL, GL, RS , RA, and RR are the AP , GP, CS,PC, and RN of the caller, respectively. The SL is theAP of the routine that surrounds the current one. TheLP in the ACB is the current local pointer.

Page 7: in - Stacks

T

<PAGE 4PERQ QCode Reference Manual

Q-Machine Architecture

1.8 Memory Organization

The PERQ's virtual memory system features a segmented32 bit virtual address space mapped into a 20 bit physicaladdress space. The segment is the unit of swappability , andcomes in two types:

1) Code segments which are byte-addressed, read-only,and fixed in size with a maximum size of 64K bytes(32K words) .

2) Data segments which are word-addressed, read-write,and variable in size with a maximum size of 64Kwords.

A PERQ process is a collection of up to 64K code anddata segments. One of the data segments is the stacksegment. Every process must have a stack segment and atleast one code segment.

All segments are allocated in 256 word chunks and whenin physical memory are aligned on 256 word boundaries.Note: A single segment must exist in contiguous memory, itmay not be fragmented.

Page 8: in - Stacks

\

PERQ QCode Reference ManualQ-Machine Architecture PAGE 5

1.8.l Memory Organization at the Process Level

The memory organization is designed with the followingattributes in mind: 1) to allow separately compiled codesegments to be grouped into a single process, 2) to allowcode segments to be shared among processes, 3) to allow eachcode segment to have its own global variables, and 4) toallow one code segment to reference routines and globalvariables in other code segments. To achieve this, thefollowing high-level characterisics are implemented:

1) All code is re-entrant.

2) Each code segment only refers to other code segmentsby internal (compiler-generated) segment numbers,which are not necessarily the same as thesystem-assigned segment numbers.

3) Each code segment in a process has its own globaldata block on the run-time stack.

4) Each code segment has an external segment table topermit referencing global variables and routinesfrom other code segments.

Page 9: in - Stacks

r

/

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 6

1.8.1.a Global Data

At the global level, there is a Global Data Block (GDB)and an external Segment Table (XST) associated with eachcode segment in a process. For a particular program module,the GDB contains the global variables, and the XSTtranslates internal (compiler-generated) segment numbers(ISNs) to actual system segment numbers (SSNs) and externalGlobal Pointers (XGPs) . In order to simplify the system, wedevote a songle pointer to reference both the current GDBand XST. This Global Pointer (GP) points to the lowestaddress in the GDB and is ALWAYS aligned on a double wordboundary.

I XST i

toward the top of stack

The XST for each segment is indexed by the internalsegment numbers (ISNs). The entry is at GP - 2*ISN (Note:There is no entry for ISN 0; ISN 0 always refers to thecurrent segment) . Each entry contains the offset from stackbase (SB) of an external data block (XGP) and the actualsystem segment number (SSN) of the external segment. TheXGP values are set by the linker, and the SSN values are setby the loader.

+.—_______ ..—

_._.+

+-————-._.-.--———+B —->| I

I undetermined space II I+_

__ .. _._._

_____+

I XST 1 I

+_

<__.

_____+

I GDB 1 I

+___

—.__ —

_____+

+________ —______+

p —->l II GDB i II I+—_—

.■

.■ .—_..— _._.+

Page 10: in - Stacks

i.

PERQ QCode Reference ManualQ-Machine Architecture PAGE 7

1.8.1.b Local Data

At the local level, there is an activation record,which consists of local variables, function result,parameters, temporaries (anonymous variables), theActivation Control Block (ACB) , the previous EStack, andextra values that the routine may push and pop from therun-time stack. Three pointers are used to access and keeptrack of this information: the top-of-stack pointer (TP)the current-activation pointer (AP) , and the local-variablespointer (LP) .

+—__ —___ _ _+I external Global Pointer (XGP) |

+______ _ _

+I System Segment Number (SSN) |+

_ __ _ _+

Page 11: in - Stacks

r

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 8

| Result m-1

I Parameters m-1

| Locals m-1

I Temporaries m-1

I ACB m-1

| EStack m-2

I Extra m-1

I Result m

I Parameters m

I Local m

I Temporaries m

I ACB m

I EStack m-1

I Extra m

toward the top of stack

The function result, parameters, locals and temporariesare located by an offset from LP.

+ — ~ —-—++—__

_.- — ++-— —-—-———+

+ —.—-——.-++_._.__. —_.__.__._.__.._.__.- ++—_.-—._._.—

__._._+

+_.___.

—___. —__ —-_—-—++—_._._._. —_._. _._- —+

LP > I

+ _._._._._. _._. — +

+. _._. _._._. —._._.-+

+_.. __. ._.__. —-_.—+

+_.—_._._ _._._._.*—.——+

AP —->|

+—_._._._._._.. _._.-

_.+

-I—. _._._._._. —+

TP ~ > |+-—————————+

Page 12: in - Stacks

»

PERQ QCode Reference ManualQ-Machine Architecture PAGE 9

Each ACB has the following form

I Static Link (SL)t- „„._„„ ;I Local Pointer (LP) (current) l+ „_ +I Dynamic Link (DL)+-rr„.-"

_ _;I Global Link (GL)

+______

;I Top Link (TL)

I Return Segment Number (RS) I+_-____ . __ _

+I Return Address within Segment (RA) |+---- - ______

+I Return Routine Number (RR) |+ ___-„_._.

_+

toward the top of stack

The values in the ACB are the AP of the surroundingroutine (SL) , the current (not previous) LP, the AP of the6ri-K

DLl__ th! G _ °f the Caller (GL) ' the TP of the caHer(TL), the SSN of the caller (RS) , the PC of the caller (RA) ,and the RN of the caller (RR) . Note: when previous pointervalues are saved in the ACB they are called links: SL, DL,GL, TL; Because the current (not previous) LP is stored inthe ACB, it is called a pointer, not a link.The EStack image immediately follows the ACB and lookslike this:

I Number of Words Saved |

I (ETOS)

I (ETOS-1)

I (ETOS-n)

toward the top of stack

+.-.--..„„„.„—____„—+

+— _-_—_

_,—_—_+

+__ __ ______+

+—-.___—_,__ --++ —_- +

+_.__._._._._._..__

—_ _+

+ _._____._ _+

+—-—__—_+

Page 13: in - Stacks

t

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 10

1.8.1.c Run-Time Stack Organization

The following is an outline of the stack for a processof n segments, executing the mth routine call, which is inthe ith segment:

I undetermined space

I XST 1

I GDB 1

I XST i

I GDB i

I XST n

I GDB n

I ACB 0 (main program)

I Extra 0

I Result 1

I Parameters 1

| Locals 1

I Temporaries 1

I ACB 1

I EStack 0

I Extra 1+ — ~ —r

+_.—_.__._.- -._.- —-—+SB ——>|

+ . _.——————f-

+__—_—__.—_._._..- —

_._.—+

+—_._. —__. —_._.- —--.—-—+

4— __._._._._._ +

+ _»__._ —__.—-—+

GP >l

+ _._._ —_ ____. —-—+

+—_._. —.—_.- -_.-—-.-—++__ —_.-.--— ++. —— ++ —————++_.. _._.

-.-._.+

+_._

_____._._._.-—-—+

+ _.- ++_._. ._._.—— -++ _ .

_._.+

+ _._.. _.- —++ - —— +

Page 14: in - Stacks

«

PERQ QCode Reference ManualQ-Machine Architecture PAGE 11

LP —->|I Result m

I Parameters m

I Locals m

I Temporaries m

AP ——>|I ACB m

I ' EStack m-1

I Extra mTP >|

+______

__+

+__

+

+ _ __._ +

+__. _____ _____+

+ .____.___ __ _+

+_

_ _____+

+ _ ______+

+_

_ _+

toward the top of stack

Page 15: in - Stacks

t

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 12

1.8.2 Memory Organization at the System Level

The system makes use of two tables to control memoryusage, the System Segment Address Table and the SystemSegment Information Table. The former contains allinformation which is needed by the Q-Code micro-code(location, size, resident, etc). The latter contains otherinformation which is only referenced by the operating system(reference, I/O and lock counts, maximum size, etc).

1.8.2.a System Segment Address Table

The System Segment Address Table is a dynamic table,which is always resident in physical memory starting atphysical address 0. This table contains two words persegment, and contains all information that the Q-Codemicro-code needs to know about each segment. Theinformation contained in this table is:

1) Segment Base Address (upper 12 bits)

2) Segment Size (number of 256 word blocks - 1)

3) FlagsNot ResidentRecently UsedMovingSharableSegment KindSegment FullSegment Table Entry In Use

The Segment Base Address is the upper 12 bits of thephysical address of the base of the segment. If the segmentis not resident in physical memory, this field is undefined.The lower 8 bits of the Segment Base Address are alwaysguarenteed to be zero (since all segments are aligned on 256word boundaries) .

The Segment Size plus one is the size of the segment in256 word blocks (i.e., Segment Size 0 = 256 words).

The Flags have the following meanings and uses:

Not Resident - When true, this flag indicates thatthe segment is either swapped out or thatthe segment table entry is not in use. Whenfalse, this flag indicates that the entry isin use and the segment it describes isresident in physical memory. (See the"Segment Table Entry In Use" flag.)

Page 16: in - Stacks

%

PERQ QCode Reference ManualQ-Machine Architecture PAGE 13

Recently Used - This flag is set when a segment isaccessed. it is used by the swapper todetermine which segments are likelycandidates to be swapped out when space isneeded.

Moving - This flag, when true, indicates that thesegment is being moved from one location inphysical memory to another. If moving istrue, Resident will be false. Moving isused only by the swapper to determine how tohandle segment faults. (Not used by theQ-Code micro-code) .

Sharable - when true, this flag indicates that asegment may be shared by several processes.(Not used by the Q-Code micro-code)

Segment Kind - This flag indicates whether thesegment is a data or code segment. (Notused by the Q-Code micro-code)

Segment. Full - This flag, when true, indicates thatthe entire data segment has allocated (viathe Pascal New procedure) . This flag isneeded to distinguish full and empty datasegment (and has no relevant meaning forcode segments) . (Not used by the Q-Codemicro-code )

Segment Table Entry In Use - This flag is set truewhen the segment table entry contains avalid segment.

The arrangement of these fields within the two wordsshown below:are

Bit 15 8 7 0

+___

___ ___ _____

—_+___________

________+■+

Word 0 ! Base Addr (bits 8-15) |

BitBit 15 4 3 0+______ _____________

__+___________

_+Word 1 I Segment Size | BA (16-19) I

+-_____________________ _______+________

_+

! Base Addr (bits 8-15) | Flags I

+________________

+ ______________;

Page 17: in - Stacks

J

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 14

The positions of the flags within the low byte ofWord 0 are:

1.8.2.b System Segment Information Table

There is no information in the System SegmentInformation Table which is needed by the Q-Code micro-code;hence it is not described here. See the documentation onthe Memory Manager.

1.8.2.C Code Segment Organization

A code segment contains the code for all routines in asegment and a routine dictionary which contains vitalinformation about each of these routines.

The first word of every code segment is the offset fromthe base of the segment to the first word of the routinedictionary. The second word contains the number of routineswhich are defined in the segment. These two words arefollowed by the actual code which comprise the routines.Finally, the code is followed by the routine dictionary.The code is padded with 0 to 3 words of 0s (by the compiler)so that the routine dictionary is aligned on a quad-wordboundary. This is possible since the compiler knows thatthe base of the segment will also be aligned on a quad-wordboundary. It should also be noted that each entry in thedictionary is exactly 2 quad-words long (8 words). Theroutine dictionary is indexed by (Base Address ofDictionary)+B*RN. Each entry has the following form:

it Flag

0 Resident123

MovingRecently UsedSharable

456

Segment KindSegment FullTable Entry In Use

7 not used

Page 18: in - Stacks

1

PERQ QCode Reference ManualQ-Machine Architecture PAGE 15

I Parameter Size (PS)

_ _________ _ _+

! Entry Address Within Segment |

I Exit Address Within Segment |

I Lexical Level (LL)

I not used 1

I not used 2

toward high memory

The Fntry and Exit Addresses are the offsets from codebeginningbase (CB) to the beginning of the routine and the

of the "terminate code" of the routine.

+___________ —____ —_

++________ —_________________ —+! Result + Parameter Size (RPS) |

! Local + Temporary Size (LTS) |+___________.________ _._ _.++_____ —___ ____ ______

++__

__ _______ —___+

+_ _ _—+

+_ ___ —______ —+

+____ —_—______ _ _+

Page 19: in - Stacks

f

16PERQ QCode Reference ManualQ-Machine Architecture

PAGE

/

The following is a sample of a code segment3 routines:

containing

| Pointer to Routine Dictionary |

| Number of Routines (3)

| Code for Routine 1 v

| Code for Routine 2 v

+- -+

| Code for Routine 3 v

| RD Entry for Routine 1

I RD Entry for Routine 2

I RD Entry for Routine 3

toward high memory

+________________ —_—

_._._._.+

> —r+________ —________

____-_+

+_________________—__ —

_._._._._._._.+

+_____________-..____ —-___.-_ +

+_._._.-.-.-._.——.—.—-—-———-—.—+< —-r

+__

___________________.-____+

+__—_______ —

._____________.___+

+____________— .-.-____.-__-_ —

__.__+

Page 20: in - Stacks

X

+

PERQ QCode Reference ManualQ-Machine Architecture

PAGE 17

I.C Error Handling and Fault Conditions

Errors and faults are handled by performing CALLVs tospecial routines (See section 4.D). The variable routinedescriptors for these special routines can be found in aspecial table, the location and format of which will beknown by the micro-code.

Page 21: in - Stacks

18PERQ QCode Reference ManualInstruction Format

PAGE

2. Instruction Format

Instructions on the Q-machine are one byte longfollowed by zero to four parameters. Parameters are eithera signed byte (B : range -128 to 127) , an unsigned byte (UB: range 0 to 255) or a word (W) . Words need not be wordaligned (unless specified). The low byte is first in theinstruction byte stream.

Any exceptions to these formats are noted with theinstructions where they occur.

3 . Pointers

There are five different types of pointers, defined asfollows: (Note: 20 bit offsets may only exist on theEStack) .

Word Pointer: A 20 bit offset from Stackßase(Stackßase is the 20 bit physical address of thebase of the stack)

Byte Pointer: A 20 bit offset from Stackßase to thebase of the byte array (TOS-1) and a byte offsetinto the array (TOS) .

String Pointer: Same as a byte pointer.

Packed Field Pointer: A2O bit offset from Stackßaseto the base of the word the field is in (TOS-1)and a one word field descriptor (TOS)

Field Descriptor:

Bits 0-3: The field width (in bits) minus 1

Bits 4-7: The rightmost bit of the field.

Pascal Pointer: Obtained by declaring a variable as apointer to another data type. (i.e., varI: "lnteger;) (TOS-1) is the system segment numberthat contains the datum. (TOS) is the offset fromthe segment base to the datum.

Implementation Note: Stacks grow from low addresses to highaddresses (i.e., if the address of TOS is 10 then theaddress of TOS-1 is 9 — not 11) .

Page 22: in - Stacks

V

PERQ QCode Reference ManualQCode Descriptions

PAGE 19

4. QCode Descriptions

4.A Variable Fetching, Indexing, Storing and Transferring

4.A.1 Loads and Stores of One Word

4.A.1. a Constant One Word Loads

Load Word Constant. Pushes thevalue (o. .ls) , with high byte zero,onto the EStack.

Load Constant Nil. Pushes the valueof NIL onto the EStack.

Load Constant -1 .Load Constant Byte. Pushes the nextbyte on the EStack, with signextend.

Load Constant Word. Pushes the nextword on the EStack.

Page 23: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 20

4.A.1.b Local One Word Loads and Stores

LDL0..15 109-124 Short Load Local Word. LDLx fetchesthe word with offset x in thecurrent activation record and pushesit onto the EStack.

Load Local Word/Byte Offset.Fetches the word with offset UB inthe current activation record andpushes it on the EStack.

Load Local Word/Word Offset.Fetches the word with offset W inthe current activation record andpushes it on the EStack.

Load Local Address/Byte Offset.Pushes a word pointer to the wordwith offset UB in the currentactivation record on EStack.

Load Local Address/Word Offset.Pushes a word pointer to the wordwith offset W in the currentactivation record on EStack.

129-136 Short Store Local Word. Store(ETOS) into word with offset xinthe current activation record.

STLO. .7

STLB UB 127 Store Local Word/Byte Offset. Store(ETOS) into word with offset UB inthe current activation record.

STLW W 128 Store Local Word/Word Offset. Store(ETOS) into word with offset W inthe current activation record.

Implementation Note: The address of the first local (offset0) is contained in the Local Pointer register (LP).The address of the Nth local is computed as (LP) + N.

Page 24: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 21

4.A.1.C Own One Word Loads and Stores

LD00..15 139-154 Short Load Own Word. LDOx fetchesthe word with offset x in thecurrent Global Data Block (GDB) andpushes it on the EStack.

LDOB UB 137 Load Own Word/Byte Offset. Fetchesthe word with offset UB in thecurrent Global Data Block (GDB) andpushes it on the EStack.

LDOW W 138 Load Own Word/Word Offset. Fetchesthe word with offset W in thecurrent Global Data Block (GDB) andpushes it on the EStack.

LOAB UB 155 Load Own Address/Byte Offset.Pushes a word pointer to the wordwith offset ÜBin the current GlobalData Block (GDB) on EStack.

LOAW W 156 Load Own Address/Word Offset.Pushes a word pointer to the wordwith offset W in BASE activationrecord on EStack.

5T00..7 159-166 Short Store Own Word. STOx stores(ETOS) into the word with offset xin the current Global Data Block(GDB) .

STOB UB 157 Store Own Word/Byte Offset. Stores(ETOS) into the word with offset UBin the current Global Data Block(GDB) .

STOW W 158 Store Own Word/Word Offset. Stores(ETOS) into the word with offset Win the current Global Data Block(GDB) .

Implementation Note: The address of the first own (offset0) is contained in the Global Pointer register (GP) .The address of the Nth own is computed as (GP)+N.

Page 25: in - Stacks

f

PERQ QCode Reference Manual PAGE 22QCode Descriptions

4.A.1.d Global One Word Loads and Stores

LDGB URI,UB2 19 2 Load Global Word/Byte Offset. Loadsthe word with offset

ÜB2

in theGlobal Data Block (GDB) for programsegment

ÜBI

onto EStack.

ÜB,W

193 Load Global Word/Word Offset. Sameas LDGB except a full word offset isused .

LDGW

LGAB U81,U82 194 Load Global Address/Byte Offset.Pushes a word pointer to the wordwith offset

ÜB2

in the Global DataBlock (GDB) for program segment

ÜBI

onto EStack.

LGAW 195 Load Global Address/Word Offset.Same as LGAB except a full wordoffset is used.

ÜB,W

LGAWW WI ,W2 181 Load Global Address/Word Segment,Word Offset. Same as LGAB except afull word is used both for thesegment number and the offset.

STGB U81,U82 196 Store Global Word/Byte Offset.Stores (ETOS) in word with offset

ÜB2

in the Global Data Block (GDB)for program segment

ÜBI

.STGW

ÜB,W

197 Store Global Word/Word Offset. Sameas STGE except a full word offset isused .

Note : To achieve LDGW and STGW with full word segmentnumbers, use LGAWW with LDIND orSTIND.

Implementation Note: Self-relative pointers to the GlobalData Blocks (GDB) for each externally referencedsegment are contained in the External Segment Table(XST) , pointed to by the Global Pointer (GP) . Theaddress of the first global (offset 0) in thedesignated GDB is computed as GP - 2 * ISN, where ISN(Internal Segment Number) is the program segment numberspecified in the load or store instruction. The Nthglobal is addressed by the base address (computes asabove) plus N.

Page 26: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

23PAGE

4.A.1 c Intermediate One Word Loads and Stores

Load Intermediate Word/Byte Offset.

ÜB.I

indicates the number of staticlinks to traverse to find theactivation record to use.

ÜB2

isthe offset within the activationrecord of the desired word. Thedatum is pushed on EStack.

Load Intermediate Word/Word Offset.Same as LDIB except a word offset isused .Load Intermediate Address/ByteOffsetEStack

A word pointer is pushed on(determined as in LDIB) .

Load Intermediate Address/WordOffsetEStack

A word pointer is pushed on(determined as in LDIW) .

Store Intermediate Word/Byte Offset.Stores (ETOS) in memory (addressdetermined as in LDIB).

Store Intermediate Word/Word Offset.Stores (ETOS) in memory (addressdetermined as in LDIW) .

Implementation Note: The Activation Pointer register (AP)contains the address of the current Activation ControlBlock (ACB). Within the ACB is the Static Link (SL) tothe previous ACD . To compute the address of the firstintermediate word of the desired level, traverse theStatic Links to the correct ACE. Within the ACB is theLocal Pointer (LP) for that activation record.

Page 27: in - Stacks

24PERQ QCode Reference ManualQCode Descriptions

PAGE

4.A.1.f Indirect One Word Loads and Stores

Store lndir_ct. (ETOS) is storedinto the word pointed to by wordpointer (ETOS-1) .

STIND 21

173 Load Indirect. Word pointed to byword pointer (ETOS) is pushed onEStack.

LDIND

Page 28: in - Stacks

s,

PERQ QCode Reference ManualQCode Descriptions PAGE 25

4.A. 2 Loads and Stores of Multiple Words

4.A. 2. a Double Word Loeds and Stores (Reals and Pointers)LDDC <block> 237 Load Double Word mn K

r-,-inr

'

/ki„

Load Double Word Constant. <block>is a double word constant. Load theconstant onto EStack.

LDDW 239 Load Double Word. (ETOS) is a wordpointer to a double word. Thedouble word is pushed onto EStack.

STDW 18 3 Store Double Word. (ETOS) , (ETOS-1)is a double word and (ETOS-2) is aword pointer to a double word blockof memory. The double word ispopped from ESTACK into the doubleword pointed to by (ETOS-2).

4.A.2.b Multiple Word Loads and Stores (Sets)

LDMC ÜB,<block> 236 Load Multiple Word Constant. UB isthe number of words to load, and<block> is a block of UB words, inreverse word order. Load the blockonto the MStack.

LDMW 238 Load Multiple words. (ETOS-1) is aword pointer to the beginning of ablock of (ETOS) words. Push theblock onto the MStack.

STMW 182 Store Multiple Words. The MStackcontains a block of (ETOS) words,(ETOS-1) is a word pointer to asimilar block. Transfer the blockfrom MStack to the destinationblock.

Page 29: in - Stacks

26PERQ QCode Reference ManualQCode Descriptions

PAGE

4 .A. 3 Byte Arrays

Note: A byte pointer is loaded onto the stack with aLLA, LOA or LGA of the base address of the array followed bythe computation of the offset.

Load Byte. Push the byte (afterzeroing the high Byte) pointed to bybyte pointer (ETOS) , (ETOS-1) onEStack.

Store Byte. Store the low byte of(ETOS) into the location specifiedby byte pointer (ETOS-I) , (ETOS-2) .Move Bytes/Byte Counter.(ETOS) , (ETOS-1) is a source bytepointer to a block of UB bytes, and(ETOS-2) , (ETOS-3) is the destinationbyte pointer to a similar block.Transfer the source block to thedestination block.

Move Bytes/Word Counter. Same asMVBB except ( ETOS-I) , (ETOS-2) is thesource byte pointer,(ETOS-3) , (ETOS-4) is the destinationbyte pointer, and (ETOS) is thenumber of bytes to transfer.

Page 30: in - Stacks

V

PAGE 27PERQ QCode Reference ManualQCode Descriptions

4.A. 4 Strings

ÜB,<chars> 19 Load String Address. UB is thelength of the string constant<chars>. A string pointer is pushed

LSA

on EStack (the virtual address of UBis pushed followed by a zero) . UBis word aligned.

String Assign. (ETOS-I) , (ETOS-2) isthe source string pointer, and(ETOS-3) , (ETOS-4) is the destinationstring pointer. (ETOS) is thedeclared length of the destination.The length of the source anddestination are compared, and if thesource string is longer than thedestination a run-time error occurs.Otherwise all bytes of sourcecontaining valid information aretransferred to the destinationstring.

184SAS

Load Character. (ETOS) , (ETOS-1) isa string pointer. (ETOS) is checkedto insure that is lies within thedynamic length of the string. Ifso, the character pointed to by(ETOS) , (ETOS-1) is pushed;otherwise, a run-time error occurs.

LDCH 25

Store Character. (ETOS) is acharacter and (ETOS-I) , (ETOS-2) is astring pointer. (ETOS-1) is checkedto insure that is lies within thedynamic length of the string. Ifso, the character (ETOS) is storedin the string, at the positionpointed to by (ETOS-I ), (ETOS-2) ;otherwise a run-time error occurs.

STCH 28

Page 31: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 28

and Array Indexing and Assignment

Move Words/Byte Counter. (ETOS) isa word pointer to a block of UBwords, and (ETOS-1) is a wordpointer to a similar block. Theblock pointed to by (ETOS) istransferred to the block pointed toby (ETOS-1) .Move Words/Word Counter. Same asMOVB except (ETOS-1) is the sourcepointer, (ETOS-2) is the destinationpointer, and (ETOS) is the number ofwords to be transfered.

Short Index and Load Word. SINDxindexes the word pointer (ETOS) by xwords, and pushes the word pointedto by the result on ESTACK. (Note:SINDO is synonymous to LDIND) .Static Index and Load Word/ByteIndex. Indexes the word pointer(ETOS) by UB words, and pushes theword pointed to by the result onESTACK.

Static Index and Load Word/WordIndex. Same as INDB except a fullword index is used.

Increment Field Pointer/Byte Index.The word pointer (ETOS) is indexedby UB words and the resultantpointer is pushed on ESTACK.

Increment Field Pointer/Word Index.Same as INCB except a full wordindex is used.

Note: INCB(ETOS) . and INCW are equivalent to add UB or W to

IXAB UB 222 Index Array/Byte Array Size. (ETOS)is an integer index, (ETOS-1) is aword pointer to the base of thearray, and UB is the size (in words)of an array element. A word pointerto the first word of the indexedelement is pushed on ESTACK.

Index Array/Word Array Size SameIXAW 223

Page 32: in - Stacks

PERQ QCode Reference Manual 29PAGEQCode Descriptions

as IXAB except (ETOS-1) is theinteger index, (ETOS-2) is the wordpointer to the base of the array,and (ETOS) is the size (in words) ofan array element. (GenlA) full wordis used for the array element size.

1XA2..4 224-226 Index Array/Short Array Size. Sameas IXAB except array element sizesare fixed at 2-4.

IXP UB 214 Index Packed Array. (ETOS) is aninteger index, and (ETOS-1) is aword pointer the base of the array.Bits 4-7 of UB contain the number ofelements per word minus 1, and bits0-3 contain the field width (inbits) minus 1. Compute and push apacked field pointer.

LDP 26 Load a Packed Field. Push the fielddescribed by the packed fieldpointer (ETOS) , (ETOS-1) on ESTACK.

STP 27 Store into Packed Field. .. Store(ETOS)' in the field described by thepacked field pointer(ETOS-I) , (ETOS-2) .

ROTSHI UB 221 Rotate/Shift. (ETOSi-1) is theargument to be rotated or shifted,and (ETOS) is the distance to rotateor shift. If UB is 0 then a rightrotate occurs, and if UB is 1 then ashift occurs. The direction of theshift is determined from (ETOS); If(ETOS) >= 0 then a left shiftoccurs, otherwise a right shift.

Page 33: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 30

4.8 Top of Stack Arithmetic and Comparisons

4.8.1 Logical

LAND 30 AND (ETOS) into

LOR 31 OR (ETOS) into

LNOT 32 Logical Not. Take one's complementof (ETOS) .

EQUBOOL 33

NEQBOOL 34

LEQBOOL 35

LESBOOL 36

GEQBOOL 37

GTRBOOL 38

(ETOS) and push true or false onESTACK.

Logical Add(ETOS-1) .Logical Or(ETOS-1) .

Page 34: in - Stacks

PERQ QCode Reference Manual PAGE 31QCode Descriptions

4.8.2 Integer

ABI 71 Absolute Value of Integer. Takeabsolute value of (ETOS) . Result isundefined if (ETOS) is initially-32768.

AD I 72 Add Integers.(ETOS-1) . Add (ETOS) and

NGI 73 Negate Integer. Tacomplement of (ETOS) .Take the two's

SBI 74

MP I 75 Multiply Integers. Multiply (ETOS)and (ETOS-1) . This instruction maycause overflow if the result islarger than 16 bits.

76 Divide Integers. Divide (ETOS-1) by(ETOS) and push quotient (as definedby Jensen and Wirth).

DVI

MODI 77 Modulo Integers. Divide (ETOS-1) by(ETOS) and push the remainder (asdefined by Jensen and Wirth) .Check Against Subrange Bounds.Insure that (ETOS-1) <= (ETOS-2) <=(ETOS), leaving (ETOS-2) on top ofthe stack. If conditions are notmet a run-time error occurs.

CHK 78

EQUI 39

NEQI 40

LEQI 41

42LESI <f

GEQI 43

GTRI 44comparisons. Compare (ETOS-1) to(ETOS) and push true or false onESTACK.

Subtract Integers. Subtract (ETOS)from (ETOS-1) .

Integer =,

<>/

<=f

>=f

and >

Page 35: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 3 2

4.8.3 Reals

All over/underflows cause a run-time error

Float. The integer (ETOS) isconverted to a floating point numberand pushed onto EStack.

Truncate Real. The real(ETOS) , (ETOS-1) is truncated (asdefined by Jensen and Wirth) ,converted to an integer, and pushedonto EStack.

Round Real. The real(ETOS) , (ETOS-1) is rounded (asdefined by Jensen and Wirth),truncated and converted to aninteger, and pushed onto EStack.

Absolute Value of Reals. Take theabsolute value of the real(ETOS) , (ETOS-1) .Add Reals. Add (ETOS) , (ETOS-1) and(ETOS-2) , (ETOS-3) .Negate Real. Negate the real(ETOS) , (ETOS-1) .

Subtractfrom

(ETOS-2) , (ETOS-3) .Multiply

and(ETOS-2) , (ETOS-3) .

Divideby

(ETOS) , (ETOS-1)

<-,

GTRREAL 50 and >

Subtract Reals.(ETOS) , (ETOS-1)

Multiply Reals.(ETOS) , (ETOS-1)

Divide Reals.(ETOS-2) , (ETOS-3)

Real =,

Of

<=f

>=f

Page 36: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 33

comparisons. Push true or false onESTACK.

Page 37: in - Stacks

PERQ QCode Reference Manual PAGE 34QCode Descriptions

Adjust Set. The set on the top ofthe MSTACK is forced to occupy UBwords, either by expansion orcompression, and its length word ispopped from ESTACK.

Build Singleton Set. The integer(ETOS) is checked to insure that 0<= (ETOS) <= 32,767, the set[(ETOS)] is pushed on MSTACK, andthe size of the set is pushed onESTACK. If (ETOS) is out of range,the null set is pushed (a zero ispushed on ESTACK, the MSTACK is notaltered) .Build Subßange Set. The integers(ETOS) and (ETOS-1) are checked asin SGS, the set [(ETOS-I) .. (ETOS) ]is pushed onto MSTACK, and the sizeof the set is pushed on ESTACK.(The null set is pushed if (ETOS-1)> (ETOS) or either is out of range).

Set Membership. See if integer(ETOS) is in set contained on thetop of MSTACK, and with length(ETOS-1) , pushing TRUE or FALSE onESTACK.

Set Union. The union of the twosets contained on the top of MSTACK,and sizes (ETOS) and (ETOS-1) ispushed on MSTACK, and the length ofthe result on ESTACK.

Set Intersection. The intersectionof the two sets contained on the topof MSTACK, and sizes (ETOS) and(ETOS-1) is pushed on MSTACK, andthe length of the result on ESTACK.

Set Difference. The difference ofthe two sets contained on the top ofMSTACK, and sizes (ETOS) and(ETOS-1) is pushed on MSTACK, andthe length of the result on ESTACK.

NEQPOWR 64

Set =,

Of

Page 38: in - Stacks

V

PERQ QCode Reference Manual PAGE 35QCode Descriptions

LEQPOWR 65

GEQPOWR 67comparisons of the two sets on topof ESTACK, with sizes (ETOS) and(ETOS-1) .

<= (subset of) ,and >= (superset of)

Page 39: in - Stacks

J

PERQ QCode Reference Manual PAGE 36QCode Descriptions

4.8.5 Strings

EQUSTR 51

NEQSTR 52

LEQSTR 53

LESSTR 54 <f

GEQSTR 55

GTRSTR 56comparisons. The string pointed toby string pointer (ETOS-2) , (ETOS-3)is lexicographically compared to thestring pointed to by string pointer(ETOS) , (ETOS-1) .

String =,

Or

<=f

>=f

and >

Page 40: in - Stacks

V

PERQ QCode Reference Manual PAGE 37QCode Descriptions

4.8.6 Byte Arrays

<f

comparisons. <=, <, >=, and > areonly emitted for packed arrays ofchar. The argument, ÜB, ifnon-zero, is the size of the array.If UB is equal to 0 then (ETOS) isthe size of the array.

Byte Array =,

<>,

<=f

>=,

and >

Page 41: in - Stacks

i

PERQ QCode Reference ManualQCode Descriptions

PAGE 38

4.8.7 Array and Record Comparisons

EQUWORD UB 69 Word or multiword structure

NEQWORD UB 70comparisons. The argument,

ÜB,

ifnon-zero, is the size of the array.If UB equals 0, then (ETOS) is thesize of the array.

and <>

Page 42: in - Stacks

fc

PERQ QCode Reference Manual PAGE 39QCode Descriptions

4.C Jumps

JMPB B 204 Unconditional Jump/Byte Offset. Bis added to the IPC. Negativevalues of B cause backward jumps.

JMPW Unconditional Jump/Word Offset. Wis added to the IPC. Negativevalues of W cause backward jumps.

W 205

JFB B 206 FalseJMPB)

Jump/Byte Offset. Jump (as inif (ETOS) is false.

JFW W 207 FalseJMPW)

Jump/Word Offset. Jump (as inif (ETOS) is false.

JTB B 208 True Jump/Byte Offset. Jump (as inJMPB) if (ETOS) is true.

JTW W 209 True Jump/Word Offset. Jump (as inJMPW) if (ETOS) is true.

JEQB B 210 Equal Jump/Byte Offset. Jump (as inJMPB) if integer (ETOS) equals(ETOS-1) .

JEQW W 211 Equal Jump/Word Offset. Jump (as inJMPW) if integer (ETOS) equals(ETOS-1) .

JNEB B 212 Not Equal Jump/Byte Offset. Jump(as in JMPB) if integer (ETOS) isnot equal to (ETOS-1) .

JNEW W 213 Not Equal Jump/Word Offset. Jump(as in JMPW) if integer (ETOS) isnot equal to (ETOS-1) .

XJP Wl,W2,W3,<Case Table> 100

Case Jump. Wl is word-aligned, andis the minimum index of the table.W2 is the maximum index. W3 is theoffset to the code to be executed ifthe case specified has no entry inthe case table. The case table isW2 - Wl + 1 words long and containsoffsets to the code to be executedfor each case.

If (ETOS) , the actual index, is notin the range W1..W2 then W3 is addedto IPC. Otherwise (ETOS) - Wl is

Page 43: in - Stacks

PERQ QCode Reference Manual PAGE 40QCode Descriptions

used as an index into the case tableand the index entry is added to IPC.

Page 44: in - Stacks

PERQ QCode Reference ManualQCode Descriptions

PAGE 41

4.D Routine Calls and Returns

Note: There can be at most 256 routines in a segment.

Call Variable Routine. (ETOS)(ETOS-3) are a variable routinedescriptor (as described above inLVRD) . Residency of the segment arechecked. If the segment isresident, the call is made as willCALL, except the GP and SL are takenfrom the variable routinedescriptor; if not, a segment fault

Call Routine. Call routine

ÜB,

which is in the current segment.

Call External Routine/Byte Segment.

ÜBI

is the internal segment number(ISN) which contains the routinenumbered

ÜB2

to be called. Firstthe ISN is translated to the correctSSN, and residency of that segmentis checked. If the segment isresident, the call proceeds; ifnot, S0 is loaded with the SSN, SIis cleared, the PC is backed up sothat the call will be re-executed,and a segment fault occurs. Thesecond attempt is guarenteed tosuceed, since the process will beunable to resume execution until thesegment in S0 is resident.

Call External Routine/Word Segment.Same as CALLXB except the internalsegment number (ISN) is given in afull word.

Load Variable Routine Descriptor.This Q-Code pushes a VariableRoutine Descriptor on the EStack forthe routine

ÜBI

in segment ISN W, atlexical level

ÜB2

. The followingvalues (which comprise a variableroutine descriptor) are pushed:ETOS = System Segment Number (SSN) ;ETOS-1 = Global Pointer, representedas an offset from SB;ETOS-2 = Routine Number; andETOS-3 = Static Link (determined asif a call were actually performed tothe routine here) .

Page 45: in - Stacks

PERQ QCode Reference Manual 42PAGEQCode Descriptions

occurs as with CALLX.

Return from Routine. Return fromthe current routine. If the routinewas a function, the function valueis left on the top of the MStack.Since the first word of a codesegment is not code, but an offsetto the routine dictionary, if the RAwhich is being returned to is 0, thereturn is performed to the exit codeof that routine. (This will proveuseful for the EXIT and EXGO Q-Codesdescribed below) .Exit from Routine. Exit from allroutines up to and including themost recent invokation of theroutine UB in ISN W. This isaccomplished by setting the RAs inall the ACBs to 0, from the mostrecent through and including thefirst ACB which was created from aninvokation the routine to beexitted, and jumping to the exitcode of the current routine.

Exit and Goto. Exit from allroutines up to, but not including,routine UB in ISN Wl , and then jumpto the instruction with offset W2from CB. The implementation issimilar to EXIT, except the last RAmodified is loaded with W2 .

Page 46: in - Stacks

* »

PERQ QCode Reference ManualQCode Descriptions

PAGE 43

4.E Systems Programs Support Procedures

No-Operation.

Replicate. Replicate (ETOS)

Replicate Two. Replicate twotop-of-estack words (i.e., firstpush original (ETOS-1) , then pushoriginal (ETOS) ) .Move to Memory Stack. Push (ETOS)onto MTOS (16 bit transfer).

Move to Expression Stack. Push(MTOS) onto ETOS (16 bit transfer -top 4 bits are zeroed) .Move Double to Memory Stack.Transfer the top two words from theEStack to the MStack. The order isreversed; old (ETOS) will be(MTOS-1) , (ETOS-1) will be (MTOS) .Move Double to Expression Stack.Transfer the top two words from theMStack to the EStack. THe order isreversed; old (MTOS) will be(ETOS-1) , (MTOS-1) will be (ETOS) .Process Switch.

(ETOS) and (ETOS-1) are wordpointers to RODef records. (ETOS-2)and (ETOS-3) are the height andwidth respectively of the transferto be performed. (ETOS-4) is thefunction to be performed.

RODef Record:

First 2 words are the virtualaddress to the first word of theimage area.

The next word is the length of ascan line in words.

Next 2 words are the X and V bitoffsets of window to be transferred.

Function Codes:

Page 47: in - Stacks

+*

PERQ QCode Reference ManualQCode Descriptions

PAGE 44

Return control to the schedular.Set process as not runable (untilset runable by some other process) .More to be added.

Disable interrupts.

Enable interrupts.

Exchange. (ETOS) and (ETOS-1) areswapped.

Exchange Double. The pair (ETOS)and (ETOS-1) are swapped with thepair (ETOS-2) and (ETOS-3).

Translate Top of Stack.(ETOS) , (ETOS-1) is a virtualaddress. if the segment SSN(ETOS-1) is resident, convert thevirtual address to an offset fromstack base (SB) and execute the nextQ-Code (what ever it may be) , without interrupts, to competion. If

0 - Source

1 - NOT Source

2 - Destination AND Source

3 - Destination AND (NOTSource)

4 - Destination OR Source

5 - Destination OR (NOT Source)

6 - Desintation XOR Source

7 - Destination XNOR Source

The above functions can replace,merge, erase, or compliment black onwhite or white on black data (Note:a "1" is a black pixel, a "0" is awhite pixel) .Note: scan lines are word aligned.

(ETOS) is the channel on which tostart 10. Performs a block if 10 isto be synchronous.

Page 48: in - Stacks

*PERQ QCode Reference Manual PAGE 45QCode Descriptions

Special Translate. This translateis similar to the previous translateQ-Codes, except is can specify agreater depth that TLATE3 , and thatit may specify the translation of 2virtual addresses. Each half of UBis interpretted as the depth of theSystem Segment Number word of thevirtual address to be translated(prior to any stack alteration). Adepth of 0 indicates no translation.All segments specified in the STLATEmust be resident before anytranslations occur, otherwise asegment fault occurs. Note, if bothnibbles of UB are non-zero then thelow order nibble (bits 0-3) must beless than the high order nibble(bits 4-7) .Load Stack Segment Number. Pushesthe system segment number of theMStack onto EStack.

Load Top Pointer (plus 1). Pushesthe value of Top Pointer (TP) plus 1onto EStack.

Add to Top Pointer/Byte Value. AddsSB to TP.

Add to Top Pointer/Word Value. Adds(ETOS) to TP.

the segment SSN (ETOS-1) isnon-resident, restore the EStack toits previous state, backup the PC tore-execute the TLATEI and perform asegment fault.

Translate Top of Stack - 1. Same asTLATEI except the virtual address isat (ETOS-I) , (ETOS-2) .Translate Top of Stack - 2. Same asTLATEI except the virtual address isat (ETOS-2) , (ETOS-3) .

Page 49: in - Stacks

<

«"

*PERQ QCode Reference ManualIndex

PAGE 46

INDEX

ABI 31ABR 3 2ACB 3Activation Record 1ADI 31ADJ 34ADR 32AP 2ATPB 45ATPW 4 5

BLOCK 44

CALL 41CALLV 41CALLX 41CB 1CHK 31CS 2

DIF 34DL 2DVI 31DVR . 32

EQUBOOL 30EQUBYT 37EQUI 31EQUPOWR 34EQUREAL 32EQUSTR 36EQUWORD 38ESTACK 1ETOS 1EXCH 44EXGO 42EXIT 42

FLT 32

GDB 1GEQBOOL 30GEQBYT 37GEQI 31GEQPOWR 35GEQSTR 36GL 3GP 2GTRBOOL 30

Page 50: in - Stacks

V**»

PERQ QCode Reference ManualIndex

47PAGE

GTRBYT 37GTRI 31GTRREAL 32GTRSTR 36

INC 28IND 28INN 34INT 34INTOFF 44ISN 1IXA 28, 29IXP 29

JEQ 39JF 39JMP 39JNE 39JT 39

LAND 30LDB 26LDC 19LDCH 27LDCMO 19LDCN 19LDDC 25LDDW 25LDG 22LDI 23LDIND 24LDL 20LDMC 25LDMW 25LDO 21LDP 29LDTP 45LEQBOOL 30LEQBYT 37LEQI 31LEQPOWR 3 5LEQREAL 32LEQSTR 36LESBOOL 30LESBYT 37LESI 31LESREAL 32LESSTR 36LGA 22LIA 23LL 1LLA 20LLAW 20

Page 51: in - Stacks

PERQ QCode Reference ManualIndex PAGE 48

LNOT 30LOA 21LOR 30LP 3LSA 27LSSN 45LTS 2LVRD 41

MES 43MES2 43MMS 43MMS2 43MODI 31MOV 28MPI 31MPR 3 2MSTACK 1MTOS 1MVB 26

NEQBOOL 30NEQBYT 37NEQI 31NEQPOWR 34NEQREAL 32NEQSTR 36NEQWORD 38NGI 31NGR 32NOOP 43

PC 1PS 2PSW 43

RA 3RASTER-OP 4 3RD 3REPL 43RETURN 4 2RN 2RND 32ROTSHI ..... 29RPS .2RR 3RS . . . . , 3

S0 2SI 2SAS 27SB 1SBI _ 31

Page 52: in - Stacks

f >*'

PERQ QCode Reference ManualIndex

PAGE 49

SBR 32Segment 1SGS 34SIND 28SL 2SRS 34SS 2SSN 1STARTIO 44STB 26STCH 27STDW 25STG 22STI 23STIND 24STL 20STLATE 4 5STMW 25STO 21STP 29

TL .2TLATEI 44TLATE2 45TLATE3 45TNC 32TP 2

UNI 34

XGP 3XJP 39XST 3