Issue I’m debugging an app and need to see the memory region pointed to by a value stored in rcx. Normally, for code, this would be done by selecting the variable (pointer) and adding a quick watch along with the
Continue readingTag: cpu-registers
[SOLVED] Using setjmp and longjmp with a local jmp_buf
Issue In the case that a local jmp_buf is actually represented by registers rather than stack memory, is it possible for setjmp or longjmp to cause the contents of the local jmp_buf to be indeterminate when setjmp returns from a
Continue reading[SOLVED] What is the default register state when program launches (asm, linux)?
Issue When the program launches (Linux ELF executable), are there zeros in eax, ebx, etc. or can there be anything? (I’m not doing any calls or using extern libraries). On my machine the registers are zeroed, but can I rely
Continue reading[SOLVED] C – Read and set assembler registers
Issue I need to be able to access assembly registers from my C code. I there a easy way to set the value of a register to the value of a variable and get the value of a register as
Continue reading[SOLVED] unsupported instruction 'mov' in inline asm moving control register to uint32_t
Issue I am using an assembly code in a C function. But gcc gives unsupported instruction ‘mov’ error for the following code: uint32_t faulting_address; asm volatile(“mov %%cr2, %0” : “=r” (faulting_address)); I don’t understand what is wrong with this. Solution
Continue reading[SOLVED] Multiple Threads Accessing Same Register Value ARM Assembly
Issue I’m working with some ARM code experimenting with multiple threads which need to access the same register. I’m using C with asm calls. However, I keep running into a bus error. Here’s an example of what I mean: #include
Continue reading[SOLVED] Why do we bother with CPU registers in assembly, instead of just working directly with memory?
Issue I have a basic question about assembly. Why do we bother doing arithmetic operations only on registers if they can work on memory as well? For example both of the following cause (essentially) the same value to be calculated
Continue reading[SOLVED] Why do we bother with CPU registers in assembly, instead of just working directly with memory?
Issue I have a basic question about assembly. Why do we bother doing arithmetic operations only on registers if they can work on memory as well? For example both of the following cause (essentially) the same value to be calculated
Continue reading[SOLVED] Print array in Asembly x86
Issue I have elements loaded in stack and I need to move them to array. My code looks like this: %include "asm_io.inc" segment .data array db 100 dup(0) length db 0 segment .text global _asm_main extern getchar _asm_main: enter 0,
Continue reading[SOLVED] Did the low register and high register swap places?
Issue IDEAL MODEL small STACK 100h jumps p186 DATASEG array dw 312, 340, 311, 300 CODESEG proc example pusha mov al ,4 ;number of elements in array mov bl, 0 ;index label1: mov cx, [array + bx] ;here, every second
Continue reading