Announcement

Collapse

Forum etiquette

Our mission ...

This forum is part of our mission to promote the preservation of vintage computers through education and outreach. (In real life we also run events and have a museum.) We encourage you to join us, participate, share your knowledge, and enjoy.

This forum has been around in this format for over 15 years. These rules and guidelines help us maintain a healthy and active community, and we moderate the forum to keep things on track. Please familiarize yourself with these rules and guidelines.


Remain civil and respectful

There are several hundred people who actively participate here. People come from all different backgrounds and will have different ways of seeing things. You will not agree with everything you read here. Back-and-forth discussions are fine but do not cross the line into rude or disrespectful behavior.

Conduct yourself as you would at any other place where people come together in person to discuss their hobby. If you wouldn't say something to somebody in person, then you probably should not be writing it here.

This should be obvious but, just in case: profanity, threats, slurs against any group (sexual, racial, gender, etc.) will not be tolerated.


Stay close to the original topic being discussed
  • If you are starting a new thread choose a reasonable sub-forum to start your thread. (If you choose incorrectly don't worry, we can fix that.)
  • If you are responding to a thread, stay on topic - the original poster was trying to achieve something. You can always start a new thread instead of potentially "hijacking" an existing thread.



Contribute something meaningful

To put things in engineering terms, we value a high signal to noise ratio. Coming here should not be a waste of time.
  • This is not a chat room. If you are taking less than 30 seconds to make a post then you are probably doing something wrong. A post should be on topic, clear, and contribute something meaningful to the discussion. If people read your posts and feel that their time as been wasted, they will stop reading your posts. Worse yet, they will stop visiting and we'll lose their experience and contributions.
  • Do not bump threads.
  • Do not "necro-post" unless you are following up to a specific person on a specific thread. And even then, that person may have moved on. Just start a new thread for your related topic.
  • Use the Private Message system for posts that are targeted at a specific person.


"PM Sent!" messages (or, how to use the Private Message system)

This forum has a private message feature that we want people to use for messages that are not of general interest to other members.

In short, if you are going to reply to a thread and that reply is targeted to a specific individual and not of interest to anybody else (either now or in the future) then send a private message instead.

Here are some obvious examples of when you should not reply to a thread and use the PM system instead:
  • "PM Sent!": Do not tell the rest of us that you sent a PM ... the forum software will tell the other person that they have a PM waiting.
  • "How much is shipping to ....": This is a very specific and directed question that is not of interest to anybody else.


Why do we have this policy? Sending a "PM Sent!" type message basically wastes everybody else's time by making them having to scroll past a post in a thread that looks to be updated, when the update is not meaningful. And the person you are sending the PM to will be notified by the forum software that they have a message waiting for them. Look up at the top near the right edge where it says 'Notifications' ... if you have a PM waiting, it will tell you there.

Copyright and other legal issues

We are here to discuss vintage computing, so discussing software, books, and other intellectual property that is on-topic is fine. We don't want people using these forums to discuss or enable copyright violations or other things that are against the law; whether you agree with the law or not is irrelevant. Do not use our resources for something that is legally or morally questionable.

Our discussions here generally fall under "fair use." Telling people how to pirate a software title is an example of something that is not allowable here.


Reporting problematic posts

If you see spam, a wildly off-topic post, or something abusive or illegal please report the thread by clicking on the "Report Post" icon. (It looks like an exclamation point in a triangle and it is available under every post.) This send a notification to all of the moderators, so somebody will see it and deal with it.

If you are unsure you may consider sending a private message to a moderator instead.


New user moderation

New users are directly moderated so that we can weed spammers out early. This means that for your first 10 posts you will have some delay before they are seen. We understand this can be disruptive to the flow of conversation and we try to keep up with our new user moderation duties to avoid undue inconvenience. Please do not make duplicate posts, extra posts to bump your post count, or ask the moderators to expedite this process; 10 moderated posts will go by quickly.

New users also have a smaller personal message inbox limit and are rate limited when sending PMs to other users.


Other suggestions
  • Use Google, books, or other definitive sources. There is a lot of information out there.
  • Don't make people guess at what you are trying to say; we are not mind readers. Be clear and concise.
  • Spelling and grammar are not rated, but they do make a post easier to read.
See more
See less

Powertran Cortex

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by pnr View Post

    Want to submit a patch that works with Cygwin? I'll do the patch for osx.

    Paul
    I might give it a go with what little I know...

    Is there a way of doing conditional assembly in 'as'? Your start.s builds what is effectively a ROM image, where I'd like to build a Cortex .cas cassette image like I did in C99. It strikes me beneficial to have both options in the start.s file, rather than two separate files. I know how to do this in the TI assemblers but not this unixified one!

    Thanks,

    Dave.
    Last edited by tms9995; March 26, 2014, 02:13 PM.

    Comment


      Originally posted by tms9995 View Post
      I might give it a go with what little I know...
      Could you test for me that the following program indeed prints its own directory on Cygwin? It works on Linux, and professor Google tells me that Cygwin offers a Linux-like /proc pseudo file system.
      Code:
      #include <unistd.h>
      #include <stdio.h>
      #include <string.h>
      #include <sys/param.h>
      
      char buf[MAXPATHLEN+1];
      
      main()
      {
      	int n;
      	char *p;
      
      	n = readlink("/proc/self/exe", buf, MAXPATHLEN);
      	if (n>0) {
      		buf[n] = '\0';
      		p = strrchr(buf,'/');
      		if (p) p[1] = '\0';
      		printf("%s\n", buf);
      	}
      	else {
      		printf("readlink failed\n");
      	}
      }
      Originally posted by tms9995 View Post
      Is there a way of doing conditional assembly in 'as'? Your start.s builds what is effectively a ROM image, where I'd like to build a Cortex .cas cassette image like I did in C99. It strikes me beneficial to have both options in the start.s file, rather than two separate files.
      1. If you call 'as' via 'cc', the C preprocessor is invoked first, so you can use #ifdef, etc.

      2. Richard Miller had .if & friends implemented, but I jettisoned that code. If you need it I can put it back. Also, I realise I need to do a documentation page for the assembler, otherwise everybody will feel lost.

      3. Actually, I think that doing separate files for the startup code might be the better way to go. I'm currently in the process of building standard libraries and most of the code in the 'crt' directory will go into a /lib/libcrt.a file. Then 'crt0.o' will only contain 'start.s'. Your version of start.s (say 'crtx.s') would be placed in say 'crtx0.o' and 'cc' would be modified to use crtx0.o instead of crt0.o, depending on a compiler flag ('-c' and '-p' are taken, how about '-z'?). It could even automatically call your a.out to cassette conversion program as the last build step, if that -z flag is specified.

      Under option 3, compiling a cassette file for the Cortex would be as easy as typing:
      Code:
      c99 -z -O -o main.cas main.c
      Could you let me know (by private mail if it is lengthy) what changes you need to the Makefiles? I'd like to get it to a level where it builds for you 'out of the box'.

      Paul

      Comment


        Originally posted by pnr View Post
        Could you test for me that the following program indeed prints its own directory on Cygwin? It works on Linux, and professor Google tells me that Cygwin offers a Linux-like /proc pseudo file system.
        Code:
        #include <unistd.h>
        #include <stdio.h>
        #include <string.h>
        #include <sys/param.h>
        
        char buf[MAXPATHLEN+1];
        
        main()
        {
        	int n;
        	char *p;
        
        	n = readlink("/proc/self/exe", buf, MAXPATHLEN);
        	if (n>0) {
        		buf[n] = '\0';
        		p = strrchr(buf,'/');
        		if (p) p[1] = '\0';
        		printf("%s\n", buf);
        	}
        	else {
        		printf("readlink failed\n");
        	}
        }

        Paul
        Hi Paul,

        I ran this on Cygwin and it works great. Firstly I built it in a local directory and it reported that correctly. Then I moved it to /usr/local/bin (which of course there is a PATH to) and it reported that directory, even though I was still in the original local one. Good find!

        Dave.

        Comment


          Originally posted by pnr View Post

          1. If you call 'as' via 'cc', the C preprocessor is invoked first, so you can use #ifdef, etc.

          2. Richard Miller had .if & friends implemented, but I jettisoned that code. If you need it I can put it back. Also, I realise I need to do a documentation page for the assembler, otherwise everybody will feel lost.

          3. Actually, I think that doing separate files for the startup code might be the better way to go. I'm currently in the process of building standard libraries and most of the code in the 'crt' directory will go into a /lib/libcrt.a file. Then 'crt0.o' will only contain 'start.s'. Your version of start.s (say 'crtx.s') would be placed in say 'crtx0.o' and 'cc' would be modified to use crtx0.o instead of crt0.o, depending on a compiler flag ('-c' and '-p' are taken, how about '-z'?). It could even automatically call your a.out to cassette conversion program as the last build step, if that -z flag is specified.

          Under option 3, compiling a cassette file for the Cortex would be as easy as typing:
          Code:
          c99 -z -O -o main.cas main.c
          Could you let me know (by private mail if it is lengthy) what changes you need to the Makefiles? I'd like to get it to a level where it builds for you 'out of the box'.

          Paul
          Email sent regarding my mods to the tool-chain.

          No big deal if .if isn't added back in to 'as' but some kinda cheat-sheet could come in handy as it's significantly different to the TI standard (took me ages to figure out how .byte, .data and .bss worked!).

          I like the sound of a -z option. I'd be happy to add that in once we get the build standardized etc.

          Dave.

          Comment


            Originally posted by tms9995 View Post
            ... but some kinda cheat-sheet could come in handy as it's significantly different to the TI standard (took me ages to figure out how .byte, .data and .bss worked!).
            Have a look at this:
            http://1587660.websites.xs4all.nl/cg...doc/old-as.pdf
            It is for Ritchie's pdp11 assembler, but Miller's assembler is a work alike. Some differences though: // to introduce a comment, numbers follow C syntax (decimal by default), .if not implemented, etc. I will use this text as the base for my to-be-done 'as99' documentation.

            I've just commited the changes to 'cc99' to make it work with relative paths. I'm adding standard libraries, but that is work in progress. So that you don't get stuck, I've temporarily added stub libraries to the repo. Alternatively, you could just replace 'cc.c' and leave the rest the same. Let me know if it works for you.

            Cleaning up the Makefiles is next.

            Paul

            Comment


              Originally posted by pnr View Post
              Have a look at this:
              http://1587660.websites.xs4all.nl/cg...doc/old-as.pdf
              It is for Ritchie's pdp11 assembler, but Miller's assembler is a work alike. Some differences though: // to introduce a comment, numbers follow C syntax (decimal by default), .if not implemented, etc. I will use this text as the base for my to-be-done 'as99' documentation.

              I've just commited the changes to 'cc99' to make it work with relative paths. I'm adding standard libraries, but that is work in progress. So that you don't get stuck, I've temporarily added stub libraries to the repo. Alternatively, you could just replace 'cc.c' and leave the rest the same. Let me know if it works for you.

              Cleaning up the Makefiles is next.

              Paul
              Assembler guide is very helpful. Thanks for that.

              As I'm back to work for the next few days, time is limited so I think I'm happy to just back and let the 'dust settle' with the current phase of updates you are implementing. No point in playing catch-up each day.

              Of course if there's something specific you'd like me to try, let me know.

              Thanks,

              Dave.

              Comment


                Just ported to the Cortex the Elite April Fool teaser I put together for the TI-99/4A. Cassette image here if you want a peek: [http://www.avjd51.dsl.pipex.com/powe...ool_cortex.zip]. Load by entering the MONitor and using the L command. Leave the IDT field blank when prompted. The game should load at >6200 and auto-run. Tested on Dave's WinCortex 2.0, but not on the real hardware.

                Stuart.

                Comment


                  Dave, is the Cassette menu for WinCortex 2.0 documented anywhere? [Play] and [Record Image] I've worked out, but not sure what [Record Raw] and [Overwrite Mode] are for?

                  Also, when [Play]ing an image, does the emulator check the header checksum before 'playing' it? From what I can see of the Cortex code, it should display 'Found""' for a program even if the header checksum is wrong, but the emulator just seems to ignore a [Play] command if the header checksum is wrong.

                  Stuart.

                  Comment


                    Originally posted by Stuart View Post
                    Dave, is the Cassette menu for WinCortex 2.0 documented anywhere? [Play] and [Record Image] I've worked out, but not sure what [Record Raw] and [Overwrite Mode] are for?

                    Also, when [Play]ing an image, does the emulator check the header checksum before 'playing' it? From what I can see of the Cortex code, it should display 'Found""' for a program even if the header checksum is wrong, but the emulator just seems to ignore a [Play] command if the header checksum is wrong.

                    Stuart.
                    Hi Stuart,

                    A manual for the emulator is long overdue. I started to write one last October but haven't got back to it yet... I need someone who excels at writing technical manuals

                    Here are some notes on the Cassette Functions:

                    Two modes are available, Image and Raw. In Raw Mode, the 'cassette recorder' will record/play the cassette's TMS9902 data stream without any further processing. Image Mode is for program images where the 'cassette recorder' processes the data stream to produce .cas files that are compatible with the PC Comms Utility etc. Image files are 'concise' in that the preamble and other padding bytes are removed.

                    When a cassette image is 'played' back, the 'cassette recorder' detects whether a valid cassette header is in the file. If one is found, then the playback is treated as an Image, else Raw Mode is assumed.

                    Overwrite Mode provides the ability to automatically overwrite existing .cas files without being prompted.


                    To save a program from BASIC:

                    1) Cassette->Record Image (F6) and choose filename. 'Cassette Recorder' is now ready.
                    2) SAVE"" or SAVE"MYPROG"
                    3) Choose Auto-Run as required.
                    4) Press Y for cassette ready.
                    5) Image is recorded to file.
                    6) 'Cassette Recorder' can be aborted using Cassette->Abort Image Record or it will time-out after a minute if no SAVE is performed.


                    To save a machine code program (or data block) from MONITOR:

                    1) Cassette->Record Image (F6) and choose filename. 'Cassette Recorder' is now ready.
                    2) D SSSS EEEE AAAA where SSSS is the start address, EEEE is the end address and AAAA is the optional auto-run address.
                    3) Enter optional program name for IDT
                    4) Choose Auto-Run as required.
                    5) Press Y for cassette ready.
                    6) Image is recorded to file.
                    7) 'Cassette Recorder' can be aborted using Cassette->Abort Image Record or it will time-out after a minute if no SAVE is performed.


                    To load a BASIC program:

                    1) LOAD"" or LOAD"MYPROG"
                    2) Press Y for cassette ready.
                    3) Cassette->Play...(F5) and choose filename to load.
                    4) Image is 'played' and program is loaded.


                    To load a machine code program (or data block) from MONITOR:

                    1) L IDT= leave blank for no filename or use MYPROG as required.
                    2) Press Y for cassette ready.
                    3) Cassette->Play...(F5) and choose filename to load.
                    4) Image is 'played' and program/data is loaded.


                    RAW Recording:

                    1) Cassette->Record Raw...(F7) and choose filename. 'Cassette Recorder' is now in RAW Record mode.
                    2) In BASIC, UNIT 3 to turn on character output to the cassette device.
                    3) LIST program is LISTed to the cassette image.
                    4) Note: Any data written to the cassette device will be recorded, so a machine code could be written to output bytes etc.
                    5) Cassette->Stop Raw Record when logging to cassette device is no longer required.


                    RAW Playback:

                    1) In BASIC, BAUD 3,9600 to enable input from cassette device (baud rate is arbitrary).
                    2) Cassette->Play...(F5) and choose filename of RAW image.
                    3) RAW image is played back into the cassette device

                    Dave.

                    PS: Raw Mode was implemented just for you!
                    Last edited by tms9995; April 21, 2014, 08:58 AM.

                    Comment


                      Originally posted by Stuart View Post
                      Just ported to the Cortex the Elite April Fool teaser I put together for the TI-99/4A. Cassette image here if you want a peek: [http://www.avjd51.dsl.pipex.com/powe...ool_cortex.zip]. Load by entering the MONitor and using the L command. Leave the IDT field blank when prompted. The game should load at >6200 and auto-run. Tested on Dave's WinCortex 2.0, but not on the real hardware.

                      Stuart.
                      Hi Stuart,

                      I loaded the program on the emulator and it runs until you press a key, upon which it aborts with "Error:Fail Lo Pro 2014" in red. I tried it on the Cortex and it does the same...

                      Dave.

                      Comment


                        Originally posted by tms9995 View Post
                        Hi Stuart,

                        I loaded the program on the emulator and it runs until you press a key, upon which it aborts with "Error:Fail Lo Pro 2014" in red. I tried it on the Cortex and it does the same...

                        Dave.
                        Exactly. As I said, an April Fool teaser. "Fail Lo Pro" being an anagram of ...? Done in response to some people on one of the TI-99/4A forums who had been on about how nice it would be to have Elite running on the TI-99 - I got called a few rude names ... Ported to the Cortex just for the hell of it and the nice animation.

                        Comment


                          Originally posted by Stuart View Post
                          Exactly. As I said, an April Fool teaser. "Fail Lo Pro" being an anagram of ...? Done in response to some people on one of the TI-99/4A forums who had been on about how nice it would be to have Elite running on the TI-99 - I got called a few rude names ... Ported to the Cortex just for the hell of it and the nice animation.
                          I did wonder if I was setting myself up... Nicely done!

                          Comment


                            CF Card

                            Finally finding some time for this project. I'm happy to report that the simple circuit to add a CF card to Stuart's breadboard (schematic posted a few weeks back) works. Who would have thought that a CF card can be almost directly hooked up to the CPU? Still running with an auto-wait-state, not sure if the timing will also work with zero wait states (min. specified width for /wr is 150ns, with zero wait states the 9995 @ 3 Mhz does 133ns?).

                            Have only done cursory testing. The 8 bit mode works, and reading sector 0 in memory mode indeed produces the MBR for a FAT32 drive (I'm using a cheapo no name 4GB card).

                            Paul

                            Comment


                              Originally posted by pnr View Post
                              Have only done cursory testing. The 8 bit mode works, and reading sector 0 in memory mode indeed produces the MBR for a FAT32 drive (I'm using a cheapo no name 4GB card).
                              Done some further work and it works well. When a file is stored on the CF card on a PC, the breadboard can read and echo it to the terminal. This involves a very minimalistic implementation of a FAT32 reader: read the MBR and scan the partition table, read the partition boot block, read & scan the root directory, read & echo the file. My thinking is that I can store an entire xinu or unix v6 file system in an unfragmented FAT32 file of say 2MB in size and make it easy to transfer stuff between breadboard unix and a PC.

                              Given routines to read & write sectors, how hard would it be to:
                              1. give Stuart's Cortex Basic port load/save functionality?
                              2. port Cortex' CDOS?

                              I guess it might be possible to port MDEX as well, as the disk driver is open source on the sysgen disk.

                              Paul

                              Comment


                                I've got Cortex BASIC load/save to a CF on my TM990, so that should be easy to port across if you want it. I've got a basic disk OS that supports load/save/dir/format using a similar disk format to the TI-99/4A floppies, then I've added *extended commands to Cortex BASIC to load/save programs by making calls into the disk OS.

                                Comment

                                Working...
                                X