; ; UNSIGNED - PL/I callable function for treating 16-bit words as unsigned ; returns FIXED BIN(31) equivalent of 16-bit unsigned quantity in the ; FIXED BIN(15) argument ; ; calling sequence: ; ; = UNSIGNED(x) where x is FIXED BIN(15 or less) ; ; declaration: ; ; DECLARE UNSIGNED ENTRY(FIXED BIN(15)) RETURNS(FIXED BIN(31)); ; ; ; examples: ; ; IF UNSIGNED(X) < UNSIGNED(Y) THEN . . . ; ; FB31 = FB31 + UNSIGNED(FB15); ; .title UNSIGNED .psect ; ; displacements into stack after SAVRG$: ; narg = 16 arg = narg+2 rtrnvalue = arg+2 UNSIGNED:: jsr r0,SAVRG$ ;function must save all registers cmp narg(sp),#2 beq nargok jsr r5,ILNAR$ ;wrong number of arguments nargok: mov rtrnvalue(sp),r0 ;point to return value clr (r0)+ ;high order word always zero mov @arg(sp),(r0) ;copy low order word rts pc .end