; Simulate the operation of the DIVIDE instruction .DIVI: SUB 0,0 ;INTEGER DIVIDE CLEAR HIGH PART .DIVU: STA 3,.CC03 ;SAVE RETURN SUBZ# 2,0,SZC ;TEST FOR OVERFLOW JMP .CC99 ;YES, EXIT (AC0>AC2) LDA 3,.CC20 ;GET STEP COUNT MOVZL 1,1 ;SHIFT DIVIDEND LOW PART .CC98: MOVL 0,0 ;SHIFT DIVIDEND HIGH PART SUB# 2,0,SZC ;DOES DIVISOR GO IN? SUB 2,0 ;YES MOVL 1,1 ;SHIFT DIVIDEND LOW PART INC 3,3,SZR ;COUNT STEP JMP .CC98 ;ITERATE LOOP SUBO 3,3,SKP ;DONE, CLEAR CARRY .CC99: SUBZ 3,3 ;SET CARRY JMP @.CC03 ;RETURN .CC03: 0 .CC20: -20 ;16(BASE 10) STEPS