06-07 (Sequential RAM Write)

06______ 000000YY

ZZZZZZZZ ZZZZZZZZ

ZZZZZZZZ ZZZZZZZZ

E0000000 80008000


07______ 000000YY

ZZZZZZZZ ZZZZZZZZ

ZZZZZZZZ ZZZZZZZZ

E0000000 80008000

_ = First address

Y = How many bytes to write

Z = ASCII converted to Hex

This codetype is used for writing to sequential addresses. The most common 06 codes are string writes but sometimes you can use this codetype to enter commands.


Example [HAXZing TERR0R]:

Note if you don't know anything about bits, hex digits, bytes, halfwords, or words I recommend you go learn.



06______ YYYYYYYY

d1d2d3d4 d5d6....


06 basically creates a string write starting at the base/pointer address and writes bytes consecutively until the amount of set bytes has been reached. Each digit you want to write needs to be expanded to a byte by converting the value you want from ascii to hex.


Example: Let's say our base address is 80123450. We are going to create a string for the value 1010101013371337 starting at 80123450. 1010101013371337 expanded where every hex digit is one byte is 31303130313031303133333731333337.


Now lets create the code:

06123450 YYYYYYYY

31303130 31303130

31333337 31333337


Y's = How many bytes we are going to write. Every two digits in the the string is one byte. Here we have 16 bytes. 16 in hex decimal = 10


Now we have:

06123450 00000010

31303130 31303130

31333337 31333337


You now need to add a terminating line:

06123450 00000010

31303130 31303130

31333337 31333337

E0000000 80008000


You're done!



06 Overview:


Since 06 creates a string it writes consecutively as defined. This means values in addresses following the base/pointer address that the code began on will be overwritten so 06 isn't the best codetype option always. In cases where you would need to write text, 06 would could be necessary.


In the example above we ended with:

06123450 00000010

31303130 31303130

31333337 31333337

E0000000 80008000


Every 4 bytes after the first 4 of the string is a value being put in the following address.

06123450 00000010

80123450-->31303130 31303130<--80123454

80123458-->31333337 31333337<--8012345C

E0000000 80008000


Another way I could put it is saying the 06 from the example could also be written as:

04123450 31303130

04123454 31303130

04123458 31333337

0412345C 31333337

E0000000 80008000


So remember 06 is not always the best choice in regions with important values following your address.