Skip to main content
Filter by
Sorted by
Tagged with
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
  • 605
0 votes
1 answer
74 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 votes
1 answer
106 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
3 votes
1 answer
90 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
0 votes
4 answers
898 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
185 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
1 vote
1 answer
146 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.8k
1 vote
1 answer
614 views

I am trying to understand the ARM cortex-M hardware behavior on reset; particularly how the SP and PC values are written upon a cold start or hard reset. Basically, it would seem the hardware (aka PE ...
NeedToKnow's user avatar
2 votes
1 answer
171 views

In STM32L432KC(arm cortex-m4+FPU) there are two ram memory blocks. Following is a snippet from the linker script I use. _e_ram2_stack = ORIGIN(RAM2) + LENGTH(RAM2); _e_ram_stack = ORIGIN(RAM ) + ...
zenprogrammer's user avatar
0 votes
1 answer
305 views

It is possible to achieve this in a cortex-m4? What i mean is having PSP only on that intervals, and all the rest MSP when there is an interrupt? The objective is just to do the stacking and ...
AB3's user avatar
  • 3
1 vote
1 answer
250 views

I am currently trying to write startup code in assembly for an STM8 without any vendor libraries. More specifically, I am using an STM8S103f3p6. I am still inexperienced in assembly and with startup ...
Alex's user avatar
  • 69
0 votes
1 answer
107 views

Learning some reverse engineering and I came across some examples of loops in x86 assembly 00401036 mov [ebp+var_4], 0 0040103D mov [ebp+var_8], 0 00401044 loc_401044: 00401044 ...
Kenneth Cox's user avatar
2 votes
0 answers
209 views

I am doing an energy profile of an ARM processor for an academic project. I managed to measure the power consumption of several assembly instructions by running them in a ~200 insts loop, e.g.: .rept ...
Alessandro Bertulli's user avatar
1 vote
1 answer
145 views

I'm currently having trouble writing this recursive factorial assembly code in MIPS. I do not want to change the format of this code, as it is for a project, but I want to understand how to store or ...
kaili's user avatar
  • 13
1 vote
2 answers
412 views

As a more specific question for assembly - Why make ISA be aware of the existence of "stack" concept? - Stack Overflow and suggested by @xiver77, what is the benefit of having a dedicated ...
tristone's user avatar
  • 125
0 votes
1 answer
291 views

To learn multithreading, I use code given by the teacher, that works for my classmates, but not for me. The error happens here: void fonction2(){ int compteur1 = 1; while(1){ ...
Amaury Lorin's user avatar
3 votes
1 answer
329 views

im learning x86 assembly, using the code below for testing, i see in gdb console that the rsp register which points at the top of the stack starts at 0x7FFFFFFFDFD0, if i understand correctly, in the ...
Isaí's user avatar
  • 49
1 vote
1 answer
692 views

why stack pointer is initialized to the maximum value? I only knows that It is the tiny register which stores the last program request’s address in a stack. It is the particular kind of buffer that ...
anonymouser's user avatar
0 votes
1 answer
108 views

I'm using TI Code Composer Studio for the MSP430F1232. Starting from a template in assembler, a call to a routine doesn't work but when I put the routine directly in the code,it works. Why does the ...
user avatar
0 votes
1 answer
965 views

Considering the 8051 micro controller RAM organization, I would like to set my stack pointer to address 30h. I would like to know if I have to do it only once in the beginning of my program, or is it ...
OcR19's user avatar
  • 23
3 votes
1 answer
1k views

What is the initial value of SS, SP, BP? Are they null (0x0) or for example does SP immediately set to 0xFFFE? When we write an assembly code without using pop and push statements does stack pointer ...
Huseyin Aydin's user avatar
1 vote
0 answers
53 views

still me. I am following the sample code given in a book but I got a segmentation fault error when linking extern asm file with cpp file Could someone tell me what the issue is: global _integer_add ; ...
not_here_to_play's user avatar
1 vote
1 answer
461 views

I am inspecting a process (which has no bugs actually) with gdb. However I noticed, when doing info registers, that RSP is higher than RBP, which is not consistent with the fact that the stack grows ...
Aaa Bbb's user avatar
  • 667
-2 votes
1 answer
781 views

Under Visual Studio masm: mov ecx,270 l1: pop eax loop l1 push eax The point of this code is to find out if there is and what is the initial value of ESP. I try to pop immediately after ...
Zackham's user avatar
  • 45
0 votes
0 answers
2k views

It seems that, while a 32-bit program can push/pop either 2 or 4 bytes to the stack, a 64-bit program has no choice but to push/pop 8 bytes at a time. Is there really no way to push/pop a 4-byte value ...
user1636349's user avatar