|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Assembly - Detecting negative value and adding quotient and remainder
Hi, i have been googleling around the solution for this but dunno how. Following is my problem:
1) I will like to check which 2 integer value is negative and which is not. 2) After doing division, i will like to have the quotient and remainder , together in a floating point unit? By the way i am using MIPS architecture. 10x in advance |
|
#2
|
||||
|
||||
|
For the first part, it is actually very easy: in the standard two's complement representation, the highest bit is clear for a positive number and set for a negative number. If you AND the value against the mask 0x7fffff, that should isolate the high bit for you to test.
As for the second question, it doesn't make much sense to me; there is no remainder in floating-point division. I am not sure if any MIPS system or simulator supports a floating point modulo. For integer division, the quotient is returned in HI and the remainder in LO.
__________________
Rev First Speaker Schol-R-LEA;2 JAM LCF ELF KoR KCO BiWM TGIF #define KINSEY (rand() % 7) λ Scheme is the Red Pill Scheme in Short • Understanding the C/C++ Preprocessor Taming Python • A Highly Opinionated Review of Programming Languages for the Novice, v1.1 FOR SALE: One ShapeSystem 2300 CMD, extensively modified for human use. Includes s/w for anthro, transgender, sex-appeal enhance, & Gillian Anderson and Jason D. Poit clone forms. Some wear. $4500 obo. tverres@et.ins.gov Last edited by Schol-R-LEA : April 21st, 2008 at 04:22 PM. |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Other Programming Languages > Assembly - Detecting negative value and adding quotient and remainder |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|