News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

JEAXNZ ??

Started by mariø, February 07, 2005, 04:50:55 PM

Previous topic - Next topic

Nilrem

From what I can gather they have to be the same data. Does one have to have anything in it. I will study it more if you think I am missing a blatant point, but for now it is 11:19pm and time for Stephen King.

pbrennick

Tomorrow is another day and at that point I am going to insist on seeing some code.

Paul

Nilrem

Ok, I'll pm you it later if that is ok? If you prefer it posted as well just say so. I'm not at my home computer right now so it will have to wait.

pbrennick

Nilrem,
You can send it to me as a PM if you feel the need.  Unfortunately, there are a lot of people who are either, smarter than me or may have a better insight into the problem and you wind up doing yourself a disservice.  As I always say, if you don't plan on selling the program, then there is no harm in posting it or attaching it to a post.

Nilrem

Yes fair enough, it' just because the code in it's entirety whilst harmless in itself could be manipulated for illegal reasons, I wouldn't want to compromise the security of the website (i.e. closed down).


.data

spiderfighter2org_val db 080h, 07Ah, 018h, 000h, 074h, 011h      ;original values
spiderfighter2new_val db 090h, 090h, 090h, 090h, 090h, 090h       ;new values

org_val db 128 dup(?)
new_val db 128 dup(?)

.code

m2m offset org_val, offset spiderfighter2org_val
m2m offset new_val, offset spiderfighter2new_val

the error I recieve for both of them is this:
Quoteerror A2001: immediate operand not allowed
I always thought this was a result of a mismatch of data types, though the variables are all declared as bytes.


tenkey

Your basic "memcpy" or "memmove" routine for copying a fixed number of bytes containing any kind of data...

    mov edi,offset org_val               ; put start of destination in EDI
    mov esi,offset spiderfighter2org_val ; put start of source in ESI
    mov ecx,6                            ; set number of bytes to move
    rep movsb                            ; copy bytes
A programming language is low level when its programs require attention to the irrelevant.
Alan Perlis, Epigram #8

Nilrem

I need them in the variable though, not a register.

Nilrem

#37
I tried this but it doesn't work properly, doesn't copy all the bytes across (only dword because they are declared as dword, but have to declare them as dword because otherwise push and pop do not work):



mov edi,offset org_val               ; put start of destination in EDI
    mov esi,offset spiderfighter2org_val ; put start of source in ESI
    mov ecx,6                            ; set number of bytes to move
    rep movsb                            ; copy bytes

push edi
pop org_val



Edit:
I was been an idiot, thankyou sooo much it works.