Next Generation Emulation banner
1 - 7 of 7 Posts

·
Registered
Joined
·
4 Posts
Discussion Starter · #1 · (Edited)
Hey everyone :)
I am doing some research on the R3000A instruction set for a college project, and I thought maybe somebody could help me with a question. Hopefully, one of the psx emu author's can answer it.
In the instruction set, the ADD and SUB instructions trap on integer overflow when they are adding/subtracting rs to rt. I was wondering if anyone could give an example of how that might be implemented in a language like C(basically a function that could test if a result has an arithmetic overflow). If anyone can help me out, it would be greatly appreciated :)
Thanks
 

·
<B><font color="lightyellow" size = "1">A BIG BAD
Joined
·
6,550 Posts
probably something like this? dunno squat btw.. :p

temp = rs+rt;
if((rs^rt)>=0&&(rs^tmp)<0) exception_here();
else rd = temp;

its probably a crud of bull, i dunno dick.. hehe:evil::evil:


emu author's DONT KILL ME PLEASE.. :heh:
 

·
Registered
Joined
·
135 Posts
Heh, u seem alright. Anyway today I released the interpreter of PSinex on the public. I know its nothing special, but its always good to give info to the public. The public will appreciate your open source project a lot, believe me. Even if some people will steal your code, we (the authors) will always know how to make it better. Get my point? =)
 
1 - 7 of 7 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top