Line 17... |
Line 17... |
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
along with this program; if not, write to the Free Software
|
along with this program; if not, write to the Free Software
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
|
|
|
INSTRUCTION (l_add) {
|
INSTRUCTION (l_add) {
|
signed long temp1;
|
signed long temp1, temp2, temp3;
|
signed char temp4;
|
signed char temp4;
|
|
|
IFF (config.cpu.dependstats) current->func_unit = it_arith;
|
IFF (config.cpu.dependstats) current->func_unit = it_arith;
|
temp1 = (signed long)eval_operand32(2, &breakpoint)+(signed long)eval_operand32(1, &breakpoint);
|
temp2 = (signed long)eval_operand32(2, &breakpoint);
|
|
temp3 = (signed long)eval_operand32(1, &breakpoint);
|
|
temp1 = temp2 + temp3;
|
set_operand32(0, temp1, &breakpoint);
|
set_operand32(0, temp1, &breakpoint);
|
set_ov_flag (temp1);
|
set_ov_flag (temp1);
|
if (ARITH_SET_FLAG) {
|
if (ARITH_SET_FLAG) {
|
flag = temp1 == 0;
|
flag = temp1 == 0;
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
}
|
}
|
|
if ((unsigned long) temp1 < (unsigned long) temp2)
|
|
setsprbits(SPR_SR, SPR_SR_CY, 1);
|
|
else
|
|
setsprbits(SPR_SR, SPR_SR_CY, 0);
|
|
|
|
temp4 = temp1;
|
|
if (temp4 == temp1)
|
|
mstats.byteadd++;
|
|
}
|
|
INSTRUCTION (l_addc) {
|
|
signed long temp1, temp2, temp3;
|
|
signed char temp4;
|
|
|
|
IFF (config.cpu.dependstats) current->func_unit = it_arith;
|
|
temp2 = (signed long)eval_operand32(2, &breakpoint);
|
|
temp3 = (signed long)eval_operand32(1, &breakpoint);
|
|
temp1 = temp2 + temp3 + getsprbits(SPR_SR, SPR_SR_CY);
|
|
set_operand32(0, temp1, &breakpoint);
|
|
set_ov_flag (temp1);
|
|
if (ARITH_SET_FLAG) {
|
|
flag = temp1 == 0;
|
|
setsprbits(SPR_SR, SPR_SR_F, flag);
|
|
}
|
|
if ((unsigned long) temp1 < (unsigned long) temp2)
|
|
setsprbits(SPR_SR, SPR_SR_CY, 1);
|
|
else
|
|
setsprbits(SPR_SR, SPR_SR_CY, 0);
|
|
|
temp4 = temp1;
|
temp4 = temp1;
|
if (temp4 == temp1)
|
if (temp4 == temp1)
|
mstats.byteadd++;
|
mstats.byteadd++;
|
}
|
}
|