Trailing-Edge
-
PDP-10 Archives
-
BB-H506E-SM
-
cobol/source/magneg.mac
There are 7 other files named magneg.mac in the archive. Click here to see a list.
TITLE MAGNEG FOR LIBOL V12C
SUBTTL GET MAGNITUDE AND NEGATIVE OF TWO-WORD COMP /CAM
SEARCH COPYRT
SALL
;COPYRIGHT (C) DIGITAL EQUIPMENT CORPORATION 1974, 1985
;ALL RIGHTS RESERVED.
;
;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND COPIED
;ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
SEARCH LBLPRM
%%LBLP==:%%LBLP
BIS==:BIS
;V10*********
; 5/15/75 /DBT BIS
;************
HISEG
.COPYRIGHT ;Put COPYRIGHT statement in .REL file.
ENTRY MAG. ;GET MAGNITUDE
ENTRY NEG. ;GET NEGATIVE
ENTRY NEG.A ;FOR USE BY OTHER ROUTINES
;CALLING SEQUENCE:
; MOVE PA,[Z AC,ADDRESS]
; PUSHJ PP,MAG./NEG.
;RESULT WILL BE LEFT IN ACCUMULATOR SPECIFIED BY "AC"
TA=13
TB=14
TC=15
PA=16
PP=17
IFE BIS,<
MAG.: MOVE TB,1(PA) ;GET LOW-PART
SKIPL TA,0(PA) ;GET HI-PART -- IS IT NEGATIVE?
JRST NEG.B ;NO--NO NEED FOR NEGATION
TLO TB,1B18 ;YES--BE SURE LOW-PART IS NEGATIVE
JRST NEG.A
NEG.: MOVE TA,0(PA) ;GET HI-PART
MOVE TB,1(PA) ;GET LOW-PART
NEG.A: SETCA TA, ;COMPLEMENT HI-PART
MOVNS TB ;NEGATE LOW-PART
TLZ TB,1B18 ;CLEAR SIGN OF LOW-PART
SKIPN TB ;IF LOW-PART IS ZERO,
ADDI TA,1 ; BUMP HI-PART
SKIPGE TA ;BE SURE SIGN OF
TLOA TB,1B18 ; LOW PART AGREES
NEG.B: TLZ TB,1B18 ; WITH HI-PART
LDB TC,[POINT 4,PA,12] ;GET RESULT LOCATION
MOVEM TA,0(TC) ;STORE
MOVEM TB,1(TC) ; RESULT
POPJ PP,
> ;END OF NON-BIS
IFN BIS,<
MAG.: ;MAGNITUDE
SKIPL TA,(PA) ;GET HIGH ORDER DIGITS - NEGATIVE?
SKIPA TB,1(PA) ;POSITIVE - GET LOW ORDER
DMOVN TA,(PA) ;GET IT AGAIN AND NEGATE
LDB TC,PACFL.## ;GET RESULT AC
DMOVEM TA,(TC) ;STORE RESULT
POPJ PP,
NEG.: ;NEGATE
DMOVE TA,(PA) ;GET SOURCE
NEG.A: LDB TC,PACFL.## ;RESULT AC
DMOVNM TA,(TC) ;STORE NEGATIVE
POPJ PP,
> ;END OF BIS
END