flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 26 Aug 2012, 20:28
Code: stdcall NumToStr, eax, ntsDec + ntsUnsigned push eax stdcall FileWriteString, [STDOUT], eax stdcall StrDel |
|||
![]() |
|
Overflowz 26 Aug 2012, 20:48
Huh ? I have never seen such code before. What the NumToStr/FileWriteString/StrDel functions does ?
|
|||
![]() |
|
JohnFound 26 Aug 2012, 21:02
They are from FreshLib. You can download it with Fresh IDE (the above link) but you can use it with every version of FASM. The reference manual is included in Fresh IDE package.
Anyway: NumToStr converts number to string. FileWriteString writes the string to the file (STDOUT in the example) and StrDel destroys the string. |
|||
![]() |
|
Overflowz 26 Aug 2012, 21:26
duh.. I need to translate these things in C-s inline ASM, I don't like dependencies
![]() Thanks ! ![]() |
|||
![]() |
|
Picnic 26 Aug 2012, 21:31
Hi,
Try this way, Code: format PE CONSOLE include "win32ax.inc" .data buf rb 33 .code main: call flags invoke MessageBox, 0, buf, "", MB_OK ret flags: pushad pushfd pushfd pop ebx mov edi,buf mov ecx,32 cld @@: xor al,al shl ebx,1 adc al,'0' stosb loop @B xor al, al stosb popfd popad ret .end main |
|||
![]() |
|
Overflowz 26 Aug 2012, 21:35
I don't understand, AFAIK there is only 8 flags, but that displayed much more than 8.. Why or what I don't know yet ?
![]() |
|||
![]() |
|
Overflowz 26 Aug 2012, 21:46
as I guess, they have different offsets according to this ? -> http://www.c-jump.com/CIS77/ASM/Instructions/I77_0070_eflags_bits.htm
|
|||
![]() |
|
revolution 26 Aug 2012, 21:53
Overflowz wrote: as I guess, they have different offsets according to this ? -> http://www.c-jump.com/CIS77/ASM/Instructions/I77_0070_eflags_bits.htm |
|||
![]() |
|
Overflowz 26 Aug 2012, 21:55
Because I don't have time for searching in manuals because of hard job, isn't it enough ?..
|
|||
![]() |
|
Picnic 26 Aug 2012, 21:57
Code converts a double word to binary.
Suppose you want to display only 16 bits of eflags register, Code: ; ; pushfd pop ebx shl ebx,16 mov edi,buf mov ecx,16 ; ; |
|||
![]() |
|
Overflowz 26 Aug 2012, 22:07
I did some tests and SHL was not successful. Instead, SHR did job starting from carry flag to end. Am I doing everything right ? I need only status and control flags to be extracted, so I should check positions of each bits right ?
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.