+9640News Posted June 5, 2020 Share Posted June 5, 2020 6 minutes ago, GDMike said: Thx asmusr and Mr beery I think I went back and edited my post, so please go back and check it again as I added some significant details for you to consider. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 5, 2020 Author Share Posted June 5, 2020 1 hour ago, BeeryMiller said: I think I went back and edited my post, so please go back and check it again as I added some significant details for you to consider. Very well. I'll look Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 5, 2020 Author Share Posted June 5, 2020 (edited) 1 hour ago, BeeryMiller said: I think I went back and edited my post, so please go back and check it again as I added some significant details for you to consider. Ahh. Yes. OK, well that would help for those situations. Good to know. Thx for that great documentation and research. I'll place it in my "planning" book. If i encounter something, I'll post it. BTW, would there ever be a situation for a file to look like: "DSKA.FILE" or "DSK.FILE" Or anything other than "DSK", besides, "CS1" or 2. Thx Mr. Beery Edited June 5, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted June 6, 2020 Share Posted June 6, 2020 7 hours ago, GDMike said: BTW, would there ever be a situation for a file to look like: "DSKA.FILE" or "DSK.FILE" Or anything other than "DSK", besides, "CS1" or 2. Yes. The device name (everything before the first dot) is how DSRLNK finds the correct DSR. The TI controller only answers to DSK1, DSK2, DSK3 and DSK. If you use DSK, you must include the disk name or the device will not be found (DSK.DISKNAME.FILENAME). Other disk controllers allow/require additional device names such as SCS1, IDE1, etc. Any DSR can include whatever name it likes in its linked list for device names. Some DSRs allow subdirectories (TIPI, SCSI, HFDC, etc.). Others will jump in with better information, I have no doubt. ...lee 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 6, 2020 Author Share Posted June 6, 2020 Ahh..ok. I thought I'd better ask. I'm only familiar with DSK1-3, but now with this, takes some creative thinking to figure out how far I go. Thx Lee. Quote Link to comment Share on other sites More sharing options...
+9640News Posted June 6, 2020 Share Posted June 6, 2020 If you want/desire to implement CPU to DISK instead of CPU to VDP to DISK transfer for those devices that will support it, then you will likely need to add some detect code right before you go into a DSRLNK call testing for compatible devices. As users are likely to save to one device initially, and then potentially save to another device later, you will probably need the detect code for device. This may involve scanning the desired DSR table for the device looking for WDSx or SCSx. Others will have to speak up if there are other devices that support the capability for CPU to DISK transfers (and vice versa). SCSx and WDS should be east to test by just the PAB name. If they save to DSKx devices of those controllers, then you will need to identify supported devices. Somewhere, someone has some device detect code they would be willing to share. If need be, I suppose there is some code in MDOS for the Geneve to distinguish devices, but I am sure there are some better sources elsewhere. Beery 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 6, 2020 Author Share Posted June 6, 2020 (edited) I've completed the search for "DSK" on my command line, I'll need, and hope to find, all aspects of that, to complete my command line search. The command line does the configuration of the device after it's found in order to prepare it for DSR. The way I've set up my command line, requires a library element to be created, as it's libr1 is set as"DSK" and so on, in this case, and that word is placed in ram and my search routine searches memory location based on the library address. I have a few library elements created. It makes future library elements easy to add and search for, as my search sets up the first library and continues search all libraries in order until found or not. Thank you. Mr beery Edited June 6, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 8, 2020 Author Share Posted June 8, 2020 (edited) While I was thinking, ok, procrastinating on my DSR situation, I came up with this for some sort of title.... But it's a start. VID_20200607_231615951.mp4 Edited June 8, 2020 by GDMike 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 9, 2020 Author Share Posted June 9, 2020 Updated start up screen. VID_20200608_232324719.mp4 2 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted June 9, 2020 Share Posted June 9, 2020 SNP, Huh! 1 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 9, 2020 Author Share Posted June 9, 2020 Rt now that's the face of my dog. He's so mad at me. Lol 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 10, 2020 Author Share Posted June 10, 2020 On 6/9/2020 at 3:25 AM, HOME AUTOMATION said: SNP, Huh! I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. It's a simple thing, but I can't get it. LI R3, >0042 LI R4, >10 DIV R3,R4 I'm supposed to get a 2 and remainder of 1. For some reason I have no attachment option. I was going to show my registers in explorer and what my results were. No where near what I thought I'd get. Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout. Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted June 10, 2020 Share Posted June 10, 2020 ...just sent you a PM about your underlying motivation... other than that ...I'd have to pull out the E/A manual to see about remainders. Quote Link to comment Share on other sites More sharing options...
+9640News Posted June 10, 2020 Share Posted June 10, 2020 7 minutes ago, GDMike said: I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. It's a simple thing, but I can't get it. LI R3, >0042 LI R4, >10 DIV R3,R4 I'm supposed to get a 2 and remainder of 1. For some reason I have no attachment option. I was going to show my registers in explorer and what my results were. No where near what I thought I'd get. Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout. Is this hex value for display purposes, or for a variable to be used in your assembly code for other purposes? The Blue TI Assembly Language book should have the routine(s) in there. Beery 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 10, 2020 Share Posted June 10, 2020 (edited) When you divide, your dividend is a 32bit number (two registers!). Thus, a DIV R3,R5 means: ((R5 << 16) + R6) / R3 Edited June 10, 2020 by mizapf 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 10, 2020 Author Share Posted June 10, 2020 That was my problem. Too I c Thx for clarifying Quote Link to comment Share on other sites More sharing options...
Stuart Posted June 10, 2020 Share Posted June 10, 2020 1 hour ago, GDMike said: I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. It's a simple thing, but I can't get it. LI R3, >0042 LI R4, >10 DIV R3,R4 I'm supposed to get a 2 and remainder of 1. For some reason I have no attachment option. I was going to show my registers in explorer and what my results were. No where near what I thought I'd get. Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout. The TI Editor/Assembler manual explains the instruction, as Beery commented above. Basically, the value you're dividing is a 32-bit word that occupies two registers (or 16-bit words in memory). The value you're dividing by is a 16-bit value in a single register (or 16-bit word in memory). With the DIV instruction, the first value is the value you're dividing by, and the second value is the value you're dividing. So for your example you want something like: CLR R3 'Put the value you're dividing in R3 and R4. You're only dividing a small number so R3 is clear. LI R4,>0042 LI R5,>10 'Value you're dividing by. DIV R5,R3 After the operation, R3 contains the quotient, and R4 the remainder. Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 10, 2020 Author Share Posted June 10, 2020 1 hour ago, BeeryMiller said: Is this hex value for display purposes, or for a variable to be used in your assembly code for other purposes? The Blue TI Assembly Language book should have the routine(s) in there. Beery Ahh. I thought my numbers, both registers, could be in LSB only. Not true I see. This is why I'm asking.. Beery, it's input from the user and can be a number from 0-254. I got the zero weeded out in code, I've also weeded out a real 1 digit opposed to 007 for example, and 070 would be taken as ASCII 70. Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 10, 2020 Author Share Posted June 10, 2020 I tried some values in R2,R3 and I never received anything in R4. Confoosed Quote Link to comment Share on other sites More sharing options...
Stuart Posted June 10, 2020 Share Posted June 10, 2020 4 minutes ago, GDMike said: I tried some values in R2,R3 and I never received anything in R4. Confoosed Post your code. Easy to get all the registers round the wrong way! 2 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 10, 2020 Share Posted June 10, 2020 (edited) The description is correct. As second operand, you specify the first register of the 32bit number, here, R3. The dividend is (R3,R4) = (R3<<16)+R4. The divisor is the word at (ADR + contents of R2). The result is in R3 (quotient) and R4 (remainder). Edited June 10, 2020 by mizapf 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 10, 2020 Share Posted June 10, 2020 (edited) Example: LI R3,0 LI R4,101 LI R2,4 DIV R2,R3 Result should be R3 = 25, R4 = 1. Edited June 10, 2020 by mizapf 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 11, 2020 Share Posted June 11, 2020 (edited) For what it's worth... This is the kind of thing where a Forth style assembler and Classic99 can be really handy to explore how instructions work without compiling the entire program and writing special test code to display results or memory locations. Then you can take what you've learned and confidently code it into your application. With the MARKER directive you can purge your little routine from the system without removing all the tools (Assembler etc..) and just re-assemble the little routine over and over until it works! I am using my Forth here but all the others can do the same thing. Not bad for 1970's technology. Spoiler \ You can play with Assembler in tiny pieces in Forth to learn \ then convert back to TI assembler for the actual program \ Paste this into Classic99 with Camel Forth running \ Mitzaph's example \ LI R3,0 \ LI R4,101 \ LI R2,4 \ DIV R2,R3 \ conditionally pull in the Assembler and some tools NEEDS MOV, FROM DSK1.ASM9900 \ load the assembler NEEDS MARKER FROM DSK1.MARKER NEEDS .S FROM DSK1.TOOLS \ translate to Camel Forth for interactive testing MARKER REMOVE \ REMOVE forgets our code but keeps the assembler & tools DECIMAL CODE DIVTEST ( -- n tos ) \ tos is R4 in Camel99 Forth TOS PUSH, \ SAVE R4 (called TOS). gives us free use of R4 \ Mitzaph's example in Forth Assembler R3 0 LI, R4 101 LI, R2 4 LI, R2 R3 DIV, \ R4, the TOS register should be 1 R3 PUSH, \ Push R3 onto Forth stack so we can see it easily NEXT, \ return to Forth ENDCODE Classic99 QI399.025 2020-06-10 21-17-41.mp4 Edited June 11, 2020 by TheBF 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted June 11, 2020 Author Share Posted June 11, 2020 (edited) 3 hours ago, mizapf said: Example: LI R3,0 LI R4,101 LI R2,4 DIV R2,R3 Result should be R3 = 25, R4 = 1. Yes it works in explorer the way you show. But I tried with >42 which is ASCII for asterisk>2A. And got a 4. I'm trying to pull a >2A out of my R4,>42. My formula places a result of hex 42 into my R4. Even though it isn't >2A it represents what I'm trying to convert into a Asterisk. I looked online and I found that if I divide the hex 42 until 0 and count the remainder and convert the remainder into a character 1 for A 2 for B that's how it would work. And it worked fine on my calculator but I can't get it to work in explorer. Thx Edited June 11, 2020 by GDMike Quote Link to comment Share on other sites More sharing options...
+TheBF Posted June 11, 2020 Share Posted June 11, 2020 your example is dividing HEX 42 ( DECIMAL 66) by HEX 0A ( DECIMAL 10) So that gives the result 6 with 6 as the remainder. I am not sure what you want to do exactly. Convert a binary number into ascii digits? 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.