Title IMS -In Memory Submit (18_Jan_84) ; Copyright Morrow Designs, Inc. (1984) .z80 aseg org 0100h ibuf equ 80h ;tail buffer location extfunc equ 0fe00h ;bios extended function location injtims equ 11 CR equ 0dh ;carriage return PCR equ 8dh ;pause carriage return LF equ 0ah ;line feed sys equ 5 ;bdos call location display equ 9 ;bdos display on CON: function ims: ld hl,ibuf ;hl => tail buffer ld a,(hl) ;get tail length or a ;see if 0 jr z,no_tail ;jmp if 0 fchar: ld b,a ;b = tail length inc hl ;strip leading space dec b ld (hl),b ;set correct length floop: inc hl ;increment tail buffer pointer ld a,';' ;standard CR symbol cp (hl) ;compare symbol to buffer jr nz,not_sc ;jmp if not symbol ld (hl),CR ;substitute CR jr not_sym ;continue processing buffer not_sc: ld a,'|' ;pause CR symbol cp (hl) ;compare symbol to buffer jr nz,not_sym ;jmp if not symbol ld (hl),PCR ;substitute pause CR not_sym:djnz floop ;loop til all of buffer is processed ld de,ibuf+1 ;pointer to processed buffer ld a,injtims ;extended function call: inject ims call extfunc ;do extended function jp 0 ;warm boot no_tail:ld de,ntmesg ;pointer to no tail message ld c,display ;display line call sys ;call bdos jp 0 ;warm boot ntmesg: db CR,LF,LF,'IMS requires a CP/M command list.',CR,LF,'$' end