Skip to main content
1 vote
2 answers
106 views

When using ARM assembly, I know I can use CNTP_CTL_EL0 to get information about the physical timer. (https://developer.arm.com/documentation/ddi0595/2021-09/AArch64-Registers/CNTP-CTL-EL0--Counter-...
Questionable's user avatar
1 vote
1 answer
70 views

Similar question: Assembly return address I want to write a function to print the return address of the current function. This is code that prints %ebp+4: void backtrace() { int ebp; asm ("movl %%...
BranchPredictor4000's user avatar
1 vote
0 answers
37 views

The code in question void _start() { const char msg[] = "Hello, World!\n"; long ret; __asm__ volatile ( "mov $1, %%rax\n" "mov $1, %%rdi\n" ...
user3786219's user avatar
6 votes
1 answer
217 views

The following code shows a bogus atomic increment on some counter: __asm__ volatile( "lock xaddl %0, %1" : "+r"(v), "+m"(*p) : : "...
pveentjer's user avatar
  • 11.7k
4 votes
1 answer
192 views

I am trying to write a C macro (not C preprocessor, but static inline with proper argument type checking) with inline ARM assembly that includes a compile-time constant parameter (to save instructions ...
personal_cloud's user avatar
2 votes
1 answer
71 views

I am porting the GetCurrentMicro function in the Arduino Core STM8 to my SDCC code and I noticed the Cosmic C Compiler _asm function allows me to return a result as well as an input in a C var. Is ...
Jonas's user avatar
  • 1,259
1 vote
1 answer
189 views

Can you somehow grab a value from a register and put it into a C variable in C with the asm keyword for arm64 macOS assembly? I have seen code from other stack overflows that have already answered ...
Jordon's user avatar
  • 103
1 vote
0 answers
92 views

So, this piece of C++ code: /* * Compile on 64-bit Linux or Solaris (I guess it will probably also work on * FreeBSD), like this: * g++ -o bin2dec bin2dec.cpp -std=c++11 #Don't put -O3 * here, as ...
FlatAssembler's user avatar
6 votes
2 answers
139 views

I have recently been learning how to program bare metal to write a kernal for the rpi4b. The last thing I needed to add was a way to have the main script only run on one core. The method I decided to ...
MsFormula's user avatar
  • 175
2 votes
1 answer
159 views

I'm following bare metal programming guide: https://github.com/cpq/bare-metal-programming-guide Clangd produces error "Non-ASM statement in naked function is not supported" in Helix editor ...
agrinevich's user avatar
1 vote
0 answers
94 views

I've made a small mod app for the game Elden Ring. With this mod, whenever the player loses health, I reduce their level by 1. Everything works so far. What I want to do now is make it happen when ...
Fran's user avatar
  • 19
2 votes
1 answer
265 views

This comes from a post about invoking a trivial buffer overflow (to jump to a function present in the source but not called explicitly in any place of the program (2333909/how-can-i-invoke-buffer-...
nostromo's user avatar
  • 465
8 votes
1 answer
229 views

I have a project that has to use GCC 14 which does not have #embed support. I attempted to simulate it as follows. namespace { namespace { extern "C" { extern std::...
Jeremy Richards's user avatar
1 vote
1 answer
208 views

The following code attempts to create a simple stackful coroutine. It allocates a stack frame in the heap space by setting the rsp register and then calling a function. Afterwards, it exits the ...
algae's user avatar
  • 151
-1 votes
1 answer
103 views

NOTE: This is decompiled ghidra code, the imageBase start at 0x00400000, so we are working with Program.exe+001a0d39 relative to image base. 005a0d39 01 87 94 ADD dword ptr [EDI + ...
Interity's user avatar

15 30 50 per page
1
2 3 4 5
151