flat assembler
Message board for the users of flat assembler.

Index > DOS > display ascii codes instead of symbols

Author
Thread Post new topic Reply to topic
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Sorry for lame question, but what should I use to implement subj?
Post 20 Jul 2004, 10:38
View user's profile Send private message Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Nobody? Sad

Then I ask visa versa (and more accurate).
I have string (for example): '47 4A 39', what should I do to convert it into string: 'G J 9'
Post 21 Jul 2004, 07:09
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
veach1 wrote:
I have string (for example): '47 4A 39', what should I do to convert it into string: 'G J 9'


At first the result string should be without spaces, i.e.: 'GJ9'.
at second you need procedure of type StrToNum and to parce the string byte by byte.

Another algo (simple and smaller, but not so flexible) is to:

1. Get first byte (for example 4).
1.1. if = 0 end of procedure.
2. subtract $30
3. if > $09 subtract 6
4. shift it 4 positions left -> value A
5. Get second byte
6. repeat 2 and 3 -> Value B
7. Byte = A or B-> store in output string
8. skip the string until <> space
9. goto 1.

Regards.
Post 21 Jul 2004, 10:06
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
Very Happy wery suitable solution, thank you
Post 21 Jul 2004, 11:44
View user's profile Send private message Reply with quote
veach1



Joined: 16 Jul 2004
Posts: 165
veach1
little correction: in step 3. substract 7, not 6
Post 22 Jul 2004, 06:17
View user's profile Send private message Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3502
Location: Bulgaria
JohnFound
veach1 wrote:
little correction: in step 3. substract 7, not 6

Right. Smile
Post 22 Jul 2004, 08:09
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.