Archived

This topic is now archived and is closed to further replies.

Nullio

Replaceing charecters in assembler

Recommended Posts

if I want to make an assembler routen to replace charecters inside a char* how would I do it?
  
char *s

_asm {

//what commands go here


};

   
Edited by - Nullio on January 1, 2002 4:40:00 PM

Share this post


Link to post
Share on other sites
quote:
Original post by Nullio
if I want to make an assembler routen to replace charecters
inside a char* how would I do it?


          
char *s

_asm {

//what commands go here


};







          
char *s = NULL;

_asm {

//what commands go here


};





Is that what you mean?




           
char s[] = "ABCDEF";

_asm {

//what commands go here


};


Or that???




... I take it it's a homework assignment that you waited till the last minitue to finish, you need to study more.


"1-2GB of virtual memory, that's way more than i'll ever need!" - Bill Gates
The Adventure: Quite possibly the game of the century!" - The Gaming Community



Edited by - kingpin on January 1, 2002 8:46:35 PM

Share this post


Link to post
Share on other sites
THE EASIEST WAY IS TO WRITE IT IN C++ AND LOOK AT DISASM!!
HERE IT IS
  
#include <iostream.h>
#include <string.h>

char* c = NULL;

void main()
{
c = new char[20]; strcpy(c,"EvilCrap");

__asm
{
mov edx,dword ptr [c]
mov byte ptr [edx+2],''a''
}

cout << c;
}

Share this post


Link to post
Share on other sites