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 CNVHZ 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 CNVHZ 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,CNVHZ A -16000,CONVXX complement is -(-16000 + offset) ZS CONVXX or 16000 - offset CNV2 MCW CONVXX-3,CNVX1 Thousands to X1 MZ CNVUZ-15&X1,CONVXX Units zone MZ CNVHZ-15&X1,CONVXX-2 Hundreds zone * SBR CNVX1,0-0 Restore X1 CNVRTX B 0-0 Return CNVHZ DCW @2SKB2SKB2SKB2SKB@ Zone bits for hundreds digit CNVUZ DCW @2222SSSSKKKKBBBB@ Zone bits for units digit CONVXX DCW #6 * 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