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
vote
2 answers

Is this piece of assembly code invalid?

I'm trying to figure out whether the following piece of assembly code is invalid. movb $0xF, (%bl) Is it invalid? If so, why? Thanks.
amorimluc
  • 1,661
  • 5
  • 22
  • 32
1
vote
1 answer

What addressing mode is used in 'mov cx, [bp+6]'?

What addressing mode is used in "mov cx, [bp+6]"? The processor is intel 8086. I am studying "Microprocessor and Interfacing" by Douglas V. Hall. I know its memory addressing mode. But not sure whether its based addressing mode or index addressing…
odbhut.shei.chhele
  • 5,834
  • 16
  • 69
  • 109
1
vote
1 answer

Use Square Brackets to Address Memory Error Assembly

I've made a program in Assembly that should reverse a string like "Was it a rat I saw?" but I can't seem to figure out what the error means: "Use square brackets to address memory, ADDR or OFFSET to get address:- Mov handle, [dest + ebx]." Any idea…
m00nbeam360
  • 1,357
  • 2
  • 21
  • 36
1
vote
2 answers

LEAL instruction, what does this mean?

So first i assign edx = y by doing movl 12(%ebp) %edx. why does leal (%edx, %edx, 2) , %edx = edx = 3*y
PhoonOne
  • 2,678
  • 12
  • 48
  • 76
1
vote
1 answer

The addressing mode can write like this?

I want use cmp instruction, Whether to set up the following syntax in assembly language? example: cmp [temp + si],[temp + si+1]
Ling Tze Hock
  • 41
  • 1
  • 7
1
vote
2 answers

addressing mode efficiency

Can someone tell me if 'immediate' adressing mode is more efficient than addresing through [eax] or any other way. Lets say that I have long function with some reads and some writes (say 5 reads, five writes) to some int value in memory mov…
grunge fightr
  • 1,360
  • 2
  • 19
  • 38
1
vote
2 answers

x86 - addressing modes to access elements in arrays

I am trying to learn assembly language. Can someone explain and/or give an example of how to use addressing modes to access elements in each of the following array types? array of DWORD array of structures, where each structure contains two…
user249375
1
vote
1 answer

Addresses in assembly code and "lea"

If I say: lea (%eax,%eax,2), %edx I've been taught that it essentially means: edx = eax + eax * 2 How does the format to this work? And I guess this leads into the second question. If I have something like this: add -0x4(%esi, %ebx, 4), %eax I…
Thanizer
  • 382
  • 1
  • 6
  • 21
0
votes
1 answer

How does this x86 addressing mode work?

Something like al will contain the address of esi + ecx + 1 ? movb (%esi, %ecx, 1), %al
brooksbp
  • 1,886
  • 4
  • 16
  • 17
0
votes
2 answers

IA32 indexed addressing mode without base address

What does this syntax mean? I'm specifically unsure about the missing base address mov 0x804a1d4(,%edx,4),%eax
victor
  • 6,688
  • 9
  • 44
  • 48
0
votes
1 answer

Is there a way to dereference a pointer stored in memory?

I'm trying to store a pointer in a variable located on memory. How could I dereference it? I'm trying to do it like this: pointer: db 0 ; the pointer variable var: db 44 ; the normal variable dereferenced: db 0 ; the result of dereferencing the…
0
votes
1 answer

Is "strb w0, [x2, w3, uxtw]" the same as "strb w0, [x2, w3, uxtw #0]"?

I'm totally puzzled. I thought that the following instructions are totally the same: strb w0,[x2,w3,uxtw 0] strb w0,[x2,w3,uxtw] but when I assemble them, I get different encoding: 40 48 23 38 strb w0, [x2, w3, uxtw] 40 58 23 38 …
0
votes
0 answers

How to decode or encode cmp instruction in x86 (ATT syntax)? R/M =100?

I was trying to decode the following hex numbers: 3b 5c 78 f6 I checked the manual of Intel, and 3b refers to the opcode of CMP Gv,Ev. 5c is 01 011 100in binary, meaning MOD=01, REG =011, R/M=100. MOD =01 means this instruction has one-byte…
Chen Yao
  • 35
  • 5
0
votes
0 answers

String length calculation and print in emu8086

I start newly learning emu8086, trying to code string length calculation and print, below the code name "Text-Size" code segment;(Segment code) assume CS:Code, Ds:Code,SS:Code,ES:Code org 100h jmp start start: mov ax, code mov ds,ax …
0
votes
1 answer

Load Word in MIPS, using register instead of immediate offset from another register

There is an instruction in MIPS which allows us to load a number from Memory. like this: .data array: .word 1,2,3,4 .text la $t0, A lw $t1, 8($t0) #will load 3 to $t1 Is there any way to use (the number inside a register) instead of…
amin_tay
  • 42
  • 3