Current state of the #MailStation homebrew software: a singleline text field for user input, and a much larger multiline text field for program output. So we now have a terminal-like interface we can use as a basis for writing command-line software.
Most of my development so far has used the community-created JsMailStation emulator, but it's a good idea to test on real hardware occasionally. For me, that means keying the program into the #MailStation's built-in hex editor. It still fits in less than 256 bytes, so the data entry isn't as time consuming as it might seem... yet.
Incongruously for a #z80 powered device, the #MailStation is heavily GUI based. There isn't a putc function, or even a fixed-width font, in the firmware. Instead, a windowing toolkit and a selection of widgets are provided, and loadable apps are expected to be event-driven. Each app supplies a main event handler function responding to incoming signals such as init, draw, and keydown. Apps don't take over the whole system as typical on single tasking retrocomputers. While the Mailstation doesn't do true multitasking, (or even #HP200LX-like switching between paused apps!), the event-driven software architecture is helpful for battery life, as the CPU can spend most of its time halted waiting for interrupts.
After lots of invisible optimization work, I've saved enough space that my new #MailStation app can display its name and icon in the app launcher.

I have now written a #z80 machine code monitor for the #MailStation. The command set is very influenced by WozMon, but unlike #Woz I haven't managed to fit it in 256 bytes (yet...)

So now, in the strictest sense of the word, I have a #repl on this thing!

(While there was already a built-in hex editor, it was not suited to interactive use. A reboot was necessary to test changes, and it was restricted to writing dataflash, which has a limited number of write cycles.)

PsfMon, my #z80 machine code monitor, is now running on my real #MailStation!

I optimized it from its original size of 332 bytes to 255 bytes, snugly fitting in one 256 byte page of dataflash. The gui "terminal emulator" takes another 256 byte page. This provides a self contained 512 byte development tool.

Command set - similar to #WozMon:

8000 - View byte at address 8000
8010,801f - View 16 bytes at address 8010
,803f - View from next address (8020) to 803f
8040>de ad - Place bytes de ad starting at 8040
>be ef - Place bytes be ef next (at 8042)
8000r - Execute code at address 8000

Anyway, here it is displaying 128 bytes of its own code.

Learning that software development using a hex machine code monitor involves far more pen & paper work than computer work.
Inevitably, I've been writing a #Forth for the #MailStation. Right now all it does is display the name of the world's greatest band (okay, that's really a test of the inner interpreter).

#MailStation #Forth has peculiar execution flow because of the event-driven environment it runs in. Forth's entry points are COLD (expected!) and ACCEPT (rather less expected). Forth so far has only one exit/yield point, also in ACCEPT, to await input provided from the gui textentry field.

Execution smoothly falls through from cold -> abort -> quit -> accept, with no "ret" along the way. (Even the "ret"-to-caller on line 42, the exit point, is tailcall optimized away by jumping to the final function rather than calling it.) It still feels transgressive to embrace unstructured-programming, even though it works great for "telescoping" routines that share an end.

When user input is received, execution picks back up on line 43. Finally, quit2 slams us unceremoniously into high-level threaded code, because by now we have set up enough interpreter state to run it.

A lot going on in this screenful of code. It's absolutely wild to implement an interpreter core without needing any conditional-branch instructions yet.

Inching toward another interesting program running on the #MailStation. That's right, it's Palo Alto Tiny #Basic v3! And, as can be seen from this screenshot, it's still feeling a bit woozy.
A couple bugs squashed, #TinyBasic seems stable now on the #MailStation! How fun!
Yup, TinyBasic is working on real #MailStation hardware too. #retrocomputing
It took about an hour to key the 2 KB program into dataflash, but it was well worth it. Now I have a #basic on the go!
@psf at this point you basically have a slightly newer one of those 80's portable computers that could run BASIC, that's actually pretty cool

i wonder if it'd be possible to turn this into a dumb terminal, i could see that being very neat indeed
@mjdxp Someone has written a terminal: https://github.com/jcs/msTERM
Unfortunately the MailStation has no RS-232, so you'll either be speaking a strange protocol over the parallel port, or using the builtin dialup modem :)
GitHub - jcs/msTERM: Terminal program for MailStation devices

Terminal program for MailStation devices. Contribute to jcs/msTERM development by creating an account on GitHub.

GitHub
@psf wow, that's pretty cool, i wonder if it'd be possible to build an adapter to convert the parallel output to RS232
@psf sounds like you're ready to implement a text adventure game!

@psf do enough coding in raw machine language and you won't need pen and paper.

I coded straight to 6502 and 8085 hex in the Time Before Assemblers. Then I wrote an assembler and never looked back.

Mind you I knew someone who insisted on coding in hex editor straight to machine language. He really objected to changing to an assembler. His code was a mass of jump instructions patching in changes (because hex editor).

This is why god invented cross compilers.

@psf That's how I started Z80 programming back in 1982. After a few months, I wrote my own assembler because I found that I wasn't good at managing code on paper. Nor was I fond of typing hex code.
Cidco MailStation - Wikipedia

@benjohn Yup! The Mailstation has been "jailbroken" for some time but there's very little homebrew software for it so far. I'm trying to help change that.
@psf it reminds me of Cambridge Z88. It looks very calm, somehow. I’ve an idea this kind of form is exactly what I’d like from is what I’d like from a clamshell portable, if it had the right software. Brilliant you’re repurposing them. Hope it goes well!
@psf pen&paper buddy  
@psf Amazing. This may be of interest: https://github.com/gp48k/z80-dis-tiny
GitHub - gp48k/z80-dis-tiny: World's smallest Z-80 disassembler

World's smallest Z-80 disassembler. Contribute to gp48k/z80-dis-tiny development by creating an account on GitHub.

GitHub
@psf oh, today i learned about it from you, and the fact it sports z80. "cidco mailstation is a must-have for those looking to enhance their home networking experience." - oh, in that case i guess i need one? (just look what you did 😃)