Questions tagged [assembly]

For questions relating to assembly language, a low-level programming language that provides a human-readable representation of machine code instructions. It is specific to the architecture of a particular computer system and is considered a symbolic representation of the machine code.

Filter by
Sorted by
Tagged with
2 votes
0 answers

How is Rosetta 2 capable of translating x87 instructions (which are stack-based) to ARM machine code (where the FPU is register-based)?

Rosetta 2 is a program that enables the new ARM-based Macs to run programs for old x86-based Macs by translating x86 machine code to ARM machine code. But how does it do that? What seems especially ...
FlatAssembler's user avatar
-2 votes
1 answer

How to provide a sensible error message for `load (load s0, s1), s2` when parsing assembly? [closed]

Suppose somebody completely misunderstands how assembly language works and, instead of writing: load s1, s2 load s0, s1 He writes: ...
FlatAssembler's user avatar
1 vote
2 answers

Does x86 assembly support linguistic recursion? [closed]

In my book "Jezici za gimnazijalce" (not available online) and in my Bachelor thesis (which will be online in about a month) I was claiming that assembly languages are like the Piraha ...
FlatAssembler's user avatar
3 votes
1 answer

X86-64 Assembly for Recursive Functions

A compiler I'm writing generates the following x86-64 assembly (AT&T syntax) for a recursive factorial function. I convert the assembly into an ELF executable using ...
Veera Sivarajan's user avatar
3 votes
1 answer

How do I explain to a syntax highlighter to highlight `a` differently in `load s0, a` (where it is a hexadecimal constant) and `regbank a`? [duplicate]

In the syntax highlighter I have implemented in my PicoBlaze Simulator in JavaScript, the assembly code address 0 load s0, 0 load s0, a regbank a is highlighted as ...
FlatAssembler's user avatar
16 votes
2 answers

What are the advantages and disadvantages of the callee versus caller clearing the stack after a call?

This is more a question about compiler design than language design, but in low level languages, when a function is called, the parameters are pushed onto the stack, and when the function returns, the ...
CPlus's user avatar
  • 7,911
5 votes
3 answers

What are some different approaches for inline assembly, and what are their pros and cons?

In my programming language that compiles to WebAssembly, I am using the following syntax for inline assembly: ...
FlatAssembler's user avatar