
72
8-4. Simple Interface Program
* Language : Basic
10 OPEN "COM1:9600,N,8,1" As #1
20 IF LOC(1) = 0 THEN 60
30 A$ = INPUT$(1,1)
40 PRINT A$ ; " ";
50 GOTO 20
60 B$=INKEY$ : IF B$ ="" THEN 20
70 PRINT B$ ; " ";
80 PRINT #1,B$;
90 GOTO 20
* Language : C
#include <bios.h>
#include <conio.h>
#define COM1 0
#define DATA_READY 0x100
#define TRUE 1
#define FALSE 0
#define SETTINGS 0xE3
int main(void)
{
int in, out, status, DONE = FALSE;
bioscom(0, SETTINGS, COM1);
cprintf("... BIOSCOM [ESC] to exit ...\n");
while (!DONE)
{
status = bioscom(3, 0, COM1);
if (status & DATA_READY)
if ((out = bioscom(2, 0, COM1) & 0x7F) != 0)
putch(out);
if (kbhit())
{
if ((in = getch()) == '\x1B')
DONE = TRUE;
bioscom(1, in, COM1);
}
}
return 0;
}
Содержание NT-580A
Страница 1: ...2 ...
Страница 12: ...13 2 Measure of Appearance 2 1 Measure of Appearance ...
Страница 24: ...25 4 4 Sealing Method Sealing Method of front cal switch ...
Страница 53: ...54 External Control I O Circuit ...
Страница 58: ...59 Normal Batching Diagram Loss in Weight Batching Diagram ...
Страница 59: ...60 UserProgramControlMode NormalBatching ...
Страница 61: ...62 UserProgramControlMode Loss in WeightBatching ...
Страница 63: ...64 AutomaticProgramControlMode NormalBatching ...
Страница 65: ...66 AutomaticProgramControlMode Loss in Weight Batching ...
Страница 85: ...86 MEMO ...
Страница 86: ...87 ...
Страница 87: ...88 ...