Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MOV vs MOV.B assembly language instruction

Tags:

assembly

I'm working through the Microcorruption CTF which uses an emulated MSP430 CPU.

I've seen several mov instruction examples like:

mov sp, r4 ; move value of stack pointer to register 4

mov #0xfffc, r15 ; move hex value fffc to r15

I'm trying to interpret:

mov.b #0x4f, 0x0(r15)

I assume mov.b is binary value of #0x4f, but I'm not sure what 0x0(r15) indicates.

like image 613
Allyl Isocyanate Avatar asked May 30 '16 20:05

Allyl Isocyanate


People also ask

What is MOV instruction in assembly language?

The mov instruction copies the data item referred to by its second operand (i.e. register contents, memory contents, or a constant value) into the location referred to by its first operand (i.e. a register or memory).

What is mov bl in assembly language?

bl is the name of the low 8 bits (bits 7-0) in the ebx register. There is also bh which is the bits 15-8 of ebx , and bx is the low 16 bits (bits 15-0). There is no name for the higher 16 bits. This applies to all of the registers eax , ebx , ecx and edx .

What are the MOV instruction Rules?

The MOV instruction has a few limitations: an immediate value cannot be moved into a segment register directly (i.e. mov ds,10) segment registers cannot be copied directly (i.e. mov es,ds) a memory location cannot be copied into another memory location (i.e. mov aNumber,aDigit)

Does MOV copy or move assembly?

@curlywei yes, a mov in assembly is a copy, not a move.


1 Answers

It means use a byte operation:

The suffix .B at the instruction memonic will result in a byte operation

So only a byte of data will be copied from the source to the destination.

0x0(r15) is an indexed addressing mode, so use r15 + 0 bytes to specify the destination.

like image 145
Kieveli Avatar answered Oct 11 '22 05:10

Kieveli