RS232


;routine for writing a single byte to the serial port without system calls.

s:
	moveq		#0,d0
	lea		data,a0
	moveq		#6,d2
	move.w		#%0000001000000000,d3


writeit:
	clr.b		d0		
	move.w		d3,d0
	move.b		(a0)+,d0
	move.b		d0,$dff030	
	clr.b		d1		
	move.b		$dff018,d1						;test buffer
	rol		#3,d1
	btst		#1,d1
	bne		wait

	cmp		#0,d2
	dbne		d2,writeit
	rts

	
wait:
	btst	#1,d1
	bne	wait
	beq	writeit



data:
	dc.b	'henrik'