Dave S Msdos Column

Program Listing 3. A demonstration of the Play statement.

10 ON PLAY(2) GOSUB 1000 20 PLAY ON

30 PLAY "MBMST25502EFBA" 50 PRINT "Just for Show "; 60 GOTO 50

1000 PLAY "EFBAEFBAEFBAEFBAEFBA" 1010 RETURN

End blew out the 1000's printer port. I subsequently received a fix from Jay Wyrick of Hollywood. FL. If you're comfortable wires on your printer's circuit boards, the modification is easy to make. It's also the method Okidata suggests. Tandy service centers can do the modification for you. too.

You eliminate the offending high voltages on pins 34 and 36 by cutting wire S6 and a lead to resistor R17. You can see both points from the back of the printer, to the left of the Centronics plug opening. Supposedly, the printer will function as usual with other computers.

I've heard of at least one use for the printer driver (LFDRVR.SYS) that comes on the 1000 DOS disk. Tom Siriani of Hillsboro. OR. discovered that having this driver installed as a device in the CONFIG.SYS file solved the "Out of paper" error when printing lines longer than 80 columns in Basic. (The other known solution is to use the Width statement: e.g.. Width Print 255.)

Should you use the 1000 printer driver? I don't: I played with it using Basic to send control codes, and wasn't impressed. The DMP-120 with driver installed acted just like my Okidata 82A with or without the driver installed. It's definitely doing something because I could print and list lines longer than 80 columns with either printer.

I would be interested to hear from anyone who finds the driver useful. You can replace codes in its character translation table from Basic or from machine language (with an INT 17H, the Basic Input/ output system [BIOS] printer interrupt).

People's Assembler

If you can't atlord an assembler and would like to try iiunhiiiC language, you already have the tools. EDLIN and Debug. This is how I've been managing; the small assembler in Debug is fine for short routines. I write source files with EDLIN (or a word processor) and use in-put/output redirection to force Debug to assemble the source file to an object file.

You can write Assembly-language code right in Debug, on the fly. but the trick is to have it assemble from a file that you can edit later. The text file must have all the keystrokes you would normally use in an assembling session with

Debug. Program Listing 1 is a small program that changes the screen to blue with bright white letters.

Type in EDLIN SCREEN.SRC and enter the text as listed, even the blank line. The first line names the output file (a .COM file), the second line starts assembly. Assembly continues up until the empty line, whose sole purpose is to end assembly.

The semicolons start comments that you can ignore, as does the assembler. This small program uses the BIOS video interrupt to set the whole screen as a window and null it with the white-on-blue attribute.

The RCX lets you change the contents of the CX register, which holds the number of bytes the program will write to disk. The W makes the program write all 11H bytes of assembled code to the file Screen.COM. Q is for Quit. To assemble the source file, type in:

DEBUG < SCREEN.SRC

Debug takes its input from the source file instead of the standard input (the keyboard). When you first write the source code, you must guess at all relative jump addresses and the number of bytes to put in CX.

I make a first pass, pressing the hold key when I want to make note of what a Jump address should be and the number of bytes involved. I then edit the source file and reassemble. With complex routines. I make several passes, especially if a relative jump instruction suddenly becomes a byte longer. Then I have to debug.

Basic Sounds

I was experimenting with the GW-Ba-sic Sound statements recently. You definitely need to learn a few things if you're used to the Sound statement on the Model 4 or 2000. The 1000 s Basic sound has a range of 110 Hz to above hearing with adjustable volume on three voices (like the late PCjr). The Tandy 1000 Basic manual has the value ranges and polarities for the tone and duration parameters mixed up or just wrong. (The more I use this manual, the madder I get.)

Program Listing 2 demonstrates the abilities of the Sound statement. The up-

and down-arrow keys raise and \ower the tone, while the left- and right-arrow keys lower or raise the volume (on the 1000 only). The program displays the present tone value in the middle of the screen. The arrow keys act through On Key event-trapping (see 1000 Basic article). The Sound On in line 10 is necessary. The "MF" puts the sound in the foreground.

On the 1000. you also get a Noise command (six types) and the Play command. The Play statement takes a string argument with up to 32 notes or rests. The variety of string arguments provides flexibility, and Tandy implemented them so that musicians can feel comfortable using them. You can play music as a background task while a program does other things. To facilitate this process. Basic provides event-trapping for the number of notes left in the music buffer. When it's near empty, an interrupt subroutine can refill the buffer.

Program Listing 3 shows how to use the Play statement with event-trapping to play music in the background as other program lines execute. Line 10 sets event-trapping to trigger with two notes left in the music buffer. You should ad-Just this value to the complexity of the foreground task. If it involves uninter-ruptable graphics that take a while to execute (like filling a large area with the Paint statement), you'll want to set the buffer trip level higher. However, setting the On Play() parameter higher means more frequently interrupting the foreground task. In the present case, a value of 1 in line 10 produced a noticeable break in the flow of the "music."

The string in line 30 sets the music in the background, as staccato, at the highest tempo and the second octave, then starts things off with the notes E. F. B. and A. The subroutine replenishes the music buffer with several repetitions of these four notes; they repeat endlessly while the screen fills with the text in the loop from lines 50-60. When the subroutine is active, screen printing halts momentarily, but the music plays without pause.

Program Protection

How much can you protect Basic programs from tampering or copying? The Save command has a protect option (Save "File".P) that saves a Basic program in an encoded binary format. The file is then protected from tampering, as you can't list. edit, or merge it. You can. however. load. run. or chain the program. as well as copy it. What more can be done?B

You can write to Dave Rowell at 80 Micro. 80 Pine St.. Peterborough. NH 03458.

(i T ENTERPRISE:

COM PUTEPAOISK ETTES

each

0 0

Post a comment