4 ms·
Always fun to see this type of thing implemented in Haskell. Here are some other examples. This one uses indexed monads to keep the instruction stream correct
by ch 11y ago
Always fun to see this type of thing implemented in Haskell.
Here are some other examples.
This one uses indexed monads to keep the instruction stream correct:
https://intoverflow.wordpress.com/2010/05/21/announcing-potential-x86-64-assembler-as-a-haskell-edsl/ https://intoverflow.wordpress.com/2010/05/21/announcing-pote...
And this one is very similar to the OP but from 2013, and emits 6502 assembly: http://wall.org/~lewis/2013/10/15/asm-monad.html http://wall.org/~lewis/2013/10/15/asm-monad.html (of course without the JIT portion).
- iheartmemcache 11y agoA bunch of people on HN were asking where to learn the conventions of x86 ASM - this actually is a pretty good place to start. He picked the 8 important registers, the 3 forms of addressing, demonstrated hi/lo (ah/al) -> ax -> eax -> rax evolution, and kept with the acc, count, data, GP conventions for eax,ecx,edx,ebx which is often overlooked (you can tell which era of x86 asm I grew up in ;)). I'm scared this has the potential to be information overload for people who aren't familiar with an assembly language and Haskell, but for me I thought this was a terribly neat (both in the "interesting" as well as "structurally well done") article. As usual, fantastic work by Steven. Up there with Bartosz and Yang in quality of write-ups.
- rdc12 11y agoI don't know Haskell (yet) but do have a small ammount of assembly experience and I managed to follow along fairly well. However on purpose I didn't worry about fully understanding the monadic side of things.