mirror of
https://github.com/SEPPDROID/Digital-Research-Source-Code.git
synced 2025-10-22 16:04:18 +00:00
64 lines
2.3 KiB
Plaintext
64 lines
2.3 KiB
Plaintext
.TITLE OUT1. (UTIL-VAX Library Routines OHEXB,OHEXW)
|
|
;-----------------------------------------------------------------------
|
|
;
|
|
; D I S C L A I M E R N O T I C E
|
|
; ------------------- -----------
|
|
;
|
|
; This document and/or portions of the material and data furnished
|
|
; herewith, was developed under sponsorship of the U. S. Government.
|
|
; Neither the U.S. nor the U.S.D.O.E., nor the Leland Stanford Junior
|
|
; University, nor their employees, nor their respective contractors,
|
|
; subcontractors, or their employees, makes any warranty, express or
|
|
; implied, or assumes any liability or responsibility for accuracy,
|
|
; completeness or usefulness of any information, apparatus, product
|
|
; or process disclosed, or represents that its use will not infringe
|
|
; privately-owned rights. Mention of any product, its manufacturer,
|
|
; or suppliers shall not, nor is it intended to, imply approval, dis-
|
|
; approval, or fitness for any particular use. The U. S. and the
|
|
; University at all times retain the right to use and disseminate same
|
|
; for any purpose whatsoever. Such distribution shall be made by the
|
|
; National Energy Software Center at the Argonne National Laboratory
|
|
; and only subject to the distributee furnishing satisfactory proof
|
|
; that he has a valid license from the Intel Corporation in effect.
|
|
;
|
|
;-----------------------------------------------------------------------
|
|
|
|
.PSECT UTIL_CODE,RD,NOWRT,EXE,GBL,CON,LONG
|
|
|
|
; OHEXB: PROCEDURE (BVALUE) PUBLIC;
|
|
; DECLARE BVALUE BYTE;
|
|
; END OHEXB;
|
|
|
|
.ENTRY OHEXB,^M<R2>
|
|
MOVL OBUFP,R2 ; R2 -> BUFFER.
|
|
MOVL 4-3(AP),R0 ; R0 <- BVALUE LEFT-JUSTIFIED.
|
|
BSBB DIGIT ; EMIT TWO HEX DIGITS.
|
|
BSBB DIGIT
|
|
MOVL R2,OBUFP ; UPDATE BUFFER POINTER.
|
|
RET
|
|
|
|
; OHEXW: PROCEDURE (AVALUE) PUBLIC;
|
|
; DECLARE AVALUE ADDRESS;
|
|
; END OHEXW;
|
|
|
|
.ENTRY OHEXW,^M<R2>
|
|
MOVL OBUFP,R2 ; R2 -> BUFFER.
|
|
MOVL 4-2(AP),R0 ; R0 <- AVALUE LEFT-JUSTIFIED.
|
|
BSBB DIGIT ; EMIT 4 HEX DIGITS.
|
|
BSBB DIGIT
|
|
BSBB DIGIT
|
|
BSBB DIGIT
|
|
MOVL R2,OBUFP ; UPDATE BUFFER POINTER.
|
|
RET
|
|
|
|
; LOCAL SUBROUTINE TO EMIT NEXT HEX DIGIT.
|
|
|
|
DIGIT: CLRL R1
|
|
ASHQ #4,R0,R0 ; GET NEXT NIBBLE IN R1.
|
|
MOVB B^HEX[R1],(R2)+ ; PUSH ASCII REPRESENTATION INTO BUFFER.
|
|
RSB
|
|
|
|
HEX: .ASCII '0123456789ABCDEF'
|
|
|
|
.END
|