2 problems

Peter Johnson peter at tortall.net
Sun Aug 19 15:12:44 PDT 2007


On Sun, 19 Aug 2007, dave wrote:
> I changed all the stos byte ... instructions to stosb ... and that
> got rid of a  lot of errors. However, I am seeing the stos error
> message in places where there is no stos instruction.--
>
> ../assemble.inc:1633: redefinition of `stos'
>      cmp     byte [esi],'.'
>        je      invalid_value
>        push    ebx edx
>        call    get_dword_value
>        pop     edx ebx			<= line 1633
>        mov     [esp],eax
>
> I suspect that multiple operands to push/pop are illegal
> (but extremely handy :-) ). Any chance of making that legal in yasm?

You can mimic this via the use of macros.  Yasm will not be supporting 
this natively (just like NASM), as not only is multiple operands not a 
real instruction, but because of this, the order by which these multiple 
operands are actually pushed onto the stack is not standardized (is push 
ebx edx equivalent to push ebx followed by push edx, or vice-versa; 
should pop pop in reverse order of its arguments or not?).

Something like this example from the NASM manual might work:

%macro  multipush 1-*
   %rep  %0
         push    %1
   %rotate 1
   %endrep
%endmacro

Which runs from left to right through the multipush arguments.

Peter


More information about the yasm-devel mailing list