Back in the days of CP/M I used several different assemblers but I particularly liked Microsoft Macro-80 for its ease of integrating assembler with code modules from PLI/80 & Bascom. Here we're demonstrating the editing and assembling a simple program using M80 and the associated linker L80 to create a new .com file called monitor.com. Its a short, simple program to demonstrate the use of M80 and L80 but it does have a useful function, which is to return you to the Playground monitor from CP/M as though you'd pressed 'reset'.
Heres the source:
uart_MCR equ 12 ; modem control reg
.z80
aseg
org 100h
ld hl, hicode
ld de, 8000h
ld bc, hi_end-hicode
ldir
jp 8000h
hicode:
in a, (uart_MCR)
and 11110111b
out (uart_MCR), a
jp 0
hi_end: nop
end 100h
...thats all there is to it. It copies a block of code to high memory, then jumps to it. The code pages in the ROM, and jumps to location zer0 where the monitor code starts.
More on the Z80 Playground Z80 CP/M hobby computer here:
8bitstack.co.uk
Cheers
Phil
![](https://s2.save4k.ru/pic/M4N-OCWJJjo/mqdefault.jpg)