Title IMS -In Memory Submit for the MD-11 using CP/M 3 (23_Feb_84) ; ; Copyright 1983, 1984 ; Morrow Designs, Inc. ; San Leandro, Ca. ; Howard Fullmer, John Zalabak ; ; ; This program Moves all characters following the command ; until the first carriage return of exclamation point into the ; Ims Buffer. This character string is collectivly refered to as ; the command tail. ; Two operations are preformed on the command tail before it ; is moved into the Ims buffer. First, all leading white space is ; removed (i.e. spaces, commas and tabs). Secondly; All occurances of ; the carriage return symbol (;) are replaced with carriage returns; ; and, All occurances of the warm boot symbol (|) are replaced with ; carriage returns with the most signifigant bit set. ; ; .z80 aseg org 0100h ;---------------------------------------------------------------------- ; Equates (5_Feb_84) ;------------------- ; WrmBot equ 0 ;Warm Boot Vector sys equ 5 ;bdos call location StrOut equ 9 ;bdos Output Sting to CON: function ExtFun equ 0FE00h ;bios extended function location InjIMS equ 11 IBuf equ 80h ;tail buffer location Tab equ 9 ;Tab Cr equ 0Dh ;carriage return PCr equ 8Dh ;pause carriage return Lf equ 0Ah ;line feed page ;---------------------------------------------------------------------- ; IMS (5_Feb_84) ;--------------- ; ; Exit with Error if there's no command tail ;------------------------------------------- ; ims: ld de,IBuf ;DE:= Start of command tail ld a,(de) ;A:= Tail Length or a ;If (tail length ne 0) jr nz,ImsSk1 ld de,ntmesg ; pointer to no tail message ld c,StrOut ; StrOut line call sys ; call bdos jp WrmBot ; warm boot ; Strip Leading White Space ;-------------------------- ; ImsSk1: ld b,a ;B:= tail length ImsLp1: inc de ;Repeat DE:= Pointer to next char in Ims String dec b ; B:= Ims String Adjusted Length ld a,(de) ; A:= Starting char of Ims String cp ' ' ; (Char eq Space) jr z,ImsLp1 cp ',' ; (Char eq Comma?) jr z,ImsLp1 cp Tab ; (Char eq Tab?) jr z,ImsLp1 ;Until (char ne Space or Comma or Tab) dec de ;DE:= last white_space character inc b ;B:= Ims String Length page ;Translate special characters in the Ims String ;---------------------------------------------- ; ld hl,IMSbuf ;HL:= pointer to translated Ims String ld (hl),b ;Save the length ld c,0 ;C:= Length adjustment (used in back slash rtn) ImsLp2: inc hl ;Repeat (output pointer (HL) to next character) inc de ; (input pointer (DE) to next character) ld a,(de) cp ';' ; If (char eq Standard_Cr) jr nz,ImsSk2 ld a,Cr ; substitute Cr jr ImsSto ImsSk2: cp '|' ; Else If (char eq Pause_Cr) jr nz,ImsSk3 ld a,PCr ; substitute pause Cr jr ImsSto ImsSk3: cp '\' ; Else If (char eq back slash) jr nz,ImsSto dec b ; Adjust the line length inc c ; increment Length_Adjustment inc de ; (move inp_pointer to next char) ld a,(de) ; substitute the next character ImsSto: ld (hl),a djnz ImsLp2 ;Until (all of buffer is processed) ld de,IMSbuf ;DE:= Pointer to start of translated input buf ld a,(de) ;A:= Length Byte sub c ;Subtract the number of backslashed characters ld (de),a ;Save the adjusted length ;Inject the Ims string into the Ims buffer ;----------------------------------------- ; ld a,InjIMS ;A:= extended function call (inject ims) call ExtFun ;Inject the Ims Sting jp WrmBot ;warm boot ntmesg: db Cr,Lf,Lf,'IMS requires a CP/M command list.',Cr,Lf,'$' IMSbuf: ds 256,0 ;Local Ims buffer (holds translated input line) end