Help with converting ASM instructions into machine code

Discussion in 'OT Technology' started by Swerve, Jun 1, 2008.

  1. Swerve

    Swerve OT Supporter

    Joined:
    Feb 20, 2005
    Messages:
    3,179
    Likes Received:
    3
    Hi,

    I am trying to convert the following line of code into machine code, but am stuck with one part.

    The original instruction is:-

    Starting with:-

    I added the MOVE part, leaving:-

    I then added the .L, leaving:-

    Then I added the destination address (D2):-

    But now I am stuck, I have the answer which is:-

    My problem is that I don't see how the remaining L#$D3A5 fits into the answer. I understand that I am moving the data it'self in Hex format, but unfortunately this isn't bridging my gap in knowledge.

    Thanks for any help!

    Swerve.

    P.S.

    I have done an easier question shown below if that helps in any way.

    Again, thanks!
    Thanks for any help!
     
  2. deusexaethera

    deusexaethera OT Supporter

    Joined:
    Jan 27, 2005
    Messages:
    19,712
    Likes Received:
    0
    Uh. Damn. Is this for CS or EE?

    Also, it would help to know the instruction set you're working with.
     
  3. EkriirkE

    EkriirkE Zika Xenu OT Supporter

    Joined:
    Jan 11, 2004
    Messages:
    14,799
    Likes Received:
    0
    Location:
    Dublin & San Francisco, CA
    you can't be expected to put all that into 16 bits, you need 16 bits just for the immediate value, and thats assuming its using 16bit values not 32
     
  4. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    What CPU are you using? What assembler?
     
  5. Ameter

    Ameter Active Member

    Joined:
    Mar 31, 2005
    Messages:
    97,795
    Likes Received:
    1
    Location:
    Calgary, AB
    looks like intel to me, but without a reference manual for machine code, it'd be next to impossible to translate it

    but the above posters are correct, it should be 32 bit, not 16 bit.
     
  6. EkriirkE

    EkriirkE Zika Xenu OT Supporter

    Joined:
    Jan 11, 2004
    Messages:
    14,799
    Likes Received:
    0
    Location:
    Dublin & San Francisco, CA
    looks more like motorola, oldschool 68K series. maybe newer MIPS?
     
  7. Coottie

    Coottie BOOMER......SOONER OT Supporter

    Joined:
    Jun 6, 2006
    Messages:
    32,407
    Likes Received:
    0
    Location:
    OKC
    That's why I asked because it didn't bear much resemblance to the intel related assembler that I used. We used NASM in my ASM course and I don't remember any syntax like that.
     

Share This Page