Block part of Flash from being programmed

Question: How to block the part of the Flash from being programmed in case of Hi-Tech compiler?

 

Answer:

By adding following code into boot.tpl, Flash part from  address 0X4000 to 0X8000 can be protected from being programmed:

------------------------------------------------------------
AREA BLOCKOUT(ROM, ABS, CON) ; Do not use [0x4000, 0x8000).
org 0x4000
BLOCKOUT_ROM:: BLK 0x4000
------------------------------------------------------------
The hex file will reflect this by only having halts in this block.