128 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
3
votes
1
answer
90
views
Do the bytes "00 10 A1 B3" make sense in Arm 32-bit architecture?
The bytes 00 10 A0 B3 decodes to movlt r1, #0 in the arm 32-bit architecture.
When I type the bytes 00 10 A1 B3 into the shell-storm online disassembler, it shows "N/A".
However, in the ...
3
votes
1
answer
90
views
Can I somehow tell GAS to change direction of operands?
I have the binary image of a bootloader which was written with some ancient assembler.
I want to port the assembly code to GNU assembler (GAS). We speak about the X86/16-bit
(real mode) world.
This ...
user avatar
user10316237
2
votes
1
answer
89
views
Why are J1 and J2 used with XOR in ARMv6-M BL instruction immediate calculation?
I’m trying to understand how the BL instruction is decoded in the ARMv6-M architecture.
The part I don’t get is in the imm32 calculation: the values of I1 and I2 are derived using J1 and J2, but they’...
3
votes
2
answers
241
views
ARM64 add instruction preferred opcode?
ARM64 supports add (extended register) that must be used for SP register, and add (shifted register) that must be used for ZR register.
The instruction add X0, X1, X2 matches the syntax for both of ...
1
vote
1
answer
116
views
What is the proper octal representation of the encoding of the operand register in intel 8086?
The classical explanation of Intel opcodes using octal says this:
As an example to see how this works, the mov instructions
in octal are:
210 xrm mov Eb, Rb
211 xrm mov Ew, Rw
...
1
vote
1
answer
185
views
8086 memory to accumulator encoding: why do mov al, [absolute] and mov ah, [absolute] have different sizes?
mov al, [10] ; a0 0a 00
mov ah, [10] ; 8a 26 0a 00
After assembling the above 8086 assembly code using NASM, I noticed a length disparity in the resulting machine code (shown in the comments above ...
2
votes
1
answer
156
views
Why encode RISCV PseudoInstruction LI to four instructions instead of two?
Dear RISCV enthusiasts,
My question is about encoding
li t1, 0xFF00F007
When using https://riscvasm.lucasteske.dev/# the code above encodes to
0: 000ff337 lui t1,0xff
4: 00f3031b ...
0
votes
0
answers
149
views
Understanding the Funct6 field in shift immediate instruction in RISC-V
The following figure shows the instruction format of the RISC-V architecture.
Also in the following figure, that is from Computer Organization and Design, RISC-V edition, 2nd edition, the three ...
0
votes
0
answers
112
views
How are x64 instructions decoded and what is the format of the generated uOps?
I'm looking at computer microarchitecture and understanding how CPUs work in hope to perhaps design my own CPU out of logic gates. I understand that the complex nature of x86-64 instructions having ...
1
vote
1
answer
119
views
Writing an assembler: clean and efficient way to handle x64 REX and VEX encoding?
I'm working on an x64 assembler (just 64 bits, at least for now), and I've gotten decently far (I have support for pretty much all instructions, including most extensions), but I have some pretty ...
1
vote
0
answers
156
views
what bits in an arm64 instruction is the operation code?
10101001101111100111101111111101
a9be7bfd
this is the binary for
stp x29, x30, [sp, #-32]
I know bit 31-30 is the 64 bit-32 bit bits, bits 0-14 is for the registers, and bits 15, 21 is for the ...
-1
votes
1
answer
84
views
Why does operand 1 in a modr/m byte change depending on the decoding mode
I'm trying to figure out why the instruction changes from add [eax], al to add [rax], al when changing the decoding mode from x86 to x64.
The instruction bytes are 00 00
I think it might be because ...
5
votes
0
answers
120
views
Why does Intel x86 manual use +rd instead of +ro or +rq for 64-bit registers?
The description of the PUSH instruction in the Intel manual (PDF, Volume 2, Chapter 4.3, PUSH) contains the line 50+rd PUSH r64. It seems +rd is used throughout most of the instruction descriptions ...
3
votes
1
answer
171
views
How to get NASM to encode `push` with a sign-extended 16-bit immediate?
When assembling the following with NASM:
BITS 64
push 32767
I get 68 ff 7f 00 00. This is interesting to me, since this is the 32b encoding (push dword). Any ideas why it doesn't resort to the 16b ...
2
votes
1
answer
119
views
ModR/M Historical Notation /0.../7
While learning about x64, I struggled to understand some notations in the intel manual.
Let's look at 0xC7 MOV:
opcode
instruction
Op/Enc
Description
C7 /0 iw
MOV r/m16, imm16
MI
Move imm16 to r/m16.
...