From: lanceedmonds@SPAMLESS.xtra.co.nz (Lance Edmonds)
Subject: Re: Need Help How can Help
Peter Arbeiter wrote:
>How can Translate this Function to PB InlineASM ??
>
>Dim TEXT as String(2048)
>Function TASC(TEXT,b%) as Integer
> Tasc = ASC(Mid$(TEXT,B%,1))
>end function
Which version of PB?
In 3.2, use pointers, and keep it simple & fast too.
(Assuming TEXT string is dynamic. If it's a fixed length string,
change STRPTR32 to VARPTR32)
DIM txtptr as byte ptr
txtptr = strptr32(TEXT)
txtptr = txtptr + b% - 1
print chr$(@txtptr)
in 3.5 use indexed pointers
DIM txtptr as byte ptr
txtptr = strptr32(TEXT)
print chr$(@txtptr[b% - 1])
To use assembly, you'd have to call $GetStrLoc, and then read the
byte-offset from there.
(Off the top of my head)
--Lance.
==============================
Lance Edmonds, Email contacts:
100354.1645@compuserve.com
Lance_Edmonds@compuserve.com
lanceedmonds@xtra.co.nz
==============================
Please remove "SPAMLESS." when
replying by email.
==============================
*** QwkNews (tm) v2.1
* [TN71] Toast House Import
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)
|