Questions tagged [immediate-operand]
94 questions
0
votes
1 answer
Visual Studio 2022, Can I control how the immediate values are generated for arm64 compilation?
When I have the following code:
int value2 = 0x11223344;
The VS2022 compiler (arm64) generates:
StarFunction PROC
...
ldr w8,|value_label|
...
...
...
ret
|value_label|
DCD 0x11223344
ENDP
As you can see, the value…

raff
- 339
- 2
- 12
0
votes
0 answers
MIPS assembly `addi` instruction, how is a hexadecimal immediate interpreted?
there is a difference between those two instructions?
addI $12,$1,0x0000ffff
vs
addI $12,$1,0xffff
I need to know what is the value of
$12 after those instruction :
lui $1,0xffffff00
addi $12,$1,0x0000ffff
should i treat 0x0000ffff as sign extended…

AVITAL
- 11
- 2
0
votes
1 answer
How to calculate the maximum range of BEQ instruction in risc-V?
In risc-v, beq instruction has 12bits of imm[12:1].
And PC-relative addressing is Target address = PC + immediate x 2
It says the reason of the multiply with 2 is for the half word instruction.
So, I think the immediate value can represent the range…

Jin
- 3
- 3
0
votes
0 answers
arm instructionLoad Register (immediate) Encoding T4 , P/U/W meaning
From:
https://developer.arm.com/documentation/ddi0403/latest page 246,
Load Register (immediate) Encoding T4,
where to find the definition of P/U/W for bit 10/9/8?

PZ30
- 1
0
votes
3 answers
error: Impossible constraint in 'asm' "i"
I have a problem about inline-assembly in AArch64, Linux, gcc version is 7.3.0
uint8x16_t vcopyq_laneq_u8_inner(uint8x16_t a, const int b, uint8x16_t c, const int d)
{
uint8x16_t res;
__asm__ __volatile__(
:"ins %[dst].B[%[dlane]],…

SnowDance1997
- 13
- 4
0
votes
3 answers
Instructions with Long (32 and 64 bit) immediate operands in RISC processors
Are operations with large immediate numbers possible in RISC processors, when the size of the immediate operand does not allow to place it in the 32-bit instruction word (standard for RISC architectures). Say we want to store a 32-bit or 64-bit…

JSpruce
- 23
- 2
0
votes
0 answers
XOR operand type mismatch
I'm trying to get around some input character restrictions by encrypting some data. However, when i try and XOR rbx back to my desired value I get an error stating operand mismatch. Am i missing something here?
xor esi, esi
movabs rbx,…

Hysii
- 702
- 2
- 10
- 23
0
votes
3 answers
Understanding address assignment to registers via assembly instructions
If I have a CPU/system with the following characteristics...
16 bit architecture (16 bit registers and bus)
8 total registers
A set of 64 assembly instructions
And assuming my assembly instructions follow the format...
OPCode (6 bits) + Register…

4Matt
- 241
- 1
- 7
0
votes
1 answer
RISC-V U-Format instruction immediate confusion
Reading the RISC-V unprivileged specification I see that U-format instructions (lui,..) are defined like so:
But the immediate value doesn't make sense to me here: specifically, if given an instruction like lui t0, 0xABCDE, the lower 12 bits of the…

linkedin
- 37
- 3
0
votes
1 answer
What are the common ways instruction decoders deal with using constants over registers in microcontrollers?
Specifically, if the assembly instruction has a constant as one of the operands, how would instruction decoder pass it to the ALU? So far I thought of three ways to do it.
Pass the constant into a free register and then pass the address of that…

Nikolai Savulkin
- 697
- 5
- 12
0
votes
1 answer
ARMv7 T3 encoding for adds
I can't tell how to determine the following:
i, 10th bit on the left.
imm3, what's the difference for this one with imm8?

Mzq
- 1,796
- 4
- 30
- 65
0
votes
1 answer
MIPS - SPIM parser immediate value out of range for bitwise ANDI
Was trying to test my program with SPIM and have this message
spim: (parser) immediate value (-16) out of range (0 .. 65535) on line 56 of file code1.a
andi $t1, $t0, 0xfffffff0
what could be the problem?

avatar
- 3
- 2
0
votes
0 answers
How to mov a 64-bit binary literal into rax? error A2071: initializer magnitude too large for specified size
Here is my code. If I half the size of the binary value to 32-bits, it works, but as soon as I try 33 bits or higher, I get "error A2071: initializer magnitude too large for specified size"
Here is my code:
.data
.code
ASM_ADD proc
mov…

RandomUser123
- 67
- 5
0
votes
1 answer
C/SIMD - creating an 'immediate array'; an array that returns immediate values?
#include
static const unsigned char LUT[16] = { 0xE4, 0x24, 0x34, 0x04,
0x38, 0x08, 0x0C, 0x00,
0x39, 0x09, 0x0D, 0x01,
…

Timothy s
- 9
- 2
0
votes
1 answer
Loading 16-bit (or bigger) immediate with a Arm inline GCC assembly
Note: Just here for the brevity the examples are simplified, so they do not justify my intentions. If I would be just writing to a memory location exactly like as in the example, then the C would be the best approach. However, I'm doing stuff where…

Anton Krug
- 1,555
- 2
- 19
- 32