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
-1
votes
1 answer

Do offsets in assembly represent addresses or bits?

I am a bit confused, will inc [esi + 8] (lets say [esi] points to 0x0000001F in 8-bit memory) increment 0x00000027 or will it affect 0x00000020? I have seen a video implying it will affect the latter whereas regular pointers in ram go by addresses,…
-1
votes
1 answer

How do we get 1230 as the value when Indirect addressing mode is used?

I am trying to solve a homework problem which is as follows: Assume that we have the following values in the given memory locations: Also assume that the base register R1 stores 200 and is always implicitly used for the indexed addressing…
doge
  • 29
  • 4
-1
votes
3 answers

Assembly language meaning of two values in src or destination

For example, what is the difference between cmpl $0x7, 0x8(%rsp) and cmpl $0x7, (%rsp) Also what is the difference between cmp and cmpl?
-1
votes
1 answer

16-bit Assembly: cannot deref some registers

I'm trying the following Intel 16 bit instruction: mov si, word [reg] where reg is some register. It compiles fine if reg is bx, but does not when it is ax, cx or dx. I'm using NASM as my assembler. I'm sure this due to some restrictions in the…
G S
  • 35,511
  • 22
  • 84
  • 118
-1
votes
1 answer

Is the raspberry pi 3 memory byte addressible or word addressable and if it is word addressable what is the word size

I am new to the raspberry pi 3 I wanted to ask a question related to the memory architecture of raspberry pi 3 my question is as follows Is the raspberry pi 3 memory byte addressable or word addressable and if it is word addressable what is the…
-1
votes
2 answers

Sum of a word array not storing in another word array

*The task assigned to me twas to write an assembly program that finds the sum of three 8-bits values and places it in memory at location SUMS. Then compute sum of three word variable, and place it in memory at location SUMS + 2. Use the following…
Codex
  • 11
  • 5
-1
votes
1 answer

A strange assembly code: cmp ebp, ds:dword_84B8844

I use IDAPro disassembly a elf file. In a function sub_8210884, I have noticed some strange code: sub_8049DB6: ... call sub_8210884 sub_8210884: push ebp mov ebp, esp push esi push ebx mov ebx, [ebp+arg_0] mov eax,…
brucexin
  • 435
  • 4
  • 5
-2
votes
1 answer

asm compile issue

:96: Error: `(%rax,%edx,4)' is not a valid base/index expression :97: Error: `-4(%rax,%edx,4)' is not a valid base/index expression 101: Error: `(%rax,%edx,4)' is not a valid base/index expression 102: Error: `-4(%rax,%edx,4)' is not a valid…
user1055916
  • 57
  • 3
  • 6
-2
votes
1 answer

Syntax of indexed addressing (and the often leading comma)

I've seen the following definition for how an indexed address is generally used in assembly (from the book Programming from the Group Up): movl BEGINNINGADDRESS(,%INDEXREGISTER,WORDSIZE) I've used something like this on arrays (my most recent…
carl.hiass
  • 1,526
  • 1
  • 6
  • 26
-2
votes
1 answer

Changing assembler instruction to a more detailled one - Did I do it right?

The following assember instruction is given: SUB[R1], 8[-R2] The form this instruction is calculated: op1 = op1 - op2 The first operand is addressed "register indirectly". The second one is addressed "register indexed" with pre-decrement…
rpbudd
  • 77
  • 9
-10
votes
2 answers

Is immediate addressing faster than a register access?

Like, say you have a variable c, which, due to optimization by the CPU, you can safely assume to be stored in a register. Which of the following is faster? c = getchar(); if( c == 033 ){ putchar( 033 ); … } or c = getchar(); if( c == 033…
1 2 3
19
20