Outputting data to ports

This is a discussion on Outputting data to ports within the C++ Programming forums, part of the General Programming Boards category; I am trying to ouput data to the parrallel portbut am having some trouble. I am using Vc++.Net I said ...

  1. #1
    Registered User
    Join Date
    Nov 2002
    Posts
    19

    Outputting data to ports

    I am trying to ouput data to the parrallel portbut am having some trouble.

    I am using Vc++.Net

    I said

    void outportb(UINT portid,BYTE value)
    {
    __asm mov edx,portid
    __asm mov al,value
    __asm out dx,al
    }

    But I am getting many errors from this. Wut is wrong? Any ideas?
    I included iostream,stdlib,stdio. Anybetters ways of doing it? Thanks!
    May GOD Bless, Strengthen, Guide, and Protect you Always!

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    > But I am getting many errors from this.
    The errors most likely come from your use of UINT and BYTE with no prior declarations. Change the function tag to

    void outportb(unsigned portid, char value)

    And it will compile...

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  2. Errors
    By Rhidian in forum C Programming
    Replies: 10
    Last Post: 04-04-2005, 12:22 PM
  3. Binary Tree, couple questions
    By scoobasean in forum C Programming
    Replies: 3
    Last Post: 03-12-2005, 08:09 PM
  4. All u wanted to know about data types&more
    By SAMSAM in forum Windows Programming
    Replies: 6
    Last Post: 03-11-2003, 02:22 PM
  5. Replies: 1
    Last Post: 07-31-2002, 11:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21