Download asmintro - Jay Moseley

Transcript
CS411MC2 - 05
F. QSRCH - LIST SEARCH AND INSERT
&LABEL
QSRCH
&RND,&HDR,&RGW=(RWK1,RWK2),&KO=4,&KL=KEYL
This macro searches the list begun by header &HDR, which is linked
in ascending order by KEY fields, for the correct place to insert the
NODE addressed by register &RND. The KEY fields are at offset &KO, and
are &KL bytes long. &RGW gives two registers which may be used if
needed for temporary work registers without disturbing
anything.
&RND
&HDR
&RGW
gives address of the NODE to be inserted.
is the name of the list HEADER CELL.
gives the names/numbers of 2 registers which can safely be
used as temporary work registers, and destroyed by the macro.
gives a number (or EQU symbol) of the offset in bytes from the
beginning of the NODE to the KEY field in the NODE.
is the length (number or EQU value) of the KEY field.
&KO
&KL
Note that the NODE to be inserted is inserted AFTER any NODES which
have the SAME KEY value.
SEARCH
+SEARCH
+QQ0002AA
+
+
+
+
+
+
+
QSRCH
LA
LR
L
LTR
BZ
CLC
BNH
ST
ST
R10,HDR1
RWK1,HDR1
RWK2,RWK1
RWK1,LINK(,RWK1)
RWK1,RWK1
*+14
4(KEYL,RWK1),4(R10)
QQ0002AA
RWK1,LINK(,R10)
R10,LINK(,RWK2)
G. QSNAP - PRINT CONTENTS OF LIST
&LABEL
QSNAP
&HDR,&MSG,&RGW=(RWK1,RWK2),&COUNT=4095,&LEN=20
This macro dumps the list beginning at the HEADER &HDR, using XSNAP
if desired with a message &MSG printed. The work registers needed are
given by &RGW, and up to &COUNT NODES are printed.
&HDR
&MSG
&RGW
&COUNT
&LEN
is name of LIST HEADER.
is quoted string used as title for list output.
specifies names/numbers of 2 registers which may be erased.
specifies the maximum number of nodes to be
printed.
is an absolute expression giving node length in bytes.
DUMP
+DUMP
+
+QQ0008AA
+
+
+QQ0008BB
QSNAP
LA
LA
QNEXT
XSNAP
BCT
EQU
HDR1,'LIST 1',COUNT=4,LEN=NODELEN
RWK1,4
RWK2,HDR1
RWK2,END=QQ&SYSNDX.BB
(not
expanded)
LABEL=&MSG,T=NO,STORAGE=(*0(RWK2),*&LEN.(RWK2))
RWK1,QQ0008AA
*