PDP-8 signed overflow detection

Pontus Pihlgren pontus at Update.UU.SE
Thu Mar 21 11:36:12 CDT 2019


I thought about it during the bus ride home. I don't 
think I got it right. I'll try again after the kids 
go to bed.

/P

On Thu, Mar 21, 2019 at 04:37:26PM +0100, Pontus Pihlgren via cctalk wrote:
> 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 cctalk mailing list