Skip to main content
Filter by
Sorted by
Tagged with
3 votes
1 answer
84 views

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 ...
vl106's user avatar
  • 150
3 votes
2 answers
175 views

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 ...
alexisrdt's user avatar
  • 524
1 vote
1 answer
174 views

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 ...
SmolScorbunny's user avatar
0 votes
0 answers
127 views

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 ...
user153245's user avatar
1 vote
1 answer
116 views

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 ...
Goubermouche's user avatar
-1 votes
1 answer
83 views

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 ...
user24684540's user avatar
3 votes
1 answer
164 views

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 ...
Goubermouche's user avatar
2 votes
1 answer
142 views

I'm trying to understand some Motorola 68000 assembler code, and I'm getting tripped up by instructions that use the program counter. My confusion is about the effective value of the program counter ...
Bri Bri's user avatar
  • 1,992
0 votes
1 answer
64 views

I'm trying to assemble code for MIPS R2000 (MIPS I ISA). I'm using LI pseudo instruction to initiate a register. After running the assembler on the following code: li $v1, 1 The binary .text ends up ...
Roi Amiel's user avatar
  • 365
2 votes
2 answers
311 views

I was asked to convert the following machine code to assembly in Intel syntax: 0x421a0770: 0D 00 3D 77 0x421a0774: AC 3D 11 2A 0x421a0778: 96 AB 77 04 0x421a077c: 90 2D 0D ...
Fsociety's user avatar
1 vote
1 answer
337 views

In a shift left / shift right instruction, the rt is used as source register. Is there any reason why rt is used as source register, instead of rs ? I saw some similar question answered "It is to ...
ummmsso's user avatar
  • 13
0 votes
1 answer
204 views

I'm in the process of writing an x86_64 disassembler, to get a better understanding of the assembly-encoding rules. I got a working version, and I understand most things about prefixes, modR/M and so ...
Juliean's user avatar
  • 1,276
0 votes
0 answers
283 views

Confused about instruction encoding supported by my core (ie. T1, T2, etc) Having the STM32F0 series Cortex-M0 programming manual, I found that https://www.st.com/resource/en/programming_manual/pm0215-...
yo3hcv's user avatar
  • 1,679
4 votes
0 answers
66 views

About push wordregister(r16) under 64BIT mode of Intel x86_64 CPU. In B-28, Vol. 2D, APPENDIX B, INSTRUCTION FORMATS AND ENCODINGS, Intel Combined Manual PDF, Order Number: 325462-080US, June 2023. ...
YutakaAoki's user avatar
1 vote
1 answer
187 views

In Intel(R) 64 and IA-32 Architectures Software Developer's Manual Combined Volumes: 1, 2A, 2B, 2C 1, 2A, 2B, 2C, 2D, 3A, 3B, 3C, 3D, and 4 Order Number: 325462-080US June 2023. 2.7.5 Compressed ...
YutakaAoki's user avatar
0 votes
1 answer
67 views

I'm working on a project where we need to modify a Rocket-chip core with new instructions. We're wondering: how does data width for load/store instructions is determined ? For instance, LB/LH/LU have ...
JohnDoe's user avatar
3 votes
1 answer
853 views

The add x1, sp, x2, lsl #1 instruction is supposed to be an "Add (shifted register)" but I have problems with the encoding to differentiate when SP and XZR is used. I'm astonished with the ...
raff's user avatar
  • 378
0 votes
1 answer
1k views

I'm learning risc-v instruction set. I know that "addi sp,sp,-40" will be converted to "fd810113". But I don't know why "addi sp,sp,-32" is converted to binary code "...
Chris633's user avatar
0 votes
1 answer
93 views

Suppose we needed to jump to the memory address 0xAE87698C. If the current PC value is 0xAF70018B show the j instruction to perform the jump (display it as both a 32-bit binary number and as an ...
eswcs's user avatar
  • 5
1 vote
1 answer
462 views

These are MOV instruction opcodes from the Intel® 64 and IA-32 Architectures Software Developer Manuals: B8+ rd id MOV r32, imm32 OI Valid Valid Move imm32 to r32. C7 /0 id MOV r/m32, imm32 MI Valid ...
rand_program's user avatar
  • 1,256
5 votes
1 answer
420 views

If I do something like (dummy example): jmp 1f 1: ret on gcc/clang it generates a short relative jump because the label is near. I'm curious, is it possible to force a JMP rel32 regardless of the ...
Petr Skocik's user avatar
  • 60.6k
0 votes
2 answers
1k views

I'm having trouble understanding a very basic x86 instruction. The instruction is 0x080491d7 <+1>: mov %esp,%ebp I know that it moves the value of esp into ebp. But I'm trying to ...
Neurosis's user avatar
1 vote
1 answer
112 views

I would like to know what is SignImm in the following formula: BTA = Branch Target Address = PC(old) + 4 + (SignImm << 2) I have read that it is the address distance between the old PC + 4 and ...
Lechius's user avatar
  • 325
0 votes
1 answer
1k views

I'm learning about RISC-V instructions in Computer Architecture. What i wonder is, because of little endian, any number in RISC-V's instruction's little digit is on little bit. I know that RISC-V use ...
WooLyung's user avatar
3 votes
1 answer
447 views

Instead of writing mov rax, 1 (7 byte encoding 48, C7, C0, 01, 00, 00, 00), I can write mov eax, 1 (5 byte encoding B8, 01, 00, 00, 00) relying on the automatic zeroing of the high dword. For copying ...
Sep Roland's user avatar
  • 41.2k