GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 I can't edit my last post, I can't upload a photo I Made. I'm rebooting my phone..one sec Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Now I don't want to BL to this routine, but Im trying to figure out how to enter and keep my R4 alive. So I'm stuck rt here at the moment.. Edited July 15, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+adamantyr Posted July 15, 2020 Share Posted July 15, 2020 My super awesome random number generator! First, you need to initialize the 9901 counter at the start of your application: * Set up 9901 counter CLR R12 * CRU base of the TMS9901 SBO 0 * Enter timer mode LI R1,>3FFF * Set counter INCT R12 * Address of bit 1 LDCR R1,14 * Load value DECT R12 SBZ 0 * Exit clock mode, start decrementer Then, the following routines will generate either a 16-bit word size random value, or any value from 0 to max-1. I've set them up to have their own workspace but you don't need to do this if you don't want to. * Random number generator (Range in R3, Result in R4) * Returns 0 to R3-1 RNDNUM DATA VWS,RAND2 RAND2 BL @RNDGEN MOV @>0006(R13),R3 CLR R4 DIV R3,R4 MOV R5,@>0008(R13) RTWP * Random number generator 16-bit (Result in R4) * returns 0-65535 RANDOM DATA VWS,RAND1 RAND1 BL @RNDGEN MOV R4,@>0008(R13) RTWP * Random number generation RNDGEN LI R4,23729 * Load with 15-bit value MPY @RSEED,R4 * Multiply by the random seed AI R5,31871 * Add a 15-bit value to the lower word CLR R12 * CRU base of the TMS9901 SBO 0 * Enter timer mode STCR R0,15 * Read current value (plus mode bit) SRL R0,1 * Get rid of mode bit SBZ 0 * Exit clock mode, decrementer continues ANDI R0,>000F * Filter to 0-15 JEQ RNDGN1 * If zero, skip SRC R5,0 * Rotate seed based on clock value RNDGN1 MOV R5,@RSEED * Copy back to RSEED 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) Fantastic!!! Now I see what I was hunting for..here * returns 0-65535 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 ...I'm still figuring out, what RDD does. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Where is that? Are you seeing double, double mr.Roboto Robocall But I have a million uses for that generator! Very very cool. Thank you!! Edited July 15, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Yup. If I do a BL @ search and a rt occurs, doesn't or won't that put me at SEARCH again? Edited July 15, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 THIS IS THE LINE TO BL TO! Ok I think I got it. Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 Assembling Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 I got a successful hit ..hold on Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 I'm just trying to line up the address in R4 with the word on the screen.. Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 15, 2020 Share Posted July 15, 2020 I'm still reviewing the code in your pics... I'm up to KSC... sort of. Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) I am fixing something 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 (edited) 2 hours ago, GDMike said: looking at LI R0, LI R1, LI R0, LI R1... you realize that the last two prevail? Edited July 15, 2020 by HOME AUTOMATION 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 Hold on. I'm about to find out if it's working yahooooooo 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: If LIBCLR is supposed to clear WORDS @>FFE0. It looks like it will instead, fill it with ascending numbers... 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 (edited) Yep fixed. Thx..was in a hurry Edited July 15, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 I was trying to make sure that my word that I'm searching for that I actually put on the screen wasn't being found later by the search program Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 All right I'm going to give you the code that I've got I keep coming up with a hit and I shouldn't be hitting Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 15, 2020 Share Posted July 15, 2020 (edited) 3 hours ago, GDMike said: LIBAD7 SHP S32P1 LBWRD TEXT 'SEARCH' DATA 0 *These are the zeros that need to follow the search term! SRCHF Edited July 15, 2020 by HOME AUTOMATION oops ... had DATA 0, in the LABEL field! Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 Here's the updated code test I'm putting an "A" at pos 0 on the screen if it's a bad search. If it's a good search, then I'm placing an asterisk on the word. I'm having to convert the address in R6 to the screen location. But I didn't have any luck, I tried inct in my loop and just a Inc but I always seem to place an asterisk at the position it shows now. And I'm always hitting a positive search no matter what my search word is. Quote Link to comment Share on other sites More sharing options...
GDMike Posted July 15, 2020 Author Share Posted July 15, 2020 I can't see straight..I'm going to dream about getting a great result. I'll wake up and it'll hit me..or something will.. Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted July 15, 2020 Share Posted July 15, 2020 ...downloading video(pg 3). ...Looking at KS3. 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 changed my search word a couple times, first it was"SEARCH" and it was a positive hit, then changed to Mike, it too was a positive hit. I wanted to make sure that I wasn't placing the search word into my copied screen page, as I thought that was happening. But I don't think it was. Is it ok if I crash? At this moment im starting to screw with things and I'm messing it up. I'll read notes in a couple hours ?? 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 15 minutes ago, GDMike said: I explained this wrong... LIBCLR was moving WORDs starting in ROM @>0000. ...Now it's just copying the WORD @>0000, repeatedly. anyhow... no need to do this. 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.