Showing posts with label BASIC. Show all posts
Showing posts with label BASIC. Show all posts

Thursday, July 19, 2012

8085 Monitor Code and Other Distractions

I've been working on an 8085 microprocessor project for about 3 years now. It started with a simple circuit on a breadboard, moved to my HP Logic Lab, where it became a real computer, then got built into a permanent version on a prototyping PC board.

I've been documenting the thing since it moved to the Logic Lab on my web site, posting how-to articles on building both versions (the hardware is identical, only the construction method is different), as well as software to control the hardware.

Where I've come up short is putting together a sort of unified OS for the system online that allows software to be developed right on the system itself, as well as any high level languages. I've been writing lots of software for my own use with the system, mostly hand-coded using my assembly coding forms and my 8085 Pocket Reference Card. But I keep either getting distracted from or otherwise dodging the job of integrating all the software bits I've already got into a simple "monitor" program (sort of a mini-OS for machine language) for the system.

Part of it is the usual life distractions. I've been sitting next to a wild fire this past week, for example. And then I've got lots of other electronic toys I like to spend some time with. Each one has its own appeal.

Before the fire, and a bit during (when I was taking a break from cutting ever more brush around my property) I've gotten back to work on putting it together. The biggest part is the part that reads the keyboard, determines the current system state, and dispatches keystrokes and execution to the right place. All the hardware interfaces are already in place, most of the basic system routines are in place (timing/delays/string handling), etc. So the "glue" is pretty much all that's needed. And I got it about halfway done before the fire started, I'm writing the code that actually takes actions for each mode, or simply hands over the necessary info to user apps running on the system.

So, if I can get time away from deck repairs on my house this weekend (now that it looks like it's unlikely to burn down or that I get evacuated), I'll be trying to wrap up and test that code.

Small Thing, Big Obstacle

The other thing I'm looking forward to is replacing some of the switches I put on the MAG-85. I put in switches for various interrupts about two years ago, and the switches themselves turned out to bounce and make so much noise that I've given up on them. No amount of debouncing, hardware or software, within reason has made them reliable. I'd hate to have someone else construct a MAG-85 and have to deal with this. It's been a thorn in my side ever since I added them, and took a lot of the fun out of the permanent hardware project for me (on the breadboard version, I used some old keyswitches out of a knackered Mac Plus keyboard, they worked great with only the most minimal hardware debounce. But I figured I could hardly specify 25 year old keyswitches in a project that others might want to build.

I'm expecting a shipment of a bunch of different switches tomorrow that I can test and select from to replace the awful switches I have now. So I can put that behind me (and probably re-simplify the circuit to take out a bunch of the extra parts I put in to try to deal with the noise on these switches.)

Frankly, the old switches are something I'd about hesitate to use in a doorbell circuit, never mind real electronics.

Saturday, April 14, 2012

Parallax Robot Expo

My daughter and I went to the Parallax Robot Expo today and had a great time. It's neat having an event like this only about 45 minutes from home. My daughter has a couple of BOE-Bot robots and a bunch of additional bits she enjoys working with. I'm into anything microprocessor or microcontroller, and I think Parallax is a neat company that makes great products.

We were a bit worried about the effects of the weather. We left home with snow falling and drove through a rainstorm on the way. When we got there it was only raining lightly. Even if it had been raining, everything was either under tents or inside. It wouldn't have been necessary to do more than duck across a few feet of open sky in any case.

As it happened, things only got better as the day went on.

We had a really good time checking out the various demos. They had one tent with activities, laptops set up with boards hooked up to them, where people could get their feet wet in programming the boards to blink lights, run servos, sound off on piezos, etc. We didn't check that out too closely since we can do that at home.

Alongside it was a "Learn to Solder" area with several tables. You get to build an S-2 Robot LED badge. Not an actual S-2 robot, mind you, but a little hang around your neck badge shaped like the Scribbler 2. It's got a 7 color LED on it, a switch, a battery, and some embedded logic. It's a neat little thing and it's entirely free.

I made one though I'm no newcomer to soldering. I had a very helpful young man making sure I prepped the parts properly and oriented them correctly. He was also able to answer my question about whether there was logic embedded in the printed circuit board.

The factory tour was also very nice. They've got some automation they're justifiably proud of. I'm surprised that it appears they actually use a CNC to make production parts. I'd have expected higher volume processes for them.

Also inside was a display and presentation area. They had various talks through the day by very approachable people with experience directly relevant to the attendees. It was interesting hearing them talk about their technical work and their work to develop their businesses. We weren't able to hear all the talks we would have liked.

Back outside there was a tent for vendors--the show prices on Parallax products were amazingly great and there were some other great vendors there, too. There was a show area for other companies, Panavise was among the companies showing there (IMO, yes, their products are worth every dime!)

Maxi Swag
One of the coolest things there, a real unexpected treat, was the Free Stuff tables. There were all sorts of free parts and boards and what I assume was discontinued product. I got a book on programming the SX microcontroller, a Javelin Stamp, some sort of Propellor board, and some other fun electronic "Junque Box" goodies, as did my daughter (I think I'll be showing her how to wire up a CCFL this weekend, there were packs of them on the tables.)

We both had a great time. My daughter got really excited and couldn't wait to get back home to her electronics. We picked up some great project books for her, cheap.

If you get a chance to go on Saturday, I recommend it highly.

Saturday, December 4, 2010

Retrocomputing for the Holidays

What could be better than an old computer under the Christmas tree? It's a fun, inexpensive gift. There's always something old under out Christmas tree. Among the larger items have been the Commodore 64 that I gave my daughters as their first computer ten years ago. It included a monitor and floppy drive, of course, and copies of the user's manual and programmer's guide.

They'd both already started programming in BASIC on my Apple IIe during the prior year. So they were ready for the C-64! I got myself a Softcard for my Apple IIe that same year.

Two years later, I added a Plus/4, since they were frustrated with the lack of direct graphics commands on the C-64. Peek and poke wasn't good enough. ;) That same year some friends gave me their Laser 128 (Apple IIc clone.)

Christmas Cheer with PA-RISC

Another two years pass, and they both got an HP9000/700 series Unix workstation. They spent Christmas break learning Bourne shell and playing with Neko under X-Windows. Yeah, these weren't 8-bitters, but they were fun old systems that ran plenty of network apps. I had a MUD on my Unix workstation, and they learned how to telnet in and play pretty quickly. Their typing improved dramatically.

I picked up an Amiga 500 and that became the family's Christmas present the next year. We hooked it up to our 36" TV and played music, games, and a bunch of demos.

The year after that, a friend gave me a Bigboard I system. CP/M, 64K, and two big 8" floppy drives. Wordstar and BASIC-80 heaven. Everyone gathered around to roast chestnuts over the power supply and listen to the disk drives churn. ;)


Sure, it's got iTunes. Does it do X-Windows?
That same year, my daughters got upgraded to Macs, G3 B&Ws. They were excited about getting a computer that would run iTunes, but first they made sure that all their Unix stuff would run as well. Once they were sure they weren't giving up the Unix command line and could port their applications, THEN they were OK with the upgrade.

Three years ago, I did some repairs to a Kaypro 4 to get it working again. Unfortunately I haven't figured out how to read and write standard diskettes with it yet. It's a souped-up unit, with an aftermarket ROM, hard disk, and floppy drives that include both double and high density units. It got set on the back burner in favor of some other projects, once they're finished I'll get back to determining if I've got all the right software to go with the ROM that's in the system.

Visiting Old Friends

Two years ago, I actually avoided adding any new hardware for the year. Instead, I spent time during the holidays pulling out several of the systems I have that have been a bit neglected and giving them some TLC then playing with them. The Apple IIe, my own C-64, another Plus/4, and the Big Board.

Last year was the year of hardware projects. I had a new 8085 computer on a breadboard (see the story at http://saundby.com/), and was preparing to move it to soldered circuit cards. I was also migrating my Ampro Little Board (a Z-80 system) from loose components on the table top to living in a box like a proper computer.

Bringing Up the Ampro Little Board

Catching Up for Christmas

This year I'm working to finish the non-breadboarded version of my 8085 and building up a Membership Card (1802-based computer, similar to a COSMAC Elf from 1976 but a lot smaller) in a decorative little Victorian-style case. I'll be posting that on my web page at saundby.com soon, I expect.

I'm keeping my eyes peeled for a Commodore 128 at the thrift stores, too. That'd really round out this Christmas year.

What's on Your List?
What retrocomputer experiences have you had for Christmases past, and what are you hoping for under the tree this year that's hopelessly "out of date"? :)

Monday, March 2, 2009

Dark BASIC Professional Retail Box

Since my earlier posts on Dark BASIC Professional (here and here), I have picked up a retail box version of it. I was using the trial version from an online download before.

There were a couple of snags on installation, one quite minor, one that became a real problem. The minor problem was that the autorun menu of the Dark BASIC Pro install CD wasn't as clear as it could have been. It gives a laundry list of things it can do, without being clear of which ones directly relate to installing Dark BASIC. There is a choice to install Dark BASIC, but whether any of the other items needs to be done before or after isn't clear, nor whether some of the other menu items install extras or demo versions of other products from The Game Creators.

I'm sure the menu makes perfect sense to someone who already knows what they're supposed to do. This sort of thing is typical of Dark BASIC. A little more work to determine what a first time user sees and thinks would make their products much nicer without a whole lot of extra effort.

As it turned out, the single Install Dark BASIC Pro item (the second item on the list on my CD, after an item allowing the installation of DirectX) was all that was necessary. I've not explored the other items on the CD as of yet.

The system I installed to initially is a netbook, without its own CD drive. I had the CD in my iMac, and was sharing it across my home network. The installation of Dark BASIC went fine this way. Until I got to the point where I needed to validate my copy of Dark BASIC.

Dark BASIC's copy protection keeps it from running unless its been authorized across the network from The Game Creator's authorization server. Having a network connection was no problem for my netbook, but first it had to validate the CD. Validation of the CD failed since I was working across a network share.

I took a trip to the Dark BASIC Pro website, and found that it's possible to authorize a copy of Dark BASIC by copying files from one computer to another. Well, I have an older, rather awful, WinXP laptop that has a CD drive directly in it, and which could probably be tricked into getting onto the internet.

Without going into all the details, I went through several iterations of trying various combinations of network connection, system, and CD and got nowhere for several hours. My older laptop didn't have a version of Windows Explorer that the server at The Game Creators was happy with (it apparently didn't support the correct procedures for talking to their server) attempts at upgrading only made things worse for the system itself, and at the end of over 4 hours of dinking around I still didn't have an authorized copy of Dark BASIC Pro.

Finally I decided to try one more idea with the netbook since using the old laptop on the network wasn't working out. If that didn't work out I would have been contacting The Game Creators directly. The last thing I tried on the off chance that it might work was connecting to the shared CD on my network by mapping it to a drive on the netbook, rather than connecting to it as an ordinary share.

This worked. The authorization program for Dark BASIC Pro was able to see that the CD was a valid CD and provide me with an authorization code for Dark BASIC when the CD was mapped as a drive.

With that hurdle out of the way, I was able to move on to using a full version of Dark BASIC Pro.

I've mentioned the manual in my earlier posts, but I hadn't really had a chance to look at it in detail. One of my students has the retail Dark BASIC, and I've glanced at his manual briefly, but not had time to do more. Now that I have my own copy, I can really see just how awful it is.

It's too bad, because the language itself isn't so bad.

Now where do I start on what's wrong with the manual? Let's start with alphabetization. It isn't.

The command lists have the commands listed in an order that suggests they appear in whatever order someone happened to think of them. As if that's not bad enough, a flip to the back of the book to the index shows that nobody bothered to do an alphabetic sort there, either.

A look at the "P" section shows:
PRINT
PREVIOUS
PERFORM...
PASTE IMAGE
POINT
PASTE SPRITE
PLAY
PERFORM...
PATH...
PLAY
PAUSE...
PLACE...
PERFORM...
PITCH...
and so on.

You have to scan every item in every list all through the book, and some of those lists are more than a page long. Somebody at The Game Creators needs to learn how to alphabetize their lists. Or how to hire someone else to do it for them.

Then we look at what should be the meat of the manual, the information on the commands in DBPro. There we find that the commands are listed, again, in an "eclectic" order, and that there are no useful examples given, most egregiously when the command is built to be used along with some other command. Multiline commands are split into multiple entries (e.g. DO and LOOP are two separate entries with the text cut and pasted between them.)

There are a multitude of other problems as well. Overall the manual reads more like an early draft than something that belongs in print in a retail box.

On the other hand, I do have to say that the inclusion of a printed manual, however rough, is a nice thing. The manual is difficult to use, but far from useless. It'll be of some use to experienced programmers. It'll be a source of confusion to beginners. It's also easier to mark up corrections in a print manual than in a PDF. So, kudos to The Game Creators for including a print manual. I'd like to ask them to please alphabetize their command lists and index, at least, in future printings.

The language itself is quite nice for what it does. If you're an experienced programmer you'll be able to write short pieces of test code pretty quickly and get some things going. There are some bugs and omissions in the language, though. The language itself is also quite inconsistant. Overall it's something like the manual. It seems to have grown up in pieces, and there hasn't been any oversight toward keeping the language consistant with itself. These problems coupled with the poor documentation means that you'll be writing a lot of test code before you get down to the real task at hand.

There are after-market books, but I've yet to find any of them at major retailers. They're available online, and while I've yet to see any it wouldn't take much to improve on the provided documentation. The forums at The Game Creators provide help as well. Most help seems to be provided in the form of example code. This is helpful to experienced programmers, less helpful to new programmers who aren't used to reading code yet.

While Dark BASIC Professional has a lot, and I mean a lot of rough edges, it pretty well does what it claims and it's quite inexpensive for a commercial product. The retail box runs $70-80. If you're completely new to programming, I wouldn't recommend it until you've spent some time learning the basics with something else that has better documentation. A free basic like Chipmunk BASIC or SmallBASIC (there's a different Small Basic especially for Windows) would probably be a better place for someone new to programming.

Then, once they get to where they need the features unique to DBPRo, they could pick it up.

Overall Grade: 78%, C

Pros:
Inexpensive for what you get.
Does what it claims.
Easy to get rolling for experienced graphics programmers familiar with current technology, but not wanting to deal with a non-procedural language like Java or C++.

Cons:
Poor manual.
Language provides poor abstraction for many graphics operations--a good knowledge of the underlying technology is required to use it properly.
Not a good language for new programmers.

Tuesday, February 17, 2009

DarkBASIC Professional Update

I mentioned some beefs about DarkBASIC Professional in an earlier post here. I have a bit of an update on what I had to say there.

First, there's the problem that DarkBASIC Pro had with my version of DirectX. DarkBASIC Pro requires DirectX version 9.0c or later, according to the website and the pop-up message I got. The pop-up message I got from DBPro claimed that I had DX version 9.0. When I ran DXDiag, it begged to differ, reporting that my system was running 9.0c.

Since my last post I decided to go ahead and do an update of DirectX. Since I was doing the download of the DX update on a different system than I was going to be installing it to, I downloaded the redist package, the same thing that developers can include on the disk when you buy a game. This means that I got the August 2008 version of DX rather than the November 2008 version for reasons known only to Microsoft, but no biggie.

I did the install, it reported updating a bunch of individual files. I ran DXDiag afterward to make sure all was kosher, and to check the version. Version 9.0c, it says. Verrry innnteresting.

I love how Microsoft respects the correct use of version numbers...

Anyway, I bring up the DarkBASIC Pro Trial version and do a quick program and compile. No more nasty notes about my DirectX version. Everybody is happy. Apparently my new version of DX 9.0c is more puissant than my prior version of 9.0c. If there were a specific file or files with versions that DarkBASIC Pro needed (d3d or whatever) it would have been nice if they'd said so, it would have eliminated at least some confusion.

Item number 2 is the complaint I had in my prior post about DBPro needing to run as Administrator. Apparently that is the case. In the instance of Vista, for example, one must right click the icon, click a tab, and allow DBPro to Run as Administrator in order for it to do what it needs.

This is an Intensely BAD Thing. Especially under Windows.

It also means that I could never consider DarkBASIC for classroom use. I like to give my students a lot of leeway, but to be honest sometimes they do things with the systems that make it difficult for others to use them. Each of the different classes that use our lab need to be able to come in and use the systems with a minimum of trouble. Our sysadmin is usually not immediately available, he's a thinly spread resource, and he doesn't need yet more work.

On top of that, I don't like to program as an administrative user, on any OS. Life is hard enough without having a program I'm trying to debug hosing the system I'm writing it on. I want some basic guard rails. I do have crash and burn systems, but they're not the one I'm doing my editing, compiling and first run on.

Another strike against DarkBASIC for the classroom is that it would cost my school money. Java, Groovy, Ruby, Python, gcc, Common LISP, and many other useful development tools are free. In many cases in both senses of the word.

Is DarkBASIC bad? No, not entirely. Running as administrator is stupid, but only mildly evil. Coupling it with the fact that it's a programming language targetted at newbie programmers makes the design decision to run as Admin extremely stupid. A result of laziness, or an unwillingness to deal with the vagaries of MS's OS, perhaps, if we were to spread the blame around a bit.

On the good side, the DarkBASIC folks do a good job of marketing. They manage to excite people into really believing they can write killer 3D software. DarkBASIC Pro itself is decent at delivering on this promise from what I can tell so far as I've used it. I think they withhold too much information about a language they've already sold you in the interest of selling additional books and materials. The manual that comes with the basic $70 package is a bad joke on the poor beginners who get it.

Bottom line, I think most beginners would be better off with something else. However, there are some people for whom DarkBASIC Pro is going to hit a chord that other languages won't. And maybe once they've gotten an entree into programming, and fought with DBPro for a while, they'll be ready to move on to something else. Any programmer should know more than one language within two years of the time they start programming, anyway.

And tell me if I'm wrong, but there just aren't a lot of places looking to hire DBPro programmers. VB, yeah. Java, yeah. C++, yeah. DBPro? It's more for the do-it-yourselfer. It's a lot like the older BASICs, but not much like VB, I'm afraid. So knowing DBPro itself isn't likely to land a programming job. But then that's not the sort of language it's built to be.

Monday, January 26, 2009

A First Look at DarkBASIC Professional

I have a student that wants to learn programming using DarkBASIC Professional. Fair enough, I've worked in a fair few BASIC dialects. BASIC is not typically what I start a student with any more, but this is a one-on-one situation. So I'm willing to give this particular commercial BASIC dialect a shot.

I went out to the website for DarkBASIC Pro and poked around. I found several versions of DarkBASIC (standard, pro, Lite, etc.), and as it happens when I went to download a trial version I got a page that simply tells me that the trial version isn't available. No forwarding links or anything.

OK, let's try again. I note that the page I ended up on is for DarkBASIC, not DarkBASIC Pro. Other pages I look at are all asking me for money that I'm not yet prepared to spend. A bit more poking around turns up a better page that allows for a download of DarkBASIC Pro's 30-day trial version.

So I download, scan for viruses (you never know, even some of the best outfits get hit, and as usual for Windows there's no MD5 or other checksum I can use to check file integrity after download) then I install the program from an administrative login. All goes smoothly up to that point.

Afterward, I go back to my usual account, a limited account where I normally do all my programming work. DarkBASIC starts, asks me to activate it, I do so with no fuss or muss and get into the editor. I type in a short program, and hit F5 to compile.

Whereupon I get an error message telling me that DarkBASIC Pro can't write to the directories under C:\Program Files\ where DarkBASIC Pro is installed. No problemo, I'll just let DBPro know that I want to save somewhere to my local user directories. Hmm, or I'll try to.

A perusal of the menus in DBPro didn't turn up any way to do that. Normally I expect to set the options for the user or the project to save to where I tell it to save. The Options pane in DBPro includes no such thing, or any other menu item that I could think to select on the basis of logic or any extension of it.

So DBPro expects me to install as an admin, and do all my programming as an admin, even though it installs a desktop icon for all users? Poor form!

I changed users to my admin account and started DBPro there. It needed to be activated again, so I did so. I entered a program and ran it. It compiled OK, the Trial Version splash screen came up, all OK. Then I get an error message telling me that I only have DirectX 9.0 installed, and that DBPro wants 9.0c. What a load of nonsense!

I had run DXDiag before donloading DBPro and verified that I met the system requirements. My system is running DX9.0c.

Fortunately, after reporting this "error" DBPro went ahead and ran my program anyway. Good thing it did, I was getting pretty annoyed by this point. My program ran fine. It was a simple PRINT program, nothing more. Since DBPro uses a run loop sort of runtime, such programs need a statement at the end to keep the program from "falling through" and ending before the results have been seen. In my case I added a "WAIT KEY" line:

PRINT "Howdy"
WAIT KEY


That's not exactly the program, but it gets the idea across.

I entered, compiled and ran several other simple programs to try out some standard BASIC control structures. They all ran fine, aside from the erroneous error message which was repeated with every run of every program.

So, is DarkBASIC Pro bad? Not at all. But it falls short of its moniker of Professional. I expect to be able to use a professional tool with individual, limited, user accounts with data stored local to that user. To be honest, I also expect something labelled as "professional" to allow the use of a revision control system, and I see no evidence of that in DBPro so far, though it may be hidden in there somewhere.

Whether I'll use DBPro with my student remains to be seen. It'll be adequate for some introductory work at least, though I may see if we can change to Visual BASIC Express, Java, or some other free development package suited for beginners. These also have wider application than DBPro in the world at large. Further, lots of information is available on them for free.

There are some free DBPro resources, but the primary resources from the company that makes DBPro are extra purchases. The printed manual my student had for DBPro that came with his purchase of it was not at all a good reference for a new programmer. The company offers a book for more money, but they keep asking for money here and money there, and it gives a feeling that their legitimate profit motive may be stretched a bit beyond where it legitimately belongs.

Edit:

I have since tried to add some sound commands. DarkBASIC Pro now tells me that I do not have DirectX installed, and my programs don't function at all, even in debug mode. My student was able to compile and run the example applications provided with his purchased copy of DarkBASIC Pro, so I know that such things can work. But that doesn't do me much good. I think I'm going to see if we can shift over to something that I can expect to work the same on both our systems, either Java/Greenfoot or Visual Basic Express.