flat assembler
Message board for the users of flat assembler.
Index
> Main > Need size example. |
Author |
|
bitRAKE 24 Apr 2011, 04:25
CMPXCHG8B can store 2 DWORDS. PUSHAD can store more.
Not clear what you are after. Otherwise I'd give an example. After CDQ, EDX is either 0 or -1. (Based on high-bit of EAX.) Is MMX or SSE an option? |
|||
24 Apr 2011, 04:25 |
|
ouadji 24 Apr 2011, 09:47
but "pushad" can't be used with "lock" but ... push ss pop ss pushad A pop_ss instruction inhibits all interrupts, including the NMI interrupt, until after execution of the next instruction. |
|||
24 Apr 2011, 09:47 |
|
revolution 24 Apr 2011, 09:52
Hehe:
Code: macro lock instr { push ss pop ss instr } |
|||
24 Apr 2011, 09:52 |
|
Overflowz 24 Apr 2011, 10:30
I really don't know what to do so.. All examples are welcome for me.. I don't know what's MMX and how to ise that.. and what that does "push ss/pop ss/pushad" ? I know only that crashes olly (like exploit)
I need to push 8 byte argument in API call.. for example: Code: movq mm0,0xFFFFFFFFFFFFFFFF invoke MessageBox,0,mm0,mm0,MB_OK This would not work right ?.. I need something like this but with QWORD.. |
|||
24 Apr 2011, 10:30 |
|
SPTH 24 Apr 2011, 16:18
Code: invoke MessageBox,0,mm0,mm0,MB_OK is Code: push MB_OK push mm0 push mm0 push 0 stdcall [MessageBox] So you can simple push two 32bit values to get one 64bit value on stack, for the API to work with it: Code: mov eax, dword[HighDWORD] push eax mov eax, dword[LowDWORD] push eax stdcall [API_THAT_NEEDS_ONE_64BIT_VALUE_ON_STACK] If you explain what you need more, somebody could help you i guess. - - - Something else Code: push ss pop ss isnt that just a NOP??? :o |
|||
24 Apr 2011, 16:18 |
|
ouadji 24 Apr 2011, 18:08
No, this is not like a "nop" the combining of these two instructions offer, for the third, a very interesting property. Quote:
MOV ESP, EBP ... or any other instruction ! the third instruction will be executed atomically. |
|||
24 Apr 2011, 18:08 |
|
Overflowz 24 Apr 2011, 23:47
I'm trying to do following but I fail.
movq mm0,0xFFFFFFFFFFFFFFFF says mm0 is invalid address.. |
|||
24 Apr 2011, 23:47 |
|
SPTH 25 Apr 2011, 00:47
See page 47 in "flat assembler 1.69 Programmer's Manual" by Tomasz Grysztar (in the root dir of your FASM compiler, called FASM.PDF):
Quote:
You can eighter use a different MMX register or a memory offset to fill the mm0 register. You can not use a constant. See the manual for more infos. (you can use ctrl+F there, too :D ) |
|||
25 Apr 2011, 00:47 |
|
Overflowz 25 Apr 2011, 02:20
Oh, I got it! Thank you and also, last little question.
how much bytes is TBYTE ? Is that larger than QWORD ? |
|||
25 Apr 2011, 02:20 |
|
revolution 25 Apr 2011, 02:33
Overflowz wrote: ... and also, last little question. http://flatassembler.net/docs.php |
|||
25 Apr 2011, 02:33 |
|
Overflowz 25 Apr 2011, 14:33
revolution
ohh.. sorry I'm always forgetting that thanks anyway Also, I'm interested why I can't do something like this ? Code: qval db 0xFFFFFFFFFFFFFFFF .. mov qword[ebp],qval says, illegal unstruction at "mov qword[ebp],qval".. but mov tbyte[ebp],qval works fine. can someone tell me what the point of using those registers ? and for what ? (of course from your experience) |
|||
25 Apr 2011, 14:33 |
|
SPTH 25 Apr 2011, 16:04
1) http://flatassembler.net/docs.php?article=manual -> ctrl+F -> "tbyte" ->
Quote:
2) Quote:
Code: include '...\FASM\INCLUDE\win32ax.inc' .data qval db 0xFFFFFFFFFFFFFFFF .code start: mov tbyte[ebp],qval .end start Gives "invalid size of operand". mov can be used for byte, word, dword - NOT qword (use movq) or tbyte (see http://flatassembler.net/docs.php?article=manual#2.1.13) or something else than 8,16,32bit. Reading the manual and searching the answeres to these questions will help you alot understanding assembler more, I promise you |
|||
25 Apr 2011, 16:04 |
|
Overflowz 25 Apr 2011, 17:17
SPTH
I got it.. Thank you |
|||
25 Apr 2011, 17:17 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.