1

for reference of the assembly language see this link

I don't understand what the command

LD.BU      d15,[a15]0x0 

exactly does.... here a specific example:

##What the registers contain BEFORE execution##
D15    0xD0000894
A15    0xD0000894

##What the registers contain AFTER execution##
D15    0x000000DC
A15    0xD0000894

Can anyone shortly explain me this?

jonnyx
  • 345
  • 2
  • 16
  • 2
    just guessing (didn't check the instruction set description). It's loading unsigned byte from memory at address `a15+0x0`, and clearing upper 24 bits of `d15` to make the 8b value extended to 32b. I.e. in memory at address 0xD0000894 is probably value 0xDC. ... ... seems in the link in chapter "1.10 Load and Store Instructions", specifically Figure 17 confirms the zero extension for `LD.BU`. .. – Ped7g Jul 24 '18 at 09:13

1 Answers1

2

LD.BU d15,[a15]0x0

It loads a byte from the address held in address register A15 to data register D15 where the value is zero-extended, i.e. the upper 24 bits are set to 0. In C99 this would be something like

uint32_t d15 = * (const uint8_t*) a15;

emacs drives me nuts
  • 2,785
  • 13
  • 23