Title IMS -In Memory Submit for the MD-11 using CP/M 3 (21_May_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. ; Several 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. If a character ; is preceeded by an up-arrow (^) then it is translated into a control ; character. Finally, any character preceeded by a back-slash (\) is ; taken literally (i.e. \^C translates to ^C Not \, 03h). ; ; Summary of Special Ims Characters: ; ; Carriage Return ; | Carriage Return/Halt Processing Until next Warm Boot ; ^ Preceeds control characters ; \ Next character is to be taken literally ; ; .z80 aseg org 0100h ;---------------------------------------------------------------------- ; Equates (21_May_84) ;-------------------- ; Bios_Entry equ 0 ;Warm Boot Vector EF_Inject_Ims equ 11 Bdos_Entry equ 5 ;bdos call location Bdos_PString equ 9 ;bdos Output Sting to CON: function Input_Buffer 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 64 ;---------------------------------------------------------------------- ; In Memory Submit (21_May_84) ;----------------------------- ; ; Exit with Error if there's no command tail ;------------------------------------------- ; ims: ld de,Input_Buffer ;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,Bdos_PString ; Bdos Print String Function call Bdos_Entry ; call bdos jp Bios_Entry ; warm boot ; Strip Leading White Space ;-------------------------- ; ImsSk1: ld b,a ;B:= tail length ImsLp1: inc de ;Repeat DE:= Pointer next char in Ims dec b ; B:= Adjusted Ims 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 ImsLp2: inc hl ;Repeat (pointer (HL) to next character) inc de ; (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 control) jr nz,ImsSk4 dec b ; Adjust the line length inc c ; Increment Length_Adjustment inc de ld a,(de) and 5Fh ; Force it to upper case sub 40h ; Convert it to a control char. jr ImsSto ImsSk4: 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 next character jr ImsSto 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 number of non-printing char ld (de),a ;Save the adjusted length call Inject_Ims jp Bios_Entry ;warm boot page ;---------------------------------------------------------------------- ; Inject the Ims string into the Ims buffer (21_May_84) ;------------------------------------------------------ ; Inject_Ims: ld a,EF_Inject_Ims ;A:= extended function call (inject ims) push hl ld hl,(Bios_Entry+1) ld l,0 ex (sp),hl ;(put cold start entry on stack) ret ;Inject the Ims Sting NtMesg: db Cr,Lf,Lf,'IMS requires a CP/M command list.',Cr,Lf,'$' IMSbuf: ds 128,0 ;Local Ims buffer (holds translated input line) end