⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmdoss.cpm

📁 语法分析 编译原理 词法分析 语法分析 C++原代码
💻 CPM
字号:
/*	cmdoss.cpm	COMND module; OS-specific routines for CP/M-80

	Copyright (C) 1985 Mark E. Mallett

	Permission is hereby granted to distribute this file indiscriminately.

Edit history

When	Who	What
------	---	--------------------------------
84xxxx	MEM	Create file.


	Routines included are:

		CMDfob		Flush terminal output buffer.
		CMDgtc		Get character from terminal without echo
		CMDptc		Output character to terminal (buffered)
		CMDpzs		Put NUL-terminated string to terminal
*/


#include "stdio.h"			/* Standard system defs */
#include "mem.h"			/* Include my standard names */


/* External routines */


/* External data */


/* Internal (public) routines */



/* Internal (public) data */


/* Local (static) data */

BYTE		Coline[201] = {0};	/* Output line */
int		Colpos = {0};		/* Position in output line */

/*

*//* CMDgtc()

	Get terminal input character, no echo.

*/

CMDgtc()

{
IND	int		c;

while ((c = CPM(6,0xffff)&0xff) == 0)
    ;
return (c&0x7f);
}
/*
*//* CMDpzs (sptr)

	Output a zero-terminated string to the console.


Inputs

	sptr		Address of the zero-terminated string


Outputs

		The string (buffered) out to the terminal.


Notes

	CMDfob() can be called to flush the output.

*/

CMDpzs (sptr)

BYTE			*sptr;		/* Address of string to output */

{
while (*sptr != NUL)			/* Until end.. */
    CMDpoc (*sptr++);			/* Output. */
}
/*

*//* CMDptc(c)

	Output c to the terminal, buffered.

*/

CMDptc(c)

{
Coline[Colpos++] = c;			/* Store char */
if ((c == '\n') || (Colpos == 200))	/* If read to break */
    CMDfob();				/*  break */
}
/*

*//* CMDfob()

	Break console output.

*/

CMDfob()

{
if (Colpos)
    {
    write (fileno(stdout),Coline,Colpos);	/* Write the line */
    Colpos = 0;				/* Reset pointer */
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -