TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Asmrepl: REPL for x86 Assembly Language

230 pointsby tekkertjeover 3 years ago

15 comments

rudolfwinestockover 3 years ago
I&#x27;ve lost the original reference, but Joe Marshall once wrote in comp.lang.lisp:<p>Here&#x27;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 &#x27;shell&#x27; 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 &#x27;debugging&#x27; the null program.
评论 #29387515 未加载
评论 #29387423 未加载
评论 #29388458 未加载
评论 #29390911 未加载
评论 #29389633 未加载
molticrystalover 3 years ago
Those who enjoy Asmrepl might also enjoy &quot;Cheap EMUlator: lightweight multi-architecture assembly playground&quot; [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 &quot; yrp604&#x2F;rappel (Linux) and Tyilo&#x2F;asm_repl&quot;.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;hugsy&#x2F;cemu" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hugsy&#x2F;cemu</a><p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;zerosum0x0&#x2F;WinREPL&#x2F;" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;zerosum0x0&#x2F;WinREPL&#x2F;</a>
pavlovover 3 years ago
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>
评论 #29385716 未加载
评论 #29385698 未加载
评论 #29386747 未加载
评论 #29386518 未加载
评论 #29386236 未加载
deepspaceover 3 years ago
Wow, this brings back memories of my final project for my &quot;programming for Engineering students&quot; 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 &#x27;save&#x27; 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.
评论 #29390899 未加载
webdoodleover 3 years ago
I fondly remember writing my first game using assembly that I hand typed from a magazine article on an Amiga. It didn&#x27;t work because of a reversed peek&#x2F;poke. It took us all day to figure it out, but we got it working!
SavantIdiotover 3 years ago
Apple &#x2F;&#x2F;e &amp; ][+ had one built in. It was called the &quot;monitor&quot;. You typed &quot;CALL -151&quot; 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&#x27;t do the same thing.
评论 #29390121 未加载
评论 #29388289 未加载
评论 #29390908 未加载
评论 #29389210 未加载
评论 #29387782 未加载
foucover 3 years ago
Does anyone remember Ketman (1997)? A combination assembler interpreter &amp; tutor for MSDOS. That was the first time I saw a REPL for assembly language.<p><a href="http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20051211022146&#x2F;http:&#x2F;&#x2F;www.btinternet.com&#x2F;~btketman&#x2F;index.html" rel="nofollow">http:&#x2F;&#x2F;web.archive.org&#x2F;web&#x2F;20051211022146&#x2F;http:&#x2F;&#x2F;www.btinter...</a>
nielsbotover 3 years ago
Not snark, but a serious question: What would one use this for?
评论 #29386403 未加载
评论 #29385891 未加载
评论 #29385900 未加载
评论 #29385852 未加载
评论 #29386025 未加载
评论 #29386418 未加载
kitdover 3 years ago
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.
westurnerover 3 years ago
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&#x2F;display: <a href="https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;iruby&#x2F;blob&#x2F;master&#x2F;lib&#x2F;iruby&#x2F;display.rb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;iruby&#x2F;blob&#x2F;master&#x2F;lib&#x2F;iruby&#x2F;displ...</a><p>iruby&#x2F;formatter: <a href="https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;iruby&#x2F;blob&#x2F;master&#x2F;lib&#x2F;iruby&#x2F;formatter.rb" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;SciRuby&#x2F;iruby&#x2F;blob&#x2F;master&#x2F;lib&#x2F;iruby&#x2F;forma...</a><p>More links to how Jupyter kernels and implicit display() and DAP: Debug Adapter Protocol work: &quot;Evcxr: A Rust REPL and Jupyter Kernel&quot; <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25923123" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=25923123</a><p>&quot;ENH: Mixed Python&#x2F;C debugging (GDB,)&quot; <a href="https:&#x2F;&#x2F;github.com&#x2F;jupyterlab&#x2F;debugger&#x2F;issues&#x2F;284" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jupyterlab&#x2F;debugger&#x2F;issues&#x2F;284</a><p>... &quot;Ask HN: How did you learn x86-64 assembly?&quot; <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23930335" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=23930335</a>
master_yoda_1over 3 years ago
Its better to use GCC intrinsic api <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;gcc-5.3.0&#x2F;gcc&#x2F;x86-Built-in-Functions.html#x86-Built-in-Functions" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;onlinedocs&#x2F;gcc-5.3.0&#x2F;gcc&#x2F;x86-Built-in-Fu...</a><p>It really tough to write x86 assembly.
评论 #29388238 未加载
评论 #29388407 未加载
asimjalisover 3 years ago
Neat. This could be embedded into a Lisp&#x2F;Clojure syntax.
评论 #29386643 未加载
praveen9920over 3 years ago
I wonder if something like this for wasm. Would be interesting to see something like this in browser
评论 #29387647 未加载
jonny_ehover 3 years ago
Is this emulating x86? Can I run it on an M1?
评论 #29385874 未加载
emersonrsantosover 3 years ago
It&#x27;s a modern DOS debug.com