AsmREPL: Wing your way through x86-64 assembly language
- Reference: 1638298749
- News link: https://www.theregister.co.uk/2021/11/30/asmrepl/
- Source link:
REPL stands for "read-evaluate-print loop", and REPLs were first seen in Lisp development environments such as Lisp Machines. They allow incremental development: programmers can write code on the fly, entering expressions or blocks of code, having them evaluated – executed – immediately, and the results printed out. This was viable because of the way Lisp blurred the lines between interpreted and compiled languages; these days, they're a standard feature of most scripting languages.
Patterson has previously offered ground-breaking developer productivity enhancements such as an analogue [2]terminal bell and performance-enhancing [3]firmware for the Stack Overflow [4]keyboard . This only has Ctrl, C, and V keys for extra-easy copy-pasting, but Patterson's firmware removes the tedious need to hold control.
[5]It's 2021 and someone's written a new Windows 3.x mouse driver. Why now?
[6]Assembly language, arcade games, and YouTube: The Reg speaks to former Microsoft engineer Dave Plummer
[7]HP's solution to running GPU-accelerated Linux apps on high-end Z workstations: Rely on Microsoft's WSL2
[8]IBM Java CTO: Devs shouldn't have to learn Docker, K8s, 30 other things to deploy an app
We suspect that the Assembler REPL came out of Patterson's work on his own just-in-time compiler for Ruby, [9]TenderJIT . He does such [10]things for his day job. And like TenderJIT, the primary purpose of AsmREPL is educational.
Patterson explained: "I wrote it because I can never remember what the test instruction does to the zero flag. Every time I use the instruction I have to look up the docs. Looking up docs is fine, but running code in a REPL helps me remember things better."
[11]
AsmREPL works by assembling code into a shared memory buffer using Patterson's own [12]Fisk , an x86-64 assembler written in Ruby, then using the Unix ptrace system call to monitor what the code is doing. Windows users will have to use [13]WSL .
[14]
It's not quite the same as a machine-code monitor, as loved by coding pioneers in the early 8-bit days, but it looks like a fun tool if you're learning to write device drivers or other very low-level code. ®
Get our [15]Tech Resources
[1] https://github.com/tenderlove/asmrepl
[2] https://analogterminalbell.com/
[3] https://github.com/tenderlove/qmk_firmware
[4] https://stackoverflow.blog/2021/09/28/become-a-better-coder-with-this-one-weird-click/
[5] https://www.theregister.com/2021/11/29/a_new_windows_3x_mouse/
[6] https://www.theregister.com/2021/01/06/plummer_interview/
[7] https://www.theregister.com/2021/11/12/hp_z_wsl2/
[8] https://www.theregister.com/2018/02/22/ibm_java_cto_john_duimovich_interview/
[9] https://github.com/tenderlove/tenderjit
[10] https://github.com/shopify/yjit
[11] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=2&c=2YaatGQNi5@J4IaZ74tbJYAAAAMw&t=ct%3Dns%26unitnum%3D2%26raptor%3Dcondor%26pos%3Dtop%26test%3D0
[12] https://github.com/tenderlove/fisk
[13] https://www.theregister.com/2021/11/17/ubuntu_team_systemd_windows_wsl2/
[14] https://pubads.g.doubleclick.net/gampad/jump?co=1&iu=/6978/reg_software/applications&sz=300x50%7C300x100%7C300x250%7C300x251%7C300x252%7C300x600%7C300x601&tile=4&c=44YaatGQNi5@J4IaZ74tbJYAAAAMw&t=ct%3Dns%26unitnum%3D4%26raptor%3Dfalcon%26pos%3Dmid%26test%3D0
[15] https://whitepapers.theregister.com/
Didn't MS-DOS do this with DEBUG in like, 1980?
Or just type "si" in gdb followed by an "info registers".
That is one thing I love about the internet age - we get to hear about all the neat little projects people are doing, and try them out. Back in the early days (pre-90s), there wasn't much pure hobby programming like that going on because the hardware was so expensive. Not to mention that computing was Serious Business (tm) back then, even though the earliest machines had their primitive 8-bit games. :)
Dodgy link?
When I try to follow the link to https://analogterminalbell.com/, Firefox gets all hot'n'bothered: "Firefox detected a potential security threat and did not continue to analogterminalbell.com. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details."
Hmmm
REPLs
"REPL stands for "read-evaluate-print loop", and REPLs were first seen in Lisp development environments such as Lisp Machines."
Lisp Machines? Lisp had a read-eval-print loop long before Lisp Machines. The first interactive Lisp was PDP-1 Lisp in 1963. The manual describes typing (CAR (QUOTE (A B C D)) followed by a space: "the computer takes control of the typewriter, impulses a carriage return, and then types out: A".
You can download the manual from https://www.computerhistory.org/pdp-1/1822b607c479d2e9de9b19ba958c16e3/