DH’s hacks for the Portfolio
I wanted to post this months ago, but it seems that long winter breaks have become a tradition on this blog.
In October last year, a reader called DH wrote a comment with his own proposition of a .com-file generator for a bare Portfolio (without any communication interface). His implementation used octal codes instead of hex, but was easier to type in. All you need is to type this at the command prompt (see the original post):
echo /180 ^P /208 /236 /205 ! /168 /223 t ^Q /168 @ u ^U /131 /224 ^O /177 ^D /254 /201 /211 /226 ^A /194 /235 /229 /180 ^B /205 ! 1 /210 /235 /221 /205 [spc] /144 > b8cat.com
where ^P means Ctrl+P, /180 means Alt+1 8 0 when NumLock is on, and [spc] obviously is Space. If you don't make any mistake, you should now have a tool, which will allow you to create executable .com files from octal codes.
DH reverse-engineered DEBUG.COM from MS-DOS 2.0 and put it on Dropbox, so that after re-typing it (remember those listings in computer magazines back in the days?) you'll have this useful tool on your Portfolio.
That's not all. After a while, DH responded again, this time with a hexadecimal-code .com generator:
echo 1 \210 \180 ^P \208 \236 \205 ! \168 @ u ^T \168 [spc] t \242 \168 ^P u ^P \168 ^A u ^X \180 ^B \205 ! 1 \210 \235 \226 ^D ^E ^D ^D $ ^O \177 ^D \211 \226 0 \228 ^A \194 \235 \210 \205 [spc] \144 > b16cat.com
This is a great replacement to h2c.com, described in my post, since it's much easier to type in, it reads hex codes separated by spaces and ignores line breaks (so preparing the input is much easier). Input files must be terminated with "!" (exclamation mark).
Here's MORE.COM transcribed into hex codes:
B4 30 CD 21 86 E0 3D 00 02 73 09 BA FC 01 B4 09 CD 21 CD 20 C6 06 E7 01 19 B4 0F CD 10 88 26 E8 01 BA 17 02 B4 09 CD 21 33 DB B4 45 CD 21 8B E8 B4 3E CD 21 BB 02 00 B4 45 CD 21 FC BA 1A 02 B9 00 10 8B DD B4 3F CD 21 0B C0 75 02 CD 20 8B C8 8B F2 AC
3C 1A 74 F5 3C 0D 75 07 C6 06 EA 01 01 EB 4C 3C 0A 75 06 FE 06 E9 01 EB 42 3C 08 75 0D 80 3E EA 01 01 74 37 FE 0E EA 01 EB 31 3C 09 75 12 8A 26 EA 01 80 C4 07 80 E4 F8 FE C4 88 26 EA 01 EB 1B 3C 07 74 17 FE 06 EA 01 8A 26 EA 01 3A 26 E8 01 76 09 FE
06 E9 01 C6 06 EA 01 01 8A D0 B4 02 CD 21 8A 26 E9 01 3A 26 E7 01 72 20 BA F0 01 B4 09 CD 21 B4 0C B0 01 CD 21 BA 17 02 B4 09 CD 21 C6 06 EA 01 01 C6 06 E9 01 01 4E 41 49 74 03 E9 6E FF E9 54 FF 18 50 01 01 00 00 00 00 00 0D 2D 2D 20 4D 6F 72 65 20
2D 2D 24 4D 4F 52 45 3A 20 49 6E 63 6F 72 72 65 63 74 20 44 4F 53 20 76 65 72 73 69 6F 6E 0D 0A 24 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 !
(Remember to terminate each line - except the last - with space!)
But that's not all. After a while, DH responded again 🙂 Here's his advice on receiving files via RS-232 without comms software:
To receive a file sent by RS-232 using MORE.COM, on the Portfolio, execute “MORE <COM1 >FileName” (replacing “FileName” with the name under which to save the file). This will stream data from the COM port directly to the file (assuming no ^Z is encountered) WITHOUT locking up the keyboard! This allows you to advance the stream by repeatedly pressing Enter until the program automatically ends, signalling a complete transfer. It also means that you can still use CTRL+C if something goes wrong (something “COPY COM1 FileName” wouldn’t let you do, since it replaces all keyboard input with the COM port instead of simply opening it alongside). My Serial Interface hasn’t come through the post yet, so if someone with their own can test this for me, that would be great thanks!
The last (as for now) contribution by DH is a version of MORE.COM that can be typed in from command prompt without using B16CAT:
\176 ^N \254 \200 \162 4 ^B \162 \92 ^B , ^D \254 \192 \162 5 ^B \162 ] ^B \180 0 \205 ! \134 \224 H = \254 ^A w ^K \186 A ^B \180 ^R \208
\236 \205 ! \205 [SPACE] \198 ^F 0 ^B ^Y \180 ^O \205 ^P \134 \224 \162 1 ^B \144 \144 \144 \144 1 \219 \180 E \205 ! \137 \197 \180 = \254
\196 \205 ! \187 ^B \128 \129 \227 ^O ^A \180 E \205 ! \252 \186 _ ^B \185 ^A ^P I \137 \235 \180 ? \205 ! ! \192 u ^B \205 [SPACE] \137 \193
\137 \214 \172 0 \228 \254 \196 \168 \128 t ^D ^D \128 \235 Z ^L \128 = \154 ^A t \230 = \141 ^A u ^K \144 \144 \144 \198 ^F 3 ^B ^A \235 ]
\144 = \138 ^A u ^F \254 ^F 2 ^B \235 Q = \136 ^A u ^U \144 \138 ^V 3 ^B 0 \246 \254 \198 \129 ^Y0 ^A ^A t = \254 ^N 3 ^B \235 7 = \137 ^A u
^T \138 6 3 ^B \128 \198 ^F \254 \198 \128 \230 \248 \254 \198 \136 6 3 ^B \235 \30 = \135 ^A t ^Y \254 ^F 3 ^B \138 6 3 ^B : 6 1 ^B v ^K
\144 \144 \254 ^F 2 ^B \198 ^F 3 ^B ^A , \128 \136 \194 \180 ^B \205 ! \138 6 2 ^B : 6 0 ^B r $ \186 4 ^B \180 ^R \208 \236 \205 ! \180 ^L
\176 ^A \205 ! \186 \92 ^B \180 ^R \208 \236 \205 ! \198 ^F 3 ^B ^A \198 ^F 2 ^B ^A N A I \144 \144 t ^D \144 \233 A \255 \233 & \255 ^X P ^A
^A \141 \138 – - [SPACE] M o r e [SPACE] – - $ M O R E : [SPACE] I n c o r r e c t [SPACE] D O S [SPACE] V e r s i o n \141 \138 $
and hex codes for a little program that uses Portfolio-specific BIOS commands (int 61h):
B4 16 B9 19 00 B2 3C CD 61 B2 3B CD 61 B2 3C CD 61 B2 3B CD 61 B2 3C CD 61 B2 38 CD 61 B2 29 CD 61 B2 39 CD 61 B2 36 CD 61 CD 20 !
Now, Portfolio hackers, who's gonna pick up the gauntlet and write some more hex-code snippets?
Edited 2014/05/24:
This is DH once again:
This should work and would be some good code to incorporate into a countdown timer program:
B4 16 B9 14 00 B2 39 CD 61 D1 E1 B2 37 CD 61 D1 E9 B2 32 CD 61 D1 E1 B2 34 CD 61 D1 E9 B2 3D CD 61 B2 3B CD 61 B2 39 CD 61 B2 3B CD 61 CD 20 !
Edited 2014/05/26:
Here’s a program that dials a number you type in using the built in DTMF dialer. This program can be entered from the prompt as follows:
echo \161 y ^A % ^O ^O \163 y ^A 1 \192 \162 ~ ^A \176 \29 $ ^O \162 \127 ^A \180 ^F \254 \196 \254 \196 \254 \196 \186 X ^A \205 ! \186 y ^A \205 ! \180 ^F \128 \196 ^D \186 } ^A \205 ! \180 ^F \254 \196 \254 \196 \254 \196 \186 y ^A \205 ! \186 n ^A \205 ! \186 y ^A \205 ! \190 \127 ^A 0 \237 \138 ^N ~ ^A \180 ^W \205 a \205 [SPACE] \144 E n t e r [SPACE] n u m b e r [SPACE] t o [SPACE] d i a l : $ D i a l i n g . . . $ \29 * $ \144 2 ^A \29 $ >DIALER.COM
May 15th, 2014 - 20:07
I just dropped in and was delighted to see this posted :D. I thought, given your collection, you might be interested in the fact that there’s currently an original Psion Organiser (not a II) going really cheap on ebay. I haven’t placed a bid for it as I thought I’d let you go for it first as I imagine you’d get more joy from it. Link: http://www.ebay.co.uk/itm/Vintage-Psion-Organiser-1984-Boxed-/161302914036
May 15th, 2014 - 21:37
Thanks a lot! It’s a real bargain, but I’ve given up on buying new stuff – I once realized that I have too many of them, and I’d like to focus on the Portfolio and Psion 3c instead. Good luck with the bidding and let us know if you got it! 🙂
May 21st, 2014 - 22:01
Missed it by 50p… 🙁
May 22nd, 2014 - 12:10
Next time maybe! Till then you can still write programs for your Organiser II 🙂
May 20th, 2014 - 18:41
A mistake (probably mine): Transferring via MORE is done by “MORE filename”.
May 20th, 2014 - 18:43
Ignore that – there’s a bug in the comments section. I intended to write:
A mistake (probably mine): Transferring via MORE is done by “MORE >filename <COM1".
May 20th, 2014 - 18:47
Hehe, ok 🙂 So it’s correct in the article?
May 20th, 2014 - 20:45
Not really, sorry…
May 21st, 2014 - 12:01
Corrected.
May 21st, 2014 - 14:15
Not quite. Basically, you have to direct COM1 into MORE and the output of MORE into a file, using the less-than and greater-than signs. Unfortunately, trying to type the command into this comments box is interpreted as an HTML tag and stripped out! It should be MORE [less-than] COM1 [greater-than] filename.
May 21st, 2014 - 14:22
Uhh… It removes these brackets from the articles as well. I had to type them as HTML entities.
Maybe that works for comments too? Test: MORE < COM1 > filename
May 23rd, 2014 - 19:55
This should work and would be some good code to incorporate into a countdown timer program:
B4 16 B9 14 00 B2 39 CD-61 D1 E1 B2 37 CD 61 D1 E9 B2 32 CD 61 D1 E1 B2-34 CD 61 D1 E9 B2 3D CD 61 B2 3B CD 61 B2 39 CD-61 B2 3B CD 61 CD 20 !
May 23rd, 2014 - 19:56
Sorry, didn’t notice the hyphens – that should of course be:
B4 16 B9 14 00 B2 39 CD 61 D1 E1 B2 37 CD 61 D1 E9 B2 32 CD 61 D1 E1 B2 34 CD 61 D1 E9 B2 3D CD 61 B2 3B CD 61 B2 39 CD 61 B2 3B CD 61 CD 20 !
May 24th, 2014 - 12:36
I’ll ask once again: don’t you want an editor account? You seem to have much more great ideas than I do 🙂
Anyway, I updated the article.
May 24th, 2014 - 18:36
I don’t really come up with ideas for programs as well as I used to and I wouldn’t say any of these are great. As for the editor account, I wouldn’t be great at writing entries…
May 26th, 2014 - 12:49
Well, if you change your mind, contact me! Your help would add much value (and “hack factor”) to this blog.
May 24th, 2014 - 18:34
Here’s a program that dials a number you type in using the built in DTMF dialer. This program can be entered from the prompt as follows:
echo \161 y ^A % ^O ^O \163 y ^A 1 \192 \162 ~ ^A \176 \29 $ ^O \162 \127 ^A \180 ^F \254 \196 \254 \196 \254 \196 \186 X ^A \205 ! \186 y ^A \205 ! \180 ^F \128 \196 ^D \186 } ^A \205 ! \180 ^F \254 \196 \254 \196 \254 \196 \186 y ^A \205 ! \186 n ^A \205 ! \186 y ^A \205 ! \190 \127 ^A 0 \237 \138 ^N ~ ^A \180 ^W \205 a \205 [SPACE] \144 E n t e r [SPACE] n u m b e r [SPACE] t o [SPACE] d i a l : $ D i a l i n g . . . $ \29 * $ \144 2 ^A \29 $ >DIALER.COM
November 12th, 2020 - 22:03
I own and run the only U.K Portfolio Club and have loads of new and secondhand hardware / software for this brilliant pocket p.c.
I even have an original Atari testboard for this great machine, loads of magazines, books, etc.
Just contact me on: portfolioclubuk@gmail.com
Paul
June 3rd, 2022 - 16:22
Hi guys, I’m going to take a chance that someone may still be here and active with the Pofo. I just aquired one with no transfer interface and am interested in creating some of these programs. I haven’t played with DOS in a long time, but alot of it has come back to me. It’s a shame my Pofo came bare, but it works! I’ve created an AUTOEXEC.BAT file like I used to have on my old XT machine lol. Anyways, I know the Dropbox link above for the DEBUG.COM is no longer valid, but does anyone have it in the form as above? I would like to type it in and create it and then make programs in assembly. I do have a parallel adapter on its way to me, so I may just wait for that and do all this the easier way haha. Take care!
September 30th, 2024 - 01:29
Sorry for the late reply on this: I was looking up the blog just now for the first time in something like 5 years and saw your comment. I’ve popped the octal dump onto Pastebin: https://pastebin.com/CEZdv6XF – hopefully this is useful to someone, even if it’s too late for your needs?
September 11th, 2022 - 19:45
I disassembled your b16cat program, converted the disassembly to an lDebug script, rebuilt it several times, and added a tool (echoify) that can automatically generate the instructions of what to type for the echo command.
I also fixed two problems: First, the HP 95LX didn’t allow me to pass along a Control-P to the echo command, so the uses of that (codepoint U+0010) had to go. I added Control-P to the problem values to detect in my echoify program. Then I modified the debugger script to avoid those.
Second, it turns out function 21.02 will expand tabs (U+0009) even when redirecting the b16cat.com program’s output to a file. (Again, on the HP 95LX, running its MS-DOS 3.22 from ROM.) So I modified b16cat to use function 21.40 (to bx = 1 as stdout handle, with cx = 1 as length) which preserves all binary values exactly.
It’s all at https://hg.pushbx.org/ecm/b16cat
This is how to use it:
dosemu -K “$PWD” -E “ldebug /c=’y b16cat.sld'” -dumb
gcc -O2 echoify.c -o echoify
./echoify b16cat.com
lDebug is my debugger, available from my website at https://pushbx.org/ecm/web/#projects-ldebug