Unitech PT600 User manual

PT600 Portable Terminal
Programming Reference Guide
Document number: 3506000120

Table of Contents
Chapter 1 BIOS and System Functions
1.1 Interrupt Vector Assignments for I/Os......................................1
1.2 Display Font Functions (INT 09H)...........................................1
1.3 Kermit Server Function (INT 0FH)..........................................4
1.4 LCD Control Functions (INT 10H...........................................5
1.5 System Functions (INT 21H) ...................................................9
1.6 Power Management Function (INT 22H) .................................47
1.7 Beeper Control (INT 31H) ......................................................48
1.8 RS232 Control Functions (INT 33H).......................................48
Chapter 2 Multipoint Communication
2.1 Multipoint Communication Protocol..........................................53
2.2 Data Communication in Multipoint Protocol..............................55
2.3 File Communication in Multipoint Protocol................................55
2.4 Host Commands......................................................................56

Chapter 1 BIOS and System Functions
The PT600 operating system supports DOS/BIOS function calls that a programmer
can access when developing an application for the portable.
1.1 Interrupt Vector Assignment for I/Os
Vector BIOS Function
09 H Display Font
0F H Kermit Server
10 H LCD Control
21 H System Functions
22 H Power Manager
31 H Beeper Control
33 H RS232 Control
1.2 Display Font Functions ( INT 09H )
00 Select Large Font
Entry Parameter: AH = 0/1 ; select 8*16-dot character font (4
lines * 16
; columns display)
Return Value: None
Example:
void TL_font(int status)
{
regs.h.ah = (unsigned char)status;
int86(0x09,®s,®s);
}
01 Select Small Font
Entry Parameter: AH = 1 ; select 6*8-dot character font (8 lines * 20
columns display)
Return Value: None
Example:
void TL_font(int status)

{
regs.h.ah = (unsigned char)status;
int86(0x09,®s,®s);
}
02 Set Font Type
3Entry Parameter: AH= 2
4AL= 0/1 ; set to large/small font
5Return Value: None
Example:
void TL_font(int status)
{
regs.h.ah = (unsigned char)status;
regs.h.al= 2;
int86(0x09,®s,®s);
}
03 Get Font Type
Entry Parameter: AH= 3
Return Value: AL= 0/1 ; large/small font
Example
int TL_get_font_type()
{
regs.h.ah = 3;
int86(0x09,®s,®s);
return(regs.h.al);
}
04 Set User-Defined Font for All Characters
Entry Parameter: AH= 4
AL= 0/1 ; large/small font
DS:DX ; pointer to the buffer with font data
; ( for large font: buffer size = 16*256 =4096
bytes
; for small font: buffer size = 6*256 =1536
bytes )
Return Value: None
Example

void TL_change_all_ASCII_font(int type,unsigned char *str)
{
regs.h.ah=4;
regs.h.al=(unsigned char)type;
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
int86x(0x9,®s,®s,&segregs);
}
05 Get Font Data for All Characters
Entry Parameter: AH= 5
AL= 0/1 ; large/small font
DS:DX ; pointer to the buffer
; ( for large font: buffer size = 16*256 =4096
bytes
; for small font: buffer size = 6*256 =1536
bytes )
Return Value: Font data in the buffer
Example:
void TL_get_all_ASCII_font(int type,unsigned char *str)
{
regs.h.ah=5;
regs.h.al=(unsigned char)type;
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
int86x(0x9,®s,®s,&segregs);
}
06 Set User-Defined Font for One Character
Entry Parameter: AH= 6
AL= 0/1 ; large/small font
CL =0 -255 ; character
DS:DX ; pointer to the buffer with font data
; ( for large font: buffer size = 16 bytes
; for small font: buffer size = 6 bytes )
6Return Value: None
Example:
void TL_change_one_ASCII_font(int type,int ascii_code,unsigned char
*str)

{
regs.h.ah=6;
regs.h.al=(unsigned char)type;
regs.h.cl=(unsigned char)ascii_code;
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
int86x(0x9,®s,®s,&segregs);
}
07 Get Font Data for One Characters
Entry Parameter: AH= 7
AL= 0/1 ; large/small font
CL =0 -255 ; character
DS:DX ; pointer to the buffer
; ( for large font: buffer size = 16 bytes
; for small font: buffer size = 6 bytes )
Return Value: Font data in the buffer
Example:
void TL_get_one_ASCII_font(int type,int ascii_code,unsigned char *str)
{
regs.h.ah=7;
regs.h.al=(unsigned char)type;
regs.h.cl=(unsigned char)ascii_code;
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
int86x(0x9,®s,®s,&segregs);
}
1.3 Kermit Server Function ( INT 0FH )
Entry Parameter: None
Return Value: None
When INT 0FH is called in user application, PT600 will enter Kermit server.
Pressing [CMD] key then [Exit] key to leave it and return to user application.
Example :
void TC_kermit_mode()
{
int86(0x0F,®s,®s);

}

1.4 LCD Control Functions ( INT 10H )
00 Clear LCD Screen
Entry Parameter: AH = 0
Return Value: None
Example:
void TL_clrscr()
{
regs.h.ah= 0;
int86(0x10,®s,®s);
}
01 Enable/Disable Screen Scroll
Entry Parameter: AH = 1
AL = 0/1 ; disable/enable screen scroll
Return Value: None
Example:
void TL_scroll(int status)
{
regs.h.ah = 1;
regs.h.al = (unsigned char)status;
int86(0x10,®s,®s);
}
02 Set Cursor Position
Entry Parameter: AH = 2
DH = Row
DL = Column PT6006x8 8x16
Row 0~7 0~3
Column
0~15 0~12
Return Value: None
Example :
void TL_gotoxy(int x,int y)
{

regs.h.ah = 2;
regs.h.dh = (unsigned char)y;
regs.h.dl = (unsigned char)x;
int86(0x10,®s,®s);
}
03 Get Cursor Position
Entry Parameter: AH = 3;
Return Value: DH = Row
DL = Column
Example :
void TL_getxy(int *x,int *y)
{
regs.h.ah = 3;
int86(0x10,®s,®s);
*y = regs.h.dh;
*x = regs.h.dl;
}
04 Display 16x16 Bitmap
Entry Parameter: AH = 4
DH = Row
DL = Column
DS:BX ; pointer to bitmap ( 32-bytes pattern data )
Return Value: None
Note: This function is available only in large font.
Example :
void TL_display_16x16_location(int x,int y,unsigned char *str)
{
regs.h.ah=4;
regs.h.dh=(unsigned char)y;
regs.h.dl=(unsigned char)x;
segregs.ds = FP_SEG(str);
regs.x.bx = FP_OFF(str);
int86x(0x10,®s,®s,&segregs);
}

Sample C program to display 16x16 graphic pattern.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
content FF
FF
3E
1C
C9
E3
F7
FF
FF
FF
FF
FF
FF
FF
FF
FF
7
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
6
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
Bit 5
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
Count
4
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
3
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
2
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
1
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
0
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
7
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
6
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
Bit 5
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
Count
4
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
3
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
2
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
1
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
0
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
¦
Byte
count 17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
Content FF
FF
FF
FE
FC
F9
F3
E7
CF
CF
E7
F3
F9
F3
E7
CF
#include <stdio.h>
#include <stdlib.h>
#include <dos.h>
#include <conio.h>
unsigned char logo[32]={0xFF,0xFF,0x3E,0x1C,0xC9,0xE3,0xF7,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFE,0xFC,0xF9,0xF3,0xE7,
0xCF,0xCF,0xE7,0xF3,0xF9,0xF3,0xE7,0xCF};
void main()
{
void far *buff;
union REGS regs;
struct SREGS sregs;
regs.h.ah=0;
int86(0x10, ®s, ®s); /* clear screen */

regs.h.ah=0;
int86(0x9, ®s, ®s); /* set large font */
regs.h.ah=5;
regs.h.al=0;
int86(0x10, ®s, ®s); /* set cursor off */
buff=logo;
regs.h.ah=4;
regs.h.dh=1; /* Row */
regs.h.dl=2; /* Column */
regs.x.bx=FP_OFF(buff);
sregs.ds=FP_SEG(buff);
int86x(0x10, ®s, ®s, &sregs);
getch();
}
05 Set Cursor On/Off
Entry Parameter: AH = 5
AL = 0/1 ; set cursor OFF/ON
Return Value: None
Example :
void TL_cursor_type(int status)
{
regs.h.ah = 5;
regs.h.al = (unsigned char)status;
int86(0x10,®s,®s);
}
06 Enable/Disable Power-on Logo Display
Entry Parameter: AH = 6
AL = 0/1 ; disable/enable
Return Value: None
Example
void TL_cursor_type(int status)
{
regs.h.ah = 5;
regs.h.al = (unsigned char)status;
int86(0x10,®s,®s);
}

0A Display Character
Entry Parameter: AH = 0AH
AL = 0 -255 ; character to display
Return Value: None
Example
regs.h.ah = 0x0A;
regs.h.al = cc;
int86(0x10,®s,®s);
4F Display 16*16 Bitmap at Current Cursor Position
Entry Parameter: AH = 4FH
DS:BX ; pointer to bitmap (32-bytes pattern data)
Return Value: None
Note: This function is available only in large font.
Example :
void TL_display_16x16(unsigned char *str)
{
regs.h.ah=0x4F;
segregs.ds = FP_SEG(str);
regs.x.bx = FP_OFF(str);
int86x(0x10,®s,®s,&segregs);
}
1.5 System Functions ( INT 21H )
00 Terminate Program
Entry Parameter: AH = 0
Return Value: None
Example:
void TS_exit_program()
{
regs.h.ah= 0;
int86(0x21,®s,®s);
}
01 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);
}
02 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;
}
03 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);
}
04 Write RS232
Entry Parameter: AH = 4
DL = 0 –255 ; ASCII character

Return Value: None
Note: Only for NONE communication protocol
Example:
void TS_stdaux_out(unsigned char ch)
{
regs.h.ah= 4;
regs.h.dl= ch;
int86(0x21,®s,®s);
return;
}

06 Direct Console I/O
Entry Parameter: AH = 6
DL = 0 –254 ; write ASCII character in DL to LCD
255 ; read ASCII character from keypad
Return Value: 1) When read (DL <> 255):
Character in AL if ZERO flag is cleared
No input if ZERO flag is set
2) When write (DL= 255):
None
Example:
unsigned char TS_stdin_out(unsigned char ch)
{
regs.h.ah= 6;
regs.h.dl= ch;
int86(0x21,®s,®s);
if (ch == 0xFF)
{
if ((regs.x.cflag & 0x40) == 0) return(regs.h.al);
else return(0);
}
return(0);
}
07 Read Keypad (wait if no key)
Entry Parameter: AH = 7
Return Value: AL = 0 –255 ; ASCII character
Example:
unsigned char TS_stdin_noecho()
{
regs.h.ah= 7;
int86(0x21,®s,®s);
return(regs.h.al);
}
08 Read Keypad (wait if no key)
Entry Parameter: AH = 8
Return Value: AL = 0 –255 ; ASCII character


09 Write Character String to LCD
Entry Parameter: AH = 9
DS:DX ; pointer to string buffer
Return Value: None
Example:
void TS_stdout_string(unsigned char *str)
{
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
regs.h.ah= 9;
int86x(0x21,®s,®s,&segregs);
return;
}
0A Buffered Keypad Input
Entry parameter: AH = 0AH
DS:DX ; pointer to data buffer
Return value: DS:DX ; pointer to data buffer
Data format in buffer:
Input buffer with CR at last
number of characters actual input
number of characters requested to be input
nm
Example:
void TS_stdin_string(unsigned char *str)
{
segregs.ds = FP_SEG(str);
regs.x.dx = FP_OFF(str);
regs.h.ah= 0x0a;
int86x(0x21,®s,®s,&segregs);
return;
}
0B Check Keypad Status
Entry Parameter: AH = 0BH
Returned Value: AL = 0 ; no keys were pressed
0FFH ; key was pressed and input character
is Ready
Example:
unsigned char TS_kbhit()
{

regs.h.ah= 0x0b;
int86(0x21,®s,®s);
return(regs.h.al);
}
1A LCD Backlight ON/OFF Control
Entry Parameter: AH = 1AH
BH = 0
AL = 0/1 ; set LCD backlight OFF/ON
Return Value: None
Example:
void TL_backlight(int status)
{
regs.h.ah= 0x1A;
regs.h.bh= 0;
regs.h.al= (unsigned char)status;
int86(0x21,®s,®s);
}
1A Buzzer ON/OFF Control
Entry Parameter: AH = 1AH
BH = 1
AL = 0/1 ; set Buzzer OFF/ON
Return Value: None
Example:
void TD_buzzer(int status)
{
regs.h.ah= 0x1A;
regs.h.bh= 1;
regs.h.al= (unsigned char)status;
int86(0x21,®s,®s);
}
1ABeeper Volume
Entry parameter: AH = 1AH
BH = 3
AL = 0/1/2 ; set LOW/MEDIUM/HIGH beeper
volume
Return Value: None
=2 high

Example:
void TD_beeper_vol(int status)
{
regs.h.ah= 0x1A;
regs.h.bh= 3;
regs.h.al= (unsigned char)status;
int86(0x21,®s,®s);
}
1A Enable/Disable RS232 Port
Entry Parameter: AH = 1AH
BH = 4
AL = 0/1 ; disable/enable
Return Value: None
Example:
void TD_serial(int status)
{
regs.h.ah= 0x1A;
regs.h.bh= 4;
regs.h.al= (unsigned char)status;
int86(0x21,®s,®s);
}
1A Enable/Disable Key or Key Function
Entry Parameter: AH = 1AH
BH = 5
AL = 0 ; All keys
1; Supervisor mode
2; Cold start
3; Warm start
4; User mode (press [CMD] for 2 seconds)
5; ALPHA key
BL = 0; Disable key or key function
1; Enable key or key function
Return Value: None
Example:
void TD_keylock(int type,int status)
{
regs.h.ah= 0x1A;

regs.h.bh= 5;
regs.h.al= (unsigned char)type;
regs.h.bl= (unsigned char)status;
int86(0x21,®s,®s);
}
Other manuals for PT600
1
Table of contents
Other Unitech Handheld manuals

Unitech
Unitech HT580 Product information sheet

Unitech
Unitech PA968 User manual

Unitech
Unitech PA726 User manual

Unitech
Unitech BD100 User manual

Unitech
Unitech PA600 User manual

Unitech
Unitech HT660e User manual

Unitech
Unitech PA720+ User manual

Unitech
Unitech PA500 User manual

Unitech
Unitech PA550 User manual

Unitech
Unitech PA692 User manual

Unitech
Unitech PA982 User manual

Unitech
Unitech HT630 Instruction manual

Unitech
Unitech HT630 User manual

Unitech
Unitech HT730 User manual

Unitech
Unitech HT660e User manual

Unitech
Unitech HT510 User manual

Unitech
Unitech PA690 User manual

Unitech
Unitech HT580 User manual

Unitech
Unitech PA982 User manual

Unitech
Unitech 400892G Preliminary User manual