1,089 questions
Advice
0
votes
0
replies
64
views
Why can't Linux compile with x86_64-none-elf toolchains?
I'm primarily use the bare-metal GNU toolchains for my projects. Have no issues with them, both GCC and the GNU assembler. But I'm wondering why Linux can't compile with it.
Get these assembler errors ...
Advice
0
votes
8
replies
221
views
Why does `tcc` compile local variables onto the stack?
I have the following C code (an MWE):
#include<time.h>
void fun() {
asm("arg1:");
struct timespec const a = { .tv_sec = 10, .tv_nsec = 0 };
asm("call_nanosleep:");
...
2
votes
1
answer
106
views
Assembly code fail when I add a jump before rept
I have the following assembled but when ever I uncomment the jmp or je it fail with 11: Error: bad or irreducible absolute expression
_start:
mov $0x0e, %ah
mov $'a', %al
_loop:
int $...
1
vote
0
answers
128
views
How to compare a register and the effective address of a variable in GAS with intel_syntax
I am following an assembly tutorial where they use NASM. They manage to compare a register to a variable's address with cmp rcx, digitSpace, but how can I do the same with GAS?
As you know this ...
3
votes
1
answer
100
views
Can I somehow tell GAS to change direction of operands?
I have the binary image of a bootloader which was written with some ancient assembler.
I want to port the assembly code to GNU assembler (GAS). We speak about the X86/16-bit
(real mode) world.
This ...
-2
votes
1
answer
182
views
Local variable in .c file overwrites memory address previously aquired in ARM GNU assembly file [duplicate]
I have implemented a basic FIFO data structure with its related functions/subroutines in a FIFO.s file and want to use them in the main function inside a main.c file;
// FIFO.s
.syntax unified
.cpu ...
2
votes
2
answers
178
views
Trying to build golang package ending up with GCC compilation segfault on as --gdwarf-5
After some package upgrade on my Ubuntu 24.04 I stumbled upon inability to build/install/work with almost any of golang packages.
So, I'm trying to install staticcheck and get the following error:
$ ...
1
vote
0
answers
51
views
Is it possible to reuse label names in ARM GNU Assembly? [duplicate]
I want to use the same label name in different parts of my Assembly code instead of using a new, never-before-used label name; Is such a thing possible?
For example:
.
.
.
Factorial: // A subroutine ...
4
votes
1
answer
125
views
Is it possible to undo the effect of the .req directive in ARM GNU Assembly?
I want to rename (more like add an alias to) one or more registers for a specific part of my Assembly code using the .req directive and later on undo the renaming of said register(s) so that those ...
1
vote
0
answers
46
views
gnu assembler x64, how to push big unsigned value [duplicate]
I have
pushl $2147487744
this is 0x80001000 gnu as gives
mycc_cpp.s:27: Error: invalid instruction suffix for `push'
I have tried
pushq
pushing hex
no luck
1
vote
1
answer
84
views
GAS creates a PLT relocation entry for call to an extern symbol?
I assembled the following file with GAS, the GNU assembler:
.extern foo
.global bar
.section .text
bar:
call foo
ret
In the object file it produced there is a relocation entry of type ...
1
vote
0
answers
103
views
Debugging GDT in assembly/D lang
I've been dabbling with writing a small OS in D lang but I'm crashing on boot. I've been debugging my main file and think that the issue is with gdt_flush which is called in gdt.d and defined in gdt.s....
3
votes
0
answers
90
views
Can the GNU Assembler perform all macro expansions in a file and then output compilable code without macros?
Is there a way to have the GNU assembly process a source file that contains macros, expand them, and then output the expanded equivalent code in a form that could be assembled by as? Basically, I'm ...
4
votes
1
answer
122
views
GNU as recursive/loop macro expected output
In this assembly file below, the macro jump_table should automagically create ... a jump table to consecutively numbered labels like jump_0, jump_1, ... jump_<n>.
It seems there is no loop ...
1
vote
1
answer
130
views
What does this mean: .size _start, . - _start in assembler?
What do the symbols mean in this assembly language statement:
.size _start, . - _start
I've searched and found quite a few identical examples and several variations but none explain what the ...