TIP: Click on subject to list as thread! ANSI
echo: power_bas
to: ALL
from: MARC VAN DEN DIKKENBERG
date: 1998-01-27 21:11:00
subject: Re: PB REG / inline ASM p

From: pb@excelsior.xs4all.nl.REMOVE-THIS (Marc van den Dikkenberg)
Subject: Re: PB REG / inline ASM problems
 
On Mon, 26 Jan 1998 19:53:16 -0500, "Barry Erick"  wrote:
 
>Marc,
> What I do when I have a similar problem is stick a $STACK meta in the
>program. Also, enable all Error Checking to see if that tells you anything.
 
Thanks for the suggestions... I've played around with the error checking
for a while, and that DID show me something interesting:
 
Here are the two variations again: the first one works fine in DOS only,
because under win95 the REG command acts weird. No errors.
 
SUB SendPacket (CompleteCode%, InUseFlag%)
	Reg 2, 3
	Reg 9, VARSEG(ECBS)
	Reg 5, VARPTR(ECBS)
	CALL INTERRUPT &H7A
 
	CompleteCode = ASC(ECBS.CompCode)
	InUseFlag = ASC(ECBS.InUse)
END SUB
 
 
And here is the second: making use of inline ASM, which should (as far as
I'm aware) be compatible with both DOS and Windows. This works fine in
Win95, but NOT in DOS. when I activate error checking, I DO get errors in
DOS:
 
SUB SendPacket (CompleteCode%, InUseFlag%)
	plop??=varseg(ECBS)
	plip??=varptr(ECBS)
	! MOV BX,3
	! MOV ES,plop??
	! MOV SI,plip??
	! INT &H7A
 
	CompleteCode = ASC(ECBS.CompCode)
	InUseFlag = ASC(ECBS.InUse)
END SUB
 
The last two lines get an error 211: Pointer is Null.
I suppose that I goof up passing the VARSEG and VARPTR variables somehow.
But I fail to see how I _should_ do that, though. And I find it somewhat
odd that this code works just like it should when run from Windows 95.
--
Marc van den Dikkenberg
-----------------------
The PowerBasic Archives
http://www.xs4all.nl/~excel/pb.html
 
*** QwkNews (tm) v2.1
 * [TN11.1] Internet Newsgroup: alt.lang.powerbasic
--- GEcho 1.20/Pro
---------------
* Origin: Toast House Remote (1:100/561)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.