Sign in to follow this  
Followers 0
mulderm

ascii converter

4 posts in this topic

Hello, I want to get a formula for basic so I can convert a Integer word with 2 ascii sign to split them in a MSD and LSD. Example: I have received from a database PC a Integer word N7:0 = 8525. These word have 2 ASCII words: MSD=! and LSD=M. How is the formula for basic (1771-db) so that I can split this integer word(8525) in MSD=33 (ascii=!) and LSD=77 (ascii=M)? Any ideas? Greetings, mulderm

Share this post


Link to post
Share on other sites
In the SLC instruction set, the AEX command (ASCII string extract) lets you split up an ascii string and move it elsewhere. It may be a bit long winded, but you could use this intruction to split up your !M into ! and M (you may have to use the instruction twice), when you have split it up it will reside in two seperate string registers, you may then use the ACI (Ascii string to integer) to convert it back to an integer. There is probably an easier way though!

Share this post


Link to post
Share on other sites
The magic word is modulo function. There are several ways to do it. This is probably the simplest one. If your scan time is at premium, you could try BSR instead of DIV. I am not sure if that would bring any gains as I'm trying to avoid them. I like bitshift or bit rotate functions but BSL and BSR sintax is rather frustrating... Edited by panic mode

Share this post


Link to post
Share on other sites
Thank you guys. It´s now understanding for me. mulderm

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0