Questions tagged [addressing-mode]

An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.

From Wikipedia (Addressing mode):

Addressing modes are an aspect of the instruction set architecture in most central processing unit (CPU) designs. The various addressing modes that are defined in a given instruction set architecture define how machine language instructions in that architecture identify the operand (or operands) of each instruction. An addressing mode specifies how to calculate the effective memory address of an operand by using information held in registers and/or constants contained within a machine instruction or elsewhere.

296 questions
0
votes
1 answer

Why code and data have different addressing mode?

I learnt from assembly language some addressing mode. But I find out that for different segment, we have different addressing mode, for example, you cannot use PC-relative addressing for data. Why is that?
JiangFeng
  • 355
  • 2
  • 14
0
votes
4 answers

How can i copy an array in nasm x86 assembly for Linux, porting 16-bit DOS code?

I have to write a program which copy an array in other array, using x86 assembler The original code is written in MSDOS' TASM for 8086 processor, but I want port this to Linux NASM using i386 processor The code in TASM is this: .MODEL SMALL .DATA …
AlmuHS
  • 387
  • 6
  • 13
0
votes
1 answer

Change this short assembler code so it works just without register-indexed

Task from an old exam (I can provide source if you don't believe me): Change the following assembler code without using register-indexed addressing. Do not use more than 4 instructions. mov eax, [ebx+8] add eax, 1 add ebx, 8 mov [ebx], eax I have…
user6530185
0
votes
1 answer

What is the name of the effective address part that is not the bank?

I'm writing a SNES emulator for fun, and I always wondered what is the name of the part that is not the bank: Effective address: $80 $0000 ^-- Bank ^-- ???
JonathanK
  • 198
  • 1
  • 10
0
votes
1 answer

Did I change the given (very short) assembler instruction correctly?

mov 8[+r1], 1337 Edit, after having read the recommended thread of dwelch I get to (assuming I understood it right): add #8, r1 mov #1337, r2 mov [r1], [r2] sub #7, r1 Is this correct or did I do mistakes? Info we had about the assembler: n[+rx]…
rpbudd
  • 77
  • 9
0
votes
2 answers

what will be the addressing mode in assembly code generated by the compiler here?

Suppose we've got two integer and character variables: int adad=12345; char character; Assuming we're discussing a platform in which, length of an integer variable is longer than or equal to three bytes, I want to access third byte of this integer…
Pooria
  • 2,017
  • 1
  • 19
  • 37
0
votes
2 answers

Addressing Mode: Distinguishing between Absolute Short and Absolute Long?

Okay so I have the following instruction: MOVE.W $1234, $8000 Now I'm confused whether the addressing mode for $1234 and $8000 is absolute short or absolute long. I would also really appreciate it if someone can explain how to distinguish between…
Sid
  • 1
  • 1
0
votes
1 answer

Stack pointer as an index register

Why can't the stack pointer (esp / rsp) be used as an index register, like [esi + esp*4]?
0
votes
2 answers

The instruction "mov ax,[ax]" wont compile

Im using a x8086 emulator called "emu8086". I wrote simple code and when i run it, it gives me an error. I cant figure out what is the problem. http://prntscr.com/8bpivm
Yaron
  • 45
  • 3
0
votes
3 answers

Determining when NASM can infer the size of the mov operation

Something has got me confused in x86 assembly for a while, it's how/when can NASM infer the size of the operation, here's an example: mov ebx, [eax] Here we are moving the 4 bytes stored at the address held in eax into ebx. The size of the…
William
  • 1,837
  • 2
  • 22
  • 36
0
votes
3 answers

In the Base + Offset addressing, Offset address is also known as

In the Base + Offset addressing, Offset address is also known as: (a) Physical Address (b) Logical Address (c) Actual Address (d) Instruction Address (e) None of these Kindly answer it. To me it might be (b) or (d). Am I right?
Mohsin Ali
  • 125
  • 1
  • 12
0
votes
1 answer

Assembly 8086 addressing mode

How does XOR [130][BX][DI], CL work? (I know what XOR does) I mean how is the effective address of the memory part calculated? Which addressing mode is this?
Asnira
  • 313
  • 1
  • 4
  • 9
0
votes
3 answers

Addressing Modes in PDP-11 Assembler

I have small question about pdp-11(simulator), I have this command (it begins from the address 1000) add 2500, #2500 and this initial list: register/address - initial value pc 1000 sp 600 2500 3000 and…
lego69
  • 767
  • 1
  • 12
  • 20
0
votes
0 answers

Immediatea Addressing mode used in instructions containing memory locations

Suppose we have: MOV #NUM, R0 I understand that the hashtag represents an immediate addressing mode. However, what I don't understand what exactly gets stored in R0 in this case. Is it the actual address of NUM?
Dimitri
  • 1,906
  • 3
  • 25
  • 49
0
votes
2 answers

Indirect Register Addressing

I am trying to figure out how register indirect addressing works. I have a variable that stores the value of 5 as follows: section .data number db 53 ; ascii code for 5 section .bss number2 resb 1 section .text global _start _start: mov…
JmanxC
  • 377
  • 2
  • 16