Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 3,186 of 4,675    |
|    Bernhard Schornak to Bartc    |
|    Re: asm improvements?    |
|    17 Dec 17 15:54:31    |
      From: schornak@nospicedham.web.de              Bartc wrote:                     > On 16/12/2017 19:38, Bernhard Schornak wrote:       >> Bartc wrote:       >       >> What about AH, BH, CH, DH?       >       > They got snipped in the quoting. They're called B16..B19. Just for       completeness as they will rarely       > be used, and ah/bh/ch/dl clash with sil/dil/bpl/spl in that you can't have a       register from both       > groups in the same instruction.                     Okay. For my taste, it is far away from intuitive, but that's       just my two cents... ;)                     >>>> Why is it preferable to use anything other than the architected       >>>> register numbers?       >>>       >>> Because they're a mess.       >>       >> Perhaps they are a mess for you, but they have one big advantage       >> over your 80 different names for 16 real registers:       >       > There are 64 names (excluding ah/bh/cx/dx), the same as the official       register names. The generic       > ones are used in software that works with ASM source (reading it or       generating it, with the width       > being an attribute).       >       > Unlike the official names, these are a simple combination of D/A/W/B and a       number from 0 to 15. (Or       > I could have had R0 to R15 and used a different way to denote width.)       >       > An assembler       >> programmer knows them by heart, and the original register naming       >> is consistent. AL, AH, AX, EAX and RAX are just defined portions       >> of one and the same 64 bit (or 32 bit until AMD64) register. The       >> great idea behind that naming gets lost with your new names, and       >> no other programmer intuitively knows what 'A9' really means. It       >> could be a macro, label, variable or function, as well... ;)       >       > Numbered registers seem to used on many machines with multiple registers.                     Like my first home-made computer powered by a Motorola 68000.       I might have understood, if you'd introduced your alternative       register names in an assembler in the early eighties, but now       (35 years later!) it seems a little bit too late to establish       new register naming acknowledged by the majority of assembler       programmers.                     > Looking back a few years, PDP10 used AC0 to AC15. PDP11, R0 to R7. IBM 360,       R0 to R15. 68K, D0 to       > D15 and A0 to A15 (including "A9"!).       >       > Z8000, R0 to R15 for 16-bit registers, with other prefixes when accessed as       8-bit halves, or grouped       > into 32 or 64 bits.       >       > PowerPC, R0 to R31. Etc. While ARM processors I've looked at use R0 to R15.       >       > In fact Intel is probably the exception, but even there, its n       n-general-purpose registers are       > numbered: ST0 to ST7, MMX0 to MMX7, XMM0 to XMM15, etc.                     Regardless of iNTEL's naming: Once introduced, register names       are like a postulate in physics. As you cannot rename mass to       'bubble-stuff' or re-define the basic rule as '1 + 1 = 3', it       is not very meaningful to introduce new register names for an       existing processor.                     > So I don't think there's much wrong with an idea that is widely used       elsewhere.       >       > Going back to Intel names, having a register called "edi" followed by one       called "r8d" sounds pretty       > crazy.       >       > Anyway, I can use both lots of names.                     You always are free to create a couple of macros to name your       register set with names of your favorite celebrities, but you       should not expect someone might be willing to substitute your       names with the established ones to understand your code... ;)                     Greetings from Augsburg              Bernhard Schornak              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca