Category : Files from Magazines
Archive   : PJ84.ZIP
Filename : STARTUP.ASM

 
Output of file : STARTUP.ASM contained in archive : PJ84.ZIP
title start up code for assembly langauge
include asm.inc

dosseg
NULL segment para public 'BEGDATA'
NULL ends

public psp,startup,dgroup_segment

.data
psp dw 0
dgroup_segment dw 0


.data?
extb _edata,_end

.code
extn set_argc_argv,ms_dos

;; startup
;
; entry AX offset stack
; ES program segment prefix
; SS DGROUP
; exit BP 0
; may use AX,BX,CX,DX,DI,SI,DS,ES
;
startup proc
cld
mov bp,0
mov psp[bp],es

add ax,15 ; compute number of paragraphs
mov cl,4 ; in program
shr ax,cl
mov bx,ss
add bx,ax
sub bx,psp[bp]

mov ah,4Ah ; shrink program memory block for
call ms_dos ; dynamic storage system

mov dgroup_segment[bp],ss

mov al,0 ; zero bss segment
mov cx,offset DGROUP:_end
mov es,dgroup_segment[bp]
mov di,offset DGROUP:_edata
sub cx,di
rep stosb

call set_argc_argv
ret
startup endp

end


  3 Responses to “Category : Files from Magazines
Archive   : PJ84.ZIP
Filename : STARTUP.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/