	.module putchar_dp256.c
	.area text
;              c -> 3,x
_putchar::
	pshd
	pshx
	tfr s,x
; #include <stdio.h>
; #define _SCI
; #include <hcs12dp256.h>
; extern int _textmode;
; int putchar(char c)
; {
;      if (_textmode && c == '\n')
	ldd __textmode
	beq L7
	ldab 3,x
	cmpb #10
	bne L7
;      	putchar('\r');
	ldd #13
	jsr _putchar
L6:
L7:
;      while ((SC0SR1 & TDRE) == 0)
	brclr 0xcc,#128,L6
; 	 ;
;      SC0DRL = c;
	movb 3,x,0xcf
;      return c;
	ldab 3,x
	clra
L3:
	tfr x,s
	pulx
	leas 2,sp
	.dbline 0 ; func end
	rts
