+retroclouds Posted December 24, 2019 Share Posted December 24, 2019 Is there an example available on how to read the floppy disk catalog in assembly language? 1 Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted December 24, 2019 Share Posted December 24, 2019 Is there an example available on how to read the floppy disk catalog in assembly language? Did you look in the ea manual?Sent from my LM-G820 using Tapatalk Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 24, 2019 Share Posted December 24, 2019 25 minutes ago, arcadeshopper said: Did you look in the ea manual? The E/A manual is pretty useless on that count. It suggests using the Disk Manager cartridge to get a disk catalog. ...lee 1 2 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted December 24, 2019 Author Share Posted December 24, 2019 ok, guess I'll take a look at the specification documents or the "The Art of Assembly Language" series. 2 Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted December 24, 2019 Share Posted December 24, 2019 Thierrys site also? http://www.unige.ch/medecine/nouspikel/ti99/disks2.htm#Low-level%20routinesSent from my LM-G820 using Tapatalk Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 24, 2019 Share Posted December 24, 2019 1 hour ago, retroclouds said: Is there an example available on how to read the floppy disk catalog in assembly language? The disk catalog is a pseudo-file created by the DSR when you attempt to open a file with a null name, such as "DSK1." The file should be opened for input and relative access as IF38. There are exactly 128 records with 38 bytes/record, each composed of 1 string and 3 floating point (FP) numbers. Each field has a one-byte count (even the FP fields!). The string field is padded on the right with spaces, so, I believe, the string length is always 10. In any case, the field is always 11 bytes. The FP fields each have a length byte of 8 followed by the 8-byte FP number, so are 9-byte fields. The disk information is contained in record 0 and the remaining records contain information about each of the 127 possible files on the disk. Actual files are first in the (alphabetical?) list with the remaining, non-existent files as null strings (or, at least, names with 10 spaces) and zeroed FP fields. Record 0 fields: Disk name (counted string in an 11-byte field) Record type (0 for this record) Total number of AUs (sectors) on the disk Free AUs (sectors) on disk Records 1 – 127 fields: Filename (counted string in an 11-byte field) File type (negative if protected) (1) Display/Fixed (2) Display/Variable (3) Internal/Fixed (4) Internal/Variable (5) Memory image (last field will be 0) AUs (sectors)/file Bytes/record The above is from Functional Specification for the TI/99 Disk Peripheral. I think WHTech has it. I can post it if you need. ...lee 2 1 Quote Link to comment Share on other sites More sharing options...
+retroclouds Posted December 25, 2019 Author Share Posted December 25, 2019 11 hours ago, Lee Stewart said: The disk catalog is a pseudo-file created by the DSR when you attempt to open a file with a null name, such as "DSK1." The file should be opened for input and relative access as IF38. There are exactly 128 records with 38 bytes/record, each composed of 1 string and 3 floating point (FP) numbers. Each field has a one-byte count (even the FP fields!). The string field is padded on the right with spaces, so, I believe, the string length is always 10. In any case, the field is always 11 bytes. The FP fields each have a length byte of 8 followed by the 8-byte FP number, so are 9-byte fields. The disk information is contained in record 0 and the remaining records contain information about each of the 127 possible files on the disk. Actual files are first in the (alphabetical?) list with the remaining, non-existent files as null strings (or, at least, names with 10 spaces) and zeroed FP fields. Record 0 fields: Disk name (counted string in an 11-byte field) Record type (0 for this record) Total number of AUs (sectors) on the disk Free AUs (sectors) on disk Records 1 – 127 fields: Filename (counted string in an 11-byte field) File type (negative if protected) (1) Display/Fixed (2) Display/Variable (3) Internal/Fixed (4) Internal/Variable (5) Memory image (last field will be 0) AUs (sectors)/file Bytes/record The above is from Functional Specification for the TI/99 Disk Peripheral. I think WHTech has it. I can post it if you need. ...lee Thanks Lee! That is some great information, it is much appreciated! The Functional Spec. is available in the DevRes Thread so should be able to grab it there. Making the catalog available as a pseudo-file is a cool idea must say. 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted December 27, 2019 Share Posted December 27, 2019 I'm glad to see this as I'm heading in a direction that's gonna require some if this info. Thanks so much Lee Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 27, 2019 Share Posted December 27, 2019 14 hours ago, GDMike said: I'm glad to see this as I'm heading in a direction that's gonna require some if this info. Thanks so much Lee No prob. Just so you know, you will need to decode the FP numbers in the last three fields of each record. If you need an explanation of FP representation on the TI-99/4A,“Appendix L” of my fbForth 2.0: A File-Based Cartridge Implementation of TI Forth gives one. A fair number of folks here can also help with converting FP to integer, which is what you will need to do with those FP numbers. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted December 27, 2019 Share Posted December 27, 2019 I used this code for my catalog program. Since GDMike can read Forth, he can convert this to ALC if it helps. It's not a complete conversion, just enough to deal the the magnitudes used in the catalog. Addr len is the string info from the field you want to convert. ie: get the field into a CPU ram buffer somewhere and go to town. : F>INT ( addr len -- addr len n) OVER C@ ( -- mantissa) CASE 0 OF 0 ENDOF 40 OF OVER 1+ C@ ENDOF 41 OF OVER 1+ C@ 64 * >R OVER 2+ C@ R> + ENDOF ( default) -1 \ bad # indicator ENDCASE ; 3 Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted December 27, 2019 Share Posted December 27, 2019 3 hours ago, TheBF said: I used this code for my catalog program. Since GDMike can read Forth, he can convert this to ALC if it helps. It's not a complete conversion, just enough to deal the the magnitudes used in the catalog. Addr len is the string info from the field you want to convert. ie: get the field into a CPU ram buffer somewhere and go to town. : F>INT ( addr len -- addr len n) OVER C@ ( -- mantissa) CASE 0 OF 0 ENDOF 40 OF OVER 1+ C@ ENDOF 41 OF OVER 1+ C@ 64 * >R OVER 2+ C@ R> + ENDOF ( default) -1 \ bad # indicator ENDCASE ; Very nice, except that you are not dealing with negative numbers, which can happen and would indicate a protected file. Also, I am pretty sure there can be as many as 32767 records (admittedly small ones if really that many) in a file, which hex representation would be >4203 >1B43 >0000 >0000. ...lee 1 Quote Link to comment Share on other sites More sharing options...
+TheBF Posted December 27, 2019 Share Posted December 27, 2019 Looks like I need a bigger case statement. Thanks. 1 1 Quote Link to comment Share on other sites More sharing options...
GDMike Posted December 27, 2019 Share Posted December 27, 2019 I understand some of what that says, but so far I've done very little CASE activity. So thank you for giving me credit anyway, but some of the general words I'm familiar with, yes. Quote Link to comment Share on other sites More sharing options...
+TheBF Posted December 28, 2019 Share Posted December 28, 2019 \ if the first byte is "0" return 0 0 OF 0 ENDOF \ if first byte is >40, fetch next char, that's the int value 40 OF OVER 1+ C@ ENDOF \ if first byte is >41, 41 OF OVER 1+ C@ 64 * >R \ fetch 1st byte, mult by 100, save this value OVER 2+ C@ R> + \ fetch 2nd byte, add it to the saved value Here is a little explanation of this (over) simplified float to integer conversion. Quote Link to comment Share on other sites More sharing options...
GDMike Posted January 12, 2020 Share Posted January 12, 2020 Looking for a venting area.. and I stopped here...I just learned a tough lesson.. using the CORRECT "compare" word in assy. I was debugging a problem for three days because for an erroneous R0 cursor location. And come to find out I used a "CI" instead of a "C". It was definitely a problem creator, not a resolver..ahh..I feel better that I found it and learned an important lesson. 2 Quote Link to comment Share on other sites More sharing options...
HOME AUTOMATION Posted January 12, 2020 Share Posted January 12, 2020 This has come up before... therefore, it will come up again... 1 Quote Link to comment Share on other sites More sharing options...
RXB Posted January 13, 2020 Share Posted January 13, 2020 On 12/24/2019 at 10:00 AM, retroclouds said: Is there an example available on how to read the floppy disk catalog in assembly language? Hmm my most favorite is these: File_Management_Specification_for_TI_99_4_Personal_Computer_V2.5_02-25-1983.pdf gpl_interfce_specs_for_99-4_disk_peripheral.pdf 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.