Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!hpcc05!hpyhde4!hpycla!hpcuhc!hpcupt3!dhandly From: dhandly@hpcupt3.cup.hp.com (Dennis Handly) Newsgroups: comp.sys.hp Subject: Re: HP9000-7XX overflow : Technical question Message-ID: <48580012@hpcupt3.cup.hp.com> Date: 6 Apr 91 07:53:21 GMT References: <9934@discus.technion.ac.il> Organization: Hewlett-Packard Cal Language Lab Lines: 16 >How do I do integer overflow detection on PA-RISC? (using machine code is OK) >Is it possible? Is it "cheap"? can it be done? can it be done without >using a whole signal call mechanism every time an overflow occurs? The add and subtract instructions have completers. You can nullify the next instruction if a condition is/isn't meet. Just make sure you don't use the ADDO or SUBO unless you want to trap. >Without this flag, or some other simple >integer overflow detection method (that is "cheap") I will have >to embed generated code that will test for overflow conditions on >every simulated instruction (instead of a simple flag check). Is the above two instructions for every add/subtract cheap enough? Of course if you don't have overflows often, you might just want to trap.