![]() You can look at the visual6502 page and instruction sets from that generation, the opcode basically is an address into a rom, the rom contains the microcode of the steps to implement that instruction. You can be CISC like and assume a microcoded architecture, a simple 8 bit opcode where the bits do not indicate anything they simply form a unique number that is looked up in a table to figure out what it does. Another approach is mips like where you have some bits reserved as opcode bits (and then for some opcodes other bits then consumed as extended opcode bits) but being overall limited by what you can fit in any instruction, but the decoding is much easier, a tradeoff. For example 1/4th of the instruction set is dedicated to one type of instructions, then 1/8th is dedicated to another type, 1/16th of the possible encodings another flavor and so on. So while ARM's encoding seems chaotic to folks that cut their teeth on MIPS you can go back to the Acorn diagrams or even parts of the ARM ARM, and see that it is not chaotic at all, starting with the top bits instructions that want more immediate bits can be determined with fewer bits, then they add another bit and another bit to the encoding making unique starting bits and working through instructions that need fewer bits to determine the instruction down to other instructions that can tolerate more. If fixed then you need a way to indicate which bits cover these large immediate encodings. Things that are pc-relative you want to probably have a lot of immediate bits, the more bits the longer it can reach, assuming fixed length instructions, if variable length then you still have to decide if there is a limit or not, or a scheme to pick the offset size in the encoding. Or maybe you want 16 bit and still allow for variable length or go with fixed length which probably means 32 bits or 64 bits, but you can see with arm, mips, risc-v and probably others that you can have 16 bit instructions and 32 bit (and larger) with some scheme to switch between them.Īnd then you bang out the encoding. If in your mind before you started this you wanted variable length you still need a minimum size so maybe like x86 you want 8 bit instructions and that opcode will either be the whole instruction or describe that more bytes are required. Some form of unconditional and conditional branching, and so on.Īre you making a stack based processor or a normal style one? You have to decide things like fixed length or variable length, but long before you get here you already have experience with many instruction sets and you have in your mind the reason why you are trying to create a new one vs just using one, or making a clone (again forgetting about legal problems).įor a general purpose processor you will need the basics, a number of alu operations add, sub, and, xor, etc.You will need some basic load and store instructions. Let us forget about patents for now which will interfere with any real implementation. There needs to be a strong reason to want to create a new one so you already have to have something you do not like or some business or educational reason, which means you have details that you wish to fix or implement that other instruction sets do not have or one does and another doesn't and you want to find a middle ground. Same here, what do I like about instruction sets what do I not like. In the same way if you want to build a house this is not caveman times you do not have to figure this out from scratch, there are millions/billions of homes to go look at and not just the basics of walls and a roof, but do I like the garage up front or in back or none, one level or multi-story. ![]() So today we have the advantage of being able to examine many many instruction sets and assembly languages and get comfortable with them. You first need to create the instruction set and honestly due to the question(s) you asked you are not familiar with instruction sets nor assembly language. ![]() It is your choice, then simply write a parser and generate the instructions.Įrik pretty much covered it if the question is about creating a new instruction set from scratch then from that one or more assembly languages. If you are asking if you can make up an new instruction set for an existing ISA, absolutely nothing is stopping you from doing that instead of something like mov ax, So you ask about assembly language which is just a low level programming language often intended to have a direct relationship with a specific instruction set architecture (ISA or instruction set). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |