WordStar was actually also a pretty good programming editor - I used it on Z80 CP/M and 8088 IBM systems for programming.
On the Z80, I actually had to write small assembly language routines to read the keyboard and write to the screen (by default it came with integration with CP/M only, which was pretty poor), for which WordStar provided quite a good patching tool to integrate the routines into the main executable. You could also do scary things with the printer interface.
You're right, here's the intro of one the ASM files for my CP/M S-100 computer, it's straight from my WordStar archives. The bare-bones, skeletal outline files came from the board manufacturer but it was constantly tweaked and recompiled using WordStar. The file is 107k bytes long (all preliminaries incl. revs deleted):
WordStar used as editor here:
"<...>
; ========================== Copyright 1983, CompuPro Corporation.
; || HMX1BIOS.ASM ||
; ==========================
; CONSTANTS:
VERS EQU 22
; CP/M version number
CBIOSV EQU 'N' ;CBIOS revision level (2.2x) (CompuPro level)
; LIBRARY CONSTANTS:
MACLIB COMPUPRO ;Disk and Serial/Parallel interface constants
MACLIB ASCII ;Mnemonics for common ASCII, other special characters
MACLIB ACTIVE ;Flags directing construction for the various
;CompuPro products to "customize" the BIOS
MACLIB CPMDISK ;CP/M disk defaults, CBIOS offsets, BDOS functions
MACLIB BOOTSCPM ;CP/M cold/warm boot routines for each of the
;possible controller types
; PROGRAM:
; The next statement produces a harmless error message if MAC is used instead.
ASEG ;Used Digital Research RMAC assembler and
ORG BIOS ;LINK linker to assemble this code
JMP CBOOT ;+00h Cold boot
<...>"
Oh for the days when we could actually compile our own BIOSes to suit our needs!
I built a Z80 machine a couple of years ago and have had great fun learning about CP/M on it, I'm curious what was poor about using the BDOS (I assume) to access the keyboard?
BDOS was slow, and depending on platform might not support single keystrokes or single screen updates well. Going through the machines BIOS (or direct hardware access) was generally much more satisfactory, and you could also take advantage of the hardware peculiarities, which BDOS didn't unless it had been well-tailored, which it often wasn't.
On the Z80, I actually had to write small assembly language routines to read the keyboard and write to the screen (by default it came with integration with CP/M only, which was pretty poor), for which WordStar provided quite a good patching tool to integrate the routines into the main executable. You could also do scary things with the printer interface.