×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

A little help with assemply

A little help with assemply

A little help with assemply

(OP)
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 :)

RE: A little help with assemply

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close