Hello, I would like to know if there is any pattern that the compiler follows to write the correspoding opcode into the .hex file
I tried to figure out patterns, but there is always some other instruction countering it
Thanks in advance
Yes, I know the structure of the hex files, and I believe that there has to be a pattern, but looking at the opcodes table, the way the MOV instruction(mainly) looks rather unintuitive, since they aren't all grouped and sometimes it looks like they break their own criteria for the sub-groups where they are, I think I am starting to see some priorities though.
The reason I want this is because I'm making a c program that receives an assembly source code file and creates a .hex, I didn't say it because it wasn't much related to programing microcontrolers
Thanks for the reply!
OK - so you are writing an assembler?
What part of the MOV instruction do you find strange? http://www.keil.com/support/man/docs/is51/is51_mov.htm
Yes, that was the term I was looking for.
I pretty much realized that I need to treat MOV as a specific case, since the difference is that it can be grouped by the 1st or 2nd argument which makes it so there are conflicts
i.e. all the "MOV A,..." instructions are in the E5-EF group, except the "MOV A,#immed" which is grouped with all the instructions like "MOV ...,#immed"(which are at the 74-7F group)
I think I can go from this point, thanks for showing me the page!
OK - so you are writing an assembler? I just saw someone claiming advantages of his wheel because t was bot perfectly round
Ah, but it can be quite educational to write some own tools. And the 8051 is good for that, since it has a quite easy architecture.