Sign in to follow this  
Followers 0
308guru

How do I either reset ST locations or fill with zeros ?

8 posts in this topic

I have information from a barcode scanned into my ST file location. It is first dumped into ST12:0 and then extracted to different locations up to ST12:15. Upon reset (input from a switch), I would like to either erase the info from those locations or fill them all with zeros. I am doing this with N locations in the same program by using FLL #N7:20 with a length of 10. That fills N7:20-N7:29 with zeros. When I tried this with the ST file I got an error. I was using: FLL Source 0 Dest #ST12:0 Length 10 I got errors of: Operand sizes do not match Invalid Constand value-valid range = 1-3 Exceeded limit of 128 total words Anybody have any ideas on what I need to change to get this to work, or any other ways of eliminating the data present or filling with zeros in the ST locations? Thanks.

Share this post


Link to post
Share on other sites
A sting will be effectively cleared when its lenght is 0. MOV 0 ST10:0.LEN. The FLL instruction and the CLR instruciton will return errors.

Share this post


Link to post
Share on other sites
Thanks for the info. Are there any easy ways to do that to multiple locations in one command? I have to clear ST12:0 - ST12:15.

Share this post


Link to post
Share on other sites
If it were me, I would create the following in a subroutine, and then conditonally call the subroutine (with a one shot) when you need to clear all 16 strings. This uses a FOR N7:50 = 0 to 15 loop and indirect addressing. CLR N7:50 LBL 1 MOV 0 ST10:[N7:50].LEN ADD 1 N7:50 N7:50 LEQ N7:50 15 JMP 1

Share this post


Link to post
Share on other sites
The FLL works for me. Never had a problem, but still have to do one string at a time.

Share this post


Link to post
Share on other sites
This looked like a great way of accomplishing what I'm trying to do. I put the code in a subroutine but when I verified the file I got an error. It was "Element level indirection is not supported". If I take the [N7:50] out of the code and just leave that line as LBL 1 MOV 0 ST12.0.LEN it's happy. I'm using a ML1100. Is that sort of command not available for that processor? Thanks. Edited by mckeand13

Share this post


Link to post
Share on other sites
Unfortunately, the only ML that supports indirect addressing is the ML1500. Looks like you have no choice but to do them one at a time. Its not all that bad, its only 16 rungs. Create a subroutine and put 16 rungs in it to move 0 to the Len of each of the strings. You can copy/paste and then quickly edit the rungs for each element.

Share this post


Link to post
Share on other sites
Which is what I think the OP was trying to avoid doing. FLL doesn't work across multiple string elements. Unfortunately, with the ML1100 he is using, it looks like he will still have to do them one at a time. But there is no need to expend processor time filling each character in the string with zeros. Just setting the .LEN to zero is sufficient.

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