flat assembler
Message board for the users of flat assembler.
Index
> Windows > The new macroinstructions for Win32 programming Goto page Previous 1, 2 |
Author |
|
vid 27 Jun 2005, 17:31
you see farrier? That's what i was talking about
|
|||
27 Jun 2005, 17:31 |
|
farrier 03 Jul 2005, 09:47
Tomasz Grysztar,
Greetings, I installed the 27 June 2005 version of FASM 1.62 and while: Code: local var[100]:WORD works, the following no longer does: Code: local var:WORD 100 dup (?) Was this a design decision? Thanks again for the FASM! farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! Last edited by farrier on 03 Jul 2005, 09:50; edited 1 time in total |
|||
03 Jul 2005, 09:47 |
|
Tomasz Grysztar 03 Jul 2005, 09:50
Quote: Was this a design decision? Yes. |
|||
03 Jul 2005, 09:50 |
|
farrier 03 Jul 2005, 09:53
I understand!
farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! |
|||
03 Jul 2005, 09:53 |
|
Tomasz Grysztar 03 Jul 2005, 14:40
Another update to "proc" macro, the "uses" syntax is now enabled:
Code: proc WindowProc uses ebx esi edi, hwnd,wmsg,wparam,lparam With MACRO\MASM.INC included, it may look like: Code: WindowProc proc uses ebx esi edi, hwnd:DWORD,wmsg:DWORD,wparam:DWORD,lparam:DWORD .if [wmsg]=WM_DESTROY invoke PostQuitMessage,0 xor eax,eax .else invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] .endif ret WindowProc endp I guess I should write some sort of official documentation/manual for the fasmw's macro package. |
|||
03 Jul 2005, 14:40 |
|
mimas 03 Jul 2005, 16:19
Nice for cleaner and safer code (these registers sometimes forgotten onto stack). As usual, Thanks Tomasz.
What about a wiki for preprocessor/macro documentation? There were tons of change recently, the users contributions may leave you some free time. |
|||
03 Jul 2005, 16:19 |
|
madmatt 03 Jul 2005, 22:24
Having a problem, I would like to define a directsound interface inside a structure, but doesn't work in the new struct macro. But when I use 'struc', everything works fine. Would it be possible to fix this?
|
|||
03 Jul 2005, 22:24 |
|
madmatt 04 Jul 2005, 11:10
Well, it compiles ok. But when i use it, it crashes. I changed it to a normal struc, and it works fine. I don't know what would make it do this, do you? Here's the example:
Code that doesn't work: Code: struct VOCFILETYPE samplerate dd 0 length dd 0 vocbuffer DirectSoundBuffer ends Code that does work: Code: struc VOCFILETYPE { .samplerate dd 0 .length dd 0 .vocbuffer DirectSoundBuffer } |
|||
04 Jul 2005, 11:10 |
|
Tomasz Grysztar 04 Jul 2005, 11:20
Oh, you're right, it defines wrong offsets this way. I will try to correct it.
|
|||
04 Jul 2005, 11:20 |
|
Tomasz Grysztar 04 Jul 2005, 11:25
I've uploaded the correction.
|
|||
04 Jul 2005, 11:25 |
|
madmatt 04 Jul 2005, 12:13
All right, works good now. and as always, thanks for your quick response, and fixes
|
|||
04 Jul 2005, 12:13 |
|
Tomasz Grysztar 05 Jul 2005, 11:23
mimas wrote: What about a wiki for preprocessor/macro documentation? There were tons of change recently, the users contributions may leave you some free time. I think some thread here would be enough. I will start one soon. |
|||
05 Jul 2005, 11:23 |
|
Tomasz Grysztar 08 Jul 2005, 09:10
I've improved the locals support, so now it can even declare the initialized locals. For example this:
Code: locals alpha dd 1000 beta db 100 endl will not only allocate the space for locals and define proper labels, but also generate code (at the point in procedure where the declaration is placed) to initialized them. Of course when you use unitialized values ("?" or reservation directives), only allocation happens. I consider also adding some stack probing for allocations larger than 1000h bytes, however haven't decided what probing method would be the best. Any advices? |
|||
08 Jul 2005, 09:10 |
|
f0dder 08 Jul 2005, 14:40
You can use the stack probing from Jørgen "jibz" Ibsen's WCRT, which is based on some code I wrote - I'm sure he won't mind. http://www.ibsensoftware.com .
It's probably a good idea to make the stack probing controllable, it's not always desired... |
|||
08 Jul 2005, 14:40 |
|
Tomasz Grysztar 08 Jul 2005, 15:04
Yes, I think of it as a kind of some additional setting to the "proc" macro.
|
|||
08 Jul 2005, 15:04 |
|
Tomasz Grysztar 08 Jul 2005, 18:19
And a new feature of extended macros, the "double" prefix for parameters in calling macros, here's the sample program:
Code: format PE console 4.0 include 'win32ax.inc' entry $ stdcall disp,double 3.7 cinvoke getchar invoke ExitProcess,0 proc disp number:QWORD cinvoke printf,"%4.2f",double [number] ret endp data import library kernel32,'kernel32.dll',\ msvcrt,'msvcrt.dll' import kernel32,\ ExitProcess,'ExitProcess' import msvcrt,\ getchar,'getchar',\ printf,'printf' end data |
|||
08 Jul 2005, 18:19 |
|
Tomasz Grysztar 11 Jul 2005, 09:05
I've restructured the "proc" macro a bit and made it generate startup/exit code by calling external macros, defined by the "prologue@proc" and "epilogue@proc" symbolic constants. So you can define now alternative prologue/epilogue macros (like stack probing etc.) and just set those constants to get them working with "proc" (the parameters passed to those macro are analoguous to the set of parameters used by MASM for prologue and epilogue macros).
Also the MACRO/MASM.INC emulates the "option" syntax: Code: option prologue:none option epilogue:none I only had one design problem with designing those macros, please look at the below two variants. Which in you opinion is better? The one currently used: Code: macro prologuedef procname,flag,parmbytes,localbytes,reglist { if parmbytes | localbytes push ebp mov ebp,esp if localbytes sub esp,localbytes end if end if if ~ reglist eq save@regs reglist end if } macro save@regs [reg] { push reg } or alternative: Code: macro prologuedef procname,flag,parmbytes,localbytes,[reg] { common if parmbytes | localbytes push ebp mov ebp,esp if localbytes sub esp,localbytes end if end if if ~ reglist eq forward push reg common end if } |
|||
11 Jul 2005, 09:05 |
|
farrier 11 Jul 2005, 10:20
Tomasz Grysztar,
Is there an error in the Quote: alternative: In the list of parameters is: Quote: [reg] but in the macro you refer to: Quote: reglist I'm still trying to learn the intricacies of the FASM macro capabilities! Thanks for your work!! farrier _________________ Some Assembly Required It's a good day to code! U.S.Constitution; Bill of Rights; Amendment 1: ... the right of the people peaceably to assemble, ... The code is dark, and full of errors! |
|||
11 Jul 2005, 10:20 |
|
Goto page Previous 1, 2 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.