Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: kas1e on March 30, 2005, 03:56:42 PM

Title: port in/out like under x86 question.
Post by: kas1e 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


Title: Re: port in/out like under x86 question.
Post by: SamuraiCrow 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.
Title: Re: port in/out like under x86 question.
Post by: Doobrey 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.
Title: Re: port in/out like under x86 question.
Post by: MskoDestny 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.
Title: Re: port in/out like under x86 question.
Post by: srg86 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