Playing With Electricity

Author(s): Harvey Taylor
Publication: ZX-Appeal
Date: February - March 1988
Pages: 6

-Feb 21/88 by Harvey Taylor

This month I have a grab bag of topics I have been meaning to get around to. I have wanted to mention the very excellent Scientific American issue October/87 on the next revolution in computers. There are articles on Architectures, Mass Storage, Networks, New chips etc. It is well worth checking out. Also If you are into 68xxx programming, there is a good article in Byte Sept/86 called “68000 Trips & Traps”. It has lots of neat little 68xxx optimization tricks. And just to give your preconceptions the old heave ho, there is an article in the Feb./88 Scientific American on plastics which conduct electricity. The last book is a reissue of Computer Lib / Dream Machines by Ted Nelson. This classic first came out in the mid-seventies & it is indicative of Nelson’s vision that the book is still relevant. Check it out!

In “QL SuperBasic, The Definitive Handbook” by Jan Jones, who wrote the language & should know, there is a really neat loading trick for the QL described. Let us say you have a downloaded basic program which does not use line numbers, or one of those copy_protected basic without line numbers programs which you wish to load. What you do is this.

On a reset machine, type AUTO & press enter. This will invoke the automatic line numbering function of the QL editor. You will be prompted with 100 and a cursor. Now, [without pressing <CTRL><SPACE>], erase the 100 and type ‘LOAD <yourfilename>’ [ eg. LOAD mdv1_APRG0_bas ]. The drive will begin to run & after a bit you will be prompted with a much higher line number. At this point, hit <CTRL><SPACE> to get out of AUTO & do a listing. You will see the unnumbered program all nicely numbered in your listing. If there is a line which superbasic does not like, there will be the keyword MISTake immediately after the line number. As Jan Jones says, ‘Neat huh?’

Some time ago Rod H. published the Savage benchmark program & gave some ZX81/2068/QL results. At the time, I told him I would SuperCharge the program & post the results. The straight QL time is 1m 25s and answer of 2499.712. Incidentally, on the QL it is possible to specify integer variables by affixing % to the variable name. If one does this to the variable A in the listing, the result is 2500 and the time is 1m 27s. A supercharged version of the Savage benchmark came up with a time of 0m 58s and a result of 2499.71218. Supercharge choked on the integer variable version.

I got a letter recently from a chap in Calgary who was having trouble hooking up a monitor to his QL. A lot of monitors on the market, have switches to allow it to accept either positive going or negative going SYNC signals. The problem arises when your monitor does not have such a switch & your QL puts out the wrong polarity of signal. Hooking up a monitor which requires positive going signals involves using a simple inverter to modify the QL signal.

Please refer to the CONCEPTS [Page 33] Section of your QL User’s Guide. There is a diagram there of the Monitor connector on the back of your QL (8 pin DIN). CSYNC is the Horizontal Sync. By the way, there are two kinds of 8 pin DIN connectors. The QL uses the “B” style, (Armaco # DD8281).

This manual was written in the UK & things are not all that they appear to be. In particular, the Pin #1 (Composite PAL) is +5 volts. This can be used as the power supply for the chip. The Pin #2 (Ground) is used to complete the power supply circuit.

The chip you will be using ( a 74LS14 ) consists of 6 Schmitt trigger Inverters. Basically you take which ever signal needs inverting ( HSYNC or VSYNC ) and run it through the inverter & hence to your monitor.

Meanwhile hooking up an ordinary composite monitor is a piece of cake. Just use Composite Video and ground. I also have one of those 5″ monitors which requires seperate Sync signals. Inverting the Horizontal Sync with a circuit similar to that discussed above works like a charm.

Finally, I want to add an optimized Scroll method which illustrates a useful technique and mindset. Using the Movem method cuts down the cycles/byte by 4.375. On a screen of 32K this can amount to 4.375 * 133*10E-9 * 32768 = .1906 sec.

All of the cycle times are listed in the back of the 68000 programmer’s reference manual.

*
* Standard Method
*
SCROLL MOVE.L #VIDEORAM,A0
LEA (10*128)A0,A1 * 10 LINES OF 128 BYTES
MOVE.W #(32768/4)-1,D0 * COUNTER
SCR_LOOP MOVE.L (A1)+,(A0)+ * 40 CYCLES
DBRA D0,SCR_LOOP * 18 CYCLES
RTS --
58/4 = 14.5 CYCLES / BYTE
*
* MOVEM METHOD
*
SCROLL MOVE:L #VIDEORAM,A0
LEA (10*128)A0,A1 * 10 LINES OF 128 BYTES
MOVEQ #32,D1 * INCREMENT
MOVE.W #(32768/32)-1,D0 * COUNTER
SCR_LOOP MOVEM.L (A0)+,D0-D7/A0 * 24 + 16*8 = 152
MOVEM.L D0-D7/A0,(A1) * 16 + 16*8 = 144
ADD.L D1,A1 * 10
DBRA D0,SCR_LOOP 18
---
324/32 = 10.125

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.