putchar.c
来自「keilc pic的版本 才搞到的 希望对大家有帮助」· C语言 代码 · 共 55 行
C
55 行
/***********************************************************************/
/* 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 + =
减小字号Ctrl + -
显示快捷键?