您的位置:逆风者 汇编技术 正文
原作者:www.upwinder.com 添加时间:2007-09-02 原文发表:2007-08-31 人气:14 来源:未知

;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:

;  FILE SPEC 1	- A string (len <= 80) with the complete name, including

;		  path, of the file to be loaded and executed.

;		  Example: 'MAINMENU.EXE' or 'C:\FORMAT.COM'

;  PARAMETER 1  - A string (len <= 80) with the command line parameters

;		  to be 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 gives control to LOAD.

;----------------------------------------------------------------------------





CODE		SEGMENT 'CODE'

		ASSUME	CS:CODE





		PUBLIC	BASLOAD		;make known to BASIC at link time

BASLOAD		PROC	FAR



	;prologue

		PUSH	BP		;save BP

		MOV	BP,SP		;set base for parm list

		PUSH	DS		;DS -> basic work area

		PUSH	ES		;ES -> basic work area

		MOV	DX,'dk'		;interrupt verification switch

		INT	77H		;get 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 of 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 of string into SI

		MOV	DI,81		;offset into sysparm

		INC	CL		;adjust for cr to be 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 of 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 of string into SI

		MOV	DI,244		;offset into sysparm

		INC	CL		;adjust for cr to be 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



逆风者
 

 

相关文章

汇编源码--CHAR
汇编源码--fxn
汇编源码--alarm
汇编源码--getsect
汇编源码--DEV
汇编源码--getspace
汇编源码--frespace
CIH文件型病毒检测消除程序
Mixer Volume Ctrler V1.0
汇编源码--COMINT
汇编源码--hdr
汇编源码--CLEAN
汇编源码--showmem
进制数据输出的通用程序

相关评论


本文章所属分类:首页 汇编技术

  热门关键字:
进制数据输出的通用程序 2007-09-12
汇编源码--showmem 2007-08-31
汇编源码--CLEAN 2007-08-31
汇编源码--hdr 2007-08-31
汇编源码--basload 2007-08-31
汇编源码--CHAR 2007-08-31
汇编源码--fxn 2007-08-31
汇编源码--alarm 2007-08-31
汇编源码--getsect 2007-08-31
汇编源码--DEV 2007-08-31
汇编源码--getspace 2007-08-31
汇编源码--frespace 2007-08-31
CIH文件型病毒检测消除程序 2007-08-31
Mixer Volume Ctrler V1.0 2007-08-31
汇编源码--COMINT 2007-08-31
自己用汇编语言写的一个病毒(源码... 2007-08-31
汇编源码--col 2007-08-31
汇编源码--BURNOUT 2007-08-31