Legacy apps in Windows/OS X was Re: Old MS-DOS & Win Software

Fred Cisin cisin at xenosoft.com
Wed Dec 7 22:22:55 CST 2005


> > > Consider on Windows XP that you can still run the following code:
> > > 	mov	cl,9
> > > 	mov	dx,offset HWMes
> > > 	call	5
> > > 	mov	cl,0
> > > 	call	5
> > Huh?  Do you mean this?
> > MOV  AH, 9
> > MOV  DX, HWMes
> > INT  21h
> > MOV  AH, 0
> > INT  21h
>   No, he meant what he wrote.  It's the CP/M compatibility layer built into
> MS-DOS.  Address 5 of the PSP (Program Segment Prefix) contains a long jump
> to MS-DOS, and uses CL for the function code instead of AH.

. . . and, you need to move the ADDRESS of the message into DS:DX, NOT the
first two bytes of the message into DX.
MOV DX, OFFSET HWMes
you can also end the program with a jump (or call) to location 0,
or even a RET without CALL (there's a 0 on the stack),
since the PSP starts with CD 20 (INT 20h)



More information about the cctalk mailing list