flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
revolution 14 Mar 2012, 19:25
No macro is required.
Code: x equ eax |
|||
![]() |
|
marcinzabrze12 14 Mar 2012, 20:11
It isn't work corectly because if you change EAX then X will be change too.
I want to have a constant value of register at current time. Code: ;==================================================== macro ShowV arg { push eax ebx ecx edx esi edi local buffer jmp @f buffer db 20 dup (0) @@: cinvoke wsprintf, buffer, '%d', arg invoke MessageBox, 0, buffer, 'ShowValue', 0 pop edi esi edx ecx ebx eax} ;==================================================== start: mov eax, 100 ; load value for test it x equ eax ShowV x ; its display 100 - everything ok now inc eax ; we change the EAX ShowV x ; its display 101 because eax is changed. i nedd to ; have x = 100 at this line. |
|||
![]() |
|
revolution 14 Mar 2012, 20:22
The CPU does not have a register named x (which is what you want to do here) so what you really want is to define a memory variable to save the value of eax so you can retrieve it later.
Code: x dd ? ;... mov eax,100 mov [x],eax ShowV [x] inc eax ShowV [x] |
|||
![]() |
|
marcinzabrze12 14 Mar 2012, 21:01
Yea. Sorry for a problem. Now i understand why it is impossible ...please forgot about it.
Thanx for help. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.