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"...
Nedi asked 1/3, 2018 at 14:17

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 ...
Chimera asked 19/1, 2013 at 21:28

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...
Footcandle asked 15/4, 2012 at 12:13

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...

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...
Competent asked 22/7, 2010 at 7:49

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) ...

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...
Meandrous asked 7/6 at 15:25

4

Solved

Is there a way to XOR horizontally an AVX register—specifically, to XOR the four 64-bit components of a 256-bit register? The goal is to get the XOR of all 4 64-bit components of an AVX register. ...
Oviposit asked 5/7, 2017 at 21:0

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...
Bearskin asked 23/11, 2014 at 16:37

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) # ...
Sensuality asked 25/1, 2021 at 4:32

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 ...
Perspicacious asked 27/4, 2012 at 16:11

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...
Diffluent asked 15/11, 2021 at 12:26

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

© 2022 - 2024 — McMap. All rights reserved.