job test five-to-three conversion ctl 6611 * org 87 x1 dcw #3 * org 106 zone dcw @2skb@ * * Print a header. * org 201 dcw @input 5-3a 5-3c 3a-5 3a-5b@ org 336 first w cs cs r 40 dcw #1 ex first * org 201 input dcw #5 dc #2 dcw #2 part of work5 work5 dcw #3 dc #2 conv3c dcw #6 dc #2 output dcw #6 dc #2 outbk dcw #2 outb dcw #3 dc #2 outbc dcw #2 * org 336 start sw 1 loop blc done r mcw 5,input mcw @ @,conv3c&1 mcw @ @,output&1 mcw @ @,outb&2 job Convert 3 to 5 not using MA or HLE * Convert 5 to 3 -- needs 44, of which zones must begin at an * address ending in 6, plus five for inout. Doesn't use MA, * advanced programming, indexing, or high-low-equal compare. * Input and output are in work5. * mcw input,work5 mcw * cnvrt bav *&1 turn off overflow a @96@,work5-3 bav cnvrt&5 mz work5-4,work5 mn work5-3,*&4 mz zone,work5-2 job convert 3 to 5 using MA and HLE * Convert 5 to 3 again -- needs 31 plus six for inout, three * fewer if conversion is done in 84-89. Needs MA and * high-low-equal compare. Could instead use and benefit from * indexing and advanced programming, if X1 can be dedicated. * Input and output are in conv3c. * mcw input,conv3c * c53c a @99@,conv3c-3 subtract one from thousands bce c53x,conv3c-4,9 done? ma k1k,conv3c sbr x1,1000&x1 instead b c53c k1k dsa 1000 c53x equ *&1 * c conv3c,work5 be *&8 mcw @*@,conv3c&1 job convert 5 to 3 using MA but not HLE * Convert 3 to 5 -- needs 41 plus four for input and six for * output, three fewer if work4 is an index register plus * the next character. Uses high-low-equal and MA. Could * instead use and benefit from indexing and advanced programming, * if an index register can be dedicated. Input is in work4-1 * and output is in output-1. * mcw work5,work4-1 * za work4,output numeric work4-1 to output b c35 k15k dsa 15000 work4 dcw #4 c35l ma k15k,work4-1 sbr xn,15000&xn instead a @1@,output-4 bump thousands c35 c output-1,work4-1 zones gone from work4? bu c35l yes * c output-1,input be *&8 mcw @*@,output&1 job convert 3 to 5 not using MA or HLE * Convert 3 to 5 -- needs 76 plus 3+2 for inout. Doesn't use * MA, indexing, advanced programming, or high-low-equal * compare. Input is in outb, output is in outb and outbk. * mcw work5,outb * mcw @00@,outbk c35b bwz c35b2,outb-2,2 a k4k0-2,outb-1 a @1@,outbk b c35b c35b2 mz work5,outb-2 c35b3 bwz c35bx,outb-2,2 a k4k0,outb&1 a @4@,outbk b c35b3 dsa 3000 k4k0 dc 0 c35bx equ *&1 * c input,outb bu *&13 c input-3,outbk be *&8 mcw @*@,outb&2 * write w loop done h done end start