trumpet socket driver not responding with data

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
mikefromca
Coder
Posts: 41
Joined: Wed Oct 16, 2019 11:28 am

trumpet socket driver not responding with data

Post by mikefromca »

Right now I'm trying to reinvent the TCP/IP initialization routine (tcpinit()) from:
http://rubbermallet.org/software/webserv.html because I ran his software as a server and there have been lockups. He mentioned he would offer a new release on his site but never did.

what he did was use "call interruptx" but I'd rather use "call absolute" and only pass in the variables that are necessary as I need a fast program.

Anyway, here is my assembly code:

Code: Select all

PUSH BP
PUSH ES
PUSH DI
PUSH DS
PUSH SI
MOV BP, SP
mov AX,00FFh
int 61h ;our chosen interrupt for ntcpdrv
MOV BX,[BP+06h+08h]  ;get driver status
mov [BX],AX
MOV BX,[BP+08h+08h]  ;tcpip info is at ES:DI
mov [BX],DI
MOV BX,[BP+0Ah+08h] 
mov [BX],ES
POP SI
POP DS
POP DI
POP ES
POP BP
RETF 06h
after compiling, I get machine code which I use in the QBASIC code below:

Code: Select all

'get hex values of each byte of machine code and ram them together
w$ = "5506571e5689e5b8ff00cd618b5e0e89078b5e10893f8b5e128c075e1f5f075dca0600"
'process each byte and rebuild the code
cd$ = "": FOR n% = 1 TO LEN(w$) STEP 2: cd$ = cd$ + CHR$(VAL("&H" + MID$(w$, n%, 2))): NEXT
'make space for data
DIM d AS STRING * 200
CLS
r%=77
DEF SEG = VARSEG(cd$)
sg% = VARSEG(d)
of% = VARPTR(d)
PRINT sg%; ":"; of% 'print our segment and offset
'r% = 77 here.
CALL absolute(sg%, of%, r%, SADD(cd$))
DEF SEG
PRINT sg%; ":"; of%
PRINT r% 'but why is sg%,of% and r% unchanged?
SYSTEM
I think the core of my problem is the assembly code but I don't know where to start...
Post Reply