Allyl Isocyanate
Allyl Isocyanate

Reputation: 13626

MOV vs MOV.B assembly language instruction

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.

Upvotes: 11

Views: 16982

Answers (1)

Kieveli
Kieveli

Reputation: 11075

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.

Upvotes: 17

Related Questions