assembly - General Purpose Registers - Order -
why general purpose registers ordered (eax, ecx, edx, ebx)? example, "inc" instruction opcodes are:
inc eax - 40 inc ecx - 41 inc edx - 42 inc ebx - 43   is there reason why ordered way?
the odd placement of (e)bx due way 8086 evolved 8080.
the 8080 has accumulator (a) , 6 general-purpose registers b, c, d, e, h , l, b/c, d/e , h/l can used in pairs, , in particular h/l can used address memory access. 8086 designed existing 8080 code translated it; guess seemed logical map registers in following order:
8080 register   -> 8086 internal register 0               b,c ->                        1               d,e ->                        2               h,l ->                        3               sp  ->                        4   as noted in answer, ax, bx, cx , dx in 8086 not arbitrary names 4 general-purpose registers - have mnemonic meanings special functions registers have: "accumulator", "base", "count" , "data". given above mapping, makes sense assign "accumulator" function internal register 0, , "base" function internal register 3. (and 8086 internal registers 5, 6 , 7 bp, si , di, new functionality.)
of course, informed (see here example) speculation - 8086 designers know sure...
Comments
Post a Comment