Interesting RosAsm Bug...

From: Randall Hyde (randyhyde_at_earthlink.net)
Date: 09/16/04


Date: Thu, 16 Sep 2004 21:17:23 GMT

I just cut and pasted some code of Rene's from
another thread into RosAsm v2.x. Here's the
complete program:

____________________________________________________________________________
_______________
____________________________________________________________________________
_______________

____________________________________________________________________________
_______________
Main:
    call 'Kernel32.ExitProcess' &NULL

_______
; Proc Macros:

[Proc | &1=0 | &2=0 | &3= | #1 | push ebp | mov ebp esp]

[ExitP | jmp P9>>]

[Arguments | {#1 Arg#x} | #+1 | &1=SizeOf#x]
[Argument | {#1 Arg#x} | #+1 | &1=SizeOf#x]

[Local | {#1 Local#x} | #+1 | sub esp SizeOf#x | &2=SizeOf#x]

[StrucPtrs | {#3 ebp+#2+#F} | #+2]

[Structure | {#1 ebp-&2-4} | sub esp #2+4 | mov D$#1 esp | StrucPtrs 0-&
2-#2-4 #L>3]

[Uses | push #1>L | &3=pop #L>1]

[EndP | P9: | &3 | mov esp ebp | pop ebp | ret &1]

; For pointing to transmitted parameters (upper "Arg#x" fall here):

[Arg1 ebp+8 Arg2 ebp+12 Arg3 ebp+16 Arg4 ebp+20 Arg5 ebp+24
 Arg6 ebp+28 Arg7 ebp+32 Arg8 ebp+36 Arg9 ebp+40 Arg10 ebp+44]

; For pointing Local Stack declared data (upper "Local#x" fall here):

[Local1 ebp-4 Local2 ebp-8 Local3 ebp-12 Local4 ebp-16
Local5 ebp-20
 Local6 ebp-24 Local7 ebp-28 Local8 ebp-32 Local9 ebp-36
Local10 ebp-40]

; To help preventing from stack sizes' mistakes (upper "SizeOf#x" fall
here):

[SizeOf1 4 SizeOf2 8 SizeOf3 12 SizeOf4 16 SizeOf5 20
 SizeOf6 24 SizeOf7 28 SizeOf8 32 SizeOf9 36 SizeOf10 40]
_______________________________________________________________

; Usage:

Proc MyProcedure:
    Arguments @X, @Y, ...
    Local @Line, @Row,...
    Structure @POINT 8, xDis 0, yDis 4
    Uses esi, edi, ecx

        ; Code...
        mov eax 0

EndP
____________________________________________________________________________
________

Now the fact that the code did not compile is not
too much of a surprise. One expects that in a first
attempt at cutting and pasting code from a newsgroup
posting into some language processor. However, the
real problem is that RosAsm resports "error: Unpaired parenthesis"
with *no* indication of where the problem lies in the program.
I'm sure somone who is a RosAsm expert can point out to me
where the problem lies in the code above, but those of us who
expect the assembler to tell us minor details like the line number
of the offending problem (or, in the case of RosAsm, putting
the cursor on the offending statement), might be a little
put off by this problem.

RosAsm also claims that
"[Local1 ebp-4 Local2 ebp-8 Local3 ebp-12 Local4 ebp-16"
is an error, I leave it up to Rene to explain what's wrong there, as this
is his code.
Cheers,
Randy Hyde



Relevant Pages

  • Re: "We Never Use Assembly Language"
    ... stated that MASM couldn't do what RosAsm was doing with PROC/ENDP. ... Instead of no-end BlaBla, ass-hole, why don't you paste ... your MASM Proc Macros doing the same things as the RosAsm ...
    (alt.lang.asm)
  • Re: "We Never Use Assembly Language"
    ... stated that MASM couldn't do what RosAsm was doing with PROC/ENDP. ... Instead of no-end BlaBla, ass-hole, why don't you paste ... your MASM Proc Macros doing the same things as the RosAsm ...
    (alt.lang.asm)