Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:43:35+00:00 2026-05-26T04:43:35+00:00

For the asm emulator i’m trying to write to convert ASM code to equivalent

  • 0

For the asm emulator i’m trying to write to convert ASM code to equivalent working code just working.. best code would be the one that can either be done in one line or two-three the most, don’t care about speed.

From my understanding.
MOVZX would be the same as MOV.. if done in C++.

MOV conversion.

MOV ESI,DWORD PTR [ESP+8]

would be like

regs.d.esi = *(unsigned int *)(regs.d.esp+0x00000008);

MOVZX conversion.

MOVZX EAX,BYTE PTR DS:[EDI]

would be like

regs.d.eax = *(unsigned char *)(regs.d.edi);

pretty much the same thing no change what so ever.

Now MOVSX i’m having trouble converting to a simple C code.. seems to be the same as the two above.. except it attempts to append as much fully set bits in front of the value moved as possible.. like

000000C7 becomes FFFFFFC7

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:43:36+00:00Added an answer on May 26, 2026 at 4:43 am

    movsx is move with sign-extend. Those set bits are a copy of the sign bit from the original value, and would be clear if the original wasn’t negative. It works just like your other conversions, except you need to use a signed type instead of an unsigned one.

    regs.d.eax = *(signed char *)(regs.d.edi); // movsx eax, byte ptr ds:[edi]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write a java code on an Android emulator that will send
I'm working on an x86 asm obfuscator that takes Intel-syntax code as a string
I know that ASM is basically the fastest one can get, but is what
ASM to C Code emulating nearly done.. just trying to solve these second pass
Can anyone help me convert following x86 inline asm code to arm format? bool
How can I put Intel asm code into my c++ application? I'm using Dev-C++.
I would like to have this x86 ASM code ported to C or C++,
Are there any asm instructions that can speed up computation of min/max of vector
I am trying to put some asm code into a latex document, onfurtunatly pdflatex
I am writing essentially the equivalent of memset() using ASM. The code I have

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.