;
;	Program for modifying addresses 
;
rst1:	ex	(sp),hl		; Save H,L and get next PC
	dec	hl		; Change RST 1 to NOP.
	ld	(hl),00h
	inc	hl
	inc	hl
	push	de		; Save D,E.
	ld	e,(hl)		; Get relative addr. in D, E.
	inc	hl
	ld	d,(hl)
	push	af		; Save condition codes.
	ex	de,hl		; Add offset for abs. addr.
	add	hl,de
	ex	de,hl
	dec	de		; Set to beginning of instr
	dec	de
	ld	(hl),d		; Store absolute addr.
	dec	hl
	ld	(hl),e
	pop	af		; Restore condition codes.
	pop	de		; Restore D,E.
	dec	hl		; Set H,L to start of instr
	ex	(sp),hl		; Restore H,L
	ret			; Execute.

	end

