Atari Portfolio

Datasheet legend
Ab/c: Fractions calculation
AC: Alternating current
BaseN: Number base calculations
Card: Magnetic card storage
Cmem: Continuous memory
Cond: Conditional execution
Const: Scientific constants
Cplx: Complex number arithmetic
DC: Direct current
Eqlib: Equation library
Exp: Exponential/logarithmic functions
Fin: Financial functions
Grph: Graphing capability
Hyp: Hyperbolic functions
Ind: Indirect addressing
Intg: Numerical integration
Jump: Unconditional jump (GOTO)
Lbl: Program labels
LCD: Liquid Crystal Display
LED: Light-Emitting Diode
Li-ion: Lithium-ion rechargeable battery
Lreg: Linear regression (2-variable statistics)
mA: Milliamperes of current
Mtrx: Matrix support
NiCd: Nickel-Cadmium rechargeable battery
NiMH: Nickel-metal-hydrite rechargeable battery
Prnt: Printer
RTC: Real-time clock
Sdev: Standard deviation (1-variable statistics)
Solv: Equation solver
Subr: Subroutine call capability
Symb: Symbolic computing
Tape: Magnetic tape storage
Trig: Trigonometric functions
Units: Unit conversions
VAC: Volts AC
VDC: Volts DC
Years of production:   Display type: Graphical display  
New price:   Display color: Black  
    Display technology: Liquid crystal display 
Size: 4"×8"×1" Display size: 240×64 pixels
Weight: 18 oz    
    Entry method: Intel 80x86 machine language 
Batteries: 3×"AA" alkaline Advanced functions: Trig Exp Hyp Lreg Grph Cmem Snd Mtrx 
External power: 6VDC 300mA   Memory functions: +/-/×/÷/^ 
I/O: Portfolio bus, Memory cards     
    Programming model: Spreadsheet data 
Precision: 13 digits Program functions: Jump Cond Subr Lbl Ind  
Memories: 128(0) kilobytes Program display:  
Program memory: 128 kilobytes Program editing:  
Chipset: Intel 80x86   Forensic result:  

pfolio.jpg (64913 bytes)Long before the HP Jornada, long before today's Pocket PC craze, there was a company that had an idea: why not shrink an IBM compatible PC to pocket size? With that, the first "instant on", pocket size multifunction personal computer was born, loaded with "productivity applications" such as a simple text processor and spreadsheet program.

In a sense, the Portfolio was slightly ahead of its time. It is equipped with a very modest amount of memory (128 kilobytes in the base model), some of which is used for a RAM disk. The default configuration reserves 32 kilobytes for the RAM drive, leaving a little under 96 kilobytes in which applications can run. Another shortcoming is the lack of compatible interfaces built into the product: its memory card port is proprietary, while serial/parallel port support is available only through optional external interfaces.

That said, the Portfolio is definitely a groundbreaking machine: for the first time, it demonstrated the suitability of the IBM PC architecture for use in a handheld productivity device. In short: it works.

Oh yes, and it does of course function as a calculator. In more ways than one, in fact. In addition to its spreadsheet functionality, it also has a built-in basic calculator program.

What the Portfolio doesn't have is programmability. Not even DOS's venerable DEBUG is present on this machine. So if you are eager to write your own programs, and you aren't content with the limited programmability that a spreadsheet application provides, you have two choices: build your own applications on a desktop PC and transfer them to the Portfolio, or...

Well, when I acquired my Portfolio, it came without the optional interface, so I had no choice in the matter: I had to find another way to write programs for it. Here is how.

It is, of course, possible to enter the bytes of a program directly from the keyboard using the ECHO command. But the ECHO command makes some assumptions: it may translate some characters in ways you don't like (e.g., convert CR characters to CRLF sequences) and it may not accept other characters at all. Fortunately, I was able to construct a very simple DOS COM application that didn't use any problematic characters:

0100 B407          MOV     AH,07
0102 80C401        ADD     AH,01
0105 CD21          INT     21
0107 88C2          MOV     DL,AL
0109 B402          MOV     AH,02
010B CD21          INT     21
010D EBF1          JMP     0100

This, of course, is the assembly listing of this little program, but how can you enter it in binary form? Why, by making use of Alt key sequences of course. In order for this to work, you need to first enable the numeric keypad of the Portfolio by simultaneously pressing the Lock and Atari keys. Shown below is how you can then create the file CAT.COM. Three-digit Alt-sequences are marked using the backslash character, while control characters are marked using ^:

C>echo \180^G\128\196^A\205!\136\194\180^B\205!\235\241>


So just to be clear, what you type is the following sequence of keystrokes:

<hold down the Alt key>
<release the Alt key>
<hold down the Alt key>
<release the Alt key>
<hold down the Alt key>
<release the Alt key>
... et cetera.

If you entered this command line correctly and then hit the Enter key, you will have a file named in your RAM drive. This program really doesn't do much more than ECHO; the only advantage is that it does not translate character sequences in any way, and it can be used to enter any character except ^C and ^S. So with the help of CAT.COM, you're ready to enter another program:

0100 B408          MOV     AH,08
0102 CD21          INT     21
0104 3C78          CMP     AL,78
0106 7428          JZ      0130
0108 3C3A          CMP     AL,3A
010A 7C02          JL      010E
010C 0409          ADD     AL,09
010E B104          MOV     CL,04
0110 D2E0          SHL     AL,CL
0112 24F0          AND     AL,F0
0114 50            PUSH    AX
0115 B408          MOV     AH,08
0117 CD21          INT     21
0119 3C78          CMP     AL,78
011B 74E9          JZ      0106
011D 3C3A          CMP     AL,3A
011F 7C02          JL      0123
0121 0409          ADD     AL,09
0123 240F          AND     AL,0F
0125 5B            POP     BX
0126 08D8          OR      AL,BL
0128 88C2          MOV     DL,AL
012A B402          MOV     AH,02
012C CD21          INT     21
012E EBD0          JMP     0100
0130 CD20          INT     20

To enter this program, invoke CAT.COM and then start entering bytes as follows (do not enter any spaces or newlines, just the characters or Alt-numeric sequences themselves):

C>cat > 
\180  ^H  \205   !    <    x    t    ( 
  <    :    |   ^B   ^D   ^I  \177  ^D 
\210 \224   $  \240   P  \180  ^H  \205 
  !    <    x    t  \233   <    :    | 
 ^B   ^D   ^I    $   ^O    [   ^H  \216 
\136 \194 \180  ^B  \205   !  \235 \208 
\205  spc 

Altogether you need to enter 50 characters, followed by Control-C, which is used to exit the program. If you did everything right, you now have H2C.COM, a 50-byte executable, on your RAM drive.

H2C.COM is sophistication itself: this program can translate hexadecimal sequences to byte code. In other words, we can now use the built-in editor to write programs! And this leads us to the last program, a version of the classic Hello, World! application, this one written using my W compiler:

write := 0x8B55, 0x8BEC, 0x085E, 0x4E8B, 0x8B04, 0x0656, 0x00B8,
	 0xCD40, 0x7321, 0x3102, 0x8BC0, 0x5DE5, 0x90C3
_() :=
	write(1, "Hello, World!
", 15)

Translated into assembler, this code looks as follows:

0100 BF3B01        MOV     DI,013B
0103 BB8100        MOV     BX,0081
0106 021E8000      ADD     BL,[0080]
010A B88200        MOV     AX,0082
010D 8827          MOV     [BX],AH
010F 80FB81        CMP     BL,81
0112 7502          JNZ     0116
0114 88D8          MOV     AL,BL
0116 50            PUSH    AX
0117 E80600        CALL    0120
011A 83C402        ADD     SP,+02
011D CD20          INT     20
011F C3            RET
0120 55            PUSH    BP
0121 89E5          MOV     BP,SP
0123 B80100        MOV     AX,0001
0126 50            PUSH    AX
0127 8D451A        LEA     AX,[DI+1A]
012A 50            PUSH    AX
012B B80F00        MOV     AX,000F
012E 50            PUSH    AX
012F 8D5D00        LEA     BX,[DI+00]
0132 FFD3          CALL    BX
0134 83C406        ADD     SP,+06
0137 89EC          MOV     SP,BP
0139 5D            POP     BP
013A C3            RET
013B 55            PUSH    BP
013C 8BEC          MOV     BP,SP
013E 8B5E08        MOV     BX,[BP+08]
0141 8B4E04        MOV     CX,[BP+04]
0144 8B5606        MOV     DX,[BP+06]
0147 B80040        MOV     AX,4000
014A CD21          INT     21
014C 7302          JNB     0150
014E 31C0          XOR     AX,AX
0150 8BE5          MOV     SP,BP
0152 5D            POP     BP
0153 C3            RET
0154 90            NOP

To enter this code, create the file HELLO.HEX using the built-in editor and then enter the following text:

BF 3B 01 BB 81 00 02 1E 80 00 B8 82 00 88 27 80
FB 81 75 02 88 D8 50 E8 06 00 83 C4 02 CD 20 C3
55 89 E5 B8 01 00 50 8D 45 1A 50 B8 0F 00 50 8D
5D 00 FF D3 83 C4 06 89 EC 5D C3 55 8B EC 8B 5E
08 8B 4E 04 8B 56 06 B8 00 40 CD 21 73 02 31 C0
8B E5 5D C3 90 48 65 6C 6C 6F 2C 20 57 6F 72 6C
64 21 0D 0A x

When you're done and verified the result, remove all spaces and concatenate all into a single line of text. Save the file; it should be a file 201 bytes in length. (Yes, that's a lowercase x at the end.)

Now run the following:

C>h2c <hello.hex >

If everything went well, the result is a 100-byte file, HELLO.COM, on drive C:. Run it:

Hello, World!

I'd have tried to further develop this idea (maybe to build a simplistic debugger), but I have, in the meantime, acquired a parallel interface for my Portfolio. So, I no longer need to write bootstrap programs by hand!

And if you have that interface, you may be able to put to use the program I just received a few days ago (June 18, 2005) from Russ Campbell, called Portfolio Lotto, which he distributes as shareware. I was most surprised to learn that people still write applications for the Portfolio! I'm not much into gambling or lotteries, but hey, to each his own! Please note I did not test the program provided here (with source) and I neither endorse nor warrant it. (As a matter of fact, I'd like to warn anyone against trusting any "system" for lottery numbers, as they have no mathematical basis.)