Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A little help with assemply

Status
Not open for further replies.

cordel1982

Technical User
Oct 31, 2009
1
0
0
IL
Hi , I need to write a program that will have to following
register values in the end :

REGISTER VALUE
R3 0x0000_0000
R4 0x0000_B000
R5 0xA000_1000

and the code I wrote is :

void main()

{
asm {
xor r3,r3,r3
addi r3,r3,0x0000
xor r4,r4,r4
addi r4,r4,0x0000B000
xor r5,r5,r5
addi r5,r5,0xA0001000
} // end of ex

I'd appreciate corrections and everything you can think of

thanks :)
 
my knowledge is highly obsolete (last, and only assm clas was 16-bit and 1985, prob'ly before you existed) so please pardon my ignorance. I am assuming that the three register references (per op) is for 32-bit. if so, wouldn't you need four ref.s in order to zero the entire reg?
my version was something like:

xor r3,r3,r3,r3
#not really needed since r3 already zeroed.
addi r3,0x00000000

xor r4,r4,r4,r4
addi r4,0x0000000B
xor r5,r5,r5,r5
addi r5,0xA0001000

but like i said, i'm real "over the hill" so disregard arrant ignorance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top