assembly Questions
1
Solved
If we look at a few modern calling conventions, like x86-64 SysV style or AArch64 style (document aapcs64.pdf titled "Procedure Call Standard for the Arm® 64-bit Architecture"), we see ex...
Stentorian asked 23/10 at 10:57
2
I'm trying to read CP15 coprocessor in the following System-on-chip
Cortex A7 - ARMv7-A
Below my snippet
void main (void)
{
unsigned int reg_value = 0;
asm volatile("mrc p15, 0, %0, c0, c0, 0"...
1
Solved
I recently tried to read assemblies of the binary of my code and found that a lot of floating-point operations are done using XMM registers and SSE instructions. For example, the following code:
fl...
Deposit asked 11/9 at 11:52
2
Solved
I'm studying x86-64 NASM and here is current situation:
These codes are for education only, not for running on client-facing system or so.
RCX holds loop count, between 1 and 1000.
At the beginnin...
Improbability asked 8/9 at 15:50
1
Solved
I compared the performance of 3x3 and 4x4 matrix multiplication using Eigen with the -O3 optimization flag, and surprisingly, I found that the 4x4 case is more than twice as fast as the 3x3 case! T...
Tamberg asked 26/8 at 16:23
3
Solved
I find that in RISC-V, ra is caller saved, in MIPS, ra is callee, which means in RISC-V callee can directly change the value in ra without save, but since ra has changed, how callee return back to ...
Breakneck asked 11/1, 2020 at 9:52
3
Solved
I am trying to understand the MARIE assembly language. I don't quite understand skipcond for
doing things like <, or >, or multiply or divide.
I am taking this simple program:
x = 1
while x...
Bicentenary asked 27/2, 2011 at 23:35
4
Solved
I am creating a little bootloader+kernel and till now I managed to read disk, load second sector, load GDT, open A20 and enable pmode.
I jumped to the 32-bits function that show me a character on ...
2
Here is a bounded loop that increments two locations of the same buffer.
unsigned int getid();
void foo(unsigned int *counter, unsigned int n) {
unsigned int A = getid();
unsigned int B = getid()...
Marleah asked 7/12, 2023 at 7:37
3
Solved
Is there a way of pushing a packed doubleword integer from XMM register to the stack? and then later on pop it back when needed?
Ideally I am looking for something like PUSH or POP for general pur...
9
Solved
I'm looking at writing a JIT compiler for a hobby virtual machine I've been working on recently. I know a bit of assembly, (I'm mainly a C programmer. I can read most assembly with reference for op...
Rwanda asked 27/1, 2011 at 4:53
2
Solved
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 Q...
Maurilla asked 5/7 at 0:31
1
I am working with an assembly language that does not contain either multiply, divide, or bit-shift instructions. I am aware that a left bit-shift can be achieved by just adding the same number to i...
Protostele asked 4/7 at 16:41
4
Solved
At some point in my program I compute an integer divisor d. From that point onward d is going to be constant.
Later in the code I will divide by that d several times - performing an integer divisi...
Blaise asked 27/7, 2017 at 14:23
4
Solved
As most of you know CPUs are not well designed to do floating point calculation in contrast to GPUs. I am wondering how to use GPU's power without any abstraction layer or driver. Can I program for...
3
I'm reading the intel manual, and I see mentions of "Linear Address Space of the processor".
I'm confused as to where or what the linear address space actually is. Where in the processor ...
Xiphoid asked 25/6, 2020 at 23:24
1
So someone on a forum asked why this C function (which I added const and restrict to, just in case):
void foo(int *const restrict dest, const int *const restrict source) {
*dest = (*source != -1) ...
Lange asked 14/6 at 13:3
2
Solved
The following code,
int foo(int);
int bar(int);
int foobar(int i) {
int a = foo(i);
int b = bar(i);
return a == b ? a : b;
};
with GCC trunk is compiling to this assembly:
foobar(int):
push r...
4
Solved
2
I have recently became interested in android development however the biggest road block for me has been even the mere thought of using java to develop for a mobile phone. I do not have confidence i...
2
Solved
In Control and Status Registers section of riscv-asm-manual, there is an example:
.equ RTC_BASE, 0x40000000
.equ TIMER_BASE, 0x40004000
# setup machine trap vector
1: auipc t0, %pcrel_hi(mtvec) # ...
7
Solved
While running a program I've written in assembly, I get Illegal instruction error. Is there a way to know which instruction is causing the error, without debugging that is, because the machine I'm ...
3
I am completely new to assembly and would like to learn arm assembly (simply because I own an m1 mac). I can't really find many ressources online, that's why I'm here. My code is as follows (file i...
4
Solved
I am learning assembly for x86 using DosBox emulator. I am trying to perform multiplication. I do not get how it works. When I write the following code:
mov al, 3
mul 2
I get an error. Although,...
Dehnel asked 10/12, 2013 at 15:58
4
Solved
I am on the hook to analyze some "timing channels" of some x86 binary code. I am posting one question to comprehend the bsf/bsr opcodes.
So high-levelly, these two opcodes can be modeled as a "loo...
Hemeralopia asked 4/2, 2019 at 2:46
1 Next >
© 2022 - 2024 — McMap. All rights reserved.