Skip to main content
Filter by
Sorted by
Tagged with
Advice
1 vote
7 replies
175 views

I just learnt that you can implement C (or any compiled language) functions in asm. Maybe to optimize them or to access CPU functionality that is not accessible otherways. I know some MIPS asm from ...
Irra's user avatar
  • 1
17 votes
3 answers
1k views

I'm reading a GNU as introductory book for programs running on top of an OS. I'm at the stack memory part and I was curious how the stack looks like in a freestanding environment. I'm guessing that ...
mltm's user avatar
  • 595
1 vote
0 answers
58 views

Given the example of a simple program for GNU assembler on i386 architecture in Linux: .section .data msg: .ascii "Hi, People!\n" len = . - msg .section .text .global _start _start: # ...
Rodion Gorkovenko's user avatar
0 votes
1 answer
83 views

When developing a Rust no_std bootloader for my micro:bit v2.21 (Cortex-M4, nRF52833), I have encountered a weird error. The bootloader jumps to the main application using cortex_m::asm::bootstrap(sp, ...
Pavel Lobodinský's user avatar
1 vote
0 answers
107 views

I'm trying to learn more about memory and trying to dissect a stack frame. For reference here is the source code that I'm running through gdb. #include <stdio.h> void test_function(int a, int b,...
0xChris's user avatar
  • 21
-1 votes
1 answer
157 views

How can I address elements on the stack that are not on top of it? I am talking about for instance first executing stmfd sp!, {r0-r12} and then push {lr}. Now I want to work with the first address of ...
user avatar
2 votes
1 answer
145 views

I'm writing a mini OS for my STM32F0 board, which has a Cortex-M0 CPU based on the ARMv6-M architecture. In particular, I'm doing the msp/psp switch after I've created the process queue for the ...
France's user avatar
  • 21
3 votes
1 answer
121 views

I have been attempting to read through the ARM manual to gain an understanding of how ARM works architecturally. I know that there is a system register for SP at each EL, like SP_EL0, SP_EL1, etc. I ...
nexos's user avatar
  • 98
1 vote
1 answer
120 views

I was following a tutorial on operating system development, and as a bit of a fanatic, I came across a line in the code that caught my attention: bits 16 section _ENTRY CLASS=CODE extern _cstart_ ...
Novice's user avatar
  • 55
0 votes
4 answers
1k views

I have recently become interested in linker scripts and assembly coding for MCUs. I just discovered that the first thing we do in the reset_handler is set the stack pointer register (sp). My question ...
Rynxie's user avatar
  • 69
0 votes
1 answer
60 views

I feel confused about the bytes the stack pointer changes when callq or retq is invoked? Here’s a little example ; Disassembly of leaf (long y) y in %rdi 0000000000400540 <leaf>: 400540: 48 8d ...
jeno jeff's user avatar
0 votes
1 answer
233 views

I am using https://www.qemu.org/docs/master/system/riscv/virt.html to compile some code that prints 'U' out the uart. My question is about stack initialization. I am assuming I can do this various ...
odnal's user avatar
  • 23
22 votes
2 answers
2k views

I'm trying to write an x86 bootloader and operating system completely in Rust (no separate assembly files, only inline assembly within Rust). My bootloader works completely as intended within the QEMU ...
suman's user avatar
  • 325
1 vote
1 answer
183 views

I'm trying to implement a poor man's call with current continuation for a program written in C. I can "easily" access and memcpy the relevant part of the C stack (obviously, that's not ...
Stefan's user avatar
  • 28.9k
2 votes
2 answers
157 views

I realized I never really thought of this. If I made a large enough recursive call chain, wouldn't the stack eventually grow down enough that it will overlap with other things, like shared libraries (...
natitati's user avatar
  • 167

15 30 50 per page
1
2 3 4 5
13