Urgent.News

What's breaking now, across thousands of outlets.

Tech

What I Learned Writing Assembly After Only Knowing Java and JavaScript

Before this semester, the lowest-level language I'd written was Java, with some JavaScript on top. Then my computer architecture course threw RISC-V assembly at me, and it completely changed how I think about what's actually happening when my code runs. Here's what stood out to me. No more "just call a function" In Java or JavaScript, you write something like: function add ( a , b ) { return a +…

Having only prior knowledge of Java and JavaScript, I embarked on learning RISC-V assembly, a stark contrast to my previous experience. This shift in perspective profoundly altered my understanding of how code operates under the hood. No longer could I rely on the convenience of high-level functions; assembly programming demanded a hands-on approach with registers and explicit instructions.

Rather than calling a function like add(2, 3), assembly required manually loading values into registers and performing operations. This direct manipulation of registers, the small storage slots within the CPU, forced me to think about where each value lived and required constant awareness of memory management. Variables, once seamless in JavaScript, became tangible entities in assembly, constantly shifting between registers and memory.

This experience offered me a newfound respect for the automated processes of high-level languages. I recognized that functions, control flows, and even loops were far more complex operations than I had previously considered. The performance implications of function calls became crystal clear, as each call required saving values, setting up arguments, and managing the return path—a price that was usually invisible in JavaScript and Java.

The absence of traditional control structures like if/else statements in assembly highlighted the intricate nature of branching. Writing equivalent logic demanded numerous branch instructions and labels, transforming what felt miraculous in JavaScript into a laborious process. This direct insight into the low-level mechanics of programming enriched my comprehension of high-level languages and their underlying mechanisms.

Though assembly proved a demanding and less forgiving language, it undeniably demystified the "magic" of high-level programming. As a final-year software engineering student, I wholeheartedly recommend such a challenging endeavor to anyone seeking to deepen their understanding of code execution. This experience transformed my approach to web development, instilling a profound appreciation for the foundational work performed by languages like Java and JavaScript.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Portable Agent Governance at Solo-Developer Scale: A Four-Domain Case Study

Portable Agent Governance at Solo-Developer Scale: A Four-Domain Case Study Summary This is about a file-based execution protocol, maintained by hand across four independent, real production projects (a crypto trading system, an e-commerce web app, an AI decision system, and an agent infrastructure layer).

More from Sunday 2 August →