3 ms·
Has anyone tried it on x87 assembly language? For those that don't know. x87 was the FPU for 32-bit x86 architectures. It's not terribly complicated, but it us
by Earw0rm 1y ago
Has anyone tried it on x87 assembly language?
For those that don't know. x87 was the FPU for 32-bit x86 architectures. It's not terribly complicated, but it uses stack-based register addressing with a fixed size (eight entry) stack.
All operations work on the top-of-stack register and one other register operand, and push the result onto the top of the stack (optionally popping the previous top of stack before the push).
It's hard but not horribly so for humans to write.. more a case of annoyingly slow and having to be methodical, because you have to reason about the state of the stack at every step.
I'd be very curious as to whether a token-prediction machine can get anywhere with this kind of task, as it requires a strong mental model of what's actually happening, or at least the ability to consistently simulate one as intermediate tokens/words.
- silisili 1y agoI'm going to doubt that. I was pushing GPT a couple weeks ago to test its limits. It's 100% unable to write compilable Go ASM syntax. In fairness it's slightly oddball, but enough exists that it's not esoteric. In the error feedback cycle, it kept blaming Go, not itself. A bit eye opening.
- messe 1y agoI'm comfortable writing asm for quite a few architectures, but Go's assembler... When I struggle to write Go ASM, I also blame Go and not myself.
- Earw0rm 1y agoThe thing with x87 is that it's easy to write compilable, correct-looking code, and much harder to write correct compilable code, even for trivial sequences of a dozen or so operations. Whereas in most asm dialects, register AX is always register AX (word length aliasing aside), that's not the case for x87: the object/value at ST3 in one operation may be ST1 or ST5 in a couple of instructions' time.
- userbinator 1y agoIf you are familiar with HP's calculators, x87 Asm isn't that difficult. Also noteworthy is that its density makes it a common choice for tiny demoscene productions.
- Earw0rm 1y agoNot too bad to write, kind of horrible to read.
- FeepingCreature 1y agoPrediction: it can do it, so long as you tell it to explicitly keep track of the FPU stack in comments on every FPU instr.