Re: A85: port instructions


[Prev][Next][Index][Thread]

Re: A85: port instructions




At 04:21 1998-05-21 +0000, you wrote:
>
>Hey Jimmy Mardell---
>
>I was looking over your new Usgard progaming lessons, and I was slightly
>disapointed on how briefly you mentioned some advanced port commands...
>
><<Some other instructions connected to ports are OUTI, OUTD, OTIR, OTDR,
>INI, IND, INIR and INDR. All of them work as the other string instructions,
>ie they can send or receive many bytes at once. When programming the TI-85
>though, they seem very useless since ports aren't used often.>>
>
>So for myself and everyone else seeking advanced serial applications with
>their linkport, could you please elaborate on these instructions?

Those instructions are quite simple really - they work exactly like
ldir/lddr, except that instead of copying a stream of bytes, you
send (receive) a stream of bytes from a port:

OUTI:   out (C),(HL) \ B=B-1 \ HL=HL+1
OUTD:   out (C),(HL) \ B=B-1 \ HL=HL-1
OTIR:   repeat OUTI until B=0
OTDR:   repeat OUTD until B=0

INI:    in (HL),(C) \ B=B-1 \ HL=HL+1
IND:    in (HL),(C) \ B=B-1 \ HL=HL-1
INIR:   repeat INI until B=0
INDR:   repeat IND until B=0

(C = the register C of course)

The reason those instructions aren't very useful on the 85 (86) is
that there is no port made for sending streams of byte. I mean, if
you send a value to the link port, you _MUST_ wait for the other calc
to confirm the transmission. Unless you've made some hardware
hack or something, the transmission would fail otherwise.

On the 82/83, those instructions can be used with the video driver
port.

--
Real name: Jimmy Mårdell                "can't go mucking with a 'void *'"
IRC......: Yarin                                // Apple's MPW C compiler
Email....: mailto:yarin@acc.umu.se        
Homepage.: http://www.acc.umu.se/~yarin/   <-- NEW HOMEPAGE!!


References: