//MARKTEST JOB (0),'TESTNEWPGM ASM',CLASS=A,MSGCLASS=T,MSGLEVEL=(1,1) //ASMLKD EXEC ASMFCL,MAC='SYS1.AMODGEN',MAC1='MVSSRC.SYM101.F01', // PARM.ASM='OBJECT,NODECK,TERM,XREF(SHORT)', // PARM.LKED='LIST,MAP,NCAL,AC=0' //ASM.SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB // DD DISP=SHR,DSN=MARK.PROD.LIB.MACROS.ASM //ASM.SYSIN DD * * * Test the number to displayable text macros * As a side effect tests the string to bunary number macro * * Program expects a PARM=nnnnnnnn where PARM is a number up * from one to eight digits long (there is probably some max * limit below 99999999 but I have not needed to fimd out what * that is yet). * * Tests * strtobin - convert parm to binary nunber value (input parm) * todec8 - convert binary number to 8 byte string * todec3 - convert binary number to 3 byte string * bin2hex - convert binary number to 8 byte hex string * TESTCVD1 CSECT STM 14,12,12(13) HOUSEKEEPING LA 14,0(13) BAL 13,84(15) USING *,13 DS 18F ST 14,4(13) ST 13,8(14) * -------------------------------------------------- * Get parm value * Address parm with R3 * Length in R5 * -------------------------------------------------- L 3,0(,1) load addr of parm list LH 5,0(,3) load len of parm list LTR 5,5 is length 0 (no parm) BZ EOJ yes, exit A 3,=F'2' point past halfword len byte * -------------------------------------------------- * Ok, to binary using STRTOBIN * Address of nunber string will be in R3 * Length of number string in R5 * -------------------------------------------------- STRTOBIN LENTYPE=R,LEN=5,STRTYPE=R,STR=3 LR 4,1 save result in R4 * -------------------------------------------------- * Make displayable again * If < 1000 use TODEC3, else use TODEC8 * In both cases also use BIN2HEX * Binary number is in R4 * Output buffer is appropriate WTO line offset * -------------------------------------------------- C 4,=F'999' BH TEST008 will not fit in three digits TODEC3 REG=4,BUF=WTOTEXT1+12 B TESTCONT * else use 8 digits TEST008 TODEC8 REG=4,BUF=WTOTEXT1+12 TESTCONT CNOP 0,4 * =====> This test program is so small we need to use TINYPRG * ...well, that is why the option exists :-) BIN2HEX REG=4,BUF=WTOTEXT1+21,TINYPRG=YES WTOTEXT1 WTO 'GOT xxx xxxxxxxx ' * * -------------------------------------------------- * Done, normal exit * -------------------------------------------------- EOJ L 13,4(13) RELOAD CALLERS SAVE AREA LM 14,12,12(13) RELOAD CALLERS REGISTERS LA 15,0 ZERO RETURN CODE BR 14 GO BACK TO CALLER LTORG END ZZ //ASM.SYSTERM DD SYSOUT=* //LKED.SYSLMOD DD DSN=MARK.LIB.LOAD(TESTCVD1),DISP=SHR //* //TESTCVD1 EXEC PGM=TESTCVD1,COND=(0,NE),PARM='500' //STEPLIB DD DSN=MARK.LIB.LOAD,DISP=SHR //TESTCVD1 EXEC PGM=TESTCVD1,COND=(0,NE),PARM='32000' //STEPLIB DD DSN=MARK.LIB.LOAD,DISP=SHR //TESTCVD1 EXEC PGM=TESTCVD1,COND=(0,NE),PARM='32000500' //STEPLIB DD DSN=MARK.LIB.LOAD,DISP=SHR //