[net.lang.pascal] Wanted: Include message patch for MS-DOS Turbo Pascal

db21@ihuxk.UUCP (Dave Beyerl) (10/08/85)

	Some time back an article was posted that described a
patch to the CP/M versions of Turbo Pascal for bypassing the
include messages prompt and automatically either including or
excluding the messages depending on user preference.  I was
wondering if anyone has determined if MS-DOS Turbo Pascal, ver 3,
can be patched in similar fashion and if so, what does the
patch look like?  I am in the middle of a school project and
don't have time to go poking around myself.  I would appreciate
any help that can be offered.  
	For those who are curious about the original article, I am 
including an edited version below for your reading pleasure.

	Thanks in advance for your help.

					Dave Beyerl
					ihuxk!db21


---------------- old article follows ----------------

Subject: Turbo Pascal patch

Several months ago someone requested a patch for Turbo Pascal so that
it would automatically load the error message overlay file without
asking the user first.  Well, this weekend I finally poked around and
wrote a patch for both Z-80 versions (1.0 and 2.0).  In essence, what
happens is that Turbo displays the question, calls a subroutine to
read the response, and stores the response.  The yes_or_no sbr returns
a 0 if the answer was 'N', and non-zero (I didn't check the exact
value) if the answer was 'Y'.  Turbo then loads the message file if
the zero flag is not set.

The patch given below overwrites the call to the "display string"
function and the start of the message.  It clears the A register, adds
one to clear the zero flag, and branches past the call to yes_or_no.
If don't you want to load the error file, change the increment
instruction to a no_op.

When the patched Turbo is run, the copyright message will be displayed
until the error file has been loaded, then it will display the "main"
menu.  If the error file is not being loaded, the c-r message will be
displayed briefly, to be replaced by the main menu.  Remember, this
patch is for the Z-80 versions, altho a similar patch could probably
be used for the IBM version.

NOTE: in the patches below, all user input is in lower case, and
      comments to the patcher are in brackets [].

------------------------------------------------------------

            Patch for Z-80 version 2.0

A> ddt turbo.com
DDT VERS 2.2
NEXT  PC
7800 0100
-d2100,212f      [ display original code ]
2100 6C 3A 20 00 21 53 01 CD D0 01 CD 25 02 0D 0D 0A l: .!S.....!....
2110 0A 0A 49 6E 63 6C 75 64 65 20 65 72 72 6F 72 20 ..Include error 
2120 6D 65 73 73 61 67 65 73 00 CD 42 2c 32 24 44 C4 messages..B,2$D.
-a210a           [ enter patch in assembler ]
210A  sub a
210B  inr a      [ type NOP if you DON'T want the error file loaded ]
210C  jmp 212c
210F  .          [ exit from assembler input mode ]
-d2100,212f      [ display patched code ]
2100 6C 3A 20 00 21 53 01 CD D0 01 97 3C C3 2C 21 0A l: .!S.....<.,!.
2110 0A 0A 49 6E 63 6C 75 64 65 20 65 72 72 6F 72 20 ..Include error 
2120 6D 65 73 73 61 67 65 73 00 CD 42 2c 32 24 44 C4 messages..B,2$D.
-g0              [ exit from DDT ]
A> save 119 turbo.com    [ save patched version ]
A>

------------------------------------------------------------

krausej@stolaf.UUCP (James J. Krause) (10/10/85)

Dave Beyerl (ihuxk!db21) writes:

> ...an article was posted that described a
> patch to the CP/M versions of Turbo Pascal for bypassing the
> include messages prompt....  I was
> wondering if anyone has determined if MS-DOS Turbo Pascal, ver 3,
> can be patched in similar fashion....

Yep.  I've got the patches for verions 2.0 and 3.0:

(XXXX stands for 4 hex digits, whose actual value is not of importance.)

Turbo Pascal Version 2.0
------------------------

A>DEBUG TURBO.COM
-A 29ED
XXXX:29ED MOV BYTE PTR [023D],0B
XXXX:29F2 NOP
XXXX:29F3 NOP
XXXX:29F4 NOP
XXXX:29F5 <ENTER>
-W
-Q

Turbo Pascal Version 3.0
------------------------

A>DEBUG TURBO.COM
-A 2EB7
XXXX:2EB7 MOV BYTE PTR [0348],0B
XXXX:2EBC NOP
XXXX:2EBD NOP
XXXX:2EBE NOP
XXXX:2EBF <ENTER>
-W
-Q


Note that these patches will always _include_ the error messages file.
I'm not sure of the alterations required to _not_ include them.
I've double- and triple-checked for typos, but of course, don't do this
to your only copy of Turbo.  I've used the patch for version 3 on the
PC-DOS & Compat. release of Turbo, and it works; I haven't had the
occasion to try out the v. 2 patch, but it's from the same source
(PC Magazine, August 6, 1985, p. 217).

				James
			(...!ihnp4!stolaf!krausej)