flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
revolution 22 Aug 2020, 12:09
pushd isn't valid. You can't push 32-bit values in 64-bit mode.
Code: pushd 'some text ' processed: pushd 'some text ' error: illegal instruction. |
|||
![]() |
|
Roman 22 Aug 2020, 13:00
Yes. From include\WIN32AX.inc
|
|||
![]() |
|
revolution 22 Aug 2020, 13:06
WIN32AX.inc is for 32-bit code. It isn't compatible with 64-bit code.
You can't push 32-bit values in 64-bit mode. |
|||
![]() |
|
Roman 22 Aug 2020, 13:27
How emulate pushd in 64 bits ?
Or write macro ? |
|||
![]() |
|
revolution 22 Aug 2020, 13:28
Code: lea rsp,[rsp-4] mov [rsp],eax |
|||
![]() |
|
Roman 22 Aug 2020, 13:29
And what in eax ?
And how in 64 bits work invoke ? invoke MessageBox,0,'Some text',0,0 I look in IDA Pro 64 bit Code: .code:0000000000401014 mov rcx, 0 ; hWnd .code:000000000040101B jmp short loc_401023 .code:000000000040101B ; --------------------------------------------------------------------------- .code:000000000040101D ; CHAR Text[] .code:000000000040101D Text db 'float',0 ; DATA XREF: start:loc_401023↓o .code:0000000000401023 ; --------------------------------------------------------------------------- .code:0000000000401023 .code:0000000000401023 loc_401023: ; CODE XREF: start+F↑j .code:0000000000401023 lea rdx, Text ; "float" .code:000000000040102A mov r8, 0 ; lpCaption .code:0000000000401031 mov r9, 0 ; uType .code:0000000000401038 call cs:MessageBoxA |
|||
![]() |
|
revolution 22 Aug 2020, 13:45
You can push 64-bit values in 64-bit mode. So all the invoke parameters are 64-bits in size.
Code: use64 push 0 ; 64-bit push push rax ; 64-bit push push eax ; invalid, not possible in 64-bit mode Last edited by revolution on 22 Aug 2020, 13:46; edited 1 time in total |
|||
![]() |
|
Overclick 22 Aug 2020, 13:45
It's your text in eax, 4 bytes )) No reason to do like that even partly.
You can push qword registers or if length undefined use something like lea rsi,[rsp] and load until zero. |
|||
![]() |
|
Roman 22 Aug 2020, 13:51
Ok.
I want try this: Code: jmp .3 .2: db "Patrik1",0 .3: mov dword [eax],.2 add eax,64 jmp .3 .2: db "Patrik2",0 .3: mov dword [eax],.2 add eax,64 Fasm get error .3 alredy exist. |
|||
![]() |
|
revolution 22 Aug 2020, 13:55
Use a new label name. Or use @f, @b, and @@
|
|||
![]() |
|
Overclick 22 Aug 2020, 13:56
Quote: And how in 64 bits work invoke ? It is not in the stack It just leaving space in code before call for db value and loads its address for function. You can do that any time. Just don't try to write on it in segmented mode. Code: .code jmp @F txt db 'abc',0 @@: |
|||
![]() |
|
Roman 22 Aug 2020, 14:06
I understood you.
Not good for me. I use @ symbol. I do that in my Fasm++: Code: jmp .class% .%classb: db "@",0 .class%: mov dword [@.c],.%classb This get on % 0 than 1 than 2. On symbol @ put some text name. jmp .class0 .0classb: db "Bill",0 .class0: jmp .class1 .1classb: db "Tom",0 .class1: PS: this fine for 32 bits and 64 bits. |
|||
![]() |
|
revolution 22 Aug 2020, 14:12
Code: mov dword [@.c],.%classb processed: mov dword[@.c],.%classb error: undefined symbol '@.c'. |
|||
![]() |
|
Roman 22 Aug 2020, 14:14
Quote:
No. I use mov dword[@.c] in my ^cls |
|||
![]() |
|
Roman 22 Aug 2020, 14:14
How replace @ to $ in this case ?
jmp @F txt db 'abc',0 @@: |
|||
![]() |
|
revolution 22 Aug 2020, 14:16
Roman: We don't know what you are doing. We have trouble reading your mind.
Give a minimal code sample showing your problem. |
|||
![]() |
|
Roman 22 Aug 2020, 14:19
Quote:
My problem this does not fit for me. Because i use token @. It's a pity that fasm can't use another token not a @ for label @@: Last edited by Roman on 22 Aug 2020, 14:21; edited 1 time in total |
|||
![]() |
|
revolution 22 Aug 2020, 14:21
Then don't use @.
![]() Therein lies the problem of trying to bend things out of shape. ![]() |
|||
![]() |
|
bitRAKE 22 Aug 2020, 14:28
Code: call @F db 'love it when a plan comes together',0 @@: pop rax ; do something with constant string address |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.