This is the past DOS era of the compilation of source code, although has passed, but for the study of the assembly is still helpful, assembly language is just a basic programmer language, most people can grasp, not necessarily in-depth research.
; Basload. ASM 07/09/84-dkeels
;----------------------------------------------------------------------------
; This program provides BASIC programs with access to the program loader (LOAD)
By passing parameters via the system parameter area (SYSPARM).
;
; Inputs:
; The FILE SPEC 1-a string (len <=) with the complete name, including
; Path, the file to is loaded and executed.
; Example: ' MAINMENU. EXE ' or ' C:format. COM '
; PARAMETER 1-a string (len <=) with the command line parameters
; To is passed to the program specified in FILE SPEC 1.
; Example: ' or ' A: '
; FILE SPEC 2-same as 1.
; PARAMETER 2-same as 1.
;
; Outputs:
; This program is gives control to LOAD.
;----------------------------------------------------------------------------
Code SEGMENT ' Code '
Assume Cs:code
Public basload make known to BASIC at link time
Basload PROC FAR
;p Rologue
PUSH BP; Save BP
MOV BP,SP set base for Parm list
PUSH DS;D s-> basic work area
PUSH es; es-> basic Work area
MOV DX, ' DK '; interrupt verification switch
INT 77H/SEG Address of sysparm area in AX
MOV es,ax ES-> sysparm Area
CLD; set direction for all moves
; move file spec. 1 to Sysparm
MOV bx,ss:[bp+12]; get addr of String descriptor
MOV CX,DS:[BX]; get length of string into CX
MOV si,ds:[bx+2]; get addr's string into SI
MOV di,0; offset into sysparm
REP MOVSB; Move string
MOV BYTE PTR es:[di],0 make it Asciiz string
; move parameter 1 to Sysparm
MOV bx,ss:[bp+10]; get addr of String descriptor
MOV CX,DS:[BX]; get length of string into CX
MOV si,ds:[bx+2]; get addr's string into SI
MOV di,81; offset into sysparm
INC CL Adjust for CR to is added at end
MOV byte PTR es:[di],cl 1st byte is length of string
DEC CL; re-adjust for move operation
INC DI
REP MOVSB; Move string
MOV BYTE PTR es:[di],13 add CR to end
; move file spec. 2 to Sysparm
MOV bx,ss:[bp+8]; get addr of String descriptor
MOV CX,DS:[BX]; get length of string into CX
MOV si,ds:[bx+2]; get addr's string into SI
MOV di,163; offset into sysparm
REP MOVSB; Move string
MOV BYTE PTR es:[di],0 make it Asciiz string
; move parameter 2 to Sysparm
MOV bx,ss:[bp+6]; get addr of String descriptor
MOV CX,DS:[BX]; get length of string into CX
MOV si,ds:[bx+2]; get addr's string into SI
MOV di,244; offset into sysparm
INC CL Adjust for CR to is added at end
MOV byte PTR es:[di],cl 1st byte is length of string
DEC CL; re-adjust for move operation
INC DI
REP MOVSB; Move string
MOV BYTE PTR es:[di],13 add CR to end
; Exit to BASIC
POP ES
POP DS
POP BP
RET 8
Basload ENDP
CODE ENDS
End Basload