back to article AsmREPL: Wing your way through x86-64 assembly language

Ruby developer and internet japester Aaron Patterson has published a REPL for 64-bit x86 assembly language, enabling interactive coding in the lowest-level language of all. REPL stands for "read-evaluate-print loop", and REPLs were first seen in Lisp development environments such as Lisp Machines. They allow incremental …

  1. Richard Tobin

    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/

    1. W.S.Gosset Silver badge

      Re: REPLs

      Fun Fact: Lisp was just a theoretical postgraduate maths-of-compilers course by wossname, pure theory, and one of his students in a general post-lecture group chinwag said, y'know, I reckon I could write an EVAL for that. By the next week's lecture he had, and Lisp instantly turned from theoretical maths to a programming language, just like that. (essentially writing your own compiler dependency tree)

      1. Michael Wojcik Silver badge

        Re: REPLs

        Not exactly. See McCarthy's history of LISP paper.

        McCarthy had implemented some of LISP's key concepts in FLPL prior to 1960. Circa 1958 Wiesner, then Director of MIT RLE, gave McCarthy and Minsky resources for the MIT Artificial Intelligence Project. Some of those were put toward programming-language development. Development began on what would become LISP in '58.

        In 1960, McCarthy wrote his seminal LISP paper ("Recursive functions of symbolic expressions and their computation by machine, part I"). That "describ[ed] LISP both as a programming language and as a formalism", so even at that point it wasn't "just a theoretical" anything – it was already conceived of as a usable programming language. (And FLPL, and other list-processing languages such as ICL, supported that view.)

        "Recursive functions" described the eval function and a suitable notation for expressing it, though McCarthy writes "such a notation was devised for the purposes of the paper with no thought that it would be used to express LISP programs in practice". Then he adds:

        S.R. Russell noticed that eval could serve as an interpreter for LISP,

        promptly hand coded it, and we now had a programming language with an

        interpreter.

        That was certainly an important moment, both for REPLs and for the future of LISP, since it ended up killing M-expressions in favor of S-expressions for LISP source.

        Note that this was in 1960 on an IBM 704. Contrary to what someone posted upthread, the first interactive LISP was not the 1963 PDP-1 LISP.

        1. Richard Tobin

          Re: REPLs

          "Note that this was in 1960 on an IBM 704. Contrary to what someone posted upthread, the first interactive LISP was not the 1963 PDP-1 LISP."

          McCarthy's own History of Lisp paper that you cite says "L. Peter Deutsch implemented the first interactive LISP on the PDP-1 computer in 1963". McCarthy had already hacked up a proof-of concept demo on the IBM 704, but it wasn't usable system. There's some more about it at https://www.quora.com/What-was-it-like-to-use-LISP-on-an-IBM-704

    2. Tom 7 Silver badge

      Re: REPLs

      Were CDR and CAR actually machine code on the machine it was first written on?

      1. Michael Wojcik Silver badge

        Re: REPLs

        Were CDR and CAR actually machine code on the machine it was first written on?

        Sorta.

        car stands for "Contents of the Address part of Register", and if memory serves the D in cdr is for "Decrement part". McCarthy writes: "The motivation for implementing car and cdr separately was strengthened by the vulgar fact that the IBM 704 had instructions (connected with indexing) that made these operations easy to implement". See page 4 of the paper I linked to in my other post.

  2. Anonymous Coward
    Anonymous Coward

    Didn't MS-DOS do this with DEBUG in like, 1980?

  3. Marco van de Voort

    Or just type "si" in gdb followed by an "info registers".

  4. msobkow Silver badge

    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. :)

    1. LDS Silver badge

      "there wasn't much pure hobby programming like that going"

      There was on Commodores and Sinclairs (and others) - just there was no easy internet to publish them, and sometimes you had to type code copied form printed lists from magazines....

      I used also a Commodore Plus 4 that with all its defects compared to the 64 had a machine language monitor - which I used to learn and the code using 6502 assembly, circa .1984...

      The "web era guys" keep on reinventing the wheel - just in more complex ways - a ruby script that invokes a python that calls a shells that run a script that calls an executable that runs a java application that creates a javascript that calls a REST API that calls a ruby script....

      1. W.S.Gosset Silver badge

        Re: "there wasn't much pure hobby programming like that going"

        > machine language monitor

        All the 80s Macintoshes had one too.

      2. Michael Wojcik Silver badge

        Re: "there wasn't much pure hobby programming like that going"

        just there was no easy internet to publish them

        But if you had a modem, there were BBSes. I'm sure many here remember the glory days of BBSes, with their treasure troves of free software and hacking documents ("txtfiles") and forums.

        Even without modems we passed around a lot of stuff as listings or on cassette tape.

        I wouldn't claim the hobbyist scene was better in, say, the early '80s. The possibilities these days are incredible – just read a site like Hackaday to see what folks are getting up to in basements and garages. But there was plenty to keep us occupied even in the days when 8-bitters roamed Suburbia.

  5. Anonymous Coward
    Anonymous Coward

    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

    1. 42656e4d203239 Bronze badge

      Re: Dodgy link?

      Could be as simple as an expired, or self signed, https cert...

      Always favour cockup over conspiracy.

    2. Frank Bitterlich

      Re: Dodgy link?

      The site expired some time ago, but it was just a redirect to the GitHub site (https://github.com/tenderlove/analog-terminal-bell) anyway.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2022