A89: Using the link port


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

A89: Using the link port




Hello All,
I am attempting to write a program which will send bytes out the port to a
PIC.

This is part of a simple test program I made, which works (complies and
runs) but I am unable to test at the moment. I was wondering if it was
right. I mainly want to confirm to general procedure for sending stuff out
the port like if and when you need to reset the port etc.
I assume flush_link sends the stuff out the port whereas transmit just
chucks it in the buffer waiting to be sent.

Here's the code:

   jsr tios::reset_link        ;reset the link interface
   move.w   #13,-(a7)          ;Want to send 13 bytes.
   lea      linkdata(PC),a0    ;Pointer to data
   move.w   a0,-(a7)           ;pointer to data
   jsr tios::transmit          ;add data to transmit buffer
   add.l   #4,a7               ;fix stack pointer, pushed 2 bytes.
   jsr tios::flush_link        ;send it!
   jsr tios::reset_link
   jsr flib::idle_loop         ;wait for keypress
   rts

linkdata:
   dc.b  $89,$06,$07,$00,$0C,$00,$00,$00,$00,$01,$61,$6E,$00

Thanks, Wesley