Hello. I have this code for printing all the values of "header" (a list of bytes) and the first value of "data_bytes" (another list of bytes):
So I expect header to go from 0 to 16, or seventeen values in total
I also expect data_byes go from 16 to a very large number that is irrelevant
Anyway, from what I see, the last value of "header" should be equal to the first value of "data_bytes"
However, the above "print ()" outcome it is:
So I counted only sixteen values in "header", not seventeen. Plus the last value of "header" is different from the first of "data_bytes"
Also in "Bless" (a hexadecimal editor) the 16° value it is "120" with is the first printed value of "data_bytes)" But I expected "data_bytes" to start from number 16 counting from zero, or 17 in total, with shall be another value. This "120" should be the number before the last of "header".
So what I expect to be printed it is:
and the first value of "data_bytes" to also be 30396, since it starts, for now, from the same byte that header ends. What I am misunderstanding?
Thanks for the help.
def test (self): print ("Header: ") for x in self.header: print (x) print ("data_bytes: ") print (self.data_bytes [0])The code that provides value to these both lists are:
self.data_bytes = rom_bytes [HEADER_SIZE:HEADER_SIZE + (16 + KB_SIZE * self.num_prg_blocks)] self.header = rom_bytes [0:HEADER_SIZE]where HEADERR_SIZE is equal to 16.
So I expect header to go from 0 to 16, or seventeen values in total
I also expect data_byes go from 16 to a very large number that is irrelevant
Anyway, from what I see, the last value of "header" should be equal to the first value of "data_bytes"
However, the above "print ()" outcome it is:
Quote:78
69
83
26
2
1
1
0
0
0
0
0
0
0
0
0
data_bytes:
120
So I counted only sixteen values in "header", not seventeen. Plus the last value of "header" is different from the first of "data_bytes"
Also in "Bless" (a hexadecimal editor) the 16° value it is "120" with is the first printed value of "data_bytes)" But I expected "data_bytes" to start from number 16 counting from zero, or 17 in total, with shall be another value. This "120" should be the number before the last of "header".
So what I expect to be printed it is:
Quote:Header:
78
69
83
26
2
1
1
0
0
0
0
0
0
0
0
120
30936
and the first value of "data_bytes" to also be 30396, since it starts, for now, from the same byte that header ends. What I am misunderstanding?
Thanks for the help.