JOB Convert number to ADCON, Preserve X1 CNVX1 EQU 89 * * B CNVRTP To convert size to positive ADCON * DSA size Address of to-be-converted * Here, SIZE is in low-order 3 characters of CONVXX * ORG 4297 CNVRTP SBR CNVGX1&6 Argument address SW CNVFLG Positive offset flag B CNV1 * * B CNVRTN To convert size to negative ADCON * DSA size Address of to-be-converted * Here, 16000-SIZE is in low-order 3 characters of CONVXX * CNVRTN SBR CNVGX1&6 Argument address CW CNVFLG Negative offset flag * CNV1 SBR CNVRTX-1,0&X1 Save X1 CNVGX1 SBR CNVX1,0-0 Argument address to X1 SBR CNVRTX&3,3&X1 Exit address MCW 2&X1,CNVX1 To-be-converted address to X1 ZA 0&X1,CONVXX To-be-converted to CONVXX BW CNV2,CNVFLG A -16000,CONVXX complement is -(-16000 + offset) ZS CONVXX or 16000 - offset CNV2 MZ CNVZ,CONVXX clear zone CNVL S CNVP1,CONVXX-3 decrement 1000's BWZ CNVLX,CONVXX-3,K Done? MA CNV1K,CONVXX B CNVL * CNVLX SBR CNVX1,0-0 Restore X1 CNVRTX B 0-0 Return CONVXX DCW #5 CNVZ DCW 0 CNVP1 DCW 1 CNV1K DSA 1000 CNVFLG DC 0 WM = CNVRTN, No WM = CMVRTP * test b cnvrtp dsa addr ma convxx,206 mcw truep,216 b cnvrtn dsa addr ma convxx,226 mcw truen,236 w h addr dcw 5000 truep dsa 5000 truen dsa 11000 END test