Trailing-Edge
-
PDP-10 Archives
-
decuslib10-10
-
43,50517/movsgn.mac
There is 1 other file named movsgn.mac in the archive. Click here to see a list.
TITLE MOVSGN FOR RPGLIB V1
SUBTTL MOVE A ZONE FROM ONE ITEM TO ANOTHER
;
; MOVSGN FOR RPGLIB V1
;
; Copyright (C) 1976, Bob Currier and Cerritos College
;
; THIS ROUTINE IS USED BY MOVEL AND THE MOVE ZONE VERBS
; TO MOVE CHARACTER ZONES AROUND.
;
; This module also contains the TESTZ and TESTB routines.
;
; FIRST UTILIZED: MARCH 23, ANNO DOMINI 1976
;
;
; CALL:
; MOVEI 16,PARAMETER ADDRESS
; PUSHJ 17,MVSGN/MVSGNR
;
; PARAMETERS:
; WORD 1:
; BYTE POINTER TO INPUT STRING
; WORD 2:
; BYTE POINTER TO OUTPUT STRING
;
; RETURNS:
; CALL+1 ALWAYS.
;
; REGISTERS USED:
; JAC, CNT, CH, TAC2, TAC3, TAC4, IPTR, OPTR
;
SEARCH RPGPRM, RPGSWI, UUOSYM, MACTEN
%%LBLLP==:%%LBLP
DEBUG==:DEBUG
BIS==:BIS
EXTERN EASTB. ; FORCE EASTBL TO BE LOADED
SALL
HISEG
ENTRY MVSGN
ENTRY MVSGNR
ENTRY TESTZ
ENTRY TESTB
EXTERN PTIBS. ; POINTER TO THE INPUT BYTE SIZE
EXTERN PTOBS. ; POINTER TO THE OUTPUT BYTE SIZE
T1==TAC2
T2==TAC3
T3==TAC4
SW==0 ; MUST BE 0 FOR RPGSWI
TA==11 ; Must agree with MOVE
TC==6 ; Must agree with MOVE
AC1==1 ; TESTB argument
AC2==2 ; TESTB argument
MVSGNR: SWONS FRESET; ; WE MUST RESET SIGN OF SOURCE
MVSGN: SWOFF FRESET; ; WE DON'T WANT TO RESET SIGN
MOVE IPTR,(PARM) ; GET INPUT POINTER
MOVE OPTR,1(PARM) ; GET OUTPUT POINTER
ILDB CH,IPTR ; GET SOURCE CHARACTER
LDB T1,PTIBS. ; GET INPUT BYTE SIZE
XCT MVSGT1-6(T1) ; CONVERT CHAR TO EBCDIC
MOVE T2,CH ; SAVE CHAR IN T2
ILDB CH,OPTR ; GET OUTPUT CHARACTER
LDB T1,PTOBS. ; GET OUTPUT BYTE SIZE
XCT MVSGT1-6(T1) ; CONVERT OUTPUT CHARACTER TO EBCDIC
LDB T3,EBCZNI ; GET ZONE FIELD OF INPUT CHAR
DPB T3,EBCZNO ; STORE AS ZONE OF OUTPUT
XCT MVSGT2-6(T1) ; CONVERT OUTPUT CHAR TO PROPER TYPE
DPB CH,OPTR ; STORE OUTPUT CHARACTER
TSWT FRESET; ; MUST WE RESET INPUT SIGN?
POPJ PP, ; NO - EXIT
MOVE CH,T2 ; GET INPUT CHARACTER
MOVEI T2,17 ; GET A HEXADECIMAL 'F'
DPB T2,EBCZNO ; STASH AS NEW INPUT ZONE
LDB T1,PTIBS. ; REGET INPUT BYTE SIZE
XCT MVSGT2-6(T1) ; CONVERT FROM EBCDIC TO WHATEVER
DPB CH,IPTR ; REPLACE CHARACTER
POPJ PP, ; EXIT
;TESTZ Routine to support the TESTZ verb
;
;
;
TESTZ: MOVE TA,1(PARM) ; get indicators
JSP JAC,INDCLR## ; clear 'em out
MOVE IPTR,(PARM) ; get pointer to operand
ILDB CH,IPTR ; get the pointer
LDB T1,PTIBS. ; get byte size
XCT MVSGT1-6(T1) ; and convert to EBCDIC
LDB T1,EBCZNO ; get the zone
CAIN T1,12 ; C ? (i.e. A-I)
JRST TSTZP ; yes - plus
CAIN T1,13 ; D ? (i.e. J-R or )
JRST TSTZM ; yes - minus
CAIN CH,120 ; & ?
JRST TSTZP ; yes - plus
CAIN CH,140 ; - ?
JRST TSTZM ; yes - minus
TSTZ: LDB TC,[POINT 8,TA,23] ; no - must be blank
PJRST SINDT ; set it on and exit
TSTZP: LDB TC,[POINT 8,TA,7] ; get plus indicator
PJRST SINDT## ; set it on
TSTZM: LDB TC,[POINT 8,TA,15] ; get minus indicator
PJRST SINDT ; set it on
;TESTB Routine to support the TESTB verb
;
;Call with AC16 pointing to resulting indicators and arguments in AC1 and AC2.
;
;
;
TESTB: HRRZ TA,(PARM) ; get the indicators
JSP JAC,INDCLR ; clear 'em
JUMPE AC2,TSTZ ; use zero indicator if no bits set
TDNN AC1,AC2 ; all masked bits off?
JRST TSTZP ; yes - use positive indicator
SETCA T1,AC1 ; no - complement
TDNN T1,AC2 ; all masked bits on?
JRST TSTZ ; yes - use zero indicator
JRST TSTZM ; no - use mediocre indicator
;DEFINE TABLE TO CONVERT TO EBCDIC
MVSGT1: LDB CH,PTR69.## ; SIXBIT TO EBCDIC
LDB CH,PTR79.## ; ASCII TO EBCDIC
Z ;
JFCL ; EBCDIC TO EBCDIC
;DEFINE TABLE TO CONVERT FROM EBCDIC
MVSGT2: LDB CH,PTR96.## ; EBCDIC TO SIXBIT
LDB CH,PTR97.## ; EBCDIC TO ASCII
Z ;
JFCL ; EBCDIC TO EBCDIC
EBCZNI: POINT 4,T2,31 ; POINTER TO ZONE IN T2
EBCZNO: POINT 4,CH,31 ; POINTER TO ZONE IN CH
END