Category : Utilities for DOS and Windows Machines
Archive   : MAXDOS.ZIP
Filename : HIRUN.ASM

Output of file : HIRUN.ASM contained in archive : MAXDOS.ZIP
ORG 100H
ENTPT: JMP setpass
stack dw 256 dup(0)
savesp dw 0
savess dw 0
savespl dw 0
savessl dw 0
mess1 db "We're back",13,10,10,'$'
; this data is used by the passthru program only
command_line db 129 dup(0)
; parmblock is used for the parmeters for the execute
parmblock dw 0 ; this is the parmblock for execute
dw command_line
tailds dw 0
dw 5ch ; fcb in psp
fcb1 dw 0
dw 6ch ; fcb in psp
fcb2 dw 0
setpass proc near
; set up a local stack
lea sp,stack+510
; prepare for the exec function
; shrink memory
mov bx,0b000h
mov ax,cs
sub bx,ax
mov ah,4ah ; shrink
int 21h
; create the commandline
; the command line has to start with /C and then the command
; and then end with a carriage return. It must have a byte at
; the front saying how long it is
lea di,command_line+1
mov al,'/'
mov al,'C'
mov al,' '
; now copy the real command line in
mov si,81h
mov cl,byte ptr ds:[80h]
mov ch,0
push cx
cmp cx,0
je no_move
rep movsb
pop cx
add cx,3
mov command_line,cl
; set up the control block with segment information
mov tailds,ds
mov fcb1,ds
mov fcb2,ds
; find the comspec
mov es,word ptr ds:[2ch]
mov di,0
mov cx,255
mov al,'='
repne scasb
; if there is no comspec, there is something wrong with the system
cmp word ptr es:[di-3],'CE'
jne env_loop
cmp word ptr es:[di-5],'PS'
jne env_loop
cmp word ptr es:[di-7],'MO'
jne env_loop
cmp byte ptr es:[di-8],'C'
jne env_loop
; got the comspec
; save the stack
mov savess,ss
mov savesp,sp
; set up the segment registers
; the comspec segment is in ES and should be in DS
push es
pop ds
push cs
pop es
mov dx,di
lea bx,parmblock
mov al,0
mov ah,4bh
; execute the thing
int 21h
; here is where we return
mov ss,cs:savess
mov sp,cs:savesp
mov ax,cs
mov ds,ax
mov es,ax
; say that we did it
lea dx,mess1
mov ah,9
int 21h
int 20h
setpass endp

  3 Responses to “Category : Utilities for DOS and Windows Machines
Archive   : MAXDOS.ZIP
Filename : HIRUN.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: