|
|
| Everything HP200LX: Knowledge, Products, Service |
|
PROGRAMMING TIP - RECOGNIZE THE 95LXSometimes a program needs to identify that it is running on the 95LX and not a desktop PC. This is so it can adjust to the unique environment of the 95LX. There are programming routines to determine this. Below are two examples. ASSEMBLER ROUTINE is_hp proc push ax bx cx dx mov ax, 4DD4h int 15h cmp bx, 4850h jnz @not_hp cmp cx, 0101h jnz @not_hp mov rom_version, dl jmp @end_is_hp @not_hp stc @end_is_hp: pop dx cx bx ax ret is_hp endp The above routine sets the carry flag if an HP95 is not found. DOS v3.22 is a ROM version and ay have appeared in early laptops or portables. C LANGUAGE ROUTINE The C language version is directly usable for Borland C compilers. You might have to adapt for Microsoft C to make this work. #include <dos.h> /* * Check if running on HP95, return 1 if so, else return 0 * */ int IsHP95(void) {union REGS r; r.x.ax = 0x4dd4; int86(0x15, &r, &r); return r.x.bx == 0x4850 && r.x.cx == 0x0101;} Mark Scardina CompuServe ID: [76711,732] Gilles Kohl CompuServe ID: [100114,3146]
|
|
Copyright © 2005 Thaddeus Computing Inc
<