Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 33 of 38

PEN*KEY 6100 Computer Programmer's Reference Guide: Appendix B: Common PEN*KEY 6000 Series Information, pages 289 to 296

Pages 289 to 296 of 328, from PEN*KEY 6100 Computer Programmer's Reference Guide

The original document is the PDF (1.2 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.

For the Norand 6100

Page 289

APPENDIX B

Common PEN*KEY 6000 Series Information scr_printf(“Bind error. Abort.\n”); break; case IPLDUR: scr_printf(“Invalid PLDU. Abort.\n”); break; case HEADJAM: jamarray[0][jamindex] = jam; jamarray[1][jamindex] = jam2; jamarray[2][jamindex] = jam3; jamarray[3][jamindex++] = jam4;

B. Common PEN*KEY 6000 Series Info.

scr_printf(“head jam. Abort.\n”); scr_printf(“page: %u\n”,page_no); scr_printf(“line: %u\n”,line_cnt); scr_printf( jam & 1 ? “Left ”:“Right ”); scr_printf(“\n%s”,((jam & 2) ? “Accel”: (jam & 4) ? “Decel”: “Print”)); scr_printf(“\n%s”, ((jam & 16) ? “Cmove”: (jam & 32) ? “Nmove”: “Pmove”)); scr_printf(“\n%s”,((jam &128) ? “highspeed”: “lowspeed”)); scr_printf(“\ncnter0 = %d\n”,jam2); scr_printf(“\interrupts = %d\n”,jam3); tdelay(10000); break; case PAPEROUT: scr_printf(“Printer paper out. Retry.\n”); break; case LOWVOLTS: scr_printf(“Printer low voltage. Retry.\n”); break; case HIVOLTS: scr_printf(“Printer over voltage. Retry.\n”); break; case LOWBAT: scr_printf(“Printer low battery. Retry.\n”); break; case COVEROFF: scr_printf(“Printer cover off. Retry.\n”); default: break; } if (exterr != HEADJAM)

ch = (scr_getc());

while (1) { scr_printf(“abort, retry, ignore, fail :”); ch = (exterr != HEADJAM) ? (scr_getc()) : ‘r’; scr_printf(“%c \n”,ch); ch = tolower(ch); switch (ch) { case ‘1’: case ‘a’: return (2); case ‘2’: case ‘r’: return (1); case ‘3’: case ‘i’: return (0); case ‘4’: case ‘f’: return (3); default: break; } } } FAR (void) errproc() { #asm sti push ds push es PEN*KEY R 6100 Computer Programmer’s Reference Guide

B-9

Page 290

Common PEN*KEY 6000 Series Information

APPENDIX B

B. Common PEN*KEY 6000 Series Info.

; pusha push ax push bx push cx push dx push si push di mov dx,dataseg mov ds,dx mov dx,[bp] push dx push si push ax push di call baderr_ add sp,8 mov –6[bp],al ;set return code ; popa pop di pop si pop dx pop cx pop bx pop ax pop es pop ds mov sp,bp pop bp iret #endasm }

IDLE.CPP // // CPU Idle call sample source code // #include <dos.h> // int86 #include <stdio.h> // printf, etc // // CPU Idle calls cause the processor to halt (via HLT instruction) until the // next hardware interrupt. This causes good power savings if used during // input polling loops, or other low activity points in an application. See // MS-Intel APM 1.1 specification or Ralf Brown’s interrupt list, for info. // unsigned char APMCPUIdle(void) { union REGS regs; regs.x.ax= 0x5305; int86(0x15, &regs, &regs); // makes actual function call being tested if (regs.x.cflag==0) { // CPU Idle successful return (0); } else { // An error occurred, check error code. switch (regs.h.ah) { case (0x03); // Interface not connected break; case (0x0B); // Interface not engaged default: // Unrecognized Return code break; } return ((unsigned carh)regs.h.ah); // return the error code B-10

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 291

APPENDIX B

Common PEN*KEY 6000 Series Information

} } // end APMCPUIdle void main(void) { printf(“Result of CPU Idle call: %2.2X\n”, APMCPUIdle()); return; }

Keyboard Remapping, with ANSI.SYS Another way to remap the keyboard is to use ANSI.SYS, which should work on any computer that supports ANSI.SYS. This is a very portable way to remap keys. ANSI.SYS works the same across all PCĆcompatible platforms. It provides the capability of reassigning keys, through the use of escape sequences. An esĆ cape sequence is a string of text that begins with two preliminary keys: the esĆ cape character and the leftĆbracket character Refer to DOS help or to the UsĆ ing ANSI.SYS paragraph, below, for additional information on composing the remapping strings for use with ANSI.SYS. Each key on the keyboard has a specific key code. Refer to any standard keyĆ board interface definition to determine keycodes for the keys.

Example Key Redefinition

Add the following line to your CONFIG.SYS file where the /x switch selects keyĆ board redefinition, as specified in the DOS Help for ANSI.SYS: device=c:\dos\ansi.sys /X

Add the following assignments (with any modifications) that you prefer to suit your needs) to your AUTOEXEC.BAT file, to set these mappings each time your system is powered up or reset: echo on prompt $<–[0;59;“INTERSVR C: D:”;13p prompt $<–[0;60;“DIR”;32p prompt $<–[0;61;“BIOS”;32p prompt $<–[0;62;“CD”;32p prompt $<–[0;63;“COPY”;32p prompt $<–[0;64;“DEL”;32p prompt $<–[0;65;“RAMDFMT”;32p prompt $<–[0;66;“C:”;13p prompt $<–[0;67;“EXIT”;13p prompt $<–[0;68;“D:”;13p prompt $p$g

Explanation of Example The listing above is shown is as it will appear, if you create it with a DOS text editor, such as EDIT.COM. The small arrow (<-) after the $" (repreĆ senting the escape character) is in EDIT.COM with one character. In most text editors, the escape character is produced by pressing [Ctrl-P], then the [Esc] key. The escape character may be produced and displayed differently, depending on the text editor you are using. In the first $" line, the indicates that the [F1] key is assigned the quoted text C: D:". The 13p indicates that the [Enter] key is added after the text. Some of the lines use 32p at the end, which indicates that a space is added after the quoted text, which allows the operator to add other parameĆ ters. Then the [Enter] key can be pressed after all parameters are added. PEN*KEY R 6100 Computer Programmer’s Reference Guide

B-11

B. Common PEN*KEY 6000 Series Info.

The following example demonstrates one way to remap function keys F1ćF10, using ANSI.SYS. This method remaps any key by supplying the appropriate key numbers in place of the where is the key code (such as 0;59).

Page 292

Common PEN*KEY 6000 Series Information

APPENDIX B

After mapping these keys and executing the code, you can press any of those mapped keys and the quoted text will result, followed by the character at the end of the line (13p, 32p, etc).

Using ANSI.SYS ANSI.SYS defines functions that change display graphics, control cursor moveĆ ment, and reassign keys. The ANSI.SYS device driver supports ANSI terminal emulation of escape sequences to control sequence of ASCII characters, the first two of which are the escape character (1Bh) and the left bracket character (5Bh). The character, or characters, that follow these two preliminary characters, speciĆ fy an alphanumeric code that controls a keyboard or display function. When you redefine keys, using ANSI.SYS, place the on" before the statements, so all escape sequences are echoed to the screen; therefore executing the redefinitions through ASNI.SYS functions. There are other switches allowed with ANSI.SYS. See DOS help on ANSI.SYS for information. " NOTE:

ANSI.SYS distinguishes upper- and lowercase letters. For example “P” and “p” are different.

/X

Remaps extended keys independently on PCĆcompatible keyboards.

B. Common PEN*KEY 6000 Series Info.

Memory Overview (PEN*KEY 6000 Series Computer) The following paragraphs describe the operation of Windows for the PEN*KEY 6000 Series Hand-Held Computers and examines some noteworthy design asĆ pects, to help you understand the concept. Some of these topics include: " "

A little background information about memory. A highĆlevel view of memory, as it applies to the PEN*KEY 6000 Series computers compared to a standard desktop PC: " The typical memory organization of a standard PC, including a pictoĆ rial view of memory, and how each area of memory is used. " A summary of the different types of memory. " A list of the commands and statements used in the CONFIG.SYS file and the AUTOEXEC.BAT file, and descriptions of their usage. " Descriptions of Windows, Storage Devices and Memory, as it relates to the PEN*KEY 6000 Series Hand-Held Computers. " How the PEN*KEY 6000 Series system works. " Standard mode vs. Enhanced mode. " RAM drive integrityĆprotection. " Some non-Windows Systems.

Background When a typical PC is first turned on, it performs a cold boot. Many pieces of softĆ ware are loaded into the PC's executable memory, or RAM, during the coldĆboot. The first thing that loads is the BIOS. On a notebook or desktop PC, the BIOS is usually stored in a ROM chip on the main CPU board (motherboard). After the BIOS is loaded, DOS is loaded into the random access memory (RAM). In a maĆ chine that is set up to run in a Windows environment, Windows is the next item loaded. Finally, an application is selected to run, which is loaded into the RAM. B-12

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 293

APPENDIX B

Common PEN*KEY 6000 Series Information

Standard PC Memory Overview While installing programs, if you load some of them into the Upper Memory Area (UMA), this helps free up some conventional memory for use by your application. The following overview should provide some insight into how memory is orgaĆ nized and what each part is for. To better understand the usage of these memory areas, refer to the diagram beĆ low, while reading the information that follows.

Extended memory

B. Common PEN*KEY 6000 Series Info.

High Memory Area (HMA) 64k Upper Memory Area (UMA) 384k

1 Megabyte Conventional memory 640k

Figure B-1 Typical Memory Organization

Definition of Terms Conventional Memory - That area of memory in which most DOS applications run. Other programs that could reside there include portions of DOS and any programs called using a or line in CONFIG.SYS or any proĆ grams that are not executed with a from AUTOEXEC.BAT. ConvenĆ tional memory can be up to 640 KB. UMA - Just above conventional memory. UMA provides memory for system hardware. Any memory not used by the system is usable. The device=elanump.sys. . ." and lines, in CONFIG.SYS, provide access to UMA. After ELANUMP.SYS is loaded and specified, other drivers are loaded into UMA using in CONFIG.SYS or in AUTOEXEC.BAT. This combination of conventional and upper memory consists of 1 MB, meaning there is 384 KB of memory for UMA. PEN*KEY R 6100 Computer Programmer’s Reference Guide

B-13

Page 294

Common PEN*KEY 6000 Series Information

APPENDIX B

Extended Memory - Above UMA and includes HMA. To access extended memory, add to CONFIG.SYS (where is the drive and directory where HIMEM.SYS exists). The most widely known application using extended memory is MS Windows. HMA = Memory residing above conventional and upper memory. If is specified in CONFIG.SYS, this loads part of DOS into HMA. This is possible if HIMEM.SYS is loaded before the statement. This frees up some conventional memory but lowers the memory used for the RAM drive by 64K bytes, because HMA has the lower 64K of extended memory. Expanded Memory - Type of memory simulated by using a program such as EMM386.EXE. Applications created with the PenRight! development environĆ ment are examples of programs that optionally use extended memory. EMM386 can use UMA and extended memory to simulate expanded memory.

Summary of Memory Types " " " " "

B. Common PEN*KEY 6000 Series Info.

"

Conventional memory Expanded memory Extended memory HMA RAM drive UMA

First 640K of memory where most applications run. Type of memory simulated using EMM386.EXE. All memory above 1 MB. Lower 64K of extended memory with DOS loaded. Section of extended memory, simulates a disk drive. 64 KB section located above conventional memory, where drivers are loaded to free space for applications running in conventional memory.

Statements and Programs (CONFIG.SYS, AUTOEXEC.BAT) Statement

Description

DEVICE= DEVICEHIGH= DOS=HIGH DOS=UMB ELANUMP.SYS EMM386.EXE HIMEM.SYS INSTALL= LOADHI

Loads or installs device drivers into conventional memory from CONFIG.SYS Loads or installs device drivers into UMA from CONFIG.SYS Loads a portion of DOS into HMA when called from CONFIG.SYS Allows programs to run in UMA when called from CONFIG.SYS Provides access to UMA when called with in CONFIG.SYS Simulates expanded memory when called with in CONFIG.SYS Provides access to extended memory when called with in CONFIG.SYS Runs an application in conventional memory from CONFIG.SYS Runs applications in UMA when called from AUTOEXEC.BAT

B-14

PEN*KEY R 6100 Computer Programmer’s Reference Guide

Page 295

APPENDIX B

Common PEN*KEY 6000 Series Information

Windows, Storage Devices, and Memory In a PEN*KEY 6000 Series system, DOS, Windows, and the application are loaded into RAM from a disk device. In Figure B-2, the system shown has four megabytes of RAM and a hard disk drive. In this system, all of the software components are stored on the hard drive, along with any application data.

ÎÎÎÎ ÎÎÎÎ ÎÎÎÎ ÎÎÎÎ 4MB Work Space

3MB

Application

2MB

Windows

1MB

DOS / BIOS

The system depicted in Figure B-2 represents the standard desktop or laptop PC. All of the software components (DOS, Windows) and the application are loaded from the hard drive into RAM, as indicated by the arrows in the diagram. The box labeled Space", is part of RAM used by the system for shortĆterm storĆ age of information. The sizes of each area of memory shown, do not necessarily represent the actual implementations. 8MB 7MB RAM Disk

6MB 5MB 4MB

Work Space

System Memory

3MB

Application

2MB

Windows

1MB

DOS / BIOS

Figure B-3 PC with RAM Disk PEN*KEY R 6100 Computer Programmer’s Reference Guide

B-15

B. Common PEN*KEY 6000 Series Info.

Figure B-2 Desktop/Laptop PC with Hard Disk

Page 296

Common PEN*KEY 6000 Series Information

APPENDIX B

The PEN*KEY 6000 Series system, depicted in Figure B-3, is like the standard desktop or laptop PC, except that a physical hard disk drive is not used for storĆ age. Instead, a section of the RAM memory is defined as a RAM disk. The only difference between the systems of Figure B-2 and Figure B-3 is the storage locaĆ tion for software components. In a normal PC, this type of system would work only if the power to the RAM was never removed. By its nature, the RAM memory loses (or its contents when the power is removed. However, in the PEN*KEY 6000 Series Computer, the RAM is powered continuously. ConseĆ quently, the RAM disk retains its contents over long periods of time. " NOTE:

In the illustrations, 4- or 8-megabyte memory models are shown. Keep in mind, as the PEN*KEY 6000 Series systems continue to be enhanced, that future releases may allow larger memory models. The double-headed arrow from the “Application” to the “disk” indicates that the application loads the data from the disk, then writes it back to the disk.

How the 6000 Series PEN*KEY System Works In the system depicted in Figure B-4, DOS and BIOS are stored in the flash memory. Flash memory is similar to RAM memory, except that flash memory does not its contents after the power has been removed.

B. Common PEN*KEY 6000 Series Info.

ÁÁ Á ÁÁ Á ÁÁÁ

1MB FLASH 8MB 7MB RAM Disk

6MB 5MB 4MB

Work Space

3MB

Application

2MB

Windows

1MB

DOS / BIOS

Figure B-4 PEN*KEY with RAM Disk

B-16

PEN*KEY R 6100 Computer Programmer’s Reference Guide

System Memory