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 3759232
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T10:17:05+00:00 2026-05-19T10:17:05+00:00

I’m working in Visual Studio 2010 and here’s a little bit of code I’m

  • 0

I’m working in Visual Studio 2010 and here’s a little bit of code I’m having trouble with:

void main()
{
int x;
char c1[100]="cd";
char c2[100]="abcdef";
_asm {
    lea edx,c2
    lea ecx,c1
    push edx
    push ecx
    call subsir
    add esp, 8   
    mov x, eax
}
}

char subsir (char *c1, char *c2) 
{
_asm {
mov ecx, c1
mov edx, c2
mov edi, 0
mov esi, 0
start: cmp [edx + edi], 0
je end
mov esi, 0
mov eax, [edx + edi]
cmp eax, [ecx + esi]
  .....

This is the first part of a program that’s meant to compare 2 words.

The problem I am having is that when I do

 mov eax, [edx + edi]

eax receives an adress and not the actual value.
I tested this by doing

 cmp eax, 97

which should activate a JE instruction (97 being the ASCII code for ‘a’) But it doesn’t. If I do

      cmp [edx + edi], 97

it does activate the JE jump.

I would be very grateful if you could tell me what am I doing wrong and how can I put the actual valuea in EAX instead of an adress.

  • 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-19T10:17:06+00:00Added an answer on May 19, 2026 at 10:17 am

    No, it is actually reading the memory at [edx + edi]. Problem is that it is reading 32-bits at a time. Which is not okay, you are comparing string content. That requires comparing one byte at a time. Fix:

    start: cmp byte ptr [edx + edi], 0
    je end
    mov esi, 0
    mov al, [edx + edi]
    cmp al, [ecx + esi]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I'm working with an upstream system that sometimes sends me text destined for HTML/XML

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.