sign-extension Questions

1

Solved

I'm looking at the following disassembled AArch64 instruction: 65 6E 20 2B adds w5, w19, w0, uxtx #3 According to the ARM manual, uxtx zero-extends w0 to an unsigned 64-bit value before adding it ...
Debus asked 28/4, 2022 at 9:36

7

Solved

I have 3 unsigned bytes that are coming over the wire separately. [byte1, byte2, byte3] I need to convert these to a signed 32-bit value but I am not quite sure how to handle the sign of the neg...
Harden asked 1/3, 2017 at 14:47

6

I stumbled upon a question that asks whether you ever had to use bit shifting in real projects. I have used bit shifts quite extensively in many projects, however, I never had to use arithmetic bit...
Vaasta asked 31/7, 2014 at 10:31

1

I can tell this is a super simple problem but I have yet to figure it out. Basically, I just want to be able to take one element an array and add and subtract some numbers from it using registers a...
Flushing asked 30/10, 2019 at 0:50

1

Solved

I have trouble finding out what movslq instruction does. Google isn't very helpful and there is no such instruction on this list. Here I have read that MOVSLQ is move and sign-extend a value fro...
Ina asked 9/4, 2019 at 3:41

2

Solved

Why do we shift by 2 the sign extended 16bit constant in branching instruction in MIPS? I am confused with this idea. What good does this shifting brings to the sign extended 16 bit constant. Here ...
Programmer asked 7/12, 2012 at 10:19

7

Solved

I faced an interesting scenario in which I got different results depending on the right operand type, and I can't really understand the reason for it. Here is the minimal code: #include <iostr...

1

Solved

Chapter 3 of Computer Systems A Programmer's Perspective (2nd Edition) mentions that cltq is equivalent to movslq %eax, %rax. Why did they create a new instruction (cltq) instead of just using mov...
Rustyrut asked 10/6, 2016 at 8:28

2

Solved

Summary: I was looking at assembly code to guide my optimizations and see lots of sign or zero extensions when adding int32 to a pointer. void Test(int *out, int offset) { out[offset] = 1; } ---...
Adenocarcinoma asked 19/4, 2016 at 1:2

1

Solved

I had a test todayand the only question I didn't understand involved converting a doubleword to a quad word. That got me thinking, why/when do we sign extend for multiplication or division? In add...
Frieda asked 7/4, 2016 at 0:57

1

Solved

I am trying to perform a bitwise or on a byte value I have in Java. For example, I am running: byte b = (byte)0b11111111; int result = 0 | b; My expected result for this would be 0b00000000 000...
Libbylibeccio asked 28/1, 2015 at 22:13

1

Solved

I am unsure of what the cbw command actually does. I have a snippet of code: mov ax,0FF0h cbw idiv ah How does the value of ax change after cbw?
Encyclical asked 1/11, 2011 at 1:51

1

Solved

Alright, so I am dealing with the following snippet of code: push %ebp mov %esp,%ebp push %ebx mov 0x8(%ebp),%eax movzwl %ax,%edx So this behaves as expected when dealing with positive values....
Beaulieu asked 6/9, 2011 at 6:3

1

Solved

I can't seem to grasp the concept on these stuff, even with the help of Google and a textbook in my hand. Following the format (opcode, rs, rt, offset)... Do you sign extend the offset before ad...
Muddle asked 29/8, 2011 at 4:44

6

Solved

I was helping someone with their homework and ran into this strange issue. The problem is to write a function that reverses the order of bytes of a signed integer(That's how the function was specif...
Haase asked 21/9, 2010 at 18:24
1

© 2022 - 2024 — McMap. All rights reserved.