3.5.11. Changing the data width for reads and writes

You can use the Command window to enter a command that reads data from, or writes data to memory. You must, however, be aware of the default width of data read or written, and how to change it if necessary. By default, a read from or write to memory in armsd, ADW, or ADU transfers a word value. For example:

let 0x8000 = 0x01

transfers 4 bytes to memory starting at address 0x8000. In this example the bytes at 0x8001, 0x8002 and 0x8003 are all zero-filled.

To write a single byte to memory, use an instruction of the form:

let *(char *) 0xaddress = value

and to read a single byte from memory, use an instruction of the form:

print /%x *(char *) 0xaddress

where /%x means display in hexadecimal.

You can also read and write halfword short values in a similar way, for example:

let *(short *) 0xaddress = value
print /%x *(short *) 0xaddress

You can also select View  ? Variables  ? Expression to open the View Expression window, and use that to specify bytes or shorts for displaying memory. For example, for bytes, enter *(char *) 0xaddress in the View Expression box, and for shorts, enter *(short *) 0xaddress in the View Expression box. To display in hexadecimal, click the right mouse button on the Expression window, select Change Window Format and enter %x.


Changes to window formats are saved. Changes to line formats are not saved. If you select Change Window Format and leave the format field blank, the setting defaults to the original setting.

Copyright © 1997, 1998 ARM Limited. All rights reserved.ARM DUI 0040D