; Patches to Programming System II in RAM

; 1) Put a jump at zero to the PS2 entry point so that BASIC and PS2
;    have a common restart point

	ORG	0
	JMP	0040H		;JUMP TO PS2 MONITOR

; 2) Patch edit buffer location to EBSTART and EBEND

EBSTART	EQU	2400H		;ALLOWS AM2 SYMBOL TABLE FROM 1E06H
				;  TO 2400H GIVING 05FAH (1530) BYTES
EBEND	EQU	5000H		;EDIT BUFFER FROM 2400H-5000H GIVES
				;  2C00H (11264) BYTE EDIT BUFFER
	ORG	0A54H
	DW	EBSTART

	ORG	0B58H
	DW	EBEND

; 3) Patch assember (AM2) to fix the symbol table overflow
;    check by changing JM at 17ADh to JC. 

;	ORG	17ADH
;	DB	0DAH		;JC INSTEAD OF JM

; 4) Or, disable the symbol table overflow check which actually just 
;    verfies that addresses don't exceed the ORG or ORR of the program.
;    An address could still fall in the edit buffer depending on where
;    the edit buffer is placed. Disabling this check allows putting code
;    anywhere. For example, in the unused 414 bytes from 11B2 to 134F
;    between EDT and AM2 when the edit buffer is moved past AM2. Note
;    the chicken and egg problem: This patch won't assemble until the
;    assembler is patched with this patch...

	ORG	17ADH
	DB	0,0,0		;NOP OUT THE COMPARE JUMP

; 5) Make EDT with no parameters 're-edit' instead of starting a new
;    file. Require EDT(N) to start a new file.

	ORG	0A43H
	JZ	0A7DH		;'EDT' ALONE JUMPS TO RE-EDIT

	ORG	0A4DH
	SUI	'N'		;'EDT(N)' JUMPS TO NEW FILE
	JZ	0A53H
	
	END
	EOA
