I've lost the original reference, but Joe Marshall once wrote in comp.lang.lisp:<p>Here's an anecdote I heard once about Minsky. He was showing a student how to use ITS to write a program. ITS was an unusual operating system in that the 'shell' was the DDT debugger. You ran programs by loading them into memory and jumping to the entry point. But you can also just start writing assembly code directly into memory from the DDT prompt. Minsky started with the null program. Obviously, it needs an entry point, so he defined a label for that. He then told the debugger to jump to that label. This immediately raised an error of there being no code at the jump target. So he wrote a few lines of code and restarted the jump instruction. This time it succeeded and the first few instructions were executed. When the debugger again halted, he looked at the register contents and wrote a few more lines. Again proceeding from where he left off he watched the program run the few more instructions. He developed the entire program by 'debugging' the null program.
Those who enjoy Asmrepl might also enjoy "Cheap EMUlator: lightweight multi-architecture assembly playground" [0] it supports 32 and 64 bit variations of intel, arm, mips and sparc instruction sets and also provides a visual experience and supports many operating systems.<p>If you are on Windows and need something in a console, a nice colorful asm repl is available WinRepl [1] which is similar to " yrp604/rappel (Linux) and Tyilo/asm_repl".<p>[0] <a href="https://github.com/hugsy/cemu" rel="nofollow">https://github.com/hugsy/cemu</a><p>[1] <a href="https://github.com/zerosum0x0/WinREPL/" rel="nofollow">https://github.com/zerosum0x0/WinREPL/</a>
Somebody should wrap this into a VGA-As-A-Service platform so that kids could learn programming the correct way:<p><pre><code> mov ax, 13h
int 10h</code></pre>
Wow, this brings back memories of my final project for my "programming for Engineering students" course in the mid-80s.<p>I wrote a DOS TSR program (remember those?) which would pop up a window when you pressed a key sequence and present you with an ASM86 REPL.<p>You could selectively 'save' pieces of code, and then when you exited the window, it would paste the saved code as inline assembly code (a hex byte array surrounded by some Turbo Pascal syntax) into your keyboard buffer - the assumption being that you are running the Turbo Pascal IDE, of course.<p>The TSR itself was written in x86 assembly, which added a level of complexity. I would have given and arm and a leg to be able to do it in a high-level language like Ruby.
I fondly remember writing my first game using assembly that I hand typed from a magazine article on an Amiga. It didn't work because of a reversed peek/poke. It took us all day to figure it out, but we got it working!
Apple //e & ][+ had one built in. It was called the "monitor". You typed "CALL -151" and you started typing assembly code. You could run, save, dump memory and read registers. When I got my first 286 I was surprised I couldn't do the same thing.
Does anyone remember Ketman (1997)? A combination assembler interpreter & tutor for MSDOS. That was the first time I saw a REPL for assembly language.<p><a href="http://web.archive.org/web/20051211022146/http://www.btinternet.com/~btketman/index.html" rel="nofollow">http://web.archive.org/web/20051211022146/http://www.btinter...</a>
Cool!<p>This reminds me of a fun project I once did, writing an x86 assembler in Lotus 123, using lookup tables. On the odd occasion when it worked, it was immensely fulfilling.
This could be implemented with Jupyter notebooks as a Jupyter kernel or maybe with just fancy use of explicitly returned objects that support the (Ruby-like, implicit) IPython.display.display() magic.<p>IRuby is the Jupyter kernel for Rubylang:<p>iruby/display:
<a href="https://github.com/SciRuby/iruby/blob/master/lib/iruby/display.rb" rel="nofollow">https://github.com/SciRuby/iruby/blob/master/lib/iruby/displ...</a><p>iruby/formatter:
<a href="https://github.com/SciRuby/iruby/blob/master/lib/iruby/formatter.rb" rel="nofollow">https://github.com/SciRuby/iruby/blob/master/lib/iruby/forma...</a><p>More links to how Jupyter kernels and implicit display() and DAP: Debug Adapter Protocol work: "Evcxr: A Rust REPL and Jupyter Kernel" <a href="https://news.ycombinator.com/item?id=25923123" rel="nofollow">https://news.ycombinator.com/item?id=25923123</a><p>"ENH: Mixed Python/C debugging (GDB,)" <a href="https://github.com/jupyterlab/debugger/issues/284" rel="nofollow">https://github.com/jupyterlab/debugger/issues/284</a><p>... "Ask HN: How did you learn x86-64 assembly?" <a href="https://news.ycombinator.com/item?id=23930335" rel="nofollow">https://news.ycombinator.com/item?id=23930335</a>
Its better to use GCC intrinsic api <a href="https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/x86-Built-in-Functions.html#x86-Built-in-Functions" rel="nofollow">https://gcc.gnu.org/onlinedocs/gcc-5.3.0/gcc/x86-Built-in-Fu...</a><p>It really tough to write x86 assembly.