Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

"The Computer made me do it."


programming / comp.lang.asm.x86 / Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments

SubjectAuthor
* Borlands tasm32 v5, calling by pointer and assemble-time checking the R.Wieser
`* Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the JJ
 `* Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the R.Wieser
  `* Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the JJ
   `- Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the R.Wieser

1
Subject: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
From: R.Wieser
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Thu, 9 Apr 2020 12:53 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: addr...@nospicedham.not.available (R.Wieser)
Newsgroups: comp.lang.asm.x86
Subject: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
Date: Thu, 9 Apr 2020 14:53:04 +0200
Organization: Aioe.org NNTP Server
Lines: 27
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <r6n5ri$kug$1@gioia.aioe.org>
Injection-Info: reader02.eternal-september.org; posting-host="727afdcff1080ef9983b92b738a50b82";
logging-data="25074"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+uBVMaK3vuBYyE++NE91sH/6Xm3d3NGAY="
Cancel-Lock: sha1:v7qcq+Za142U0oq2DU6f9rK9UDc=
View all headers
Hello all,

I'm Using Borlands Tasm32 v5, and am calling a procedure by pointer (a
callback).  The problem is that it doesn't (can't) do any assemble-time
checking of the provided arguments, while this does happen when calling the
function by value.

example:

;-- Definition of the procedure
TheFunction PROCDESC @@lArgOne:DWORD,@@lArgTwo:DWORD

;-- A by-pointer call
mov [@@pFunction],offset [TheFunction]
....
call [@@pFunction], eax, 42, -1   ;<- Too many arguments, but not detected.

;-- A by-value call
call TheFunction, eax, 42, -1    ;<- detected

My question, (how) can I tell the by-pointer call which procedure it is
targetting, so that its (number and type of) arguments can be checked ?

Regards,
Rudy Wieser




Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
From: JJ
Newsgroups: comp.lang.asm.x86
Organization: albasani.net
Date: Fri, 10 Apr 2020 05:57 UTC
References: 1
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@nospicedham.vfemail.net (JJ)
Newsgroups: comp.lang.asm.x86
Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
Date: Fri, 10 Apr 2020 12:57:51 +0700
Organization: albasani.net
Lines: 29
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <b1qr6idfbia1.zxogoxewfq7p.dlg@40tude.net>
References: <r6n5ri$kug$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="1ae0d12d4deacff35c02fe7956374fb2";
logging-data="1398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Fcv7vOR5b17KGdkD6ow31nDOzYrZJidM="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:zafoGkPKIfgfmnGMlnFDdamohDw=
View all headers
On Thu, 9 Apr 2020 14:53:04 +0200, R.Wieser wrote:
Hello all,

I'm Using Borlands Tasm32 v5, and am calling a procedure by pointer (a
callback).  The problem is that it doesn't (can't) do any assemble-time
checking of the provided arguments, while this does happen when calling the
function by value.

example:

;-- Definition of the procedure
TheFunction PROCDESC @@lArgOne:DWORD,@@lArgTwo:DWORD

;-- A by-pointer call
mov [@@pFunction],offset [TheFunction]
....
call [@@pFunction], eax, 42, -1   ;<- Too many arguments, but not detected.

;-- A by-value call
call TheFunction, eax, 42, -1    ;<- detected

My question, (how) can I tell the by-pointer call which procedure it is
targetting, so that its (number and type of) arguments can be checked ?

Regards,
Rudy Wieser

PROCDESC should work. PROCTYPE can also be used as alternative.



Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
From: R.Wieser
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Fri, 10 Apr 2020 07:47 UTC
References: 1 2
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: addr...@nospicedham.not.available (R.Wieser)
Newsgroups: comp.lang.asm.x86
Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
Date: Fri, 10 Apr 2020 09:47:36 +0200
Organization: Aioe.org NNTP Server
Lines: 14
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <r6p8av$lu4$1@gioia.aioe.org>
References: <r6n5ri$kug$1@gioia.aioe.org> <b1qr6idfbia1.zxogoxewfq7p.dlg@40tude.net>
Injection-Info: reader02.eternal-september.org; posting-host="1ae0d12d4deacff35c02fe7956374fb2";
logging-data="5975"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/vUDucvLa/QwiwUzfheEr97jxWgf1l5s="
Cancel-Lock: sha1:0x6VS2O9s87jSE8+z3eQGMIuWvQ=
View all headers
JJ,

PROCDESC should work. PROCTYPE can also be used as alternative.

I'm not sure what you are saying there or where it should work ...

The problem is the "call [@@pFunction]" line (not detecting an argument
mismatch).  I should put either of the above in there ?   I tried that
before posting, but the assembler just threw an error.

Regards,
Rudy Wieser




Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
From: JJ
Newsgroups: comp.lang.asm.x86
Organization: albasani.net
Date: Sat, 11 Apr 2020 03:01 UTC
References: 1 2 3
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: jj4pub...@nospicedham.vfemail.net (JJ)
Newsgroups: comp.lang.asm.x86
Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
Date: Sat, 11 Apr 2020 10:01:33 +0700
Organization: albasani.net
Lines: 21
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <wpjt7gzm8f49.hbizzi7gqjjx$.dlg@40tude.net>
References: <r6n5ri$kug$1@gioia.aioe.org> <b1qr6idfbia1.zxogoxewfq7p.dlg@40tude.net> <r6p8av$lu4$1@gioia.aioe.org>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="851dd5d05f886c5eaed9245021fe4026";
logging-data="27411"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18p2+3lOzFZT7M45KchrYEMAsCbT1bLB2M="
User-Agent: 40tude_Dialog/2.0.15.84
Cancel-Lock: sha1:5ifptDaKMXXb0ZetfmwgGjk6aPI=
View all headers
On Fri, 10 Apr 2020 09:47:36 +0200, R.Wieser wrote:

I'm not sure what you are saying there or where it should work ...

The problem is the "call [@@pFunction]" line (not detecting an argument
mismatch).  I should put either of the above in there ?   I tried that
before posting, but the assembler just threw an error.

Here's a snippet from TASM5 User's Guide, Chapter 13, "Calling procedures
that have been prototyped".

[quote]
You can also use procedure types (declared with PROCTYPE) to supply a
distance and language, and force type-checking to occur. For example,

  footype proctype pascal near :word, :dword, :word
  .
  .
  call footype ptr[bx],ax,ds bx,cs ;no error!
[/quote]



Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
From: R.Wieser
Newsgroups: comp.lang.asm.x86
Organization: Aioe.org NNTP Server
Date: Sat, 11 Apr 2020 07:19 UTC
References: 1 2 3 4
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: addr...@nospicedham.not.available (R.Wieser)
Newsgroups: comp.lang.asm.x86
Subject: Re: Borlands tasm32 v5, calling by pointer and assemble-time checking the provided arguments
Date: Sat, 11 Apr 2020 09:19:26 +0200
Organization: Aioe.org NNTP Server
Lines: 18
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <r6rr26$14j7$1@gioia.aioe.org>
References: <r6n5ri$kug$1@gioia.aioe.org> <b1qr6idfbia1.zxogoxewfq7p.dlg@40tude.net> <r6p8av$lu4$1@gioia.aioe.org> <wpjt7gzm8f49.hbizzi7gqjjx$.dlg@40tude.net>
Injection-Info: reader02.eternal-september.org; posting-host="851dd5d05f886c5eaed9245021fe4026";
logging-data="2422"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19WXuwF3NRaERP3I4nYwfTzKdH+xTN5qhI="
Cancel-Lock: sha1:p9RY+83SnPjdDkVnsY9KYVNxq4M=
View all headers
JJ,

Here's a snippet from TASM5 User's Guide, Chapter 13, "Calling
procedures that have been prototyped".

Alas, all I get with your exact example (using v5.0 and v5.4) is an error:

"Can't generate instance of type: footype"

I can't even think how it can throw that error at *assemble* time - it
should not be generating instances of anything.

I also tried it with an existing procedure, but got the same result.

Regards,
Rudy Wieser




1
rocksolid light 0.7.2
clearneti2ptor