uniquity
01-22-2010, 12:42 AM
for my class, i was assigned a problem involving writing my own procedure for division. some of the guidelines include, no arithmetic procedues (i.e. add, sub, div, mul) and no pseudo instructions (PS. this is on the MIPS architecture). conceptually, i have everything figured out but am unclear on how to do certain things.
first problem i'm having is not using pseudo instructions. certain instructions i don't know how to get around not using them (i.e. 'li', 'la', 'move')
the second problem i'm having is...i'm writing my own add and subtract procedures for use in dividing. right now i'm writing the procedure for add using xor, add, shift, and branch instructions. now usually i would have a variable as a counter to go through the 32 bits, but because i cant use any arithmetic procedures, i dont know how to increment/decrement the counter
i've been trying to figure out how to do this and its just started hurting my head now haha so any help is greatly appreciated. thanks in advance!
first problem i'm having is not using pseudo instructions. certain instructions i don't know how to get around not using them (i.e. 'li', 'la', 'move')
the second problem i'm having is...i'm writing my own add and subtract procedures for use in dividing. right now i'm writing the procedure for add using xor, add, shift, and branch instructions. now usually i would have a variable as a counter to go through the 32 bits, but because i cant use any arithmetic procedures, i dont know how to increment/decrement the counter
i've been trying to figure out how to do this and its just started hurting my head now haha so any help is greatly appreciated. thanks in advance!