flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
roxaz 27 Jul 2008, 11:35
va_list is probably one of the best CRT features, wouldnt it be great to have this thing in asm too? yes it would! thx to uncle roxaz now you will be able to have just that! i made fasm macros for using va_list.
demo app included demonstrating usage of va_list. enjoy ;] Code: ;ap = register to store va_list in, v = last argument before va_list ;vSize = size of argument v. macro va_start ap*, v*, vSize* { lea ap, v add ap, vSize } ;ap = va_list, t = size of argument that is being taken out of va_list ;value is returned in eax register. macro va_arg ap*, t* { mov eax, [ap] add ap, t } ;ap = va_list ;kinda not needed imo.. but it was in crt so.. macro va_end ap* { xor ap, ap }
|
|||||||||||
![]() |
|
roxaz 27 Jul 2008, 17:10
you can ofcourse, however if you are working with va_lists a lot it saves few seconds, and i value those few seconds ;]
|
|||
![]() |
|
vid 27 Jul 2008, 17:23
Quote: and i value those few seconds Then don't code assembly ![]() |
|||
![]() |
|
roxaz 27 Jul 2008, 19:28
some things can never be done in high level language ^_^
|
|||
![]() |
|
rCX 27 Jul 2008, 20:19
It seems that there are at least three reasons why asm programmers use macros.
reason 1. Size optimization reason 2. Speed optimization reason 3. Coding optimization (making asm coding faster or easier to understand) reason ? I guess this falls more into reason 3. ![]() |
|||
![]() |
|
vid 27 Jul 2008, 20:23
Quote: some things can never be done in high level language ^_^ That's why people to whom secons matter, use assembly only for few small parts that can't be done in HLL ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.