home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Vectronix 2
/
VECTRONIX2.iso
/
FILES_03
/
C_JS_108.ZIP
/
COMS
/
IO_ST.S
< prev
Wrap
Text File
|
1995-08-19
|
1KB
|
36 lines
*---------------------------------------------------------------------
* Example code on how to send and recive a Byte (8 bits) on the ATARI
* ST side.
*---------------------------------------------------------------------
*---------------------------------------------------------------------
* Byte to be sent is in D0.W
*---------------------------------------------------------------------
send_byte
move.l #$fb0000,a0 * Base
lsl.w #1,d0 * Shift because cartport don't
* have a A0 adress line.
move.w d0,a1 * Move...
loop
move.w $fa0002,d0 * Status register.
btst #1,d0 * If '1' there is already a
* byte waiting in buffer not
* read by the Jaguar.
bne loop
move.w 0(a0,a1.w),d0 * Buffer clear. Send byte by
* reading! Trash in d0.
rts
*---------------------------------------------------------------------
*---------------------------------------------------------------------
*---------------------------------------------------------------------
get_byte
move.w $fa0002,d0 * Status register load.
btst #0,d0 * If '0' there are NO new byte
* to be read.
beq get_byte
move.w $fa0000,d0 * Buffer loaded! Move
* incoming byte to d0.
and.w #$ff,d0 * Mask off trash from d0.
rts