cpu-registers

Do general purpose registers are generally memory mapped?

让人想犯罪 __ 提交于 2020-12-13 18:41:28
问题 I am very confused with Memory Map and Memory mapped I/O. Do general purpose registers for example in ARM Architecture r0, r1, and etc are generally memory mapped? Please help. 回答1: No, those registers are inside the actual CPU (or CPU core for multi-core CPUs). You can not access them through memory. A memory-mapped register is something which you access through an address or a pointer (in languages that has pointers). I/O devices often have memory-mapped registers, where you write to or

what's the purpose of using media registers that can hold 32 bytes [duplicate]

三世轮回 提交于 2020-12-13 04:55:33
问题 This question already has answers here : What is the difference between non-packed and packed instruction in the context of SIMD-operations? (2 answers) What is the benefit of SIMD on a superscalar out-of-order CPU? (1 answer) What are some rules of thumb for when SIMD would be faster? (SSE2, AVX) [closed] (1 answer) Why floating point registers are different than general purpose ones (1 answer) Is there any architecture that uses the same register space for scalar integer and floating point

Proper implementation of Timer1 for PWM generation

我的梦境 提交于 2020-12-06 12:22:35
问题 On the Atmel ATmega328P (datasheet), there are three timers available for PWM generation (timer0, timer1, and timer2). I already have what I need using the 8-bit timer2, I am just concerned with using different timer instad of timer2, because timer2 is used in various libraries, and I'd like to have more granularity. Thus I'd like to use the 16-bit timer1. Here is what I am using to generate a 25 kHz, variable duty cycle using timer2. For this example, lets consider a 35% duty cycle: void

Does it matter which registers you use when writing assembly?

守給你的承諾、 提交于 2020-12-03 07:27:10
问题 If you're writing assembly, does it matter which registers you allocate values to? Say, you store an accumulated/intermediate value in %ebx instead of %eax, which was traditionally used for that purpose. Is that bad practice? Will it affect performance? In other words, can you treat them equally as storage space, or should you stick to using them for specific purposes? 回答1: First and foremost, you have to use registers that support the instructions you want to use. Many instructions on x86

GDB info registers command - Second column of output

只谈情不闲聊 提交于 2020-12-01 09:44:16
问题 Upon running info registers in gdb, we get an output similar to the following: rax 0x1c 28 rbx 0x0 0 rcx 0x400a60 4196960 rdx 0x7fffffffde88 140737488346760 rsi 0x1 1 rdi 0x400932 4196658 rbp 0x0 0x0 rsp 0x7fffffffde68 0x7fffffffde68 r8 0x400ad0 4197072 r9 0x7ffff7dea560 140737351951712 r10 0x7fffffffdc30 140737488346160 r11 0x7ffff7732dd0 140737344908752 r12 0x4007f0 4196336 r13 0x7fffffffde80 140737488346752 r14 0x0 0 r15 0x0 0 rip 0x7ffff7732dd0 0x7ffff7732dd0 eflags 0x202 [ IF ] cs 0x33

GDB info registers command - Second column of output

[亡魂溺海] 提交于 2020-12-01 09:44:03
问题 Upon running info registers in gdb, we get an output similar to the following: rax 0x1c 28 rbx 0x0 0 rcx 0x400a60 4196960 rdx 0x7fffffffde88 140737488346760 rsi 0x1 1 rdi 0x400932 4196658 rbp 0x0 0x0 rsp 0x7fffffffde68 0x7fffffffde68 r8 0x400ad0 4197072 r9 0x7ffff7dea560 140737351951712 r10 0x7fffffffdc30 140737488346160 r11 0x7ffff7732dd0 140737344908752 r12 0x4007f0 4196336 r13 0x7fffffffde80 140737488346752 r14 0x0 0 r15 0x0 0 rip 0x7ffff7732dd0 0x7ffff7732dd0 eflags 0x202 [ IF ] cs 0x33

What's the best way to remember the x86-64 System V arg register order?

一世执手 提交于 2020-11-25 03:41:39
问题 I often forget the registers that I need to use for each argument in a syscall, and everytime I forget I just visit this question. The right order for integer/pointer args to x86_64 user-space function calls is: %rdi , %rsi , %rdx , %rcx , %r8 and %r9 . (with variadic functions taking AL = the number of FP args, up to 8) Or for system calls, %rax (syscall call number), and same args except %r10 instead of %rcx . What's the best way to remember these registers instead of google this question