summaryrefslogtreecommitdiffstats
path: root/libgloss/m68hc11/sci-inout.S
diff options
context:
space:
mode:
Diffstat (limited to 'libgloss/m68hc11/sci-inout.S')
-rw-r--r--libgloss/m68hc11/sci-inout.S29
1 files changed, 24 insertions, 5 deletions
diff --git a/libgloss/m68hc11/sci-inout.S b/libgloss/m68hc11/sci-inout.S
index 070fd7da2..a8675d270 100644
--- a/libgloss/m68hc11/sci-inout.S
+++ b/libgloss/m68hc11/sci-inout.S
@@ -1,5 +1,5 @@
/* M68HC11/M68HC12 serial line operations
- * Copyright (C) 1999, 2001 Stephane Carrez (stcarrez@nerim.fr)
+ * Copyright (C) 1999, 2001, 2003, 2004 Stephane Carrez (stcarrez@nerim.fr)
*
* The authors hereby grant permission to use, copy, modify, distribute,
* and license this software and its documentation for any purpose, provided
@@ -12,6 +12,25 @@
* they apply.
*/
+#ifdef __HAVE_SHORT_INT__
+ .mode mshort
+#else
+ .mode mlong
+#endif
+
+#if defined(__USE_RTC__)
+ .macro ret
+#if defined(mc68hc12)
+ rtc
+#else
+ jmp __return_32
+#endif
+ .endm
+#else
+ .macro ret
+ rts
+ .endm
+#endif
#ifdef mc68hc12
SC0CR1 = 0xC2
SC0CR2 = 0xC3
@@ -39,7 +58,7 @@ L1:
ldab SC0CR2,x
orab #0x8
stab SC0CR2,x
- rts
+ ret
.sect .text
.globl inbyte
@@ -52,7 +71,7 @@ inbyte:
bita #0x20
beq inbyte
ldab SC0CR2,x
- rts
+ ret
.globl _sci_init
.sect .text
@@ -99,7 +118,7 @@ L1:
ldab SCCR2,x
orab #0x8
stab SCCR2,x
- rts
+ ret
.sect .text
.globl inbyte
@@ -112,7 +131,7 @@ inbyte:
bita #0x20
beq inbyte
ldab SCDR,x
- rts
+ ret
.globl _sci_init
.sect .text