Welcome, Guest. Please login or register.

Author Topic: port in/out like under x86 question.  (Read 956 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kas1eTopic starter

port in/out like under x86 question.
« on: March 30, 2005, 03:56:42 PM »
Hi 2 all. So, for example i want to work with LPT directly, and set DATA 0,1,2,etc pins to 1 or 0 directly from code. for x86 under dos/linux i can to use in/out mnemonics (at&t syntax):
Code: [Select]

  movw $0x37a,%dx   // 37a = lpt1
  inb (%dx),%al     // read control bytes

  orb $1,%al       // set some state
  outw %ax,(%dx)   // put to port directly

Well, how i can do it this under aos, from C/ASM ?

thanks


 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2280
  • Country: us
  • Gender: Male
    • Show only replies by SamuraiCrow
Re: port in/out like under x86 question.
« Reply #1 on: March 31, 2005, 12:48:08 AM »
Look up the documentation to PAR: device or bang the Paula chip.  You won't see special In/Out assembler opcodes on any other processor than the Intel due to patent issues.
 

Offline Doobrey

  • Hero Member
  • *****
  • Join Date: Oct 2002
  • Posts: 1876
    • Show only replies by Doobrey
    • http://www.doobreynet.co.uk
Re: port in/out like under x86 question.
« Reply #2 on: March 31, 2005, 02:16:28 AM »
I thought it was one of the CIAs not Paula..

Anyway, it`s all in the 3.1 Dev CD. One write to set the pins IO direction, another to set all the pins states...can`t rememeber the 2 addresses off the top of my head..

Personally, I`d use the parallel.device, that way it`ll be usable to other people with 3rd party cards like the HyperComs etc.
On schedule, and suing
 

Offline MskoDestny

  • Sr. Member
  • ****
  • Join Date: Oct 2004
  • Posts: 363
    • Show only replies by MskoDestny
    • http://www.retrodev.com
Re: port in/out like under x86 question.
« Reply #3 on: April 01, 2005, 11:12:25 PM »
Quote

SamuraiCrow wrote:
Look up the documentation to PAR: device or bang the Paula chip.  You won't see special In/Out assembler opcodes on any other processor than the Intel due to patent issues.

The Z80 (and I believe a number of old 8-bit processors) had I/O ports.  I/O ports are really a relic from the days of old when you needed the entire memory range for actual memory so the devices had their own memory space of sorts.  With more modern processors that supported more RAM the idea of having a second memory space for devices became an unnecessary complication.
 

Offline srg86

  • Full Member
  • ***
  • Join Date: Aug 2004
  • Posts: 211
    • Show only replies by srg86
    • http://www.aopp12.dsl.pipex.com
Re: port in/out like under x86 question.
« Reply #4 on: April 13, 2005, 06:28:35 PM »
The AVR line of 8-bit microcontrollers has it's built in peripheral's registers in a block which can then be access by memory IO. Interesteingly they also have IO instructions and an IO address space so you and use both (in fact io instructions are faster because the architechture is optimised for them).

It's like the IO address space is also mapped into a portion of the memory address space, odd.

srg