+Atari2600PAL Posted August 17, 2023 Share Posted August 17, 2023 I found 30 minutes to have a play @apersson850 and can now find my way around the menu system with '?' and do basic operations like a disk directory. Many thanks Decided to create a work disk for when I try my first application so formatted a DSDD disk (using CorComp disk manager) and then Zero'd it in p-code. It asked for the number of blocks and based on your information above I told it 720 blocks which created a PASCAL file that filled the DSDD disk so that looks good But I don't think my boot disk is working properly because when I tried to execute *DFORMAT it gave a bad file error? Also, the boot disk doesn't have SYSTEM.COMPILER (there may be others missing). It was an image called 705.dsk I got from WHTech ftp site Is there another disk image out there that has everything on it I might need to use the system please? (I only have two DSDD floppy drives so would like to have a boot disk with everything needed by the system and use dsk2, or should I say #5, for my own stuff while I learn) Many thanks Quote Link to comment Share on other sites More sharing options...
+TheBF Posted August 17, 2023 Share Posted August 17, 2023 19 minutes ago, FarmerPotato said: I've read much Niklaus Wirth in the past year, so new respect for Pascal. (Also Kernighan: Software Tools in Pascal.) Wirth was one those guys that did great work, but didn't get enough respect IMHO. After Pascal he went on to Modula and proved it could build an operating system. I think he even had custom silicon for one of his projects. How many millions of man hours were wasted waiting for C to compile compared to if people had been using a fast compiling language like Modula. Things I wonder ... Quote Link to comment Share on other sites More sharing options...
+mizapf Posted August 17, 2023 Share Posted August 17, 2023 I learned Modula-2 in my first semester 1989/90 in our introductory course at the university. Never used it again after that. 1 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted August 17, 2023 Author Share Posted August 17, 2023 There are two code pools. The primary one is between the screen data and disk buffers in VPD RAM. The secondary is in 24 K RAM expansion between the heap and the stack. Obviously the secondary pool is bigger to begin with, before anything has been loaded. P-code is loaded in segments. A "standard" program is usually only in one segment, and that segment isn't bigger than it fits in any code pool. The system then puts it in the primary one, because that leaves more space in the other one for the heap and stack to grow into. A big program can be split in several segments. For that to make any point, at least some of the different segments must be independent from each other, since a calling and called segment must stay in memory at the same time. But if you have a program with these functions, that is a good candidate for splitting up in segments, since it's likely that then only the main program and one of the other segments must be loaded at the same time. Program structure Main Setup Data entry Printout A program calling procedures in a separately compiled unit will also call a different segment. The units themselves may also be segmented. Segment properties A segment is loaded in memory only when needed. A segment can be moved in memory, inside the code pool, if it's in the way for something else. So a segment that can be overwritten by a lot of data added to the stack can be moved towards the heap, to allow room for the stack to grow. Note that this can happen while the segment is executing. It will just be halted, moved and restarted from where it was halted. A segment can be deleted from memory if it's not in use (no procedure running inside the segment). A segment that has been discarded can be reloaded again, if procedures are called inside the segment once again. Since segments in the primary code pool (VDP RAM) doesn't compete with data space (heap/stack), loading segments there has no space penalty. If you write your code in such a way that the segment Main and any one of the other three in the example above doesn't combine to larger size than will fit in the primary code pool (VDP), then you'll have the largest possible space for data all the time. The memory manager will also not need to move code, just load different segments when they are needed. Segments manipulating VPD RAM directly themselves must run from CPU RAM, or they'll literally trap their own feet. Segments containing assembly code also must run from CPU RAM, of course. They can still be made relocatable. The PME can execute code from CPU RAM, VDP RAM or GROM. Since reading from successive addresses in CPU RAM is different compared to reading from VDP RAM or GROM, the system replaces some code in the inner interpreter, if it switches from a segment in one type of code to the other. Reading data bytes is the same, just from different addresses, for VDP RAM and GROM. But setting up the address is different, so when there's a jump in the p-code, a flag will tell the PME which address loader code to use. As a summary, it's safe to say that the p-systems memory management capabilities is pretty outstanding, considering the machines and time it was running in. 4 1 Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted August 17, 2023 Share Posted August 17, 2023 5 minutes ago, TheBF said: Wirth was one those guys that did great work, but didn't get enough respect IMHO. After Pascal he went on to Modula and proved it could build an operating system. I think he even had custom silicon for one of his projects. How many millions of man hours were wasted waiting for C to compile compared to if people had been using a fast compiling language like Modula. Things I wonder ... The more I lean about C compilers--the preprocessor is the yuckiest. C is one hack atop another, which makes us hackers pleased (at first). But I feel like I work in the dead-end of ALGOL. I've stopped using C++ for money or pleasure. Imagining an alternative (still less than ideal) world where Pascal compiles to Pcode and prevented Java. In any of the Wirth languages, can you have a procedure that returns a procedure? Quote Link to comment Share on other sites More sharing options...
apersson850 Posted August 17, 2023 Author Share Posted August 17, 2023 The disks from TI were split up on several. One had the Compiler, another the Editor and Filer, a third the Assembler and Linker and a fourth the other utilities. You can make your own combination as you like, provided you do get the files to begin with. Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 17, 2023 Share Posted August 17, 2023 19 minutes ago, apersson850 said: The disks from TI were split up on several. One had the Compiler, another the Editor and Filer, a third the Assembler and Linker and a fourth the other utilities. You can make your own combination as you like, provided you do get the files to begin with. Have got a set of 5 x 92k dsk images for those (Compiler, Editor/Filer 1, Editor/Filer 2, Assemble/Link, Utils) I downloaded from somewhere, will try to use those to make a single 360k disk (less utils) Thanks Quote Link to comment Share on other sites More sharing options...
+FarmerPotato Posted August 17, 2023 Share Posted August 17, 2023 @apersson850 Thank you for the great explanation of code pools. I see now that, to have the heap there, is a better use of CPU RAM. TI offered two other Pascals with choice of interpreted "Pcode" or compiled. It seems that compiled code was position-independent (PIC) (no absolute addresses!) but I haven't read that the runtime ever moved it. See TI's "Software Development Handbook" or the MPX or RX manuals (Bitsavers) The Microprocessor Pascal runtime source is 50% known, thanks to Dave Pitts. (I will post those details appropriately into the topic Assembly Language Tricks) 3 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 17, 2023 Share Posted August 17, 2023 2 hours ago, Atari2600PAL said: Have got a set of 5 x 92k dsk images for those (Compiler, Editor/Filer 1, Editor/Filer 2, Assemble/Link, Utils) I downloaded from somewhere, will try to use those to make a single 360k disk (less utils) Thanks Turned out it was 4 disks, not 5, that I had Took a while to get my head around swapping the disks around so I could copy the 4 SSSD disks onto the 1 DSDD, but got there in the end and as a quick and dirty test I can now load *DFORMAT without error I guess next up will be to try a short program to get some kind of handle on how more of the system works Not used Pascal for decades so it won't be easy, but looking forward to it when I can find the time Many thanks Quote Link to comment Share on other sites More sharing options...
+TheBF Posted August 17, 2023 Share Posted August 17, 2023 4 hours ago, FarmerPotato said: The more I lean about C compilers--the preprocessor is the yuckiest. C is one hack atop another, which makes us hackers pleased (at first). But I feel like I work in the dead-end of ALGOL. I've stopped using C++ for money or pleasure. Imagining an alternative (still less than ideal) world where Pascal compiles to Pcode and prevented Java. In any of the Wirth languages, can you have a procedure that returns a procedure? That's above my pay grade but it seems to have pointers so if you can return a pointer to function ... Modula-2 tutorial: Pointers and Dynamic Allocation (modula2.org) Quote Link to comment Share on other sites More sharing options...
apersson850 Posted August 18, 2023 Author Share Posted August 18, 2023 (edited) There are pointers available in the UCSD implementation of Pascal too, but you can't call a procedure through them. On the other hand, the intrinsic pmachine allows you to generate inline p-code as you wish, so by some unorthdox coding this may be possible anyway. I don't remember without checking the p-codes for calling a procedure how the argument for which one to call is handled. My gut feeling is that they are included in the p-code, in which case self-modifying code would be needed to change which procedure to call. But if there's something that's unreliable in this world, it's self modifying code that's also moved around in memory and swapped in/out from disk at any time. A case statement listing the possible procedures and indexing which to call via a variable is at least a working method. Edited August 18, 2023 by apersson850 3 1 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 18, 2023 Share Posted August 18, 2023 Just written, compiled & run my first little test program Many thanks for getting me started I think all the manuals will be my bedtime reading for quite a while 5 Quote Link to comment Share on other sites More sharing options...
+Vorticon Posted August 18, 2023 Share Posted August 18, 2023 For anyone just starting out with UCSD Pascal, there is a Windows file utility called Pcode Tool which allows various manipulations of Pascal disk images and files, including copying and pasting of code from an external editor. Super helpful if you are emulator-based. manual.pdf p-code-tool-V3.0.exe 6 1 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 18, 2023 Share Posted August 18, 2023 1 hour ago, Vorticon said: For anyone just starting out with UCSD Pascal, there is a Windows file utility called Pcode Tool which allows various manipulations of Pascal disk images and files, including copying and pasting of code from an external editor. Super helpful if you are emulator-based. manual.pdf 376.09 kB · 1 download p-code-tool-V3.0.exe 156 kB · 1 download Am going to have to consider getting a cheap windows laptop for the various emulators I’d like to run and for tools like this 3 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 31, 2023 Share Posted August 31, 2023 Out of interest, does a gotek drive support the direct sector access the p-code card requires please? Many thanks Quote Link to comment Share on other sites More sharing options...
+mizapf Posted August 31, 2023 Share Posted August 31, 2023 A Gotek drive emulates a floppy drive at the Shugart bus level, so it does not even know what a sector is or even a byte. It only delivers flux changes. The only thing to consider is that only the HFE files can save special information that is outside of pure sector contents. Gotek can handle DSK files, but those only contain sector contents. As we're not talking about disk protection schemes but only about direct sector access, this should be OK. If needed, HFE files can be created with numerous tools from DSK, including my TIImageTool. 2 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted August 31, 2023 Share Posted August 31, 2023 21 minutes ago, mizapf said: A Gotek drive emulates a floppy drive at the Shugart bus level, so it does not even know what a sector is or even a byte. It only delivers flux changes. The only thing to consider is that only the HFE files can save special information that is outside of pure sector contents. Gotek can handle DSK files, but those only contain sector contents. As we're not talking about disk protection schemes but only about direct sector access, this should be OK. If needed, HFE files can be created with numerous tools from DSK, including my TIImageTool. Thanks for the info From what you say I can see that it should work in theory, but am wondering if anyone has actually used a gotek with the p-code card Ideally, if I got one, I'd really want to use it only with real iron (other than using my laptop to format a USB stick for it and simply copying dsk file images from/to it) and not need any other utilities (I don't want to install anything, like java, on my laptop) Many thanks Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted August 31, 2023 Share Posted August 31, 2023 7 hours ago, Atari2600PAL said: Thanks for the info From what you say I can see that it should work in theory, but am wondering if anyone has actually used a gotek with the p-code card Ideally, if I got one, I'd really want to use it only with real iron (other than using my laptop to format a USB stick for it and simply copying dsk file images from/to it) and not need any other utilities (I don't want to install anything, like java, on my laptop) Many thanks yes it works but i recommend you not use the stock firmware get flashfloppy 3 Quote Link to comment Share on other sites More sharing options...
+Atari2600PAL Posted September 1, 2023 Share Posted September 1, 2023 9 hours ago, arcadeshopper said: yes it works but i recommend you not use the stock firmware get flashfloppy Many thanks for the confirmation @arcadeshopper, good to know for the future when I can make more use of p-code Quote Link to comment Share on other sites More sharing options...
globeron Posted October 1, 2023 Share Posted October 1, 2023 On 9/1/2023 at 1:38 PM, Atari2600PAL said: Many thanks for the confirmation @arcadeshopper, good to know for the future when I can make more use of p-code Gotek + Flashfloppy image works perfect * here are the steps - https://forums.atariage.com/topic/316370-gotek-drives/?do=findComment&comment=4751261* * and I also changed the OLED, then you can see the disk image names (when swapping disks) - https://forums.atariage.com/topic/316370-gotek-drives/?do=findComment&comment=4765627 2 Quote Link to comment Share on other sites More sharing options...
globeron Posted October 1, 2023 Share Posted October 1, 2023 FYI - I have 1x UCSD P-System for PEB box (selling via eBay) * https://www.ebay.com/itm/404517529697 * Shipment from Thailand via DHL (Zone 3 Express Easy 3 Box shipment costs USD 110) Description: very rare - TI-99/4A UCSD P-Code Card (black shell) for PEB Box See video - starts up the UCSD IV.0 system 1. https://youtu.be/ynkZ4HdGBBM Requires additional floppy disks (see whtech and atariage site for details) See: https://ftp.whtech.com/Diskettes/UCSD_Pascal/ https://forums.atariage.com/topic/193355-pascal-on-the-994a/page/21/#comment-5300489 2 Quote Link to comment Share on other sites More sharing options...
globeron Posted October 5, 2023 Share Posted October 5, 2023 These two UCSD P-Code Pascal Notebooks are of my father. Handwritten in Dutch language. Just scanned them in. Not sure if it is useful. UCSD-P-CodeSystem-Pascal-Notebook1-PvanKleunen.pdf UCSD-P-CodeSystem-Pascal-Notebook2-PvanKleunen.pdf 6 Quote Link to comment Share on other sites More sharing options...
apersson850 Posted October 9, 2023 Author Share Posted October 9, 2023 Looks like he made notes from the manuals, some Pascal workbook and the important issue that the supplied dformat program can't handle double density, although it claims it can. Quote Link to comment Share on other sites More sharing options...
Rhodanaj Posted November 14, 2023 Share Posted November 14, 2023 (edited) On 8/18/2023 at 5:21 PM, Vorticon said: For anyone just starting out with UCSD Pascal, there is a Windows file utility called Pcode Tool which allows various manipulations of Pascal disk images and files, including copying and pasting of code from an external editor. Super helpful if you are emulator-based. Working with the Pcode Tool is now even a little bit more easier, with version 4.1. You can double click on the text file to open it and when closing the file, after you have changed something, the disk will be safed immediately. My Google Drive map: https://drive.google.com/drive/folders/1NmDA1LMIFFecp0aERg9jQR8ZLkaP9pDV?usp=sharing manual v4.1.pdf p-code v41-winrar3.rar Edited November 15, 2023 by Rhodanaj changed the WinRar6 rar file with a WinRar3 rar file 3 Quote Link to comment Share on other sites More sharing options...
JasonACT Posted November 15, 2023 Share Posted November 15, 2023 16 hours ago, Rhodanaj said: with version 4.1 I'm having trouble opening the .rar file, is there any particular version of software I need to download? I've tried (and old) WinRAR and a much newer 7Zip already. 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.