1,831 questions
Advice
0
votes
12
replies
286
views
Can you use the this keyword outside of the non static function member?
Recently I came across this keyword use in class and struct to get the pointer type of the object:
#include <iostream>
struct sample {
void function() {
std::cout << "...
Score of 0
0 answers
289 views
Mirror kernel virtual addresses in a user-space simulator
I am developing a user-space simulator that is intended to produce execution traces identical to those generated when the program runs inside the kernel.
The program operates within a small sandboxed ...
Score of 3
1 answer
238 views
Taking address of a temporary is allowed if the function's result is consumed [duplicate]
I work in Visual Studio, and observe that a function taking a const pointer can be called with a pointer on temporary conditionally depending on the usage of function's result.
The minimal example ...
Score of 0
1 answer
98 views
HarfBuzz + FreeType on bare-metal: GSUB shaping causes hard fault
I’m trying to use HarfBuzz 8.3.0 with FreeType 2.13.2 and lvgl on NXP i.MX RT1064 with bare-metal and I'm encountering hard faults during Indic (GSUB) shaping [which you can see in the image]. I ...
Score of 1
2 answers
219 views
Call Stack - What is stored in the call stack between the declaration of a caller function's last variable and a callee function's first variable?
I am using an Ubuntu 16.04 a 32-bit Virtual Machine OS.
I executed
sysctl -w kernel.randomize_va_space=0
to disable ASLR in root prior to gcc.
I have also compiled this using the command:
gcc -g -fno-...
Score of 3
4 answers
343 views
What is the difference between a value and a memory address in x86_64 AT&T assembly language?
Novice here, with a frustratingly simple question. I'm trying to learn assembly and this has been a stumbling block for me for so long, I would really appreciate help with these concepts. Thanks so ...
Score of -2
1 answer
154 views
Translating flags into memory addresses ram map pokemon [closed]
I'm trying to understand how to get memory addresses from the page https://datacrystal.tcrf.net/wiki/Pok%C3%A9mon_Gold_and_Silver/Flags in order to put them in my pyboy project.
For instance I want to ...
Score of 2
2 answers
165 views
Justification of storing metadata in 2 least significant bits of address
I read this code that seems to use lower 2 bits of addresses to store binary flag, see below (obfuscated due to sensitivity):
void *setFlag4Addr( void *addr, BOOLEAN flag )
{
// long for 32-bit ...
Score of 2
2 answers
135 views
Disparity in errors on passing const-argument value to a non-const parameter of a function in C++
I was trying to understand the use of 'const' keyword with pointers from the source: GeeksforGeeks.
It is mentioned that "Passing const argument value to a non-const parameter of a function isn't ...
Score of 2
1 answer
114 views
how does the cpu find static/global objects on x86?
I know the stack pointer can be used to find stack allocated objects, but how does the cpu find global/static objects? From what I could tell from the disassembly, it uses absolute/immediate ...
Score of 0
2 answers
110 views
Calculating storage space between two memory addresses
If a byte addressable RAM occupies the hexadecimal addresses AOOO to BFFF, then how many KB of storage space is available?
I understand A000 and BFFF to be 16 bit numbers (2 bytes). So each address ...
Score of 1
0 answers
89 views
I can not read the FIFO of Semtech SX1231
#include <stdint.h>
#include <stdbool.h>
#include <reg_mg82f6d64.h>
#define RegFifo 0x00
#define RegIrqFlags1 0x27
#define RegIrqFlags2 0x28
void wrb(uint8_t dat);
...
Score of -6
1 answer
171 views
C++ pointer dynamically allocation address concern [closed]
Im new to C++, so Im learning, but im having some doubts with pointers and memory addresses, I'm practicing with some exercices and got stuck with something that i haven't been able to get, I have ...
Score of 4
1 answer
262 views
Understanding the behavior of $ Location Counter - var1 DWORD $ assembles to start of data section in MASM, not start of line
Program Code - 1
.386
.model flat
.data
Array1 DWORD 1,2,3,4,5
var1 DWORD $
.code
start PROC
MOV EAX, OFFSET Array1
MOV EBX, var1
LEAVE
RET
start ENDP
END
Program Code - 1 ...
Score of 2
1 answer
107 views
Indirect addressing on P16F877
Suppose I have two numbers, n1 and n2, one in bank 0 and the other in bank 2. I want to do a sum operation on them using the indirect addressing approach.
Here is the code from my lecture, which is ...