; ; SEND.ASM - Version 0.0 (August, 1996) ; Send A Command To Your Modem From The CP/M-86 Command Line ; Freeware from Kirk Lawrence ; ; Syntax: SEND ; ; This source code is currently set up for COM2. To change it to a different ; COM port, comment out the COM2 port addresses, below, and uncomment the ; port addresses for the desired COM port number...then recompile. ; ; cseg ;start of code segment org 100h ;leave room for base page jmp start ;go start the program ; ;--------------- ;COM1 addresses: ;dataprt dw 03F8h ;modem data port for COM1 ;ctrlprt dw 03FDh ;modem control port for COM1 ; ;--------------- ;COM2 addresses: dataprt dw 02F8h ;modem data port for COM2 ctrlprt dw 02FDh ;modem control port for COM2 ; ;--------------- ;COM3 addresses: ;dataprt dw 03E8h ;modem data port for COM3 ;ctrlprt dw 03EDh ;modem control port for COM3 ; ;--------------- ;COM4 addresses: ;dataprt dw 02E8h ;modem data port for COM4 ;ctrlprt dw 02EDh ;modem control port for COM4 ; nbr dw 0 ;storage variable for the timer's use synt db 13,10,' Syntax: SEND ',13,10,07,'$' ; start: mov si,81h ;point SI to the beginning of the command line ;-------------------------------------------------------------- ; Check to see if the user entered a command line argument. ; If not, print the syntax message and quit. parse: lodsb ;load a byte from the command line (in AL) cmp al,20h ;is it a space? je parse ;yes, so ignore it and go check the next byte jg sendit ;no, so go assume a command line arg. exists mov cl,9 ;function 9 - print string mov dx,offset synt ;point to the 'syntax' message int 224 ;call BDOS jmp exit ;go quit ;-------------------------------------------------------------- ; Send the user's command to the modem. ; sendit: mov si,82h ;point SI to the start of the command line data sendmore: lodsb ;load a byte from the command line (in AL) mov dx,dataprt ;point DX to the modem data port out dx,al ;send the byte to the port mov ax,0001 ;set timer delay in AX call timer ;go pause a little bit mov dx,dataprt ;point DX to the modem data port in al,dx ;read a byte from the port cmp al,0 ;is the byte a hexidecimal zero? jne sendmore ;no, so go send another byte mov al,13 ;stuff a carriage return into AL mov dx,dataprt ;point DX to the modem data port out dx,al ;send the byte to the port mov ax,0001 ;set timer delay in AX call timer ;go pause a little bit mov dx,dataprt ;point DX to the modem data port in al,dx ;read a byte from the port exit: xor cx,cx ;function 0 - reset system int 224 ;call BDOS ; ;-------------------------------------------------------------- ; This is our timer routine to produce delays of a desired ; number of "timer ticks." The delay factor is specified in ; AX prior to calling this routine. ; timer: mov nbr,ax ;move delay factor into variable mov ah,00 ;function 0 - read system timer int 1Ah ;call BIOS time-of-day services ; (current count returned in DX) add dx,nbr ;add our delay factor mov nbr,dx ;move result into variable count: mov ah,00h ;function 0 - read system timer int 1Ah ;call BIOS time-of-day services cmp dx,nbr ;has time period elapsed? jne count ;no, go count some more ret ;return end