TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

A C++ Developer Learns Assembly

51 点作者 rjinman8 个月前

6 条评论

pjc508 个月前
&gt; There weren&#x27;t really any new concepts to grasp, it was just extremely fiddly<p>&gt; The need to keep things simple tempered any urge I might&#x27;ve had to generalise prematurely with needless abstraction<p>Probably the defining characteristics of assembly. Not only does it not provide abstractions, it doesn&#x27;t provide any metaprogramming tools (other than simple text macros) to help you build any either.<p>For a long time I&#x27;ve had in my ideas folder the phrase &quot;typesafe macro assembler?&quot; The idea would be to build the language people sometimes think C is but isn&#x27;t: it would provide some sort of record type (struct), register allocation, checking to see if you&#x27;ve assigned one thing to a storage location of a different type, and little else. Possibly a means to define a calling convention for caller-saved vs callee-saved registers; possibly some basic structured programming block tools to de-sphagetti your code. Crucially, it would emit exactly the operations you specify (including weirder mnemonic instructions and highly platform specific ones) in the order you specify them.
评论 #41733461 未加载
tuckerpo8 个月前
I did roughly the same thing many moons ago as the final &quot;exam&quot; for my undergraduate embedded systems course. We made Space Invaders, though :^) <a href="https:&#x2F;&#x2F;github.com&#x2F;tuckerpo&#x2F;MicroSpaceInvaders">https:&#x2F;&#x2F;github.com&#x2F;tuckerpo&#x2F;MicroSpaceInvaders</a><p>We targetted a real SoC, though, so a lot of my implementation can be thought of as a &quot;board support package&quot; or HAL, twiddling LEDs, taking in input, TTY in&#x2F;out, i2c, timers, IRQ&#x2F;FIQ handlers, etc...<p>Assembly programming in general is more or less just getting a feel for any given ISA&#x27;s most important instructions, mnemonics ordering and data&#x2F;code separation. The rest is a walk in the park if you&#x27;re comfortable with boring old procedural programming.
ykonstant8 个月前
Finally, someone who uses a sane build system! :D
Irus_248 个月前
Thanks for sharing your experience learning assembly. I&#x27;m curious about the resources you used in your learning journey. Could you share some of the books name, tutorials, or other materials you found particularly helpful?
rep_lodsb8 个月前
non-JS URL: <a href="https:&#x2F;&#x2F;content.deadbeef.io&#x2F;pages&#x2F;a_cpp_developer_learns_assembly.html" rel="nofollow">https:&#x2F;&#x2F;content.deadbeef.io&#x2F;pages&#x2F;a_cpp_developer_learns_ass...</a><p>Sadly it doesn&#x27;t work on my system: the display is drawn at the start (sometimes partially), and then only ever updates when switching between virtual consoles.<p>Tried adding O_SYNC to the open flags for the framebuffer, and it didn&#x27;t help. It&#x27;s writing to the device 60 times per second, just won&#x27;t show for some reason.
评论 #41729760 未加载
snvzz8 个月前
<a href="https:&#x2F;&#x2F;archive.is&#x2F;d5tUv" rel="nofollow">https:&#x2F;&#x2F;archive.is&#x2F;d5tUv</a>