📄 putchar.c
字号:
/***********************************************************************/
/* This file is part of the C166 Compiler package */
/* Copyright KEIL ELEKTRONIK GmbH 1992-1997 */
/***********************************************************************/
/* */
/* PUTCHAR.C: This routine is the general character output of C166. */
/* */
/* To translate this file use C166 with the following invocation: */
/* */
/* C166 PUTCHAR.C */
/* */
/* To link the modified PUTCHAR.OBJ file to your application use the */
/* following L166 invocation: */
/* */
/* L166 <your object file list>, PUTCHAR.OBJ <controls> */
/* */
/***********************************************************************/
#include <reg166.h>
#define XON 0x11
#define XOFF 0x13
char putchar (signed char c) {
if (c == '\n') {
if (S0RIR) {
if (S0RBUF == XOFF) {
do {
S0RIR = 0;
while (!S0RIR) { ; }
}
while (S0RBUF != XON);
S0RIR = 0;
}
}
while (!S0TIR) { ; }
S0TIR = 0;
S0TBUF = 0x0d; /* output CR */
}
if (S0RIR) {
if (S0RBUF == XOFF) {
do {
S0RIR = 0;
while (!S0RIR) { ; }
}
while (S0RBUF != XON);
S0RIR = 0;
}
}
while (!S0TIR) { ; }
S0TIR = 0;
return (S0TBUF = c);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -