#define IRQ4_int 0xC
/* IRQ4 interrupt vector number */
#define IRQ4_enab 0xEF /* IRQ4 interrupt controller enable mask */
#define INT_controller 0x20 /* 8259 Interrupt controller address */
#define End_of_interrupt 0x20
/* Non-specific end of interrupt command */
void interrupt int_char_in(void);
void send_ctlc(void);
#define INT_BUF_size 9000
char int_buf[INT_BUF_size], *int_buf_in = int_buf, *int_buf_out = int_buf;
unsigned int int_buf_count = 0;
unsigned char int_buf_ovfl = 0;
int main(int argc, char *argv[])
{
void interrupt (*oldvect)();
char command[80], c;
int i;
oldvect = getvect(IRQ4_int);
/* Save old interrupt vector */
setvect(IRQ4_int,int_char_in); /* Set up new interrupt handler */
bioscom(0,BAUD9600 | EVEN_7,0); /* Initialize settings for COM1 */
outportb(MCR,0x9);
/* Enable IRQ buffer, DTR = 1 */
outportb(IER,0x1);
/* Enable UART data receive interrupt */
/* Enable IRQ4 in 8259 interrupt controller register */
outportb(INT_con1,inportb(INT_con1) & IRQ4_enab);
do {
if(int_buf_ovfl) {
printf("\nBuffer Overflow!!!\n\n");
int_buf_in = int_buf_out = int_buf;
int_buf_count = int_buf_ovfl = 0;
}
RS-232 Operation Using Turbo C
(continued)
Continued on next page
Chapter 6 Application Programs
RS-232 Operation Using Turbo C
194
Summary of Contents for 34401A
Page 12: ...1 Quick Start 1 ...
Page 26: ...2 Front Panel Menu Operation 2 ...
Page 50: ...3 Features and Functions 3 ...
Page 103: ...4 Remote Interface Reference 4 ...
Page 135: ...SCPI Status System 4 Chapter 4 Remote Interface Reference The SCPI Status Model 135 ...
Page 170: ...5 Error Messages 5 ...
Page 182: ...6 Application Programs 6 ...
Page 196: ...7 Measurement Tutorial 7 ...
Page 214: ...8 Specifications 8 ...