NewsProductsSprinterSupportDownloadSprinter ForumAbout usLinksSite map Russian site
Support
 Updates | Knowledge base | Manuals | Resellers | Warranties | Feedback

Knowledge Base

[ Back ] [ Index ] [ Categories ] [ Next ]

Q10001. How to parse the command line in my programm?

Summary

This article contain example for getting command line.

More information

	ORG	8100h-512
;EXE-file header:
	dw	5845h	  ; EXE Signature
	db	45h	  ; Reserved (EXE type)
	db	00h	  ; Version of EXE file
	dd	00000200h ; Code offset
	dw	0000h	  ; Primary loader size or 0 (no primary loader)
	dd	00000000h ; Reserved
	dw	0000h	  ; Reserved
	dw	START	  ; Loading address
	dw	START	  ; Starting address (register PC)
	dw	0BFFFh	  ; Stack address (register SP)
	ds	490	  ; Reserved 
 
;code of program
 
START	PUSH	IX	;IX pointer to Command line parameters
	POP	HL	;ld hl,ix
	INC	HL	;skip size of Command line
			;Now, HL pointer to first simbol of parameters
			;If you typed "TEST.EXE Hello", then HL pointer to " Hello"
			;with first space.
	LD	C,5Ch	;system call number (PCHARS)
	RST	10h	;call kernel
 
;return from your program
	LD      C,41h   ;system call number (EXIT)
	RST     10h     ;call kernel
	RET

24 April 2002.
PETERS PLUS LTD.

[ Back ] [ Index ] [ Categories ] [ Next ]