home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS 1992 September
/
Simtel20_Sept92.cdr
/
msdos
/
sysutl
/
undoc2eh.arc
/
UNDOC2EH.ASM
next >
Wrap
Assembly Source File
|
1989-01-08
|
3KB
|
109 lines
comment |
This program, UNDOC2EH, was written by Hardin Brothers and it appeared
in the May 1988 issue of _PC Resource_.
This copy was obtained from the "Clone Phone BBS", which is PCResource's
owned and operated service to its readers: (603)924-9337 2400/1200/300 8N1
The entire contents of the May 1988 issue of _PC Resource_ is
Copyright (c) 1988 by IDG Communications/Peterborough, Inc.
--> This program waits for any key to be typed after a message is placed on
--> the console before continuing!
This program is offered as a solution (albeit undocumented!) to the
problem of how does a child of the resident/permanent COMMAND.COM add
a shell variable to the parent/root environment without modifying
AUTOEXEC.BAT and rebooting?
Hardin Brothers points out that this is a relatively "dangerous" technique
since it goes 'against the grain' of the usual parent-child relationship.
On the other hand, he says that for adding a new variable to the root
environment or for changing the system prompt without requiring a reboot,
this technique seems ideal. He recommends that this technique never be
used to spawn a child process -- use the program he wrote that uses the
documented technique instead (see PCRSPWN1.ARC).
Hardin Brothers reports that neither DOS itself nor COMMAND.COM use this
interrupt service. He says the "accepted" method [how can a method be
"accepted" if the service is undocumented?] is for the parent to use the
same technique as when spawning a child process using the documented
INT 21h Service 4Bh. Set DS:SI to point to a DOS command line string
before invoking INT 2Eh.
Hardin Brothers uses the trigraph '==>' which when read is 'points to'.
This program is the same as the original version in the magazine article
except for two changes:
1- This opening comment and attribution block by me,
Chris Sylvain (cgs@umd5.umd.edu).
2- The name of the program was changed from RESET to UNDOC2EH.
|
comment |
This program demonstrates the UNDOCUMENTED DOS Interrupt, INT 2Eh.
It will reset the system prompt and then exit
|
.MODEL SMALL
.STACK
.DATA
cmd db lcmd_lin-1
cmd_lin db 'PROMPT This prompt set by UNDOC2EH$_$p $b$q$b ',0dh
lcmd_lin equ $-cmd_lin
msg1 db 'Calling DOS Execute interrupt',10,13,'$'
msg2 db 'Return from Execute interrupt',10,13,'$'
.CODE
old_sp dw ?
old_ss dw ?
start: mov ax,@data
mov ds,ax ;Initialize data segment
lea dx,msg1 ;Print opening message
mov ah,09h ;Print a message
int 21h ;DOS Request
call pause ;Let user see it
mov bx,seg end_seg ;Get end of our program
mov ax,es ;ES is seg of PSP
sub bx,ax ;BX = memory to keep
mov ah,4ah ;Set memory block
int 21h ;DOS Request
jc exit ;Go if error
push ds ;Save DS
mov cs:old_sp,sp ;Save our stack
mov cs:old_ss,ss
lea si,cmd ;DS:SI ==> command
int 2eh ;Execute command
cli ;Turn off interrupts
mov sp,cs:old_sp ;Restore stack
mov ss,cs:old_ss
sti ;Interrupts back on
pop ds ;Restore saved registers
lea dx,msg2 ;Report success
mov ah,09h ;DOS Request
int 21h
exit: mov ax,4c00h ;Return to DOS, no error
int 21h ;DOS Request
pause proc near
mov ah,07h ;Keyboard input -- unfiltered
int 21h ;DOS request
ret
pause endp
end_seg segment
end_seg ends
end start