.TITLE IENCOD .ENABL LC ; ; ; ; Author: S. ROZENBERG ; Ste INFI ; 3, rue des Pres-Aubry ; 92370, CHAVILLE ; FRANCE ; tel: 750-92-94 ; ; ; This subprogram is to be used as interface to FORTRAN ; Integer output conversions. ; ; The call is : ; ; ; CALL IENCOD (MODE,BUFFER,WIDTH,VALUE) ; ; ; Parameters : ; MODE = 0 -> Octal, 1 -> Integer ; BUFFER = Address of output buffer ; WIDTH = Width of output conveited value ; VALUE = Value to be converted. ; ; Example : ; CALL IENCOD (1,BUFF,9,INT) ! Convert INT to integer-width = 9 ; ! Result in BUFF. ; ; Notes : ; 1) MODE must be 0 or 1 ; 2) All parameters must be present ; If on of these conditions is not filled, the IENCOD function ; will act as a NOP. .PAGE .PSECT USROM .GLOBL ICO$ , OCO$ IENCOD:: CMPB (R5)+,#4 ; All arguments present ? BNE 1$ ; No. Out INC R5 MOV @(R5)+,R0 ; Get MODE CMP R0,#1 ; Legal mode ? BHI 1$ ; No MOV (R5)+,-(SP) ; Push address of output buffer MOV @(R5)+,-(SP) ; Push width MOV @(R5)+,-(SP) ; Push value ASL R0 ; Convert to word offset CALL @CNVRT(R0) ; Call conversion routine 1$: RETURN CNVRT: .WORD OCO$ ; Octal conversion routine .WORD ICO$ ; Integer conversion routine .END