Im developping my own version of a 8051 in VHDL. and Im using Keil software to make test programes. I know how to added my own SFR's, but the problem is If I Want to added a special instructions not supported by the original 8051, the only way I know is modifing manually the hex file generated by the compiler . I want to make the macro assembler or the C compiler supporting my special instruction by specifing the new opcodes . is this possible? please give me your advice I will be very thinkful.
You can use macro
"You can use macro" Possibly for the assembler, but how could that work for the C51 Compiler??
If you want to use your new instructions, you must use assembler. Compiler can't use instructions when it generate code if it doesn't know that this instructions exist.
http://www.archelon.com advertise with the heading "Need to build a C compiler", try them. Evidently they are advertising for people making new processors. Erik
Refer to http://www.keil.com/support/docs/2434.htm for details on adding assembler macros that use your new instructions. Note that there is only 1 unused opcode on the 8051. So, if you start replacing existing instructions with new instructions you may render it impossible for the compiler to generate code (since instructions used by the compiler are no longer available). If may want to consider using the A5 opcode as an escape prefix for your new instructions. Refer to the Philips 51MX, Dallas 390, and Intel 251 documentation for more information on how those companies added new instructions without upsetting any existing instructions. Jon