home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,693 of 4,675   
   Rod Pemberton to R.Wieser   
   Re: Borlands Tasm32 v5.x and using "assu   
   15 Dec 18 05:40:22   
   
   From: invalid@nospicedham.lkntrgzxc.com   
      
   On Sat, 15 Dec 2018 10:29:40 +0100   
   "R.Wieser"  wrote:   
      
   > Sometimes I write code where I have the target address of a procedure   
   > in a register or memory location (stack-based argument).   The   
   > problem is than when I use such an indirect call the (number and type   
   > of) arguments of the call are not compile-time checked against the   
   > target procedure.   
   >   
   > Example:   
   > - - - - - - - - - - - -   
   > Foo PROCDESC lArg1:DWORD,lArg2.DWORD   
      
   The . should be a : I think.  Is this a syntax error issue or typo?   
      
   > lea eax,[Foo]   
   > call eax,12345678h   
   > - - - - - - - - - - - -   
      
   Borland's TASM 4.0 manual indicates that the PROCTYPE directive is used   
   to force type-checking, e.g.,   
      
   Foo PROCTYPE ???? :DWORD, :DWORD   
      
   where ???? is the language specified by either MODEL or PROCDESC which   
   should be NOLANGUAGE for assembly, or BASIC, FORTRAN, PROLOG, C, CPP   
   for C++, SYSCALL, STDCALL, or PASCAL   
      
   Does the PROCTYPE do what you want? i.e., generate an error?   
      
   Is the language specified somewhere in your code?   
      
      
   Also, Borland's TASM 4.0 manual seems to think the format for the call   
   instruction should be:   
      
   call Foo ???? 12345678h, 0h   
      
   where I placed 0h for the (missing) second argument   
      
   where ???? is the language specified by either MODEL or PROCDESC which   
   should be NOLANGUAGE for assembly, or BASIC, FORTRAN, PROLOG, C, CPP,   
   SYSCALL, STDCALL, or PASCAL   
      
      
   So, does that format, i.e., calling Foo directly instead of indirectly   
   via a register, generate an error?   
      
   I.e., does any assembler track values in registers such as the address   
   of a procedure to be called? ...   
      
   I.e., I don't see an example of using call indirectly via a register.   
      
   > This will not generate a compile-time error, even though the call   
   > misses an argument.   
      
   ...   
      
   > I've tried to "assume" the EAX register to the procedure (assume EAX:   
   > FooBar), but Borlands Tasm32 v5.x does not seem to like that. :-(   
   >   
   > Question: *can* I put an "assume" on a register, and if so how do I   
   > do that ?   
      
   ...   
      
   > And and afterthought:   
   > If it is possible, is the scope of such an assumption limited to the   
   > procedure, or is it global (I assume the former, but ...) ?   
   >   
      
   ...   
      
      
   Sorry, I'm not qualified to answer any of your questions, as I'm not   
   familiar with TASM's regular syntax, but I didn't mind looking for a few   
   minutes.  FYI, TASM's ideal syntax is similar to NASM's syntax, IIRC.   
      
      
   Rod Pemberton   
   --   
   Why isn't the SpaceX car considered to be space junk? Elon Musk, space   
   polluter.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca