Hello KM,
What assembler are you using? For CW assembler, the syntax for the ORG directive is -
ORG <expression> ; to define the new address.
In this context, flash block protection has no external security function, but provide protection against code corruption by a wayward flash erase or flash programming sub-routine. Refer to section 4.4.6 of the datasheet.
Yes, you would locate the sector erase and the byte programming sub-routines within flash A, without the need to execute any code from RAM. I have attached a relocatable assembly code example, that was originally intended to use a fixed block of RAM for a small part of the code. This should be easily adaptable for your purpose. Simply change the label F_FLASH_CMD to FLASH_CMD, and eliminate its special section. Also eliminate the RAM_COPY sub-routine.
If you are using absolute assembly, instead of relocatable assembly, you will also need to INCLUDE the code file, and rename the file from .ASM, perhaps to .INC. There will be some other file modifications for absolute assembly.
There is also a relevant Application Note AN3404.
Regards,
Mac