Author |
Message |
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 14 Jan 2007 03:30:06 pm Post subject: |
|
|
Hi!!
i'm making a prog on the computer (in VB.NET) and i want the program to save files in 8xp format so i've got to understand how it works.
I've come to understand some things: when i open the file in a hexadecimal editor i get something like this:
2A 2A 54 49 38 33 46 2A 1A 0A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, this is the tag of the file, after this comes a char that is some kind of information, after this a 00, then again another char with some kind of information, then 00 00 00 00, then the title, then 00 00 00, then another char with some information, and after that the only find that u could understand is that the char that corresponds to a new line is 3F and uppercase letters and numbers are shown correclty in the "text mode" but lowercase letters get like encrypted, and the last to chars contain also some informatio. Can someone exlpain to me how the file "works"? |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 14 Jan 2007 03:40:54 pm Post subject: |
|
|
See this page. |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 15 Jan 2007 04:45:20 pm Post subject: |
|
|
Thank you that was very helpul exept in 2 things:
i coudn't understand the checksum, and i dont know how to insert lowercase letters has program data, because when i do with graphlink and then i open in hex editor for each lower letter it has two chars. |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 15 Jan 2007 05:43:52 pm Post subject: |
|
|
The checksum:
...you know how each char corresponds to a value between 0 and 255, right? Well, like the file I linked to says, you take the values of all bytes from 37 to the last byte before the checksum, add them together, and ignore all but the lowest 16 bits, and that will be your checksum.
Lowercase letters:
yes, the lowercase letter tokens are kind of counterintuitive. Each lowercase letter is made up of two bytes, where the first is BB (187 in decimal) and the second varies with the letter, but "a" is B0 (176 in decimal) and it increases normally up to "z".
However, what I'm sure you'd prefer is to be able to understand ALL the tokens. To do that, you look in ti83plus.inc, go to the "Tokens" section, and it will have all the information you need. |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 15 Jan 2007 06:28:49 pm Post subject: |
|
|
i just didn't understand this: "and ignore all but the lowest 16 bits" |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 15 Jan 2007 07:38:01 pm Post subject: |
|
|
Um...
-take only the lowest 16 bits
-take the remainder when divided by 65536 (2^16)
-bitwise AND the result and 65535 (2^16-1)
-hundreds of other synonyms.
Is it clear now? |
|
Back to top |
|
|
alexrudd pm me if you read this
Bandwidth Hog
Joined: 06 Oct 2004 Posts: 2335
|
Posted: 15 Jan 2007 09:01:52 pm Post subject: |
|
|
To someone who hasn't much experience in binary, it really doesn't make any sense.
(Try the second suggestion, it will be easiest) |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 16 Jan 2007 02:59:54 pm Post subject: |
|
|
Let me see if I understand, i add all the decimal values from the byte 37 to the byte before the checksum and then i divide that value by 655536 and the value i get from the division is the checksum??? |
|
Back to top |
|
|
DarkerLine ceci n'est pas une |
Super Elite (Last Title)
Joined: 04 Nov 2003 Posts: 8328
|
Posted: 16 Jan 2007 03:40:26 pm Post subject: |
|
|
65536. And no, it's the REMAINDER when dividing. |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 17 Jan 2007 12:51:26 pm Post subject: |
|
|
And how do i get the remainder?
For exemple 20566/65536=0.313812255 the remainder is what?
PS: i'm portuguese so i didn't understoud what remainder is. |
|
Back to top |
|
|
benryves
Active Member
Joined: 23 Feb 2006 Posts: 564
|
Posted: 17 Jan 2007 01:41:13 pm Post subject: |
|
|
The remainer is what is left after a division.
For example, if you were to divide 245 by 100 you'd get 2 as the result and 45 as the remainer (the bit that doesn't divide into 100).
You can use the Mod operator to return this value for positive results:
Dim Remainder As Integer = Checksum Mod 65536
You can also do it using bit-masking -
Dim Remainder As Integer = Checksum And &HFFFF
...but that requires a more thorough knowledge of binary logic.
Last edited by Guest on 17 Jan 2007 01:43:33 pm; edited 1 time in total |
|
Back to top |
|
|
alexrudd pm me if you read this
Bandwidth Hog
Joined: 06 Oct 2004 Posts: 2335
|
Posted: 17 Jan 2007 04:50:59 pm Post subject: |
|
|
Lasering wrote: And how do i get the remainder?
For exemple 20566/65536=0.313812255 the remainder is what?
PS: i'm portuguese so i didn't understaud what remainder is. [post="95189"]<{POST_SNAPBACK}>[/post]
Maybe examples will help where words cannot.
(R = remainder)
3/3 = 1, R0
4/3 = 1, R1
5/3 = 1, R2
20566/656536 = 0, R20566 |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 18 Jan 2007 01:27:51 pm Post subject: |
|
|
I olny don't udnerstand on thing.
If the remaider is for exemple 0,1555 (only the 1555 of course), how do i insert it in two bytes?
Last edited by Guest on 18 Jan 2007 01:31:30 pm; edited 1 time in total |
|
Back to top |
|
|
Recursive Acronym
Advanced Member
Joined: 11 Dec 2006 Posts: 499
|
Posted: 20 Jan 2007 09:37:12 pm Post subject: |
|
|
DarkerLine wrote: Lowercase letters:
yes, the lowercase letter tokens are kind of counterintuitive. Each lowercase letter is made up of two bytes, where the first is BB (187 in decimal) and the second varies with the letter, but "a" is B0 (176 in decimal) and it increases normally up to "z".
[post="95135"]<{POST_SNAPBACK}>[/post]
Actually, I looked into this one time and I think I found that "a" is $BBB0, "k" is $BBBA, and "l" is $BBBC. $BBBB appears as a question mark. I was working with a string using CalcSys.
Lasering wrote: I olny don't udnerstand on thing.
If the remaider is for exemple 0,1555 (only the 1555 of course), how do i insert it in two bytes?
[post="95248"]<{POST_SNAPBACK}>[/post]
The 1555 is the remainder. To insert it with two bytes, convert it to hexadecimal:
1555d=613h
You can do this using the built-in calculator in either Windows or Mac.
Remember, each byte is two hex digits, so the two bytes would be $06 and $13.
By the way, what good hex editors are there out there for Windows (maybe Mac )?
Last edited by Guest on 20 Jan 2007 09:47:34 pm; edited 1 time in total |
|
Back to top |
|
|
kermmartian Site Admin Kemetech
Calc Guru
Joined: 20 Mar 2004 Posts: 1220
|
Posted: 22 Jan 2007 02:20:49 am Post subject: |
|
|
BBBB is a questionmark because it's an invalid token. You always must know where to start even if you're in the middle of a token string, so since BB introduces a two-byte token, BBBBxx would be useless - is it BBBB, xx or BB, BBxx? Therefore, BBBB is skipped as a TI-OS token. |
|
Back to top |
|
|
Lasering
Newbie
Joined: 16 Oct 2006 Posts: 23
|
Posted: 24 Jan 2007 10:59:34 am Post subject: |
|
|
Thks Recursive Acronym!!!
A good editor (the one that I use) is XV32 donwload it Here. |
|
Back to top |
|
|
|