PT630 Programming Reference Guide
Page 15 of 59
------------------------------------------------------------------------------------------------------------------
1.5
System Functions ( INT 21H )
1.5.1 Terminate
Program
Entry Parameter: AH = 0
Return Value: None
Example:
void
TS_exit_program()
{
regs.h.ah=
0;
int86(0x21,®s,®s);
}
1.5.2 Read Keypad (wait if no key) and Write to LCD
Entry Parameter: AH = 1
Return Value: AL = 0 – 255
; ASCII character
Example:
unsigned char TS_stdin()
{
regs.h.ah= 1;
int86(0x21,®s,®s);
return(regs.h.al);
}
1.5.3 Write
LCD
Entry Parameter: AH = 2
DL = 0 – 255
; ASCII character
Return Value: None
Example:
void TS_stdout(unsigned char ch)
{
regs.h.ah= 2;
regs.h.dl= ch;
int86(0x21,®s,®s);
return;
}
1.5.4 Read RS232 (wait if no character)
Entry Parameter: AH = 3
Return Value:
AL = 0 – 255
; ASCII character
Note:
Only for NONE communication protocol
Example:
unsigned char TS_stdaux_in()
{
regs.h.ah= 3;
int86(0x21,®s,®s);
return(regs.h.al);
}