Skip to main content

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
139 views

What are some options to test ARM assembly that some compiler outputs under Windows? QEMU is not an option, right?

So, I've designed a programming language called AEC and I've made an AEC-to-x86 compiler and an AEC-to-WebAssembly compiler. I am thinking about developing an AEC-to-ARM compiler. A little problem is: ...
FlatAssembler's user avatar
1 vote
0 answers
102 views

How do the assemblers for processors which have "near jump" and "far jump" instructions of different length calculate the addresses of the labels? [duplicate]

How do preprocessors of the assemblers for processors which have "near jump" and "far jump" instructions of different length (like x86) calculate the addresses of the labels? Isn't ...
FlatAssembler's user avatar
5 votes
1 answer
302 views

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
212 views

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
1k views

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
412 views

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
154 views

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
2k views

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
  • 9,143
5 votes
3 answers
665 views

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