1 SLR Brief descriptions of utility routines included in various DEC supplied object, macro, and command libraries are available for the following. For more information type: AID SLRLIB routine Information is available for: GCML "get command line" subroutine for MACRO-11 programs EGCML an extended version of GCML supporting procedure libraries CAT5(B) convert ASCII to RAD50 character codes C5TA convert RAD50 to ASCII character codes DD2CT convert decimal to binary double precision OD2CT convert octal to binary double precision CDTB convert decimal to binary single precision COTB convert octal to binary single precision CAT5 convert ASCII to RAD50 character codes (also CAT5B) CBDAT convert binary date information to string CBDMG convert binary to magnitude decimal CBDSG convert binary to signed decimal CDDMG convert double precision binary to decimal CBOMG convert binary to octal magnitude CBOSG convert binary to signed octal CBTMG convert byte to octal magnitude CBTA general purpose binary to ASCII convert CVTUC lower case to upper case convert DAT binary date to string TIM binary time to string EDMSG general purpose output formatter SAVREG summary of register save co-routines MUL single precision multiply DIV single precision divide DMUL double precision multiply DDIV double precision divide CORE dynamic memory allocate/return 2 GCML GCML is a system library routine which performs the standard functions of obtaining a command line from the operating system, scanning it for certain special characters and returning it to the caller. GCML is used by almost all DEC supplied utilities and layered products. It is the recommended interface for programmers creating utilites in MACRO-11 for use under the RSX operating systems. Full documentation may be found in the SLRTEM library utility reference manual. 2 EGCML EGCML is an extended version of the standard GCML utility. Support is included for input from procedure modules (or "files") contained in a universal library. Support also exists to allow control of terminal timeout and write with breakthrough of Control-O terminal state. GCML and EGCML both exist in the system object and macro libraries. Programs written to use GCML will continue to assemble and link to reference the GCML service. Users wishing to take advantage of the EGCML features must make minor modifications to their source programs, reassemble them and link to reference the EGCML module. While global entry points are different to the two services, the macros calling GCML and EGCML have the same names and calling arguments. This way, both services can exist in the object libraries and source requires little or no modification to use the new services. A list of EGCML macros and their aarguments may be obtained by typing: AID SLRLIB EGCML MACROS 3 MACROS Note that all macros described below are defined within the EGCML interface macro definition EGCMI$. This macro must be defined and expanded before any reference to other GCML or EGCML call macros. Failure to do this will cause the macro assembler to reference the GCML call macros and not the EGCML call macros. Include the following code within any module which references EGCML call macros: .MCALL EGCMI$ ; LOAD THE INTERFACE DEFINITION MACRO EGCMI$ ; EXPAND IT DEFINING THE EGCML INTERFACE Macros defined by EGCMI$ are: EGCMI$ Define the extended EGCML interface GCMLD$ GLOB Define the offsets and bit flags contained in the impure work area ECMLB$ FILE,LUN=1,MAXD=3,PRMP=< >,BFAD,BFSZ=80.,PDL,SWIT Allocate the impure work area and optionally the FDB or FAB/RAB GCMLB$ MAXD=1,PRMP=< >,UBUF,LUN,PDL,SIZE=80. Older GCML interface macro which calls ECMLB$. Used to avoid source change GCMSW$ NAME Allocate the EGCML switch control tables. Used by INDIRECT. GCML$ NAME,PRAD,PRLN GET command input from executive, terminal, or nested file RCML$ NAME RESET EGCML command input to level 0 (normally the command terminal) CCML$ GCMB CLOSE the currently open top level nested file MCML$ GCMB Obtain only MCR level command line FCML$ GCMB FORCE command line. Used for example, by INDIRECT processing of .CHAIN LCML$ GCMB Chain to new input file. ECML$ GCMB Reset MCR level EOF flag DCML$ GCMB Pop one level of file nesting GCMM$ GCMB MARK. Obtain record address of current command file. GCMP$ GCMB POINT. Position command file to previously saved record address CMSET$ GCMB,TSUB,TVFC,TTMO,FQFN,OVBC Modify fields in impure work area CMGET$ GCMB,TSUB,TVFC,TTMO,FQFN,OVBC Obtain values from fields in impure work area. 2 CAT5 Convert ASCII to Radix-50 Input: Output: R0 = address of ASCII characters C/CLR: R0 = updated character pointer R1 = character control flag R1 = converted RAD50 value 0=> period is a terminator R2 = terminator character 1=> period is RAD50 character C/SET: R2 = illegal character CALL $CAT5 ; to stop conversion on blanks CALL $CAT5B ; to treat blanks as legal RAD50 characters 2 C5TA Convert Radix-50 to ASCII Input: Output: R0 = ASCII character output address R0 = next available output address R1 = Radix-50 word R1-R2 are modified CALL $C5TA 2 DD2CT Convert signed ASCII decimal number to two word binary Input: Output: R3 = address of two word output c/clr => conversion successful field c/set => conversion error R4 = number of characters to convert R5 = address of character string to convert Call: CALL .DD2CT 2 OD2CT Convert signed ASCII octal number to two word binary Input: Output: R3 = address of two word output field c/clr => conversion successful R4 = number of characters to convert c/set => conversion error R5 = address of character string to convert Call: CALL .OD2CT 2 CDTB Convert single precision decimal number to binary Input: Output: R0 = address of first byte of string R0 = address of next byte in buffer to convert R1 = the converted value R2 = the character which stopped conversion Call: CALL $CDTB 2 COTB Convert single precision decimal number to binary Input: Output: R0 = address of first byte of string R0 = address of next byte in buffer to convert R1 = the converted value R2 = the character which stopped conversion Call: CALL $CDTB 2 CBDAT Convert binary date information to string (01-31) Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBDAT 2 CBDMG Convert binary to magnitude decimal Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBDMG 2 CBDSG Convert binary to signed decimal Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBDSG 2 CDDMG Convert double precision binary to decimal Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Address of binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBDMG 2 CBOMG Convert binary to octal magnitude Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBOMG 2 CBOSG convert binary to signed octal Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBOSG 2 CBTMG convert byte to octal magnitude Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = Zero suppression flag: R2 = 0 =>suppress leading zeros R2 = 1 =>do not suppress leading zeros Call: CALL $CBTMG 2 CBTA general purpose binary to ASCII convert Input: Output: R0 = address of output buffer R0 = points to next byte in output buffer after converted string R1 = Binary value to be converted R2 = conversion control mask: bits 0-7 conversion radix 2-10. bit 8 set => signed conversion bit 9 set => don't suppress leading zeros bit 10 set => replace leading zeros, if any, with blanks clear => don't replace leading zeros with blanks bits 11-15 field width range = 1-31. Call: CALL $CBTA 2 CVTUC lower to upper case conversion Input:: Output: R0 = address of text string to shift R0 = not altered R1 = address of output buffer R1 = not altered R2 = count of characters to scan R2 = destroyed Call: CALL $CVTUC 2 DAT convert binary date data to strng Input: Output: R0 = address of output buffer R0 = points to next free byte R1 = Address of 3-word binary date. Refer to GTIM$ directive for format Call: CALL $DAT 2 TIM convert binary time data to string Input: Output: R0 = address of output buffer R0 = points to next free byte R1 = start address of 5-word time buffer. Refer to GTIM$ directive for format R2 = format of resultant conversion R2 = 1 => convert only hours R2 = 2 => convert to format HH:MM R2 = 3 => convert to format HH:MM:SS R2 = 4 => convert to format HH:MM:SS.S Call: CALL $TIM 2 EDMSG general purpose output format processor Input: Output: R0 = output buffer address R0 = updated to next free byte in output buffer R1 = address of format control string R2 = starting address of argument block Call: CALL $EDMSG Summary of control string format characters: Format Char.. Next word in Argument block is... %A,%nA,$VA address of ASCII character or string. Move to output. %B,%nB,%VB address of a binary byte. Convert to OCTAL notation %D,%nD,%VD binary word. Convert to signed DECIMAL notation %E,%ne,%VE address of extended ASCII character or string. Move to output. Non-printing characters are replaced with SPACE. %F,%nF,%VF insert a form feed in output %I address of an ASCIZ string to be logically inserted at this point in the format control string. %M,%nM,%VM binary word. Convert to magnitude DECIMAL notation. %N,%nN,%VN insert carriage return in output. %O,%nO,%VO binary word. Convert to signed OCTAL notation. %P,%nP,%VP binary word. Convert to magnitude OCTAL notation. %R,%nR,%VR Radix-50 binary values. Convert to ASCII notation. %S,%nS,%VS Insert a SPACE in output. %T,%nT,%VT address of double precision values. Convert to magnitude DECIMAL notation. %U,%nU,%VU binary word. Convert to magnitude DECIMAL notation. %X,%nX,%VX Radix-50 filename string. Convert to full ASCII filename string. %Y Date in binary form. Convert to DD-MMM-YY notation. %1Z Time. Convert to HH notation %2Z Time. Convert to HH:MM notation. %3Z Time. Convert to HH:MM:SS notation %4Z Time. Convert to HH:MM:SS.S notation. %n< Define blanked field beginning. Insert 'n' SPACES and backup to current position. %n> Advance to end of currently defined blanked field. 2 SAVREG Several routines are available for the save/restore of processor registers. These are all co-routines, that is they save the registers on the stack and return with the address of a register restore routine on top of the stack. The calling routine need only "RETURN" to the restore routine, which, after restoring the registers will "RETURN" to the caller's caller. Refer to the System library reference for more information. Calling sequences are: To save: Use the command: R0-R5 JSR PC,$SAVAL or CALL $SAVAL R3-R5 JSR R5,$SAVRG R0-R2 JSR R2,$SAVVR R1-R5 JSR R5,.SAVR1 2 MUL single precision unsigned multiply Input: Output: R0 = multiplier R0 = high order part of result R1 = multiplicand R1 = low order part of result Call: CALL $MUL 2 DIV single precision unsigned divide Input: Output: R0 = dividend R0 = quotient R1 = divisor R1 = remainder Call: CALL $DIV 2 DMUL double precision multiply Input: Output: R0 = multiplier R0 = high order part of product R2 = high order part of multiplicand R1 = low order part of product R3 = low order part of multiplicand Call: CALL $DMUL 2 DDIV double precision divide Input: Output: R0 = unsigned divisor R0 = remainder R1 = high order dividend R1 = high order quotient R2 = low order dividend R2 = low order quotient Call: CALL $DDIV 2 CORE Allocate dynamic memory. Input: Output: R0 = Address of free memory listhead Carry/Clear => success R0 = address of allocated block R1 = Size of block requested. R1 = actual size of block allocated R1 > 0 => best fit allocation R1 < 0 => first fit Call: CALL $RQCB Release dynamic memory. Input: Output: R0 = Address of free memory listhead R0 = unchanged R1 = Size of block to be released R1 = destroyed R2 = Address of block to be released R2 = destroyed Call: CALL $RLCB