Menu

#184 arg used multiple times in context gives unexpected results

open
nobody
1
2004-06-14
2004-06-14
Anonymous
No

Just received this report by e-mail:

---
In this code parameter a and c will be on identical
address (Declared in function):

func:
%push my_context
%stacksize small
%assign %$localsize
arg a:dword,b:dword
arg c:dword

...

%pop
---

I get a syntax error on the %assign line (don't know why
it was included), but otherwise confirmed on 0.98.35,
and can't see any more recent fixes.

I'm not sure if this should work as it logically appears it
should, or generate an error. The directive is
documented as having a non-intuitive format, I know,
but obviously code that doesn't do what it looks like it
should is not a reasonable result.

Discussion

  • nasm64developer

    nasm64developer - 2004-06-14

    Logged In: YES
    user_id=804543

    In essence NASM expects the user to specify all
    arguments in a single %ARG statement:

    %ARG a:dword, b:dword, c:dword

    Multiple %ARG statements can still be useful, to
    pass union-like arguments on the stack:

    %ARG type:word, d:dword
    %ARG type:word, w1:word, w2:word

    In other words: this is not a bug, but a feature.
    Though a poorly documented one.

     
  • nasm64developer

    nasm64developer - 2004-06-14
    • priority: 5 --> 1
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.