PDP-8 signed overflow detection

Pontus Pihlgren pontus at Update.UU.SE
Thu Mar 21 10:37:26 CDT 2019


Hmm, sounds like a fun thing to figure out. How about this for a start. 
Naive, written five minutes before I have to catch my bus, untested.

I hope I understood the problem at least :)

/P

SATSUM,0
       CLA CLL
       TAD I SATSUM
       ISZ SATSUM
       TAD I SATSUM
       ISZ SATSUM
       SNL
       JMP I SATSUM
       AND (4000)
       SZA
       TAD (3777)
       JMP I SATSUM

On Thu, Mar 21, 2019 at 12:26:37AM -0700, Kyle Owen via cctalk wrote:
> What is the shortest subroutine on a PDP-8 which will add two variables in
> RAM and return the saturated sum (that is, returning 2047 or -2048 upon
> overflow, otherwise the sum) in the accumulator?
> 
> Kyle


More information about the cctech mailing list