From: "Barry Erick"
Subject: Re: PB REG / inline ASM problems
Is your ECBS block SHARED, or PUBLIC? How is the Sub getting that? Trace
through in the IDE or Debugger, and use ALT 7 to bring up the CPU registers
and also watch the ECBS variable to make sure it is appearing in the SUB.
--- Barry
Marc van den Dikkenberg wrote in message ...
|
|I've converted a fully functional set of IPX network routines
|from QB to PB. I've tried two different ways of implementing it in PB, but
|there is one major problem: either it works under win95, or it works under
|DOS. Not both of them... Of course these days, that's not quite acceptable,
|and I'm trying to figure out how to get this to work under BOTH operating
|systems, like the original QuickBasic source does...
|
|Is there anyone who knows what might be the problem?
|Here's the SUB that causes the problems...
|
|
|Original QB code (works fine under both DOS and Win95)
|---
|SUB SendPacket (CompleteCode%, InUseFlag%)
| InReg.BX = 3
| InReg.ES = VARSEG(ECBS)
| InReg.SI = VARPTR(ECBS)
| CALL InterruptX(&H7A, InReg, OutReg)
| CompleteCode = ASC(ECBS.CompCode)
| InUseFlag = ASC(ECBS.InUse)
|END SUB
|---
|
|
|PB Code. Works find under DOS, crashes under Win95
|---
|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
|---
|
|
|Alternative PB Code. Works fine under Win95, locks up under DOS.
|---
|SUB SendPacket (CompleteCode%, InUseFlag%)
| print "I'm starting"
| 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)
| print "I'm done"
|END SUB
|---
|
|The weird thing, is that this sub is completed completely: the text "I'm
|done" appears on the screen. However, the program locks up completely. The
|very next line after calling the SendPacket SUB is "BEEP", and some print
|statements. None of these happen... Trying to use WORDS instead of integers
|(plop??) has exactly the same result. Works under Win95, locks up under
|DOS.
|
|As you understand, this is getting quite frustrating...
|any ideas, anyone?
|
|--
|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)
|