home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc2
/
amebat.lzh
/
AMEBAT.ASM
next >
Wrap
Assembly Source File
|
1985-05-18
|
3KB
|
122 lines
;
; === AMEBAT.ASM ===
;
; This program provides a way to spawn to AME86 without using ugly batch files.
; The program will take your command line (ie. filenames etc.) and pass them
; to AME86. Change drive, path, and .CMD specs per requirements as noted
; in the data structures at the bottom of the code. See AMEBAT.DOC for furthur
; information.
;
; Assemble, link, and convert to .COM as follows:
;
; MASM AMEBAT.ASM AMEBAT.OBJ NUL NUL ;Note NO commas
; LINK AMEBAT.OBJ,AMEBAT.EXE,NUL,NUL ;Note commas (ignore stack error)
; EXE2BIN AMEBAT.EXE CPMPROG.COM ;CPMPROG = KEDT,SELECT, etc.
;
; You can edit and build this file over and over for all your CP/M progs
;
; Written by Jay Jervey, 21-MAR-1985, Fountain Valley, CA
;
RET_NEAR MACRO
DB 0C3H
ENDM
.RADIX 10D
CODE SEGMENT
ASSUME CS:CODE,DS:CODE,ES:CODE,SS:CODE
ORG 2CH
ENVIRON DW 0
ORG 80H
CMDLEN DB 0
CMDLIN DB 0
ORG 100H
DOS EQU 21H
BATCH: MOV SP,OFFSET STACK ;Set up new stack
PUSH CS
POP ES
MOV BX,48 ;Free unneeded memory
MOV AH,4AH
INT DOS
MOV AX,ENVIRON ;Set environment segment
MOV PARAM_BLOCK,AX
MOV AX,CS
MOV DS,AX
MOV ES,AX
MOV FCB5C_SEG,AX ;Set FCB segs
MOV FCB6C_SEG,AX
MOV COMMAND_SEG,AX ;Set 80H command line seg
XOR CH,CH ;Append command line for AME86
MOV CL,CMDLEN
ADD COMMAND_BLOCK,CL
MOV SI,OFFSET CMDLIN
MOV DI,OFFSET TAIL
CLD
REP MOVSB
MOV BYTE PTR [DI],0DH ;Must terminate with carriage return
MOV DX,OFFSET AME86 ;Program to execute in DX
MOV BX,OFFSET PARAM_BLOCK ;Start of parameter block in BX
CALL SPAWN ;Do it
MOV AH,0 ;Exit
INT DOS
SPAWN: CLI
MOV STACK_SEG,SS ;Save stack
MOV STACK_PTR,SP
STI
MOV AL,0
MOV AH,4BH
INT DOS ;Run AME86
MOV AX,CS
MOV DS,AX
MOV ES,AX
CLI
MOV SS,STACK_SEG ;Restore stack
MOV SP,STACK_PTR
STI
RET_NEAR
STACK_PTR DW 0
STACK_SEG DW 0
PARAM_BLOCK DW 0
COMMAND_OFF DW OFFSET COMMAND_BLOCK
COMMAND_SEG DW 0
DW OFFSET FCB
FCB5C_SEG DW 0
DW OFFSET FCB
FCB6C_SEG DW 0
FCB DB 5 ;Change to drive of CP/M program
; 1=A, 2=B.... 5=E etc.
DB 12 DUP (20H)
DB 0,0,0,0
AME86 DB 'E:\AME86.EXE',0 ;Point to AME86 here (ie. path etc.)
COMMAND_BLOCK DB STRLEN
COMMAND_STRING DB ' E:\\KEDT.CMD/C' ;Command line for AME86
;Note: the double backslash indicates
;the root directory. This is an AME86
;feature only. Other directory paths
;are specified normally.
STRLEN = $ - OFFSET COMMAND_STRING
TAIL DB 0DH
DB 300 DUP (?)
STACK DB ?
CODE ENDS
END BATCH