Sharp logo

MZ-800 course Chapter 2 
2. BASIC-800 ( 1Z016 / 5Z-009 )


2.3 Extra BASIC instructions

In this part of the chapter you really will encounter extra BASIC instructions, that is why the word Extra is no longer between quotes. This part will not only contain the programs, but also an explanation of the new instructions. It is a pity that we can not show you the most recent instructions, which will be part of the special GAME-BASIC. You will have to do with instructions which are familiar to a relatively large number of people. Later on in this book some programs will be explained. Here we shall only explain the instructions.

INVERSE[ON]


For QD-BASIC:

10 POKE $A015,$CD,$64,$1,$9D,$28,$11,$23,
$D9,$ED,$53,$EC,$5,$C9,$11,$DF,$42,$18,$F6 20 POKE $A028,$23,$D9,$EE,$FF,$C9 30 POKE $200,$28,$A0 :POKE $7460,$41:POKE $9FF7,$A3 40 POKE $59EC,$49,$4E,$56,$45,$52,$53,$C5:POKE $9FF1,$79

Unfortunately we do not have a tape version.

INVERSE really says it all. With this instruction you can inverse the text displayed on your screen. Inverse in this context means that black becomes white and the other way around. If the fore- and background colours are not black and white, these colours will be switched. This is how INVERSE works:

INVERSEON - The colours will be inverted.
INVERSE - The colours will return to normal.
An example:

INVERSEON:PRINT"NEPTUNES SOFTWARE";:INVERSE:PRINT"-The best there is."

The instructions PMODE and PSKIP are now inoperable.

CLIST


This listing applies to QD-BASIC. The alterations needed for tape BASIC are below. The function XOPEN will be unusable.

10 FOR A=$0 TO $43:READ A$:POKE $FAB+A,VAL("$"+A$):NEXT A:
POKE $5FF0,$AB,$F 20 FOR A-9 TO 29:READ A$:POKE $3BDF+A,VAL("$"+A$):NEXT A:
POKE $5CFD,$DF,$3B 30 POKE $FEF,$43,$98,$92,$9F,$A9,$3A:POKE $5AAA,$43,$4C,
$49,$53,$D4 40 DATA ED,5B,4D,9E,C4,D3,5E,D5,EB,CD 50 DATA 78,5E,D1,23,23,23,23,30,03,21 60 DATA A6,00,EB,D5,22,4D,9E,E1,11,A4 70 DATA 11,D5,CD,01,84,D1,21,00,00,1A 80 DATA 4F,06,00,FE,00,28,06,13,1A,47 90 DATA 09,18,F2,11,F5,0F,DF,16,11,EF 100 DATA 0F,DF,05,DF,01,C3,81,58 110 DATA CD,51,85,E5,7B,FE,01,28,0D,FE 120 DATA 00,C2,6A,63,21,81,58,22,F0,5F 130 DATA E1,C9,21,AB,0F,22,F0,5F,E1,C9
Adjustments for tape BASIC:
40 DATA ED,5B,D6,9D,C4,D3,5E,D5,EB,CD
60 DATA A6,00,EB,D5,22,D6,9D,E1,11,A4
70 DATA 11,D5,CD,8A,83,D1,21,00,00,1A
110 DATA CD,DA,84,E5,7B,FE,01,28,0D,FE

Usage of CLIST:
CLIST 1 - Turn on the checklist command.
CLIST 0 - Turn off the checklist command.

When the checklist command is turned on, a verification number appears after typing a line. When you copy a line from a book which also has verification numbers, you can see if you have copied the line correctly. You can also use it when you print out your own listing.

BACK


This listing applies both to QD- and tape BASIC.

10 DATA 2A,70,10,23,23,23,23,7E,B7,C9,CD,00,57,28,13,21,70,10
20 DATA 11,44,57,01,12,00,ED,B0,2A,70,10,01,10,00,ED,B0,C3,8E
30 DATA 61,CD,00,57,C2,8E,63,21,44,57,11,70,10,01,12,00,ED,80
40 DATA ED,5B,70,10,01,10,00,ED,B0,CD,3E,00,AF,C9
50 FOR A=$5700 TO $5B17:READ A$:POKE A,VAL("$"+A$)
60 NEXT A:POKE $5B17,$42,$43,$CB:POKE $5C99,$A,$57:POKE $5D1D,$25,$75

The functionality of BACK:

If you have issued the NEW command and you did not yet load or type anything, you can retrieve your listing with the back command. If you did put something new in memory, you will get an instruction error.

BOR


First we will give you the tape BASIC version, then the QD version. Most of you will probably know this one already.

Tape version:
10 POKE $59E9,$42,$4F,$D2
20 POKE $55B0,$CD,$DA,$84,$7B,$1,$CF,$6,$ED,$79,$C9
30 POKE $5C9D,$B0,$55
Diskette-version:
10 POKE $59E9,$42,$4F,$D2
20 POKE $5599,$CD,$51,$85,$7B,$1,$CF,$6,$ED,$79,$C9
30 POKE $5C9D,$99,$55

Functionality of the BOR instruction:
BOR x ( 0 =< x =< 65535 ) will change the colour of the border to the colour represented by x.

The OFF instruction is no longer usable after running the program above.

BCOLOR


First we will give the QD-version, and then the patch for tape BASIC.

10 POKE $5600,$CD,$51,$85,$7B,$32,$15,$56,$C9
20 POKE $5608,$3A,$9B,$10,$32,$1F,$56,$C3,$D9,$5
30 POKE $5611,$23,$D9,$77,$3E,$0,$F6,$40,$D3,$CC,$7E,$EE,$FF
40 POKE $561D,$77,$3E,$7,$F6,$80,$D3,$CC,$C3,$EF,$5
50 POKE $5B21,$42:POKE $5D6,$C3,$8,$56
60 POKE $5EC,$C3,$11,$56:POKE $5D21,$0,$56
For tape BASIC you must replace line 10 with:
10 POKE $5600,$CD,$DA,$84,$7B,$32,$15,$56,$C9

Functionality of BCOLOR:
BCOLOR x ( 0 =< x =< 65535 ) will change the background colour of the text on the screen to the color represented by x.

An example:
BCOLOR 1:PRINT"NEPTUNES SOFTWARE";:BCOLOR 2:PRINT"-The best there is."

This was the last extra instruction. Later on there is more about this. Oh, and by the way: the CCOLOR instruction is unusable.

Previous page
Next page
Contents


Go to the top of this page Home

last updated July 8, 2004
Arjan Habing, Mark de Rover, Jeroen F. J. Laros, sharpmz@sharpmz.org