Macros for handling large numbers

© Copyright Sergio ovacchini, 1982-1983. All rights reserved.

Short macro descriptions.

This set of macros was created for manipulating large numbers.

Remark1:
(IM) Means Internal Macro, Not intended for use in a program.
... (omissis) ... indicates that I have NOT analyzed macro, so I described only its use.

Remark2:
This page contains small code samples, which do not format correctly. These code snippets will be moved to the relevant macro details page in due time.

$

Used for LABELS; they are used separated from their operaration field to permit UPDATE to insert lines without change line number

$$DSGEN

(IM) Used by $DCL macro to generate variable declarations
Usage: $$DSGEN &TYPE,LMOD=

&TYPE
a type of variables: F, D, C etc...
LMOD
a parameter for length modifier, has values:

Example:

         $$DSGEN (D,L),LMOD=ONLY

Expl.: Declatives are generated for variables of type "D" and "L" only if is present length modifier.

$$GETREL

(IM) Used to obtain an already set Condition Code.
(NOT COMPLETED)

$$REG#

(IM) To return a numerical value indicating if a symbolic name &OPERAND is a register, type of reg., etc...
Usage:

         $$REG# &OPERAND

The variable &$REG# is set:
-1 &OPERAND isn't a register,
0 15 num. of a general register
-16 -22 Float 0 to 6
-256 -271 Control registers 0 to 15

$@#

Used to assign to a even-odd reg.'s pair the adress (@) and a length (#) of an operand
Usage:

         $@# &REG,&OP

$A

Add (with carry) &OPERAND to &RESULT, &CARRY contains Carry from additions. Used in loops to repeatedly add pieces (words) of numbers
Usage:

         $A    &RESULT,&OPERAND,&CARRY

$ACR

Add Carry register, used to add carry from prec. oper. to the result, obtaining (in &carry) a new carry.
Usage:

         $ACR  &RESULT,&CARRY

$ACST

Add Complement and STore (in a loop, with carry)
Add &REG to the contents of a word at the end of a string representing the number &OPERAND, complement it, and if a register (&CR), used as control, isn't negative, store value.
See $CHSR for details. Used in MULTIPLY operation.
Usage:

         $ACST &REG,&OPERAND,&CARRY,&WORK=WRKADR,
 &CR=,&RS=,&SV=

$AP

Add Packed (with carry) as $A, for packed numbers.
Usage:

         $AP   &RESULT,&OPERAND,&CARRY

$APC

Add Packed Carry. Has the same use as $ACR, but for Packed numbers.
Usage:

         $APC &RESULT,&CARRY

$APNT

Advance PoiNTer (in loop). Used to modify address and Length of an &OPERAND. A work register is used to set the length of a treated piece.
Usage:

         $APNT &OPERAND,&WORK=WRKADR

$AR

Add Register (with carry). See $A.

$ARGS

Used to define Procedure PARAMETERS.
Usage:

         $ARGS &OPRNDS,&PARMPTR=PARMPTR
&OPRNDS
a variables list whose addressing instructions are to be generating.
PARMPTR
a gen register to be used as pointer of a list of addresses.

Es.:

*       parm. definition
         $ARGS (VAR1,VAR2,VAR3,VARN),PARMPTR=R1
*
         $USE  VAR1,R2   R2 is used to address VAR1
         .....
         MVC   WORK(8),VAR2  N.B. No len. info of VAR1 ..
*           was passed.

$AST

Add and STore Nooverflow (with carry, in a loop). Add data contained in &REG to the contents of a word at the end of a string representing the number &OPERAND. No Overflow occurs.
Usage:

         $AST  &REG,&OPERAND,&CARRY,&WORK=WRKADR
&REG
the register to be added
&OPERAND
the name of the string in which is stored the number
&CARRY
a register used to contain carry from add.
WORK= ...
indicate a register to be used as work.

$ASTN

Same as $AST, but no test if performed for overflow.

$BSF

Binary Shortest Form. Is used to reduce a number to its shortest form; trunc. is done on byte basis.
Usage:

         $BSF  &OPERAND,&WORK=(WRKLNK,WRKADR)
&OPERAND
the string containing the number
WORK=
specifies 2 reg. used as work.

On return Condition Code:
CC = 0: length is 1 byte; the value of the number is 0 or -1.
CC = 1: number is negative
CC = 2: number is positive

$BSFP

Binary Shortest Form (positvive numbers). Is a simplified version of $BSF
Usage:

        $BSFP &OPERAND,&WORK=WRKADR

$CALL

Call a program. The code produced by this macro is ADCON-FREE, (the machine code may be moved across memory). Standard OS LINK is generated. may be used also for recursive call. Coherence is checked. Limits: 256 max routine addresses, 256*16 parameter addresses in the same Assembler session.
Usage:

         $CALL &ENTRY,&OPRNDS,&OP1=,&OP2=,&RES=,
 &RES1=,&RES2=,         *
               &R0=,&R1=,&R2=,&R3=,&ID=,&
 WKAPTR=WKAPTR,                *
               &PARMPTR=R1,&LINK=(WRKLNK,WRKADR),&
 STATIC=NO
&ENTRY
the routine name to be called, if it is like: @xxxxxx, then is assumed that this operand contains the routine address; if it is written as (xxxxxxx), then is assumed to be a register containing the address.
&OPRNDS
the parameter list in the form: (p1,p2,p3,,p5,....pn)
&OP1=,&OP2=,&RES=,&RES1=,&RES2=
used to call quickly mathematic function, using registers. For &OP1 are used R4 (address) and R5 (length), for &OP2: R6 & R7, for &RES/&RES1: R8 & R9, for &RES2: R10 & R11. &R0,&R1,&R2,&R3 are used to assign values to these registers.
&ID
the identifier and is used as in OS.
WKAPTR
indicates the pointer to be used for WORK/STACK area; if "NONE" is specified, no address is passed and neither code for recursivity is generated.
PARMPTR
specifies a pointer for paramter list, if the par. list is omitted, no value is assigned to R1 (or oth. reg.).
LINK=(r1,r2)
specifies 2 registers to be used as return address (1. reg) and link addr. (2. reg). By default for return adress is used WRKLNK (R14) for routine address WRKADR (R15).
LINK=SVCnnn
indicates the JUMP must be taken by means of the "nnn" Supervisor Call instr.. If used in the form: LINK=(SVCnnn,r), then "r" is the register containing routine address.
STATIC=NO/(YES/SI)
specifies if LA & ST instr. are to be used to generate the parameter list (STATIC=NO), or constants A(yyyyyy) if STATIC=YES.

$CC

Used to set a Condition Code value (0-3).
Usage:

         $CC   &OP

&OP is the value of CC to be set.

$CHS

CHange Sign (in loop).
If value of &OPERAND is negative, 2 complement of data in & REG is done; in the field "FLG0" &OPERAND is indicated "CARRY".
Usage:

         $CHS  &REG,&OPERAND

$CHSR

CHange Sign control Register (in loop).
A register (CR=) is used to control a complementation operation. ... (omissis) ...
Usage:

         $CHSR &REG,&CR=,&SV=NO,&RS=NO

... (omissis) ...

$CHS1

Another version of $CHSR.
... (omissis) ...
Usage:

     $CHS1 &REG,&CR=

$CLR

Fills an area with binary zeroes.
Usage:

       $CLR  &OPER,&TEST=NO,&WORK=WORK1
&OPER
the area to be cleared.
WORK=
specified a work (must be odd) reg..
TEST=NO
indicates: do not test the operand length, it was already done.

$CLRN

CLeaR Negative.
Fill an area with binary ones.
Usage:

         $CLRN &OPERAND,&SAVE=NO,&TEST=NO,&WORK=
(WRKLNK,WRKADR)
&OPERAND
the name of the string to be cleared.
SAVE = ADDR/LENGTH/NO
save/restore address, length etc. if other value save/restore all.

... (omissis) ...

$CLRP

CLeaR Packed.
The sign is specified in &SGNR.
Usage:

         $CLRP &OPERAND,&SGNR,&SAVE=NO,&TEST=NO,&
WORK=(WRKLNK,WRKADR)

... (omissis) ...

$DAR

Divide Absolute Register (with 32.th bit correction).
Divide &REG0 by &REG1, the result is corrected to sign bit.
Usage:

         $DAR  &REG0,&REG1,&WORK=(WRKLNK,WRKADR)

... (omissis) ...

$DCL

Generates DC and DSECT for various macros.
Usage:

         $DCL

$DECR

DECRement register.
In &DECR is contained amount of decrement; if omitted, decr. = 1.
Usage:

         $DECR &REG,&DECR,&WORK=WRKADR

... (omissis) ...

$DEF

Used to define a DSECT defining a field used by means of address and length.
Usage:

         $DEF  &OPERAND,&OLDOPR,&NEW,&SAVE=NO
&OPERAND
the name for which the DSECT is generated.
&OLDOPR
If specified, same couple of regs is used for &OPERAND.
&NEW
specifies a field never declared.
&SAVE=NO/YES
specifies if must be generated instr. to save registers or not.

$DIIR

Division; 2 bytes of result are intended as fractional part.
... (omissis) ...
Usage:

         $DIIR &RDIV,&OP

... (omissis) ...

$DPR

Divide Register; divisor is positive. See $DR.

$DR

Divide Register.
This is used to do division as: ((N-1)*16**8+16**8-1)/N whose quotient isn't 31 bits in length.
Usage:

         $DPR  &REG0,&REG1,&WORK=(WRKLNK,WRKADR)

... (omissis) ...

$DRIIR

Another version of $DIIR.
Usage:

         $DRIIR &RDIV,&OPR

$DROP

Used to generate instr. to save information on a variable when discontinuing usage.
Usage:

         $DROP &VARNAME,&SAVE=YES
&VARNAME
variable to be dropped, if it is a passed parameter, only the "DROP" is generated, if it is in a symbol table (es. $DEF)
SAVE=YES
if spedified save instr. for address and length are generated.

$DR1

Divide Register (with correction for 32.th bit), divisor is an even number.
... (omissis) ...
Usage:

         $DR1  &REG0,&REG1,&WORK=(WRKLNK,WRKADR)

... (omissis) ...

$DS

Used as the DS instrucion, if the variable name was, or will be, already generated, no DS instruction is gener.
Usage:

&VARNAME $DS   &TYPE

$ENDPROC

Used to close a procedure. If no $RETURN is present in the current procedure, one is generated. If no $DCL is used, one $DCL is performed.
Usage:

         $ENDPROC

$ENTRY

As $PROC, declares an ENTRY, but isn't possible alter options used in $PROC. (see)
Usage:

         $ENTRY &OPRNDS,                                               *
           &OP1=,&OP2=,&RES=,&RES1=,&RES2=,                            *
           &R0=,&R1=,&R2=,&R3=,TOKENS=,                                *
           &WKASIZE=,                                                  *
           &SAVE=ALL,&ERRSTK=

See $PROC.

$EQU

As the EQU; add symbol to the symbol table.
Usage:

&SYMBOL  $EQU  &OPERAND

$ES

Extend Sign (short). Used to extend sign for numbers of length <= 256 bytes.
Usage:

         $ES   &OPERAND,&TEST=NO,&WORK=WRKADR

... (omissis) ...

$ESGN

Extract Significant part of a number. Is used also to verify if bits are all zeroes or ones.
Usage:

         $ESGN &OPERAND,&TEST=NO,&SAVE=NO,&
 WORK=(WRKLNK,WRKADR),       *
           &RES=(WORK0,WORK1)

... (omissis) ...

$EXTS

EXTend Sign (long)
... (omissis) ...
Usage:

         $EXTS &OPERAND,&SAVE=NO,&TEST=NO,&
 WORK=(WRKLNK,WRKADR)

... (omissis) ...

$FAR

Fast Add Register (with carry)
... (omissis) ...
Usage:

         $FAR  &RESR,&OPR,&CARRY,&ONE=ONE

... (omissis) ...

$FLSP

Field Load Sign Packed; used to transfer sign of a packed number.
Usage:

         $FLSP &FIELD,&OPERAND,&WORK=WRKADR

... (omissis) ...

$FSR

Fast Subtract Register (with borrow).
... (omissis) ...
Usage:

         $FSR  &RESULT,&OPERAND,&BORROW,&ONE=ONE

... (omissis) ...

$G30PE

Get 30 digits Packed from Exponent (in loop).
Decrement exponent by 30, moves 30 zeroes in number, maintaining sign.
Usage:

         $G30PE &FIELD,&EXP,&WORK=WRKADR

$G9PE

Get 9 digits Packed from Exponent (in loop).
... (omissis) ...
Usage:
... (omissis) ...

$INCR

INCRement register. &INCR is added to &REG.
... (omissis) ...
Usage:

         $INCR &REG,&INCR,&WORK=WRKADR,&OPT=

... (omissis) ...

$L

Load in &REG, data from the end of &OPERAND. Used in loops.
... (omissis) ...
Usage:

         $L    &REG,&OPERAND,&WORK=WRKADR,&SET=NO

... (omissis) ...

$LL

Left Load (in loop).
Load in &REG data from beginning of a string &OPERAND.
Usage:

         $LL   &REG,&OPERAND

... (omissis) ...

$LL1

Left Load 1.st (in loop). Used to load 1.st word (or less) of a string from left.
... (omissis) ...
Usage:

         $LL1  &REG,&OPERAND,&WORK=WRKADR

... (omissis) ...

$LL9P

Load 9 digits Packed (in loop). Data is loaded from a number in packed format &OPERAND and stored in a field (&FIELD). Used for conversion from Packed to Binary and vice versa.
Usage:

         $LL9P &FIELD,&OPERAND,&REG,&WORK=WRKADR

... (omissis) ...

$LL9PD

As $LL9P. Exponent is considered.
Usage:

         $LL9PD &FIELD,&OPERAND,&EXP,&WORK=WRKADR

... (omissis) ...

$LL9PE

Variant of $LL9PD.
Usage:

         $LL9PE &FIELD,&OPERAND,&EXP,&WORK=WRKADR,
 &CR=

... (omissis) ...

$LL9PS

Same as $LL9PD, but first digit is stored in a left (SX) semibyte.

$LSP

Load Sign Packed.
... (omissis) ...
Usage:

         $LSP  &FIELD,&OPERAND,&WORK=WRKADR

... (omissis) ...

$LST

Left STore (in loop). Store data in &REG in words of & OPERAND, from left.
Usage:

         $LST  &REG,&OPERAND,&WORK=WRKADR

... (omissis) ...

$LST1

Left STore 1.st (in loop). Store &REG, or part, in &OPERAND, beginning from left.
... (omissis) ...
Usage:

         $LST1 &REG,&OPERAND,&WORK=WRKADR

... (omissis) ...

$LT

Load & Test (in loop). Load in &REG data from the end of &OPERAND, set Condition code.
Usage:

         $LT   &REG,&OPERAND,&WORK=WRKADR,&SET=NO

... (omissis) ...

$LTL

Load data from the end of &OPERAND and Test Length.
... (omissis) ...
Usage:

         $LTL  &REG,&OPERAND,&WORK=WRKADR,&SET=NO

... (omissis) ...

$LTLMR

Left Test Length and Multiply Register.
... (omissis) ...
Usage:

         $LTLMR &REG0,&REG1,&WORK=WRKADR

... (omissis) ...

$L1L9P

Load 9 digits Packed (in loop).
... (omissis) ...
Used to convert from packed to binary and vice versa.
Usage:

         $L1L9P &FIELD,&OPERAND,&REG,&WORK=(WRKLNK,
 WRKADR),&CC=NO

... (omissis) ...

$L1L9PE

Load 9 digits Packed with Exponent (in loop). As $L1L9P. Exponent is considered.
Usage:

         $L1L9PE &FIELD,&OPERAND,&EXP,&
 WORK=(WRKLNK,WRKADR),&CR=NO

... (omissis) ...

$L10P

Load 10 digits Packed (in loop).
... (omissis) ...
Usage:

         $L10P &FIELD,&OPERAND,&WORK=(WRKADR,WRKLNK),
 &OVFLW=NO

... (omissis) ...

$L14P

As $L10P.

$L15PE

Load 9 digits Packed with Exponent (in loop). Exponent is considered.
Usage:

         $L15PE &FIELD,&OPERAND,&EXP,&
 WORK=(WRKLNK,WRKADR),&CR=NO,     *
               &CLEAR=YES

... (omissis) ...

$L28P

As $L10P.

$L30P

As $L10P.
Usage:

$L30PD

Load 30 digits Packed (in loop) when last digit is in right (DX) semibyte.
... (omissis) ...
Usage:

         $L30PD &FIELD,&OPERAND,&REG,&WORK=WRKADR

... (omissis) ...

$L30PE

Load 30 digits Packed (in loop) consideriing exponent.
... (omissis) ...
Usage:

         $L30PE &FIELD,&OPERAND,&EXP,&
 WORK=(WRKLNK,WRKADR),&CR=NO

... (omissis) ...

$L30PS

Load 30 digits Packed (in loop) when last digit is in left (SX) semibyte.
... (omissis) ...
Usage:

         $L30PS &FIELD,&OPERAND,&WORK=(WRKLNK,WRKADR),
 &OVFLW=NO

... (omissis) ...

$L9P

As $L10P.

$L9PE

As $L10P.

$MOVE

MOVE 256 bytes (or less) of &OPERAND to &AREA (in /> Usage:

         $MOVE

... (omissis) ...

$MR

Multiply Register, in loop (with correction for 32.th bit).
... (omissis) ...
Usage:

         $MR   &REG0,&REG1,&WORK=WRKADR

... (omissis) ...

$MR1

Same as $MR, with correction for 32.th bit only for the 1.st operand.
Usage:

         $MR1  &REG0,&REG1

... (omissis) ...

$MR2

Same as $MR, with correction for 32.th bit only for the operand.
Usage:

         $MR2  &REG0,&REG1,&WORK=WRKADR

... (omissis) ...

$MV

Fill an area from &STRADDR, for the length &LENGTH, with the last character contained in &REG.
Usage:

         $MV   &REG,&STRADDR,&LENGTH,&TEST=NO

... (omissis) ...

$MVA

MoVe Address. Store in &LOC, value of address specified in &VALUE.
Usage:

         $MVA  &LOC,&VALUE,&WORK=WRKADR
&LOC
specifies where the address is to be stored. If it is a register a L instruction is generated, otherwise a MVC.
&VALUE
indicates the value to be stored in &LOC. If &VALUE is a parameter, address in load from parameter list. If &VALUE is a symbol name used as couple address-length, address is taken from this register.
If &VALUE is a register whose name begins with @, is assumed that this register contains address.
If &VALUE is a constant beginning with @, is assumed that the address is a constant.
eg.: if &VALUE is a variable, &LOC receives address of its location. Thus $MVA LOC,@234, generates:
         LA    WRKADR,234
         ST    WRKADR,LOC

$MVC

MoVe Characters (for string < 256 char in length). Copies value of &OP2 into &OP1.
Usage:

         $MVC  &OP1,&OP2,&TEST=NO,&RES=NO
&OP1, &OP2
destination and source of the move.
TEST=YES/SI
indicates test must be performed before move.
RES=YES/SI
restore of the length of &OP1 must be done.

$MVIN

MoVe INverse (in loop).
Pieces of 256 char (or less) are loaded from &OPERAND, from right to left, and stored, inverted by MVCIN, in a field &FIELD (256 bytes length).
Usage:

         $MVIN &FIELD,&OPERAND,&WORK=WRKADR

... (omissis) ...

$MVN

MoVe Number (as MVCL, but right aligned). Padded with sign.
Usage:

         $MVN  &OP1,&OP2,&TEST=NO,&WORK=WRKADR

... (omissis) ...

$MVNP

MoVe Number Positive or Packed. (as $MVN but padded with zeroes)
Usage:

         $MVNP &OP1,&OP2,&TEST=NO,&WORK=WRKADR

... (omissis) ...

$MVPSF

MoVe Packed Shortest Form.
... (omissis) ...
Usage:

         $MVPSF &OPER,&WORK=(WORK0,WORK1,WRKADR)

... (omissis) ...

$MVSP

MoVe Short Packed (in loop).
... (omissis) ...
Usage:

         $MVSP &OP1,&OP2,&WORK=(WRKLNK,WRKADR),&
 OVFLW=NO

... (omissis) ...

$MVV

A simplified variant of $MVA.
Usage:

         $MVV  &LOC,&VALUE,&WORK=WRKADR

... (omissis) ...

$NAR

... (omissis) ...
Usage: ... (omissis) ...

$PACK

PAcK 16 byte (or less) at a time (in loop).
Pieces of 16 bytes are loaded, from right to left, from &OPER and packed into &RIS.
Usage:

     $PACK  &RIS,&OPER,&WORK=(WRKLNK,WRKADR),&CC=NO,
 &TEST=NO

... (omissis) ...

$PACK1

As $PACK, used for the 1.st occurence in PACK loops.
Usage: ... (omissis) ...

$POS

POSition of a String in Operand. In &OPERAND is searched for &STRING. Resulting address is in &ADDR.
Usage:

         $POS  &ADDR,&OPERAND,&STRING,&WORK=WRKADR

CC = 0 &OPERAND contains &STRING.
... (omissis) ...

$PROC

Used to inizialize a program.
N.B. Code for: MAIN, OS, CMS, WKASIZE is not implemented.
Usage:

     $PROC &OPRNDS,                                                    *
           &OP1=,&OP2=,&RES=,&RES1=,&RES2=,                            *
           &R0=,&R1=,&R2=,&R3=,&TOKENS=,                               *
           &WKAPTR=WKAPTR,&PARMPTR=PARMPTR,                            *
           &BASE=BASEREG,&LINK=(WRKLNK,WRKADR),                        *
           &OPTIONS=,&WKASIZE=,&SAVE=ALL,&ERRSTK=
&OPRNDS
parameter list passed from calling program. If called from OS, only one parameter is allowed, 100 char. in length, PARMPRT= must indicate R1 as pointer, WKAPTR (Work Area Pointer) must be R13, LINK= must specify R14 & R15.
&OP1=,&OP2=,&RES=,&RES1=,&RES2=
used to call quickly mathematic function, using registers. for &OP1 are used R4 (address) and R5 (length), for &OP2: R6 & R7, for &RES/&RES1: R8 & R9, for &RES2: R10 & R11.
&R0=,&R1=,&R2=,&R3=
are used to assign values to these registers. 3 definition type are accepted:
&TOKENS
In CMS programs a DSECT defining tokens is generated; eg.: TOKENS=(COMMAND,FNAME,FTYPE,FMODE,TOKEN) generates:

         @CMS@PL@ DSECT
         COMMAND  DS   CL8
         FNAME    DS   CL8
         FTYPE    DS   CL8
         FMODE    DS   CL8
         TOKEN    DS   CL8
         ............
         USING    @CMS@PL@,$@PLIST indirizzamento
 
If TOKENS=YES then the following DSECT:

         @CMS@PL@ DSECT
         TOKEN    DS   CL8
         NEXTOKEN DS   CL8
 
is generated. ===> NOT IMPLEMENTED ..........
WKAPTR
indicates the pointer to be used for WORK/STACK area; if "NONE" is specified, no address is passed and neither code for recursivity is generated.
PARMPTR
specififies a pointer for paramter list, if the par. list is omitted, no value is assigned to R1 (or oth. reg.).
LINK=(r1,r2)
specifies 2 registers to be used as return address (1. reg) and link addr. (2. reg). By default for return adress is used WRKLNK (R14) and for routine address WRKADR (R15).
LINK=SVCnnn
indicates the JUMP must be taken by means of the "nnn" Supervisor Call instr.. If used in the form: LINK=(SVCnnn,r), then "r" is the register containing routine address.
BASE=BASEREG
Specifies the name of base register.
OPTIONS=
Specifies routine type; values are:
WKASIZE=
If options specifies MAIN, this is the amount of storage to be acquired, by means of GETMAIN R (actually STORAGE OBTAIN), if OS, or DMSFREE (actually CMSSTOR OBTAIN), if CMS. De-allocation is done by $RETURN.
===> NON IMPLEMENTED .....
ERRSTK=
specifies LABEL of routine to be called if error in storage acquisition.

------- GENERAL USAGE OF $PROC MACROS ------
EXAMPLES:

PROG     $PROC PARM,OPTIONS=(MAIN,OS),WKASIZE=512K
         .....
         $USE  PARM,R2
REG1     $EQU  R1
         L     REG1,PALLINO
         .....
         $SV   REG1
         L     R1,PINCO
         .....
         $RS   REG1
         $CALL EXT,(P1,REG1,456,P4,P5)
         BNZ   ERROR
         .....
         $RETURN
PINCO    $DS   F
PALLINO  $DS   F
COSTANTE DC    C'Costante'
KNUMERIC DC    F'12345678'
         $DCL
         .....
         $ENDPROC

....... and, in another ASM SESSION ....

         EXT   $PROC (P1,P2,P3,P4,P5)
         .....
RP1      $EQU  R5
         $SV   R2
         $USE  P1,R2
         L     RP1,P1
         .....
         $SV   RP1
RP2      $EQU  R5
         $USE  P2,R2
         L     RP2,P2
         .....
         $RS   R2
         $RS   RP1
         $CALL EXT2,(RP1,RP2,P3,P4,P5)
         BNZ   ERROR
         .....
         $RETURN
DCM      DC    C'Messaggio'
DSL1     $DS   CL3
DSLM     $DS   CL13
         $DCL
         .....
         $ENDPROC

$PSF

Packed Shortest Form. Used to reduce a packed number to its minimal lenght.
... (omissis) ...
Usage:

         $PSF  &OPERAND,&WORK=WRKADR

... (omissis) ...

$REQU

Register Equate & definition of some values used by those macros.
Usage:

         $REQU

$RETURN

Generates code to accomplish necessary operations to cleanly return to the calling program; names of registers have to be the sames as used in $PROC.
Usage:

         $RETURN &RSRA=,&RETC=,&CC=
RSRA=
specifies the list of register saved by $PROC to be restored; if omitted, all saved register are restored.
RETC=
used to set Return code (R15) to be passed to the calling program; if not specified, no code is generated.
CC=
used to set Condition Code.

$REUSE

Generates code to reuse &VARNAME as a couple address-length (a DSECT, regs equates, USING).
Usage:

         $REUSE &VARNAME,&OPRND,&PARMPTR=NO,&SAVE=NO
&VARNAME
the variable to be reused.
&OPRND
an optional operand used to specify how the addressing is to be restored, it may be a register or a know symbol.
PARMPTR=
used to restore parameters passed to this routine, values are:
"NO" or a symbol indicating a register.
SAVE=
if not = "NO", then &OPRND is saved.

$RS

Used to generate code for restore symbol saved by $SV.
Usage:

         $RS   &OP,&OP1
&OP
the symbol to be restored to.
&OP1
if present, is the source of restore IE storage location used to hold &OP1, is used as restore loc. for &OP.
N.B. $SV and $RS DO NOT USE A STACK to do SAVE/RESTORE

$RSRA

ReStore from Register Area. As standardized, locations from 12 to 72 are used to store regs from 12 to 13 in an area passed from calling program and pointed by R13.
Usage:

         $RSRA &OP,&OP1
&OP
register to be restored.
&OP1
if present, source of restore; value is loaded from location reserved to hold value of &OP1, means restore &OP as if it is &OP1.

$RTL

Right Test Length. Load data from the beginning of &OPERAND and Test Length.
... (omissis) ...
Usage:

         $RTL  &OP1,&OP2,&WORK=WRKADR

... (omissis) ...

$S

Subtract (in loops, with borrow) Subtract &OPERAND from &RESULT, &BORROW contains Borrow from subtractions. Used in loops to repeatedly subtract pieces (words) of numbers
Usage:

         $S    &RESULT,&OPERAND,&BORROW

$SGN

SiGN verify. Verify that &OPERAND's bits are all zeroes or ones. CC is set.
... (omissis) ...
Usage:

     $SGN  &OPERAND,&TEST=NO

... (omissis) ...

$SGNP

SiGN Packed. Set sign for a packed number.
... (omissis) ...
Usage:

         $SGNP &OPERAND,&SGNR,&ONLY=NO,&WORK=WRKADR

... (omissis) ...

$SGXAR

SiGn eXtension Add Register. Adds sign's extension to a register.
... (omissis) ...
Usage:

         $SGXAR &RESULT,&#NEG,&CARRY

... (omissis) ...

$SGXI

SiGn eXtension Increment.
... (omissis) ...
Usage:

         $SGXI &#NEG,&REG,&PRESERV=NO

... (omissis) ...

$SNE

Search Not Equal char in operand. Code is generated to search for &CHAR in &OPERAND, from right to left (Is Used for numbers).
Usage:

         $SNE  &ADDR,&OPERAND,&CHAR,&WORK=WRKADR
&ADDR
will contain address of 1.st caracter not equal to &CHAR, beginning from the end of the string, if found.
&OPERAND
the string object of the searching.
&CHAR
the character that is searching for.
WORK=
indicates a work register to be used.

CC = 0 indicates &CHAR isn't present in the string, Lenght of &OPERAND reaches zero.

$SP

Subtract Packed (in loops,with borrow)
... (omissis) ...
Usage:

         $SP   &RESULT,&OPERAND,&BORROW

... (omissis) ...

$SPB

Subtract Packed Borrow. Used to subtract borrow.
... (omissis) ...
Usage:

         $SPB  &RESULT,&BORROW

... (omissis) ...

$SR

Subtract Register (in loops, with borrow), like $S.
Usage:

         $SR   &RESULT,&OPERAND,&BORROW

... (omissis) ...

$SSP

Store Sign Packed. Used to transfer sign for packed numbers.
... (omissis) ...
Usage:

         $SSP  &FIELD,&OPERAND,&WORK=WRKADR

... (omissis) ...

$ST

STore (in loop). Store data in &REG, to the end of &OPERAND. Used in loops.
... (omissis) ...
Usage:

         $ST   &REG,&OPERAND,&WORK=WRKADR

... (omissis) ...

$STC

STore Caracter (in loop). like $ST.
... (omissis) ...
Usage:

         $STC  &REG,&OPERAND

... (omissis) ...

$STN

STore No test for overflow (in loop).
... (omissis) ...
Usage:

         $STN  &REG,&OPERAND,&WORK=WRKADR

... (omissis) ...

$ST10P

STore 10 digits Packed (in loop). Used for coversions from/to binary.
... (omissis) ...
Usage:

         $ST10P  &FIELD,&OPERAND,&WORK=(WRKLNK,WRKADR),
 &OVFLW=NO

... (omissis) ...

$ST14P

STore 14 digits Packed (in loop).
... (omissis) ...

$ST15P

STore 15 digits Packed (in loop).
... (omissis) ...

$ST15PE

STore 15 digits Packed (in loops) number has exponent.
... (omissis) ...
Usage:

         $ST15PE &FIELD,&OPERAND,&EXP,&
 WORK=(WRKLNK,WRKADR),           *
               &OVFLW=NO,&PRESERV=NO,&CR=NO,&ONLY=YES

... (omissis) ...

$ST28P

STore 28 digits Packed. Like $ST10P.
... (omissis) ...

$ST30P

STore 30 digits Packed. Like $ST10P.
... (omissis) ...

$ST30PD

STore 30 digits Packed.
... (omissis) ...

$ST30PE

STore 30 digits Packed (in loops) number has exponent.
... (omissis) ...
Usage:

         $ST30PE &FIELD,&OPERAND,&ADDER,&EXP,&
 MAXEXP=,                 *
           &WORK=(WRKLNK,WRKADR),&OVFLW=NO,&CR=

... (omissis) ...

$ST30PS

STore 30 digits Packed.
... (omissis) ...

$ST9P

STore 9 digits Packed. Like $ST10P.
... (omissis) ...

$ST9PE

Like $ST30PE.

$SV

Generates code to save value of a register in an area generated by $DCL.
Usage:

         $SV   &OP,&OP1
&OP
the name of the register to be saved.
&OP1
if present, indicates that &OP is to be saved as it ts &OP1. Eg.:

          $SV  REG1,REG2
          .....
          $RS  REG2
          avoid use of LR REG2,REG1
  
N.B.: this macro is NOT intented to be used in stack mode; the name of a register, in the logic of those macros, must change when meaning change; so they are many symbol for a only one register: $EQU is to be used to signal change of meaning of a register. $EQU puts register name in a symbol table, so those macros can avoid register overlay.

$SVAREA

Defines fields & symbols for a SAVE/STACK area.
Usage:

         $SVAREA &LNG=ASSEMBLE

LNG=PLI, generates an area filled with PLI indicators.

$SVRA

SaVe in Register Area. Save register in SAVE/STACK area. See $RSRA for details.
Usage:

         $SVRA &OP,&OP1

... (omissis) ...

$TR

TRanslate 256 bytes (or less) (in loops). Used to repeat TR (translate) instruction in a loop.
... (omissis) ...
Usage:

         $TR   &OPERAND,&TABLE,&WORK=WRKADR

... (omissis) ...

$TSGE

Test SiGn Extension.
... (omissis) ...
Usage:

         $TSGE &OPERAND,&TEST=NO,&SAVE=NO,&
 WORK=(WRKLNK,WRKADR)

... (omissis) ...

$TZERO

Test if ZERO. Veriifies that an area is filled by all zeroes.
Usage:

         $TZERO &OPERAND,&SAVE=NO,&TEST=NO,&
 WORK=(WRKLNK,WRKADR)

... (omissis) ...

$UNPK

UNPacK a packed 16 digits (or less) at a time, used in loops.
... (omissis) ...
Usage:

         $UNPK &RES,&OPERAND,&WORK=(WRKLNK,WRKADR),
 &CC=NO,&TEST=NO

... (omissis) ...

$UNPK1

Like $UNPK, but used first when doing a loop.
Usage:

         $UNPK1 &RES,&OPERAND,&WORK=(WRKLNK,WRKADR),
 &CC=NO,&TEST=NO

... (omissis) ...

$USE

Generates instructions to address and use &VARIABLE as a couple address-length (a DSECT, regs equates, USING).
Usage:

         $USE  &VARNAME,&OPRND,&PARMPTR=NO,&SAVE=NO
&VARNAME
the variable to be used as a pair address-length.
&OPRND
an optional operand used to specify how the addressing is to be restored, it may be a register or a know symbol.
PARMPTR=
used to restore parameters passed to this routine, values are: "NO" or a symbol indicating a register.
SAVE=
if not = "NO", then &OPRND is saved.

$WORK

Obsolete. As $SVAREA, defines fields & symbols for a SAVE/STACK area.
Usage:

         $WORK &OP
&OP
"END" when $WORK is to be closed.

 

This site is a member of WebRing.
You are invited to browse the list of mainframe-loving sites.
Running
    Tyrannosaurus Rex Dinos are not dead. They are alive and well and living in data centers all around you. They speak in tongues and work strange magics with computers. Beware the dino! And just in case you're waiting for the final demise of these dino's: remember that dinos ruled the world for 155-million years!
Dinos and other anachronisms
[ Join Now | Ring Hub | Random | << Prev | Next >> ]
 


Below you find the logo of our sponsor and logos of the web-standards that this page adheres to.