HOME AUTOMATION Posted July 4, 2020 Share Posted July 4, 2020 1 hour ago, GDMike said: they can't fix my ac until next week. Well, if you should try to work on the AC, yourself. Make sure, not to connect the bottle to the "high side", whatever you do!!! 2 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 4, 2020 Author Share Posted July 4, 2020 (edited) I have another idea for my program if I decide to get on it today. I need to figure another way. Thx for your tips. Hope your doing well. "When things get rough, I buy gold from Rosland capital" Edited July 5, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 11, 2020 Author Share Posted July 11, 2020 (edited) On 6/30/2020 at 10:15 PM, HOME AUTOMATION said: AORG >CBD4 *DELETE TEST TEXT 'COMEFINDMEBRO' *DEL AORG >7D00 *DEL QUERI TEXT 'COMEFINDMEBRO' *SET THIS LINE UP IN YOUR PROGRAM, DELETE FROM HERE DATA 0 *THIS SHOULD FOLLOW YOUR BUFFER SPACE, DELETE FROM HERE VALID DATA 0 ENTRY LI R4,>A000 *SET THIS VALUE UP IN YOUR PROGRAM, DELETE FROM HERE LI R6,>0000 *SET THIS VALUE UP IN YOUR PROGRAM, DELETE FROM HERE SEARCH LI R3,QUERI *THIS IS THE LINE TO BL TO! CMPARE CB *R3,*R4+ JEQ NEXT C R4,R6 JNE CMPARE OUTNO RT NEXT MOV R4,R5 CONT CB *R3,@VALID JEQ OUTYES C R4,R6 JEQ OUTNO INC R3 CB *R3,*R4+ JEQ CONT RESTAR MOV R5,R4 JMP SEARCH OUTYES MOV R5,R4 DEC R4 RT END Here, I removed the testing lines for you. I hope I did it right. VALID DATA 0 SEARCH LI R3,QUERI *THIS IS THE LINE TO BL TO! CMPARE CB *R3,*R4+ JEQ NEXT C R4,R6 JNE CMPARE OUTNO RT NEXT MOV R4,R5 CONT CB *R3,@VALID JEQ OUTYES C R4,R6 JEQ OUTNO INC R3 CB *R3,*R4+ JEQ CONT RESTAR MOV R5,R4 JMP SEARCH OUTYES MOV R5,R4 DEC R4 RT END Set up a buffer labeled QUERI, make sure to fill it with all zeros, before overlaying your search term. This buffer should have an extra 1 or 2 zeros after it's max. length! This will indicate the search completed successfully, when found by my program. R4=Where to start searching from. R6=Where to stop searching. BL @SEARCH This should find the first occurrence, before returning to your program. R4 will be set to the starting address of the found term. or R4 will be equal to R6 if nothing was found. Adding the length of the search term to R4, then BL-ing back to SEARCH, should allow you to find the next occurrence. Good luck, you might need it. EDIT: I hope these comments make more sense to you, than they do to me! VALID DATA 0 TERM FOUND, COMPARATOR. SEARCH LI R3,QUERI R3=SEARCH TERM'S ADDRESS. *THIS IS THE ENTRY ADDRESS! CMPARE CB *R3,*R4+ COMPARE 1st LETTER OF SEARCH TERM, TO THE LETTERS IN THE SPECIFIED RANGE, ONE LETTER AT A TIME. JEQ NEXT DO THEY MATCH? YES! CHECK IF SECOND LETTERS MATCH. NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JNE CMPARE NO! CHECK NEXT LETTER IN THE SPECIFIED RANGE. YES! CONTINUE. OUTNO RT BYE, NOTHING FOUND. NEXT MOV R4,R5 SAVE THE POSITION OF THE NEXT POSSIBLE FIRST LETTER MATCH ...TO RESTART FROM IN CASE THE SECOND LETTER DOESN'T MATCH, OR TO INDICATE WHERE AN OCCURRENCE WAS FOUND LATER. CONT CB *R3,@VALID HAVE WE ALREADY MATCHED ALL CHARACTERS? JEQ OUTYES YES! MATCH FOUND! NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JEQ OUTNO YES! EXIT(NO OCCURRENCE(S)) FOUND. NO! CONTINUE. INC R3 ADVANCE TO THE NEXT LETTER OF THE SEARCH TERM. CB *R3,*R4+ COMPARE ADDITIONAL LETTERS, ONE AT A TIME. JEQ CONT YES! CHECK 3RD AND UP, LETTERS. IF A LETTER DOESN'T MATCH, CONTINUE. RESTAR MOV R5,R4 RESTORE NEXT POSSIBLE FIRST LETTER MATCH ADDRESS. JMP SEARCH KEEP SEARCHING FOR NEXT FIRST LETTER MATCH. OUTYES MOV R5,R4 RETRIEVE POSITION OF THE PREVIOUS NEXT POSSIBLE FIRST LETTER MATCH. DEC R4 SET R4 TO THE POSITION OF THE FIRST CHARACTER OF THE MATCHED TERM. RT OCCURRENCE FOUND END FEELS SO GOOD! I'm going back, back to this code and I'll try to adapt it. I gave my own code a try and had good results, but too good, apparently. Because I would find words like, seven when seven didn't exist, but the word even was there in my page that I was searching and so I was picking up words that had similar characters. I found all the words I was searching for, but I can't seem to shake the errors like above mentioned. So im going to try to adapt your sweet code again. Edited July 11, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 On 6/30/2020 at 10:15 PM, HOME AUTOMATION said: AORG >CBD4 *DELETE TEST TEXT 'COMEFINDMEBRO' *DEL AORG >7D00 *DEL QUERI TEXT 'COMEFINDMEBRO' *SET THIS LINE UP IN YOUR PROGRAM, DELETE FROM HERE DATA 0 *THIS SHOULD FOLLOW YOUR BUFFER SPACE, DELETE FROM HERE VALID DATA 0 ENTRY LI R4,>A000 *SET THIS VALUE UP IN YOUR PROGRAM, DELETE FROM HERE LI R6,>0000 *SET THIS VALUE UP IN YOUR PROGRAM, DELETE FROM HERE SEARCH LI R3,QUERI *THIS IS THE LINE TO BL TO! CMPARE CB *R3,*R4+ JEQ NEXT C R4,R6 JNE CMPARE OUTNO RT NEXT MOV R4,R5 CONT CB *R3,@VALID JEQ OUTYES C R4,R6 JEQ OUTNO INC R3 CB *R3,*R4+ JEQ CONT RESTAR MOV R5,R4 JMP SEARCH OUTYES MOV R5,R4 DEC R4 RT END Here, I removed the testing lines for you. I hope I did it right. VALID DATA 0 SEARCH LI R3,QUERI *THIS IS THE LINE TO BL TO! CMPARE CB *R3,*R4+ JEQ NEXT C R4,R6 JNE CMPARE OUTNO RT NEXT MOV R4,R5 CONT CB *R3,@VALID JEQ OUTYES C R4,R6 JEQ OUTNO INC R3 CB *R3,*R4+ JEQ CONT RESTAR MOV R5,R4 JMP SEARCH OUTYES MOV R5,R4 DEC R4 RT END Set up a buffer labeled QUERI, make sure to fill it with all zeros, before overlaying your search term. This buffer should have an extra 1 or 2 zeros after it's max. length! This will indicate the search completed successfully, when found by my program. R4=Where to start searching from. R6=Where to stop searching. BL @SEARCH This should find the first occurrence, before returning to your program. R4 will be set to the starting address of the found term. or R4 will be equal to R6 if nothing was found. Adding the length of the search term to R4, then BL-ing back to SEARCH, should allow you to find the next occurrence. Good luck, you might need it. EDIT: I hope these comments make more sense to you, than they do to me! VALID DATA 0 TERM FOUND, COMPARATOR. SEARCH LI R3,QUERI R3=SEARCH TERM'S ADDRESS. *THIS IS THE ENTRY ADDRESS! CMPARE CB *R3,*R4+ COMPARE 1st LETTER OF SEARCH TERM, TO THE LETTERS IN THE SPECIFIED RANGE, ONE LETTER AT A TIME. JEQ NEXT DO THEY MATCH? YES! CHECK IF SECOND LETTERS MATCH. NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JNE CMPARE NO! CHECK NEXT LETTER IN THE SPECIFIED RANGE. YES! CONTINUE. OUTNO RT BYE, NOTHING FOUND. NEXT MOV R4,R5 SAVE THE POSITION OF THE NEXT POSSIBLE FIRST LETTER MATCH ...TO RESTART FROM IN CASE THE SECOND LETTER DOESN'T MATCH, OR TO INDICATE WHERE AN OCCURRENCE WAS FOUND LATER. CONT CB *R3,@VALID HAVE WE ALREADY MATCHED ALL CHARACTERS? JEQ OUTYES YES! MATCH FOUND! NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JEQ OUTNO YES! EXIT(NO OCCURRENCE(S)) FOUND. NO! CONTINUE. INC R3 ADVANCE TO THE NEXT LETTER OF THE SEARCH TERM. CB *R3,*R4+ COMPARE ADDITIONAL LETTERS, ONE AT A TIME. JEQ CONT YES! CHECK 3RD AND UP, LETTERS. IF A LETTER DOESN'T MATCH, CONTINUE. RESTAR MOV R5,R4 RESTORE NEXT POSSIBLE FIRST LETTER MATCH ADDRESS. JMP SEARCH KEEP SEARCHING FOR NEXT FIRST LETTER MATCH. OUTYES MOV R5,R4 RETRIEVE POSITION OF THE PREVIOUS NEXT POSSIBLE FIRST LETTER MATCH. DEC R4 SET R4 TO THE POSITION OF THE FIRST CHARACTER OF THE MATCHED TERM. RT OCCURRENCE FOUND END FEELS SO GOOD! Here's my code, I'll supply a video soon 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 (edited) Here are the values: Libad7 is the string that the user keys in, it can be a length of 16 characters. S32P1 is page 1 of my 16 pages in cpu,(nice find, Automation) RAM. It's 860 bytes in length. Located in lower ram, but not all of my pages are in lower ram, and not all pages are consecutive, meaning, 1 page does not follow another, necessarily. Pages are identified as S32P1,S32P2,S32P3,S32P4,S32P5,S32P6,S32P7,S32P8,S32P9,S32PA,B,C,D,E,F,G PAGE contains the number 1-16 this is later passed to the program, I'm setting it solid here as I already know I'm dealing with page 1, so I'm safe setting this. This represents the current search word and where it was found, page 1? Page 2? Etc.. RRA2 contains the word length of the word that the user keyed in. If the user typed TI-99 then RRA2 contains a 5. Note: libad7 is cleared prior to the user entry data. It's cleared with >20, spaces, all 16 characters before the user typed the word that is to be searched. Edited July 13, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 (edited) Here's my video. I can search, and if the word I found, then I manually tell it to pull up page 1 in the last part of code, but it's finding even instead of eleven. And not landing on the first found word, but here it's likeif the first word I'm looking for is located on the first line then it puts the cursor on the work if it's on the second line and it puts it a line behind it and if it's the third line it puts it like two lines behind it so far so on but it still pulls up to page regardless which is cool meaning it found the word. VID_20200712_084203852.mp4 Edited July 12, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 I'm going to try again, and use automation's code. I'll have to push a zero to the end of my user word string, while keeping RRA2 untouched. Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 (edited) NO! CHECK NEXT LETTER IN THE SPECIFIED RANGE. YES! CONTINUE. OUTNO RT BYE, NOTHING FOUND I'm not understanding how the BL to search works If it's only finding one character in the string and returning to my program? Why do I need the BL routine? And how do I know I have a word match, because outyes is a rt.? Anyway, the BL is confusing me. Lol I'll keep adjusting and see what I can come up with. Yayhoooo Edited July 12, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 12, 2020 Share Posted July 12, 2020 22 hours ago, GDMike said: Haha...^^^ ^^^^^^this server is sooo silly... 7 hours ago, GDMike said:On 6/30/2020 at 11:15 PM, HOME AUTOMATION said: ... R4 will be set to the starting address of the found term. or R4 will be equal to R6 if nothing was found. ... This search program, as intended, will check the entire string before RETURNing to the calling program. I'm only showing it as a subroutine for convenience ...both since, that seemed to be what you have been doing and since, I envisioned that you might want to use it dynamically, and perhaps from farther away than JMPs would allow for. If R4<>R6 you've found a match(entire string)! P.S. I have yet to review your code/download video. P.P.S. I should have set this up, in a working example for you. However, I am burdened with many responsibilities right now! 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 12, 2020 Author Share Posted July 12, 2020 Good to know an answer to that, probably obvious to most, but I really thought so originally, but then started thinking, and that's where I got in trouble. Ok, I need to get rid of the BL and I do need it in a jump format, for it's driving me crazy, I cannot seem to make it work when I threw out the bl, I also tried it with keeping the BL and since I'm doing a BL to get to this, I did what Lee said, just remember r11 prior to the BL and be sure to ret back before returning to the original BL. So I tried that and found that the lockup routine I created worked but nothing else, so I've reverted back to your original code minus the BL and put it as a regular in line process to my calling BL And just removed my old program instead. But it's lock up again. So I'm made jumps back to search where you have RT and the program comes back saying it found the string, Even the string I don't have in memory. But no more locking up. I've been playing with yes and no routines because I don't know where to look for a successful word find. Thx for taking some time out of your day - no hurry automaniac man, it can wait for your next vodka. I'm just going to go play with the cb radio on skip.. lol 1 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 12, 2020 Share Posted July 12, 2020 Hmm, you do realize this is searching CPU, not VDP? Wish I was well enough for Vodka... was at the Liq. Store today ...but returned with only more empty boxes... 1 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 13, 2020 Author Share Posted July 13, 2020 Yup. I said that earlier I believe. There's a difference. Oh, I hope I didn't say vdp RAM, did I? Naaaa... really? Hmmm Oh well. Must of been having one of those days.. Did you see my code? It actually finds the words searched, but it's got some kind of problem. It's very close to working I believe. "I'm stuck in the middle with you" Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 13, 2020 Author Share Posted July 13, 2020 Ok, I fudged and fudge and yeah, I can't get a positive or correct negative on a find. Sorry, I've exhausted my structure in your code, I'm not getting Wonderful and exciting conclusions, just wonderful confusion. Sorry. I've got to wait until you have time again. I'm already doing a BL to my search routine, I call findw. It looks like this: FINDW mov R11,@SAVRTN LI R9, LIBAD7 * contains my search word plus 2 zeros LI R10,S32P1 * my page with cool stuff, like boat payment structure, future house budget, etc. RRA2= the length of libad7, without zeroes padded Take care, gotta go do my hair Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 13, 2020 Share Posted July 13, 2020 (edited) It's been a while since you uploaded any code. It might help, if I could see how your managing R4, R6... If you're searching paged memory. How this is being translated into VDP memory. Coming up with insightful examples is difficult w/o knowing your work environment. You wont tell me if you have/use a MINIMEMORY cartridge! That's often my first choice for development! Maybe if you familiarized yourself, by running the code's example somewhat, before... trying to adapt it... might yield better results. Edited July 14, 2020 by HOME AUTOMATION 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 14, 2020 Author Share Posted July 14, 2020 (edited) I did think about just cutting your code as a standalone and throwing it in a EA test sandbox, but then talked myself out of it, because I figured you'd have something to account for my not getting r4 or r6 values as they should produce. Nonetheless, I will definitely give that a try tommorow, and I'm glad you reminded me to do that, I just was caught up in the distraction But that sounds like a super duper idea to me. And funny, I usually do that, as I did that with the division problems and the hmm I forget, but something else that you sent me. Thx for guiding me. Stupid me, I should have done that. In a good note, I fixed my lawnmower that has been fighting me for 4 days. Ehh.. don't think about even looking at it in your mind as it will break on a dime!! Ehh . Don't do it!!! I got it rt where it'll run. Ok. Thx again for the exciting times! I can't wait to try tommorow. Well, were watching the Vikings series at this time, gotta go for now. Edited July 14, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 14, 2020 Author Share Posted July 14, 2020 (edited) Btw. I use e/a, explorer But seldom use explorer unless I can't understand a value. I'll be using it in my sandbox I'll setup a blank page 1 with some text I'll setup a search word on libad7 padded with 18 zeros, and as my search word is, in this scenario, 7 characters long. And I suppose I have to do a BL to search, but you left a couple of rt for tests true and false, I like to setup a savrtn prior to the BL and returning to savrtn.. Can I trust just a rt? I'll test that too in explorer It's Happening Edited July 14, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted July 15, 2020 Share Posted July 15, 2020 27 minutes ago, GDMike said: Can I trust just a rt? For RT, the Assembler emits the code for B *R11 If you are restoring R11, RT is perfectly safe. ...lee 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted July 15, 2020 Share Posted July 15, 2020 For what it's worth, I have never used RT. To me, B *R11 is unambiguous as to what is happening. Also, if a subroutine calls another subroutine you can: SUBRT1 MOV R11,R10 (store return address) Do some stuff BL @SUBRT2 (which returns with B *R11 Do some more stuff B *R10 (return) (you don't have to move R10 back to R11 and then RT) 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Well, I think it's good for people like me that tend to forget stuff, I like to see where I'm coming from and going to.. until I get better versed. Here I've set up a test example, hoping I can see how the search will work. This is all the code I've done. It's setting up S32P1 as a page of data. It sets up a search word, the word is "SEARCH" in uppercase. It is located on page 1. See video and code pictures Next I'll import automation's code VID_20200714_205154148.mp4 Edited July 15, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 15, 2020 Share Posted July 15, 2020 2 hours ago, GDMike said: explorer M.G. explorer? 2 hours ago, GDMike said: but you left a couple of rt for tests true and false, VALID DATA 0 TERM FOUND, COMPARATOR. SEARCH LI R3,QUERI R3=SEARCH TERM'S ADDRESS. *THIS IS THE ENTRY ADDRESS! CMPARE CB *R3,*R4+ COMPARE 1st LETTER OF SEARCH TERM, TO THE LETTERS IN THE SPECIFIED RANGE, ONE LETTER AT A TIME. JEQ NEXT DO THEY MATCH? YES! CHECK IF SECOND LETTERS MATCH. NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JNE CMPARE NO! CHECK NEXT LETTER IN THE SPECIFIED RANGE. YES! CONTINUE. OUTNO RT BYE, NOTHING FOUND. NEXT MOV R4,R5 SAVE THE POSITION OF THE NEXT POSSIBLE FIRST LETTER MATCH ...TO RESTART FROM IN CASE THE SECOND LETTER DOESN'T MATCH, OR TO INDICATE WHERE AN OCCURRENCE WAS FOUND LATER. CONT CB *R3,@VALID HAVE WE ALREADY MATCHED ALL CHARACTERS? JEQ OUTYES YES! MATCH FOUND! NO! CONTINUE. C R4,R6 HAVE WE REACHED THE END OF THE SEARCH RANGE YET? JEQ OUTNO YES! EXIT(NO OCCURRENCE(S)) FOUND. NO! CONTINUE. INC R3 ADVANCE TO THE NEXT LETTER OF THE SEARCH TERM. CB *R3,*R4+ COMPARE ADDITIONAL LETTERS, ONE AT A TIME. JEQ CONT YES! CHECK 3RD AND UP, LETTERS. IF A LETTER DOESN'T MATCH, CONTINUE. RESTAR MOV R5,R4 RESTORE NEXT POSSIBLE FIRST LETTER MATCH ADDRESS. JMP SEARCH KEEP SEARCHING FOR NEXT FIRST LETTER MATCH. OUTYES MOV R5,R4 RETRIEVE POSITION OF THE PREVIOUS NEXT POSSIBLE FIRST LETTER MATCH. DEC R4 SET R4 TO THE POSITION OF THE FIRST CHARACTER OF THE MATCHED TERM. RT OCCURRENCE FOUND END FEELS SO GOOD! No, it's not a test! When I'm testing you, you'll KNOW! You're looking at this in an over complicated way... ...I believe I have traveled far enough, that I have earned the right to use as many RTs in my subs, as I please! When you think about it... they're all going to the same place... so subprograms can really only have 1 return address. Even with more entry points... it would still only be 1 subprogram. probably the best thing to do is: upon return, C R4,R6, as I do above, to see if the search has reached the end of the "search space". This should never be "true" if a match was found. so, JNE to the section of your program that handles matches, or perhaps, JEQ to the section of your program that handles mismatches. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) I'm putting it together next, so I can watch it in MG explorer. But I'm going to get a Scooby snack first. I'll be watching my phone. Edited July 15, 2020 by GDMike 1 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 15, 2020 Share Posted July 15, 2020 1 hour ago, GDMike said: FINALLY... My name, in lights!!! Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Ok, this is similar to what I'm doing in my program up to this point, except how I'm getting "SEARCH" into LIBAD7. But I'm still reading the screen like this and vmbr into LIBAD7 in both programs. I believe it's padded with zeros. I'll now add your code to this Hollywood production. I'm not interested in adding any BL routines to aid me in my kscans or clear screens, this is just a test. Edited July 15, 2020 by GDMike 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 Where do I enter? Do I do something like this? Ifvi do a BL @search will my R4 be valid in cmpre? Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 Atariage won't allow me to upload now. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.