Category : Recently Uploaded Files
Archive   : 80XXX_94.ZIP
Filename : PRIMARY.ASM

 
Output of file : PRIMARY.ASM contained in archive : 80XXX_94.ZIP
;---------------------------------
; primary.asm by Mitch Ames

; This program checks for the existance of a secondary shell in memory,
; and returns an error level of 1 if so, 0 if not.

; The primary shell is the first program in memory which owns itself (as
; determined by the memory control block). The program compares its parent's
; PSP with that of the primary PSP to determine whether the primary or a
; secondary shell is running. Note that if this program is called directly
; from another (via function 4B) it will register the parent as a secondary
; shell.


code segment
assume cs:code,ds:code,es:code,ss:code

.radix 16

org 0100

start: mov sp,0100 ;use default DTA as stack
mov ah,52 ;find first memory control block
int 21
mov ax,es:[bx-2] ;AX points to first MCB segment
mcb: mov es,ax ;ES is memory control block segment
inc ax ;AX is memory block segment
cmp ax,es:[1] ;does block own itself?
jz shell ;first one that does is primary shell
add ax,es:[3] ;calculate address of next MCB
jmp mcb

shell: cmp ax,ds:[16] ;is primary shell
this program's parent?
mov al,0 ;if so, exit code 0
je quit
mov dx,offset msg ;else write message
mov ah,9
int 21
mov al,1 ;exit code 1
quit: mov ah,4C
int 21

msg db "Secondary shell detected.",13d,10d,"$"


code ends
end start



  3 Responses to “Category : Recently Uploaded Files
Archive   : 80XXX_94.ZIP
Filename : PRIMARY.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: http://www.os2museum.com/wp/mtswslnk/