944,123 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Unsolved
  • Views: 2674
  • Assembly RSS
Oct 2nd, 2006
0

How to extract the opcode and the data form the instruction

Expand Post »
How to extract the opcode and the data form the instruction? "instruction" is inst below in decimal. For some values of "??", I should be able to extract the opCode and data???

opCode = inst >>??;
data = inst & ??;

It is done on a x86 processor using C.
It is 16 bit in total.

Starting from 0 from the right to left.
11th to 15th bit is OpCode.

0 to 9th bit is Data.


Is there a shortcut using hexadecimal notation?
Last edited by sciconf; Oct 2nd, 2006 at 11:39 pm.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sciconf is offline Offline
3 posts
since Oct 2006
Oct 10th, 2006
1

Re: How to extract the opcode and the data form the instruction

Something like

Assembly Syntax (Toggle Plain Text)
  1. ( opc >> 11 ) & 0x3f; // 6 bits
  2. opc & 0x3ff; // 10 bits
Team Colleague
Reputation Points: 5862
Solved Threads: 950
Posting Sage
Salem is offline Offline
7,164 posts
since Dec 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: urgently help in a program in MIPS
Next Thread in Assembly Forum Timeline: IPv6 Address Storage in Memory?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC