home *** CD-ROM | disk | FTP | other *** search
- You can use both assembler and basic to
- control the parallellport, but since it
- mostly is no need of a high speed, do I
- think is most comfortable to use basic,
- but you maybe like the challenge of
- asseblerprogramming. It is up to you.
- Anyway, in this article will I stay on
- basic. Now let us walk through some
- little subroutines in basic:
- INIT:
- POKE 12571136&,199
- POKE 12570624&,255
- POKE 12575489&,0
- RETURN
- The first POKE sets the addressbits
- BUSY, POUT and SEL to be outputbits.The
- second POKE selects address $7, which
- lits the READY-LED. The Third POKE sets
- the parallellport for input. After you
- have called this routine once after a
- power-on can you start the real work.
- Let's go on with reading from parallell
- port into the Amiga.
- READ:
- POKE 12575489&,0
- POKE 12570624&,248+Address
- InData=PEEK(12574977&)
- POKE 12570624&,255
- RETURN
-
- The first POKE set the parallellport to
- input, with setting all the bits in the
- data direction register, located at
- address 12575489 to zero.If you instead
- set the bits to high, is the parallell
- port set for output.The databits on the
- parallellport can also be set for
- different directions, since the bits in
- the datadirection register is controls
- one bit each on the parallellport,
- indepentely of each other,but this will
- NOT be used in this project. It is for
- example used to get a fast twodirection
- datatalk, with a nibble in each
- direction. The second POKE in the Read-
- routine is used to select the address
- of the IC you want to read from, i.e.
- write to the adressbits. The variable
- "Address" is an integer value between 0
- and 7. The PEEK command reads the data
- from the parallellport,which is located
- on address 12574977 in your Amiga. The
- last POKE is used to lit the READY-LED
- when the reading is done, by selecting
- address $7 (248+7=255). Now let's go on
- with see how to write to the parallell-
- port: WRITE:
- POKE 12570624&,248+Address
- POKE 12575489&,255
- POKE 12574977&,OutData
- POKE 12570624&,255
- RETURN
-