*DECK DLDISO PROC DLDISO(FIELD,LENGTH,CHARWD); *IF DEF,IMS # * * 1. PROC NAME AUTHOR DATE. * DLDISO S.KRULEVITCH 79/01/04 * * 2. FUNCTIONAL DESCRIPTION. * CONVERT AN OCTAL NUMBER TO DISPLAY CODE * * 3. METHOD USED. * A RIGHT JUSTIFIED OCTAL NUMBER IS CONVERTED DIGIT * BY DIGIT TO A LEFT JUSTIFIED CHARACTER ITEM. * UP TO 20 OCTAL DIGITS MAY BE CONVERTED. * * 4. ENTRY PARAMETERS. * FIELD - A WORD CONTAINING THE OCTAL NUMBER IN * RIGHT MOST BITS. * LENGTH - THE NUMBER OF OCTAL DIGITS TO BE CONVERTED * * 5. EXIT PARAMETER. * CHARWD - CHARACTER WORD LEFT JUSTIFIED. * * 6. COMDECKS CALLED. * NONE. * * 7. ROUTINES CALLED. * NONE. * * 8. DAYFILE MESSAGES. * NONE. * # *ENDIF BEGIN # INPUT PARAMETERS # ITEM FIELD U; # OCTAL NUMBER TO BE CONVERTED # ITEM LENGTH I; # NUMBER OF OCTAL DIGITS # # OUTPUT PARAMETER # ITEM CHARWD C(20); # DISPLAY CODE WORD # # LOCAL VARIABLES # DEF OCTL # 3 #; # OCTAL DIGIT LENGTH IN BITS # ITEM A; # TEMPORARY VARIABLE # ITEM B; # TEMPORARY VARIABLE # # OCTAL TO DISPLAY CONVERSION # ITEM OCTC C(8) = "01234567"; ITEM OCTAL; # 3 BIT OCTAL DIGIT # ITEM I; # DO LOOP INDUCTION VARIABLE # ITEM J; # INDEX # #**********************************************************************# # OCTAL TO DISPLAY CODE CONVERSION # J = 0; CHARWD = " "; A = 20 - LENGTH; FOR I = A STEP 1 UNTIL 19 DO BEGIN OCTAL = B FIELD; C CHARWD = C OCTC; J = J + 1; END END # DLDISO # TERM