Programming in the Putri-DOS Environment Q. The new PutriDos assembler works OK on my system except every now and then certain sequences of instructions get assembled incorrectly. How come? A. To combat sexism, if the assembler finds a chunk of machine code that equals the ASCII equivalent of "MAN" in any combination of upper and lower case it changes it to "PERSON". If such changes to your code produce undesired run-time effects you may set the MCP option, which leaves sexist code intact. The system will print out a scathing lecture and then ask "Are you sure?" several times, but if you persevere it'll turn the option on. Q. I was trying to run a program I'd written for my computer, but PutriDos kept giving me "Emulator Not Found" messages. Why? A. When the version you have of PutriDos starts to run a program it analyzes the machine code to determine what machine it was written for, then calls the appropriate emulator. This is to increase portability of software. Unfortunately, it means you can't run programs actually written for your machine. Rewrite it for some other system and then yours will run it OK. Resist the temptation to write an emulator to let your machine emulate itself. Such a self-emulator would need an emulator to run on, and would thus call itself recursively and hang the system. Q. When I tried to run a Turbid Pasquale program I'd written (see source file on enclosed disk) my printer vanished. How can I get it back? A. Turbid Pasquale, like many other languages, allows devices to be treated as if they were files. While this simplifies input and output routines, especially if the user is to be given a choice of where to send the output, there are hazards. Your program has stumbled into one of them. You evidently modeled the program after one that wrote to a disk file, and at one point you assigned the printer to a file and then deleted that file. On most other systems deleting a device either does nothing or produces an error, but PutriDos simply goes ahead and does as it is told. The best chance of getting it back is to run a file recovery program. These programs, which are commercially available and advertised in such magazines as Putrid Computing, should restore your printer if you have not placed some other object (such as a cat) in the space the printer formerly occupied and have not since connected any other device to the printer port. You should also be aware that a similar thing can happen if you treat the printer (or other device) as a file and set the Hidden attribute bit. In this case, however, the printer will be somewhere around the house. Since the compiler doesn't have much imagination, it will almost always hide it behind the sofa, under a bed, or in a closet. Simply find it and put it back in its rightful place. Q. My system suddenly vanished (Poof! Into thin air!) while running a program. How do I get it back? A. The program listing you included with your question is in PutriDos Basic and uses the GOSUB statement several times. The problem is that the programmer who did the GOSUB statement didn't know that it meant "GO to SUBroutine" and instead programmed it as "GO to SUBmarine". Your system is therefore on board a submarine somewhere in the seven seas. If it went to a U.S. Navy submarine you should have gotten it back by now. Our naval personnel have orders to enter a RETURN instruction which will cause the machine to appear back home again. If it is on a submarine of one of our NATO allies or some other friendly country you will eventually get it back, but it will take a while because it has to go through that Navy's Lost-and-Found plus customs and several layers of paperwork. However, if it is on a Russian or Chinese sub you are Out of Luck as they tend to keep any item of Western technology they can get their hands on. A revised version of PutriDos Basic is in the works, with this bug (among others) corrected. Until then, try to avoid using the GOSUB statement. If you find GOSUB absolutely necessary, your local PutriDos Users' Group has some simple hex patches which, while not perfect, may help to some degree. Q. While debugging a program in Putri-Dos BASIC recently, I noticed that whenever a certain line of code was executed the modem would try to dial out. Since I didn't have a phone line plugged in to the modem at the time it didn't succeed in completing the call. I did, however, eventually notice a mistake in the line in question, and when I fixed it the modem no longer tried to dial. What mystifies me is that nothing in the line where the error was seems to resemble any command involving a modem. A. According to the printout, the error in question was an Illegal Function Call. Since the writers of that version of BASIC are very law-abiding, the modem activity you saw was the system trying to call the police to have you arrested. You're lucky the modem wasn't hooked up. And just in case someone else is not so fortunate, this is a good time to remind all our readers that your local Putri-Dos Users' Group has bail bond services available at very attractive pre-need rates. Q. I've heard a lot about "computer viruses" lately. What do I need to know about them? A. Not much, if you're running PutriDos. Writing a virus is as simple as writing a program to do something silly, giving the executable file a name of the form V*.DNA, and then running any other program you want to have your new virus infect. You may then distribute your virus by giving copies of the infected program to your friends, uploading to boards, leaving floppies on toilet seats, etc. You make the V*.DNA file and Putri-DOS does the rest. When the command processor gets control it looks in all directories of all drives for V*.DNA files, and appends any it finds onto any "normal" program it is asked to load. The next time that program runs it will copy the V*.DNA section into any directory that it doesn't already exist in (with the Hidden attribute set so the user doesn't notice), then give the DNA code control. Once it's done whatever you wrote it to do its exit system call will give control to the nominal contents of the executable it's piggybacked on so the user sees things as being pretty much normal. If a program is infected with more than one virus they will get control in reverse chronological order, newest first. One thing to watch out for, though. Some spoilsport users have forsaken interactive operation in favor of putting the entire session into the AUTOEXEC.BAT file, ending with a little program to hang the system until it is rebooted. Under that procedure if the programs being run are not infected the viral processor never gets control, leaving the would-be virus writer to fall back on other, more complicated methods that are beyond the scope of this Update. Tom Digby bubbles@well.sf.ca.us for Putri-DOS Users' Group