Its seems the PDP11 core in the PiTube is the same, as it gives the same results. Which are interesting.
DIV divisor,Rn should do a 32-bit divide: R(n)*65536+R(nOR1) DIV divisor. So, eg, DIV #10,R0 should do (R0*65536+R1)/10. Dividing a 16-dividend always works, ie Rn=0. But if Rn<>0 then it fails in a regular way.
DIV #10,R0 fails such that:
If (R0 MOD 5)=odd or (R0 DIV 5)=odd the DIV fails.
Otherwise, DIV works.
DIV has implementation-specific results when the result overflows, but the custom divide10 code specifically never overflows, it either divides &0000nnnn by 10, which will never overflow the maximum being 6553, or it divides up to a maximum of &0009FFFF by 10, the maximum remainder from dividing by 10, which is 655359, so will never overflow the maximum result being 65535.
DIV divisor,Rn should do a 32-bit divide: R(n)*65536+R(nOR1) DIV divisor. So, eg, DIV #10,R0 should do (R0*65536+R1)/10. Dividing a 16-dividend always works, ie Rn=0. But if Rn<>0 then it fails in a regular way.
DIV #10,R0 fails such that:
If (R0 MOD 5)=odd or (R0 DIV 5)=odd the DIV fails.
Otherwise, DIV works.
DIV has implementation-specific results when the result overflows, but the custom divide10 code specifically never overflows, it either divides &0000nnnn by 10, which will never overflow the maximum being 6553, or it divides up to a maximum of &0009FFFF by 10, the maximum remainder from dividing by 10, which is 655359, so will never overflow the maximum result being 65535.
Statistics: Posted by jgharston — Mon Oct 28, 2024 9:06 pm