Announcement

Collapse
No announcement yet.

POWER BASIC AND PACKET DRIVER

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • POWER BASIC AND PACKET DRIVER

    'ACCESS_TYPE
    'AH=02H
    'ES I RECEIVE HANDLE ( SUB RECETCP() )
    'PROBLEM .....HELP ME..... THANKS YOU ...


    SHARED BUFFSEG%,BUFFPTR%,BUFF$
    SHARED BUFFREADY


    BUFF$=STRING$(1600,CHR$(0))
    BUFFSEG%=STRSEG(BUFF$)
    BUFFPTR%=STRPTR(BUFF$)
    BUFFERADY=0

    CLS
    CALL TCP_START()
    END

    SUB TCP_START()
    DIM HAND AS INTEGER

    'PKT_INFO
    REG 1,&H01FF
    REG 2,&H00
    CALL INTERRUPT(&H60)

    DEF SEG=REG(8)
    J=REG(5)
    A$=PEEK$(J,10)
    PRINT "INFO:";A$


    'ACCESS_TYPE

    TCPTYPE$=CHR$(&H08)+CHR$(&H00)
    TCPTYPESEG%=STRSEG(TCPTYPE$)
    TCPTYPEPTR%=STRPTR(TCPTYPE$)
    RECESEG%=CODESEG(RECETCP)
    RECEPTR%=CODEPTR(RECETCP)

    REG 1,&H0201 'AX
    REG 2,&HFFFF 'BX
    REG 3,&H0002 'CX
    REG 4,&H0000 'DX
    REG 5,TCPTYPEPTR% '0x0800 offset
    REG 6,RECEPTR% 'RECEIVE SUB OFFSET
    REG 8,TCPTYPESEG% '0x0800 segment
    REG 9,RECESEG% 'RECEIVE SUB SEGMENT
    CALL INTERRUPT(&H60)

    HAND=REG(1)

    'GET_ADDRESS
    CARDADDRESS$=SPACE$(6)
    CARDSEG%=STRSEG(CARDADDRESS$)
    CARDPTR%=STRPTR(CARDADDRESS$)

    REG 1,&H0600
    REG 2,HAND
    REG 3,6
    REG 9,CARDSEG%
    REG 6,CARDPTR%
    CALL INTERRUPT(&H60)
    PRINT "ETHERNET CARD ADDRESS : ";
    FOR I=1 TO 6
    PRINT HEX$(ASC(MID$(CARDADDRESS$,I,1)));
    IF I<6 THEN PRINT ":";
    NEXT I
    PRINT


    'SET_RCV_MODE
    REG 1,&H1400
    REG 2,HAND
    REG 3,&H6
    CALL INTERRUPT(&H60)


    LOCATE 3,1:PRINT "NET MONITOR"
    DO
    K$=INKEY$
    LOCATE 5,1:PRINT TIME$;
    IF BUFFREADY = 1 THEN
    LOCATE 6,1:PRINT "RECEIVE TCP DATA",TIME$
    END IF
    LOOP UNTIL K$=CHR$(27)

    'RELEASE HAND
    REG 1,&H0300
    REG 2,HAND
    CALL INTERRUPT(&H60)


    END SUB

    FUNCTION RECETCP()
    IF REG(1)=0 THEN
    BUFFREADY=0
    REG 9,BUFFSEG%
    REG 6,BUFFPTR%
    ELSE
    BUFFREADY=1
    END IF

    END FUNCTION

    ------------------


    [This message has been edited by hsu2 liu (edited May 23, 2001).]

  • #2
    Can you explain your problem more clearly please? Thanks!

    ------------------
    Lance
    PowerBASIC Support
    mailto:[email protected][email protected]</A>
    Lance
    mailto:[email protected]

    Comment

    Working...
    X