BBC BASIC Programming on the NCs
If you already know a bit about programming in BBC BASIC, and want to know about programming the NC and it's differences to the BBC Micro, read on!
BBC BASIC Information
Entering and using BBC BASIC Commands you can't use The SOUND command Using TIME$ Bugs in BASIC File handling Assembly language programming Book list
Programming Tips
Tim's Tips for programming
FREE Software to Download
Software information pages Software index
Data Sheets
Data Sheets index BBC BASIC command reference VDU commands PLOT commands BASIC error messages OS error messages
Entering and using BBC BASIC
Press and and you will see the BASIC prompt.
To run a program automatically after pressing FUNCTION-B (as you might want to do with my Menu Master program), re-name the file as AUTO. To automatically run a second program after the first one has finished, name the second file NOTEPAD.RUN.
You will find that the cursor keys cannot be used to copy a line as on the BBC Micro. Instead, type
EDIT line
and then you can use the left and right cursor keys and the two delete keys to edit the line. This is also a quick way to copy a line -- just EDIT the line and change its line number, press ENTER, and there will be two copies of the line.
Commands you can't use
The following commands can't be used because of differences in hardware. If you type them in you will get the 'Sorry' error message.
- ADVAL -- There is no ADC.
- COLOR / COLOUR / GCOL -- The NC only has a mono screen!
- ENVELOPE -- The NC can only produce 'beeping' noises from it's speaker, so the ENVELOPE command will not work.
- INKEY(-x) -- You can not use this syntax to check for a specific key (x) since only one key is registered at a time. Normal use with a positive parameter is allowed.
- MODE -- The NC has only one mode.
- *FX -- These are not accepted.
The SOUND command
The syntax of the SOUND command is...
SOUND c,a,p,d
...where...
- 'c' is the channel number, either 1 or 2 (There are only two channels)
- 'a' is the amplitude. This is ignored since there is only one amplitude.
- 'p' is the pitch. This is a multiple of four in the range 0 to 255.
One step of four is a jump of one semitone. One step of eight is a jump of one tone.
- 'd' is the duration measured in 20th's of a second, i.e., a value of 20 gives a note lasting 1 second.
Using TIME$
The format of TIME$ is as follows :
ddd.nn mmm yyyy,hh:mm:ss
...where ddd is the day as a three-letter word, nn is the day as a two-digit number, mmm is the month as a three-letter word, yyyy is the year, hh is the hour in 24-hour format, mm is the minute, and ss is the second.
Bugs in BASIC
There are three 'bugs' that I have found whilst using BASIC. If you have found any more, please email me.
- When using INKEY in a loop, it sometimes pauses the program execution. You will have to press any key to continue.
- Sometimes when EDITing a line, every keypress makes the whole line repeat again and again on the screen. Press ENTER and the line will not be corrupted.
- When the text screen scrolls in a text window and there are characters in the last column, parts of the last column are left on the screen. Using CLS still fails to clear the remnants of the characters.
File handling
The NC200 differs from the BBC Micro in that it uses 12 character filenames and can support extensions using a separating dot, although files saved to disk need to be in MS-DOS format; maximum 8 characters plus a three character extension separated by a dot.
Assembly language programming
The NC machines can be programmed in assembly language, although the mnemonics will be for the Z80 processor. The integer variables are used to pass and return register values :
A% |
A |
B% |
B |
C% |
C |
D% |
D |
E% |
E |
F% |
Flags |
H% |
H |
L% |
L |
P% |
Program counter |
In addition, IX addresses CALL's parameter block and IY addresses the machine code routine itself (i.e. PC = IY)
The NC firmware has a number of built in routines for functions such as file handling, yellow events, power management, communications, etc. Details of these can be found on the Amstrad website, or in the Complete list of System Variables Datasheet.
Book list
Below is a list of some books written for the NCs and the BBC Micro. Thanks goes to Matt Randle and Paul Keeble for providing the information in this table.
Title |
ISBN and Publisher |
Notes |
- FEATURED BOOK -
Getting The Most From The Amstrad NC100 Notepad
Ian Sinclair |
Dabbs Press
A limited number of copies are currently available from Paul Keeble paulkeeble@ntlworld.com at a cost of £4.99 + postage & packing. |
The NC100 is the computer you can use in five minutes, but no computer is mastered in five minutes, and you need more time to be able to use the NC100 to its best advantage. This is a book which takes you through the steps of learning how to use the NC100 effectively, making your own choices of what you use it for and how you set it up. This is the book that tells you what to watch out for, what to avoid, how to get around problems and how to tackle the awkward jobs; all the things you never get to know in the first five minutes. This is the book which tells you what the NC100 cannot do, and what work is passed on to a desktop machine. Start reading now, and make your NC100 work for you!
Includes chapters on:
- Printing and Printing problems
- Macros and other Advanced Actions
- Using Mailing Lists
- Advanced Mail-merge Commands
- Using Memory Cards
- Data Transfer
- and many more...
292 pages. |
NC100 Magic
Vic Gerhardi and Dave Hampson |
ISBN 0-7457-0236-8
Rakewell
Email: vic@rakewell.com |
This book will help you get to know and love your Amstrad NC100 Notepad afterthe first five minutes. Topics include advanced word processing, mail merge, programming and hidden commands! Click here to find out more from the Rakewell website |
How To Program The Amstrad NC100 Notepad
Patrick Hall |
ISBN 1-85058-511-3
Sigma Press
Tel: 01625 531035 |
Mainly programming information and a few programs |
The Amstrad Notepad Advanced User Guide
Robin Nixon |
ISBN 1-85058-515-6
Sigma Press
Tel: 01625 531035 |
14 programs on disk and a reference section with Z80 instruction set.
Available to read in its entirety at Google Books.
Visit Robin Nixon's homepage at www.robinnixon.com |
Getting The Best From Your Amstrad Notepad
Kim Wilson |
Sigma Press
Tel: 01625 531035 |
|
Advanced Programming Techniques For The BBC Micro
Jim McGregor and Alan Watt |
ISBN 0-201-14059-4
Addison-Wesley |
Features on 3D graphics, databases, board games, etc. |
|