home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 June
/
SIMTEL_0692.cdr
/
msdos
/
sysutl
/
exec.arc
/
SHELL.LST
< prev
Wrap
File List
|
1988-09-12
|
7KB
|
192 lines
Microsoft (R) Macro Assembler Version 5.00 9/12/88 00:30:16
Page 1-1
; Date: Tue, 16 Aug 88 18:11 PDT
; From: <MULTI%TRIUMFCL.BITNET@CORNELLC.CCS.COR
NELL.EDU>
; Subject: Correction to previous version...
;MASM SHELL;
;LINK SHELL;
;EXE2BIN SHELL SHELL.COM;
;
; Modifications:
;
; Who When What
; === ==== ====
; Y.N. Miles 15-Aug-88 Tried t
o figure out EXEC (SHELL)
; from th
e IBM tech. ref. manual
; Gave up
in disgust, wrote my own
;
; Y.N. Miles 16-Aug-88 Char co
unt in COMAND does not
; include
itself or trailing <CR>
; Specify
path for COMMAND.COM
; Correct
docs for 64K space req.
;
;NOTE: This program is in .COM form because I
cannot stand .EXE files
;
0000 code segment
assume cs:code,ds:code,es:code
0100 org 100h
0100 89 26 019C R start: mov spsave,sp ; Save SP point
er
0104 8C 16 019A R mov sssave,ss ; Save SS block
;
0108 BB 1000 mov bx,1000h ; ...surrender
64K of space
010B B4 4A mov ah,4ah ; ...with this
call
010D CD 21 int 21h ; ...for sub-p
rocess area
;
010F B8 005C mov ax,5Ch ; Get input def
ault FCB
0112 A3 0192 R mov fcbin+0,ax ; ...and save
offset
0115 8C 06 0194 R mov fcbin+2,es ; ...with segm
ent
;
Microsoft (R) Macro Assembler Version 5.00 9/12/88 00:30:16
Page 1-2
0119 8D 36 0081 lea si,cs:81h ; Get input def
ault FCB
011D 8D 3E 005C lea di,es:5Ch ; ...kosher it
0121 B8 2901 mov ax,2901h ; ...by fillin
g it
0124 CD 21 int 21h ; ...with blan
ks
;
0126 B8 006C mov ax,6Ch ; Get output de
fault FCB
0129 A3 0196 R mov fcbot+0,ax ; ...and save
offset
012C 8C 06 0198 R mov fcbot+2,es ; ...with segm
ent
;
0130 8D 36 0081 lea si,cs:81h ; Get output de
fault FCB
0134 8D 3E 006C lea di,es:6Ch ; ...kosher it
0138 B8 2901 mov ax,2901h ; ...by fillin
g it
013B CD 21 int 21h ; ...with blan
ks
;
013D C7 06 018C R 0000 mov envir,0 ; No environmen
t segment (so static)
;
0143 C7 06 018E R 0080 mov comand+0,80h ; ...setup com
mand line for copy to
0149 8C 06 0190 R mov comand+2,es ; ...parameter
area 80h in PSP
;
014D 8D 36 0176 R lea si,order ; Get order cou
nt/ascii_string/<CR>
0151 8A 0E 0176 R mov cl,order ; Get bytes in
ASCII string
0155 80 C1 02 add cl,2 ; ...add two n
on-string bytes
0158 B5 00 mov ch,0 ; ...convert b
yte count to word count
015A 8D 3E 0080 lea di,es:80h ; ...copy into
DOS parameter area at 80h
015E F3/ A4 rep movsb ; ...the order
= count/ascii_string/CR
;
0160 8D 16 017D R lea dx,daemon ; DS:BX --> Dos
transient null terminated
0164 8D 1E 018C R lea bx,envir ; ES:BX --> Sta
rt 7 word parameter block
;
0168 B8 4B00 mov ax,4B00h ; Do the DOS ex
ec (shell) request
016B CD 21 int 21h ; ...with call
Microsoft (R) Macro Assembler Version 5.00 9/12/88 00:30:16
Page 1-3
;
016D 8B 26 019C R mov sp,spsave ; Restore SP
0171 8E 16 019A R mov ss,sssave ; ...and SS
0175 C3 ret ; RET uses 0 on
stack to int 20h in PSP
;
0176 05 2F 43 44 49 52 0D order db 5,"/CDIR",13 ; Count
ed order for DOS, <CR> end
017D 43 3A 5C 43 4F 4D 4D daemon db "C:\COMMAND.COM",0 ; DOS t
ransient executes order
41 4E 44 2E 43 4F 4D
00
;
018C 0000 envir dw 0 ; Environment s
egment (static, not used)
018E 0000 0000 comand dw 0,0 ; Command line
dword (points to PSP:80h)
0192 0000 0000 fcbin dw 0,0 ; Input FCB dwo
rd (points to FCB:5Ch)
0196 0000 0000 fcbot dw 0,0 ; Outpt FCB dwo
rd (points to FCB:6Ch)
;
019A 0000 sssave dw 0 ; Supposed to s
ave stack segment
019C 0000 spsave dw 0 ; and stack poi
nter so RET calls INT 20h
;
019E code ends
;
end start
Microsoft (R) Macro Assembler Version 5.00 9/12/88 00:30:16
Symbols-1
Segments and Groups:
N a m e Length Align Combine Class
CODE . . . . . . . . . . . . . . 019E PARA NONE
Symbols:
N a m e Type Value Attr
COMAND . . . . . . . . . . . . . L WORD 018E CODE
DAEMON . . . . . . . . . . . . . L BYTE 017D CODE
ENVIR . . . . . . . . . . . . . L WORD 018C CODE
FCBIN . . . . . . . . . . . . . L WORD 0192 CODE
FCBOT . . . . . . . . . . . . . L WORD 0196 CODE
ORDER . . . . . . . . . . . . . L BYTE 0176 CODE
SPSAVE . . . . . . . . . . . . . L WORD 019C CODE
SSSAVE . . . . . . . . . . . . . L WORD 019A CODE
START . . . . . . . . . . . . . L NEAR 0100 CODE
@FILENAME . . . . . . . . . . . TEXT shell
87 Source Lines
87 Total Lines
12 Symbols
51020 + 175508 Bytes symbol space free
0 Warning Errors
0 Severe Errors