80-Bus News

  

September-October 1984, Volume 3, Issue 5











Page 32 of 47











32

CONFIG, but I can’t be bothered to do it to a machine which doesn’t belong to me in the first place.

All that apart, I use dBASE with the reply prompts highlighted, that is, in inverse video, and I like to see a flashing cursor under these circumstances anyway. Further, the prompt is usually on the eighth line which looks untidy as it overlays the underhangs on characters like lower case g, j, y, etc. So I like to see a flashing cursor on the 9th line when using dBASE. How can this be achieved?

Well the obvious is to send a command string to the SVC/IVC to turn the cursor on, blinking, and move it down one line. It appears nice and easy, just work out the control words and then print them:

STORE CHR(27 )+"Y"+CHR (72 )+CHR(8 ) TO curs ? curs

Not so, dBASE says different. The main problem in this instance is the CHR(8), instantly recognisable as 08h, or backspace. Now dBASE does not send a backspace, it translates the 08h into a cursor left movement. To achieve a back space you use the DEL key and the 7fh code is translated into a three byte string: 08h (to move the cursor back one), 20h (to delete the character at the cursor, which also advances the cursor) and 08h to move the cursor back again. (This problem is not uncommon, several control codes are converted either by the BDOS or the application program, so dBASE is not an isolated instance. The characters usually affected would be 08h, backspace, O9h, tab, Oah, line feed and Odh carriage return.) The answer is to use the PUTVID program in the SVC/IVC manual, but this means making a machine code patch for dBASE (or whatever).

According to the manual dBASE uses memory up to about aQ0OH, so any address above this could be used for the patch, so I chose COQOOH for convenience. The machine code listing is given in Listing Two.

All it has is a data table at cOllh and the PUTVID routine enclosed in a loop to shove the four characters in turn at the video card. dBASE uses POKES like Basic, but the -call’ procedure is slightly different, you use the SET function to set the call address, then use CALL to call it. So the (decimalized) dBASE version of the above is as follows, (49152 is the decimal equivalent of c000h):

* Enable cursor type

SET CALL TO 49152

POKE 49152,6,4,33,17,192, 219, 178, 15, 56,251, 126, 35, 211,177, 16, 245 POKE 49168,201,27,89,/72,8

CALL

You could do the same with MBASIC, using the same POKE addresses and data, thus: .

10 CURS=49152

20 FOR A=49152 TO 49172: READ B: POKE A,B: NEXT

30 DATA 6,4,33,17,192,219,178,15, 56,251, 126,35, 211,177,16,245 40 DATA 201,27,89,72,8

50 CALL CURS


This is an OCR’d version of the scanned page and likely contains recognition errors.











Page 32 of 47