Announcement

Collapse
No announcement yet.

I Want.....

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

  • I Want.....

    I Want Document Power Basic DLL 6.00
    And I am Not Run
    Out PortNumber, Value
    INP PortNumber

    Or ASM OUT &h..
    ASM IN &h..

    Plese Help ME....


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

  • #2
    I believe we have a com problem. Could you please restate
    your concern a little more clearly?????

    Cheers,
    Cecil

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

    Comment


    • #3
      You can't use IN and OUT instructions in 32 bit Windows. But they might work in Windows95/98/ME.

      If you really really really really must, you can use:

      ASM db &H0EE 'out dx, al
      ASM db &H0EC 'in al, dx

      No guarantees though! Use at your own risk!

      There is a DLL out there for this too, which I'm sure I have on my harddisk but it's hiding from me now...

      Peter.


      ------------------
      [email protected]
      [email protected]

      Comment


      • #4
        See the FAQ forum for inline-assembler code for port I/O under Win9x (not NT/2000).

        See www.lvr.com for hardware access DLL's and Kernel-mode drivers for PowerBASIC.

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

        Comment


        • #5
          MEHMET ALI,

          TRY THIS,


          '=============================================================================
          ' portest3.bas - It Works!
          '-----------------------------------------------------------------------------
          #COMPILE EXE
          #INCLUDE "win32api.inc"
          '-----------------------------------------------------------------------------
          %IDsend = 1
          %IDExit = 2
          %IDreceive = 3
          %IDenvia = 4
          GLOBAL Value AS INTEGER
          GLOBAL valorrecebido AS INTEGER
          GLOBAL PortAddress AS INTEGER
          GLOBAL F AS INTEGER
          '-----------------------------------------------------------------------------
          CALLBACK FUNCTION sendport()
          CALL out32 (BYVAL PortAddress, BYVAL Value)
          CONTROL SET TEXT CBHNDL,%IDenvia, STR$(value)
          CALL in32 (BYVAL PortAddress)
          CONTROL SET TEXT CBHNDL,%IDreceive, STR$(F)
          Value = Value + 1
          IF Value => 255 THEN Value = 0
          END FUNCTION
          '-----------------------------------------------------------------------------
          CALLBACK FUNCTION Fim()
          DIALOG END CBHNDL, 0
          END FUNCTION
          '-----------------------------------------------------------------------------

          FUNCTION PBMAIN() AS LONG
          LOCAL hDlg AS LONG
          PortAddress = &H378 '(Usual PARALEL-port address IS &h378)
          Value = 1 'Valor inicial a ser enviado para o Port
          DIALOG NEW 0, "IN-OUT test to PORT 3F8H", ,, 200, _
          100, 0, 0 TO hDlg
          CONTROL ADD LABEL,hDlg,-1,"Read value ",10,10,80,8
          CONTROL ADD LABEL,hDlg,-1,"Sent value ",10,30,80,8
          CONTROL ADD TEXTBOX,hDlg,%IDreceive,"",90,10,60,12
          CONTROL ADD TEXTBOX,hDlg,%IDenvia,"",90,30,60,12
          CONTROL ADD BUTTON, hDlg, %IDsend, "Send", 50, 75, 40, 14, _
          %BS_DEFAULT CALL sendport
          CONTROL ADD BUTTON, hDlg, %IDEXIT, "End", 110, 75, 40, 14,0 CALL Fim
          DIALOG SHOW MODAL hDlg
          END FUNCTION
          '-----------------------------------------------------------------------------

          REM DECLARE SUB Out32(BYVAL PortAddress AS INTEGER,BYVAL ByteValue AS BYTE)
          SUB Out32(BYVAL PortAddress AS INTEGER,BYVAL ByteValue AS BYTE)
          ' ! push dx
          ! mov dx,PortAddress
          ! mov al,Value
          ! out dx,al
          ' ! pop dx
          END SUB

          '-----------------------------------------------------------------------------

          REM DECLARE FUNCTION In32(BYVAL PortAddress AS INTEGER) AS BYTE
          FUNCTION In32(BYVAL PortAddress AS INTEGER) AS BYTE
          LOCAL Valorrecebido AS BYTE
          ' ! push dx
          ! mov dx,PortAddress
          ! in al,dx
          ! mov Valorrecebido,al
          ' ! pop dx
          F = Valorrecebido
          END FUNCTION
          '----------------------------------------------------------------------------

          SALAM,

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



          Arthur Kohl

          Comment


          • #6
            It says it works, but it won't under Win NT/2000!


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

            Comment


            • #7
              Mehmet,
              In revisig my posting above, I noticed that a line of code
              was devided improperly.
              Please correct the line as follows:
              DIALOG NEW 0, "IN-OUT test to PORT 3F8H", ,, 200, 100, 0, 0 TO hDlg

              Good Luck!
              Arthur


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



              Arthur Kohl

              Comment


              • #8
                Lance,
                I tryed it on W98 and it worked ok.
                I don't have NT or W2000.
                Do you have a solution for them?

                Arthur

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



                Arthur Kohl

                Comment


                • #9
                  www.sstnet.com has a really nice freeware package (DLPORTIO)
                  that works with NT. I haven't tried it with win2000, but will oon.
                  You will need to get Depends.exe (Dependency Walker) to get change
                  the alias' in the include file. The DLL has those "C mangled"
                  names, so if you don't change them, nothing works.
                  I can't remember where I got Dependency Walker. It is free on
                  the web, maybe even on the PB site.

                  I've gotten the byte i/o routines to work just fine. They have
                  some buffer version, but not luck. Since it's a freebie they
                  would really like it if you don't bother them with tech support.

                  Russ Srole

                  ------------------
                  "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                  Comment


                  • #10
                    Yes... install a kernel-mode driver (similar to a Win9x VxD) and do your I/O through that. See www.lvr.com for more info.

                    Originally posted by ARTHUR KOHL:
                    Lance,
                    I tryed it on W98 and it worked ok.
                    I don't have NT or W2000.
                    Do you have a solution for them?

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

                    Comment


                    • #11
                      SELAM
                      THANK YOU THE SAMPLES IS RUNING

                      AND I AM SORY MY ENGLISH LANGUAGE NOT VERY....
                      THANK YOU
                      THANK YOU ALL FRIENDS


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

                      Comment


                      • #12
                        Why Run Under Win2000 Profesional ???

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

                        Comment


                        • #13
                          Be prepared! Someday soon MicroSoft won't be selling a version of
                          windows that allows the direct port access.

                          ------------------
                          "There are two novels that can change a bookish fourteen-year old's life: The Lord of the Rings and Atlas Shrugged. One is a childish fantasy that often engenders a lifelong obsession with its unbelievable heroes, leading to an emotionally stunted, socially crippled adulthood, unable to deal with the real world. The other, of course, involves orcs." - John Rogers

                          Comment

                          Working...
                          X