Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Oct 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Translation Table?

    Hello CF

    Ive been trying to sort this out for a long time now, but i just cant! I may be stupid, but i really need an anwser! I know what a translation table is! BUT! How does it work?? Take a look at this and plz tell me how its ment to work, and most important of all why its like that!


    UpCase:
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,09h,0Ah,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,21h,22h,23h,24h,25h,26h,27h,28h,29h,2Ah,2Bh,2Ch,2Dh,2Eh,2Fh
    db 30h,31h,32h,33h,34h,35h,36h,37h,38h,39h,3Ah,3Bh,3Ch,3Dh,3Eh,3Fh
    db 40h,41h,42h,43h,44h,45h,46h,47h,48h,49h,4Ah,4Bh,4Ch,4Dh,4Eh,4Fh
    db 50h,51h,52h,53h,54h,55h,56h,57h,58h,59h,5Ah,5Bh,5Ch,5Dh,5Eh,5Fh
    db 60h,41h,42h,43h,44h,45h,46h,47h,48h,49h,4Ah,4Bh,4Ch,4Dh,4Eh,4Fh
    db 50h,51h,52h,53h,54h,55h,56h,57h,58h,59h,5Ah,7Bh,7Ch,7Dh,7Eh,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h

    This should translate all lower-case charaters to uppercase! But how does it do that??

  2. #2
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Basically that is mapping each value of the character to it's upper case. If it's not a letter it appears to be returning a space (0x20). So basically, if you give it the location of 'a' (0x61) if will give you 'A' (0x41). At the 'A' location, it will also have 0x41.

    See the complete listing of values at http://asciitable.com/
    Whats the point of a signature?

  3. Users who have thanked CrzySdrs for this post:

    Napsteren (03-29-2011)

  4. #3
    New Coder
    Join Date
    Oct 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Okay, i think i almost got it now. But what about the others values?

    Like : 60h,41h,42h,43h,44h,45h,46h,47h,48h,49h,4Ah,4Bh,4Ch,4Dh,4Eh,4Fh

    What is it that the table basically does?

  5. #4
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    As I said before, all the other values are listed in the table at asciitable.com. Your translation table just has all the uppercase values for each letter in that table, so that if you lookup a letter, you will find its corresponding uppercase value.
    Whats the point of a signature?

  6. Users who have thanked CrzySdrs for this post:

    Napsteren (03-29-2011)

  7. #5
    New Coder
    Join Date
    Oct 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Okay! Thanks! That gave me a more clear pic of what it is now... Then to another question now when i see that your good in the stuff !
    How do i read it?

    I think its confusing me that its kind a like all in one table, and all together, but when i see it i think of it as each line got their own rules. Like the first line is

    20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    And here is a different value?!?!
    And again different!?
    20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,
    20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,

    Are you getting what im saying :S?

  8. #6
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I am assuming that db stands for "define byte" and you are just creating a big array of values in memory. To use this table, you would simply take the base address of that array and use an offset of the value of the letter, and the value at that resultant address would be the uppercase letter.
    Whats the point of a signature?

  9. #7
    New Coder
    Join Date
    Oct 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Yep your right about the db. And thanks again I thought about this, and then i know what my real question is. Why do you set it up that way? I mean like why is 30h at the 4 line?? I know what 30h is, but does it work a way where you need to place them correct? And like why is there only 1 (09h)??

    UpCase:
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,09h,0Ah,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,21h,22h,23h,24h,25h,26h,27h,28h,29h,2Ah,2Bh,2Ch,2Dh,2Eh,2Fh
    db 30h,31h,32h,33h,34h,35h,36h,37h,38h,39h,3Ah,3Bh,3Ch,3Dh,3Eh,3Fh
    db 40h,41h,42h,43h,44h,45h,46h,47h,48h,49h,4Ah,4Bh,4Ch,4Dh,4Eh,4Fh
    db 50h,51h,52h,53h,54h,55h,56h,57h,58h,59h,5Ah,5Bh,5Ch,5Dh,5Eh,5Fh
    db 60h,41h,42h,43h,44h,45h,46h,47h,48h,49h,4Ah,4Bh,4Ch,4Dh,4Eh,4Fh
    db 50h,51h,52h,53h,54h,55h,56h,57h,58h,59h,5Ah,7Bh,7Ch,7Dh,7Eh,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h
    db 20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h,20h

  10. #8
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    I don't think it matters what line it's on, just that it is in the correct order. The line breaks may just be for your reading convenience.

    If you look at the asciitable, 09h is a new line, which is something that you probably don't want to strip out of your uppercased string.
    Whats the point of a signature?

  11. #9
    New Coder
    Join Date
    Oct 2010
    Posts
    40
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Thank you so much! Okay so lets summ... All the other values than 20h and 09h is Uppercase Letters, and also +.!"#%& and so on... So to make it a little more clear, what had happend if all the other values than 20h and 09h was lowercase letters values??? Would the output then be lower?

  12. #10
    Regular Coder
    Join Date
    Jun 2003
    Location
    Silicon Forest
    Posts
    155
    Thanks
    0
    Thanked 5 Times in 5 Posts
    Yes, if all the values in the table that are upper case currently were changed to lower case, then the translation table would convert to lower case.
    Whats the point of a signature?


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •