4 ms·
Your wish has been granted. It's called C and it's been around since the 70's.
by claystu 11y ago
Your wish has been granted. It's called C and it's been around since the 70's.
- jwr 11y agoI will take an educated guess that none of the responders to my comment (and I'll just post this one reply to all) have written significant amounts of assembly code, especially using MMX/SSE/AVX, and so will respectfully disagree with all of the responses. Briefly: * writing assembly in C is an exercise in frustration, just try to see anything past the syntax, same goes for intrinsics, with the added bonus of having to check whether the code you got is actually what you wanted, * no, you do not want to manually keep track of all of your 32 AVX-512 registers, trust me (for x86+SSE I used printed register allocation tables to help me track of what is where at which stage), heck, even on a measly ARM Cortex-M managing your R0-R12 (and not all instructions operate on all of them) can get annoying. The idea that you can keep registers in your head stems from the days when we had AX-DX to work with. "Assembly" doesn't have to mean doing everything manually (and macros, yay!), really. There is a middle ground, where you get a reasonably intelligent assembler which does a lot of the manual grudge work for you. There are also more intelligent assemblers which, for example, take your linear assembly and convert it into VLIW, allocating processing units. Or reorder instructions around branches. Assembly language should be thought of as a spectrum of tools.
- claystu 11y agoThis is a serious question: what's the point of programming in assembly if you don't want to control the registers? And what do you do if the assembler does a poor job of register allocation? If you hand optimize it, you're back in normal assembly; if you ignore it, you might as well not check in the first place. Once you sacrifice the registers, assembly just becomes a non-portable programming language without any libraries. Unless you build it out with macros and capitalize on it being a programmable programming language, but then why not go with Forth or some kind of Lisp? What does no-register assembly gain you that higher level languages don't already offer?