* int word_read_write(int adrs,int mode)

	.include	defines.mac

	.xdef	_word_read_write
_word_read_write:
	move.l	4(sp),a0	* address
	move.l	8(sp),d1	* mode
	
	SUPERMODE		* SuperVisor mode
	move.l	d0,a1		* a1=SSP
	
	moveq.l	#0,d2		* for long wordŠg’£
	move.w	(a0),d2		* read port
	tst.l	d1		* mode>=0?
	bmi	wrw1		* no : read only
	move.w	d1,(a0)		* write port
wrw1:
	USERMODE		* to user mode
	move.l	d2,d0		* return with before port
	rts
	
	.end
