home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
UTIL
/
WWIVE
/
MYWIVE.ZIP
/
LOADER.ASM
< prev
next >
Wrap
Assembly Source File
|
1991-06-13
|
2KB
|
82 lines
.MODEL TINY
.CODE
org 100h
start:
jmp start1
flag db 1
prog_name:
db 'BBS.EXE',0
db 60 dup (0)
start1:
mov ax,cs
mov ss,ax
mov sp,OFFSET stack_top ; set the stack
mov es,ax
mov bx,OFFSET stack_top ; last byte used
mov cl,4
shr bx,cl ; get paragraph count
add bx,1 ; add 1 for luck
mov ah,4ah ; func 4AH = SETBLOCK
int 21h ; give back most of memory to DOS
exec:
push cs
push cs
push cs
pop ds
pop es
mov dx,OFFSET flag ; DS:DX points to flag, prog name
mov ax,256bh ; set vector 6bh to DS:DX
int 21h
pop ax ; AX=CS=DS=ES
mov word ptr [parm_block+4],ax ; Set CS in parm_block
mov dx,OFFSET prog_name ; get program name offset
mov bx,OFFSET parm_block ; get offset of parm block
mov ax,4b00h ; fun 4b00 is exec
mov byte ptr [flag],0 ; clear the flag
int 21h ; do the exec
cmp byte ptr cs:[flag],0 ; see if we have to run again
jne start1
terminate:
xor dx,dx
mov ds,dx
mov ax,256bh ; clear vector 6bh
int 21h
mov ah,4dh
int 21h ; get return code
mov ah,4ch ; terminate
int 21h
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
parm_block dw 0 ; environment
dw 80h ; CMD line offset
dw 0 ; CMD line seg, set to CS
dd 0 ; who cares about the FCB's?
dd 0
stack_bottom db 32 dup (0)
stack_top:
END start