Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 2385

8-bit acorn software: other • Re: A superfast 3D maze shooter for the PDP-11

$
0
0
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.
Isn't a 16-bit quotient of +65535 actually an arithmetic overflow, as DIV is doing signed division?

The emulation code tests for quotients in the range -32768 -> +32767

Code:

   if (quo < -0x8000 || quo > 0x7fff) {      cpu.PS |= FLAGV;  // J11,11/70 compat
https://github.com/stardot/b-em/blob/ma ... p11.c#L461

In this case, the R[n], R[n|1] register value are undefined, and actually remain unchanged.

Do you see an error here?

Dave

Statistics: Posted by hoglet — Mon Oct 28, 2024 10:21 pm



Viewing all articles
Browse latest Browse all 2385

Trending Articles