mirror of https://github.com/wwarthen/RomWBW.git
committed by
GitHub
1199 changed files with 61102 additions and 23183 deletions
@ -0,0 +1,4 @@ |
|||
{ |
|||
"files.trimTrailingWhitespace": false, |
|||
"files.eol": "\r\n" |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
INTTEST |
|||
======= |
|||
|
|||
RomWBW includes an API allowing applications to "hook" interrupts. |
|||
The `INTTEST` utility allows you to test this functionality. |
|||
|
|||
|
|||
** Syntax ** |
|||
|
|||
`INTTEST` |
|||
|
|||
|
|||
** Usage ** |
|||
|
|||
`INTTEST` is an interactive application. At startup, it will display |
|||
a list of the interrupt vector slots in your system along with the |
|||
current vector address for each of them. |
|||
|
|||
It then prompts you to enter the slot number (in hex) of a vector to |
|||
hook. After entering this, the application will watch the hooked |
|||
vector and countdown from 0xFF to 0x00 as interrupts are noted. |
|||
|
|||
When the counter reaches 0x00, the interrupt is unhooked and the |
|||
application terminates. The application can also be terminated by |
|||
pressing <esc>. |
|||
|
|||
|
|||
** Notes ** |
|||
|
|||
If your system is running without interrupts active, the application |
|||
will terminate immediately. |
|||
|
|||
All slots have vectors even if the corresponding interrupt is not |
|||
doing anything. In this case, the vector is pointing to the "bad |
|||
interrupt" handler. |
|||
|
|||
If you hook a vector that is not receiving any interrupts, the |
|||
down-counter will not do anything. |
|||
|
|||
|
|||
** Etymology* * |
|||
|
|||
The `INTTEST` command is an original product and the source code is |
|||
provided in the RomWBW distribution. |
|||
@ -0,0 +1,4 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.sys del *.sys |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.sys |
|||
@ -0,0 +1,23 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the CP/M 2.2 system files for the RomWBW CP/M 2.2 |
|||
adaptation. All of these files are already included on the CP/M |
|||
boot disk images. However if you are creating a CP/M boot disk |
|||
manually, you should copy all of these files to the boot disk. |
|||
|
|||
Note: Two file have been provided one for RomWBW HBIOS, and one for UNA |
|||
BIOS. One of these files must be installed on the system boot track. |
|||
This is usually achieved by the SYSCOPY utility e.g. |
|||
|
|||
SYSCOPY a:=cpm_wbw.sys |
|||
|
|||
These files should also be copied to any CP/M 2.2 boot disks on your |
|||
system when you upgrade your ROM firmware. Some of these files |
|||
*must* match the version of the RomWBW firmware you are using for |
|||
proper operation of your system. |
|||
@ -0,0 +1,4 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.sys del *.sys |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.sys *.bin |
|||
@ -0,0 +1,21 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the QPM 2.7 system files for the RomWBW QPM 2.7 |
|||
adaptation. All of these files are already included on the QPM |
|||
boot disk images. However if you are creating a QPM boot disk |
|||
manually, you should copy all of these files to the boot disk. |
|||
|
|||
Note: Two file have been provided one for RomWBW HBIOS, and one for UNA |
|||
BIOS. One of these files must be installed on the system boot track. |
|||
Refer to the QPM Documentation for installing QPM |
|||
|
|||
These files should also be copied to any QPM boot disks on your |
|||
system when you upgrade your ROM firmware. Some of these files |
|||
*must* match the version of the RomWBW firmware you are using for |
|||
proper operation of your system. |
|||
@ -0,0 +1,4 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.sys del *.sys |
|||
@ -0,0 +1,7 @@ |
|||
TOOLS = ../../Tools |
|||
MOREDIFF := $(shell $(TOOLS)/unix/casefn.sh *.spr) |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
clean:: |
|||
@rm -f *.sys |
|||
@ -0,0 +1,23 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory contains the ZSDOS system files for the RomWBW ZSDOS |
|||
adaptation. All of these files are already included on the ZSDOS |
|||
boot disk images. However if you are creating a ZSDOS boot disk |
|||
manually, you should copy all of these files to the boot disk. |
|||
|
|||
Note: Two file have been provided one for RomWBW HBIOS, and one for UNA |
|||
BIOS. One of these files must be installed on the system boot track. |
|||
This is usually achieved by the SYSCOPY utility e.g. |
|||
|
|||
SYSCOPY a:=zsys_wbw.sys |
|||
|
|||
These files should also be copied to any ZSDOS boot disks on your |
|||
system when you upgrade your ROM firmware. Some of these files |
|||
*must* match the version of the RomWBW firmware you are using for |
|||
proper operation of your system. |
|||
@ -0,0 +1,70 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory ("Doc/CPM") is part of the RomWBW System Software |
|||
distribution archive. It contains documentation for the CP/M and |
|||
CP/M work-alike operating system components of the system. |
|||
|
|||
|
|||
CPM Manual ("CPM Manual.pdf") |
|||
----------------------------- |
|||
|
|||
The original DRI CP/M 2.x Operating System Manual. This should be |
|||
considered the primary reference for system operation. The section |
|||
on CP/M 2 Alteration can be ignored since this work has already been |
|||
completed as part of the RomWBW distribution. |
|||
|
|||
|
|||
CPM3 Command Summary ("CPM3 Command Summary.pdf") |
|||
CPM3 Programmer's Guide ("CPM3 Programmers Guide.pdf") |
|||
CPM3 System Guide ("CPM3 System Guide.pdf") |
|||
CPM3 User's Guide ("CPM3 Users Guide.pdf") |
|||
------------------------------------------------------ |
|||
|
|||
The original DRI CP/M 3.0 Operating System Documentation Set. This |
|||
should be considered the primary reference for CP/M 3 system operation. |
|||
|
|||
|
|||
NZCOM, Z3PLUS, and replace ZCPR3.3 Documentation |
|||
------------------------------------------------ |
|||
|
|||
NZCOM operating system operation manual. ("NZCOM Users Manual.pdf") |
|||
Z3PLUS operating system operation manual. ("Z3PLUS Users Manual.pdf") |
|||
Z-System User Guide ("Z-System User Guide.pdf") |
|||
ZCPR3.3 Users Guide ("ZCPR3.3 Users Guide.pdf") |
|||
|
|||
|
|||
QP/M 2.7 Installation Guide and Supplements ("qpm27.pdf") |
|||
QP/M 2.7 Interface Guide ("qdos27.pdf") |
|||
QP/M 2.7 Features and Facilities ("qcp27.pdf") |
|||
-------------------------------------------- |
|||
|
|||
Official documentation set for QP/M 2.7 from original QP/M distribution. |
|||
|
|||
|
|||
ZCPR Manual ("ZCPR Manual.pdf") |
|||
------------------------------- |
|||
|
|||
ZCPR is the command proccessor portion of Z-System. This is the |
|||
manual for ZCPR 1.x as included in RomWBW. The installation |
|||
instructions can be ignored since that work has already been |
|||
completed as part of the RomWBW distribution. |
|||
|
|||
ZCPR D&J Manual ("ZCPR-DJ.doc") |
|||
------------------------------- |
|||
|
|||
ZCPR D&J User Manual. This manual supplements the ZCPR Manual. |
|||
|
|||
|
|||
ZSDOS Manual ("ZSDOS Manual.pdf") |
|||
--------------------------------- |
|||
|
|||
ZSDOS is the DOS portion of Z-System. This is the manual for ZSDOS |
|||
1.x as included in RomWBW. The installation instructions can be |
|||
ignored since that work has already been completed as part of the |
|||
RomWBW distribution. |
|||
Binary file not shown.
File diff suppressed because it is too large
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -0,0 +1,62 @@ |
|||
*********************************************************************** |
|||
*** *** |
|||
*** R o m W B W *** |
|||
*** *** |
|||
*** Z80/Z180 System Software *** |
|||
*** *** |
|||
*********************************************************************** |
|||
|
|||
This directory ("Doc/Language") is part of the RomWBW System Software |
|||
distribution archive. It contains documentation for Programming |
|||
Languages provided with the system. |
|||
|
|||
|
|||
Aztec C Compiler User Manual (Aztec_C_1.06_User_Manual_Mar84.pdf) |
|||
----------------------------------------------------------------- |
|||
|
|||
Official user manual for the Aztec C Compiler included in the aztecc disk image. |
|||
|
|||
|
|||
Borland TurboPascal User Manual (Turbo_Pascal_Version_3.0_Reference_Manual_1986.pdf) |
|||
------------------------------------------------------------------------------------ |
|||
|
|||
Official user manual Borland TurboPascal included in the pascal disk image. |
|||
|
|||
|
|||
Cowgol Lanaguage (Cowgol Language.pdf) |
|||
-------------------------------------- |
|||
|
|||
Documentation for Cowgol Language included in the cowgol disk image |
|||
|
|||
|
|||
HI-TECH C Compiler User Manual (HI-TECH Z80 C Compiler Manual.txt) |
|||
------------------------------------------------------------------ |
|||
|
|||
Official user manual for the HI-TECH C Compiler included in the |
|||
hitechc disk image. |
|||
|
|||
|
|||
Microsoft Basic-80 Reference Manual v5.0 (Microsoft Basic-80 Reference Manual v5.0.pdf) |
|||
--------------------------------------------------------------------------------------- |
|||
|
|||
Official manual for Microsoft BASIC as included in RomWBW. |
|||
|
|||
|
|||
Microsoft FORTRAN-80 User Manual (Microsoft_FORTRAN-80_Users_Manual_1977.pdf) |
|||
----------------------------------------------------------------------------- |
|||
|
|||
Official user manual for Microsoft's FORTRAN-80 compiler included in the fortran |
|||
disk image. |
|||
|
|||
|
|||
Z80 Assembler User Manual (z80asm (SLR Systems).pdf) |
|||
---------------------------------------------------- |
|||
|
|||
Official user manual for the Z80 Macro Assembler by SLR Systems |
|||
included in the z80asm disk image. |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,144 +0,0 @@ |
|||
SIMH (X) |
|||
---- |
|||
- Test UART driver |
|||
- Test HDSK driver |
|||
|
|||
Zeta 1 (X) |
|||
------ |
|||
- Test UART driver |
|||
- Test PPP detection (startup w/ and w/o PPP) |
|||
- Test boot to CRT |
|||
- Test PPPSD driver |
|||
- Test PPPCON driver (video & kbd) |
|||
- Test FD driver |
|||
- Test FDU app |
|||
|
|||
Zeta 2 (X) |
|||
------ |
|||
- Test UART driver |
|||
- Test PPP detection (startup w/ and w/o PPP) |
|||
- Test boot to CRT |
|||
- Test PPPSD driver |
|||
- Test PPPCON driver (video & kbd) |
|||
- Test FD driver |
|||
- Test FDU app |
|||
|
|||
RCBus (X) |
|||
------ |
|||
- Test SIO driver (Serial Module) |
|||
- Test ACIA driver (Dual Serial Module) |
|||
- Test IDE driver (Compact Flash Module) |
|||
- Test PPIDE driver (IDE Module) |
|||
- Test FD driver (SMC and WDC) |
|||
- Test FDU app (SMC and WDC) |
|||
|
|||
N8-2312 (X) |
|||
------- |
|||
- Test ASCI driver |
|||
- Test SD driver (CSIO mode) |
|||
- Test FD driver |
|||
- Test FDU app |
|||
- Test TMS driver (video & kbd) |
|||
|
|||
N8-2511 (X) |
|||
------- |
|||
- Test ASCI driver |
|||
- Test SD driver (Juha mode) |
|||
- Test FD driver |
|||
- Test FDU app |
|||
- Test TMS driver (video & kbd) |
|||
|
|||
SBC (X) |
|||
--- |
|||
- Test UART driver |
|||
- Test PPIDE driver |
|||
- Test PPISD driver |
|||
- Test PRP detection |
|||
- Test boot to CRT console |
|||
|
|||
MK4 (X) |
|||
--- |
|||
- Test ASCI driver |
|||
- Test IDE driver |
|||
- Test SD driver |
|||
- Test PRP detection |
|||
|
|||
RAMF (X) |
|||
---- |
|||
- Test RAMF driver |
|||
|
|||
PRP (X) |
|||
--- |
|||
- Test PRPSD driver |
|||
- Test PRPCON driver (video & kbd) |
|||
|
|||
SCG (X) |
|||
--- |
|||
- Test TMS driver (video) |
|||
|
|||
VDU (X) |
|||
--- |
|||
- Test CVDU driver (video & kbd) |
|||
|
|||
CVDU (X) |
|||
---- |
|||
- Test CVDU driver (video & kbd) |
|||
|
|||
VGA (X) |
|||
--- |
|||
- Test VGA driver (video & kbd) |
|||
|
|||
DIO (X) |
|||
--- |
|||
- Test FD driver |
|||
- Test FDU app |
|||
- Test IDE driver |
|||
|
|||
DIO3 (X) |
|||
---- |
|||
- Test FD driver |
|||
- Test FDU app |
|||
- Test PPIDE driver |
|||
|
|||
DIDE (X) |
|||
---- |
|||
- Test FD driver |
|||
- Test FDU app |
|||
- Test IDE driver |
|||
|
|||
DSD (X) |
|||
--- |
|||
- Test SD driver |
|||
|
|||
4UART (X) |
|||
----- |
|||
- Test UART driver |
|||
|
|||
|
|||
UNA (X) |
|||
--- |
|||
- General Startup |
|||
- Boot from disk functionality |
|||
- Image loading |
|||
- Monitor |
|||
- XM app |
|||
- ASSIGN app |
|||
- MODE app |
|||
- SYSCOPY app |
|||
- OSLDR app |
|||
- FDU app |
|||
- FDISK80 app |
|||
|
|||
GENERAL (X) |
|||
------- |
|||
- Boot to ROM |
|||
- Boot to Disk |
|||
- Boot to Monitor |
|||
- XM app |
|||
- XM port auto-detect |
|||
- ASSIGN app |
|||
- MODE app |
|||
- SYSCOPY app |
|||
- FDU app |
|||
- FDISK80 app |
|||
- TUNE app |
|||
Binary file not shown.
@ -0,0 +1,48 @@ |
|||
FROM ubuntu:jammy-20240111 as basebuilder |
|||
|
|||
# This docker file can be used to build a tool chain docker image for building RomWBW images. |
|||
|
|||
# Tested on a ubuntu host and on Windows un WSL (with docker desktop) |
|||
|
|||
# First build the docker image (will b) |
|||
# docker build --progress plain -t romwbw-chain . |
|||
|
|||
# After you have built the above image (called romwbw-chain), you can use it to compile and build the RomWBW images |
|||
# as per the standard make scripts within RomWBW. |
|||
# Start a new terminal, cd to where you have clone RomWBW, and then run this command: |
|||
# docker run -v ${PWD}:/src/ --privileged=true -u $(id -u ${USER}):$(id -g ${USER}) -it romwbw-chain:latest |
|||
|
|||
# you can now compile and build the required images: |
|||
|
|||
# cd Tools && make |
|||
# cd Source && make # at least once to build many common units |
|||
# cd Source && make rom ROM_PLATFORM=RCEZ80 ROM_CONFIG=std |
|||
|
|||
# when finish, type 'exit' to return to back to your standard terminal session |
|||
|
|||
LABEL Maintainer="Dean Netherton" \ |
|||
Description="spike to use clang for ez80 target" |
|||
|
|||
ENV DEBIAN_FRONTEND=noninteractive |
|||
|
|||
|
|||
RUN dpkg --add-architecture i386 |
|||
RUN sed -i 's/http:\/\/archive\.ubuntu\.com\/ubuntu/http:\/\/au.archive.ubuntu.com\/ubuntu/g' /etc/apt/sources.list |
|||
RUN apt update -y |
|||
RUN apt dist-upgrade -y |
|||
RUN apt install -y --no-install-recommends cmake lzip ca-certificates mtools build-essential dos2unix libboost-all-dev texinfo texi2html libxml2-dev subversion bison flex zlib1g-dev m4 git wget dosfstools curl |
|||
|
|||
RUN mkdir work |
|||
WORKDIR /work |
|||
|
|||
FROM basebuilder as main |
|||
|
|||
LABEL Maintainer="Dean Netherton" \ |
|||
Description="spike to build RomWBW" |
|||
|
|||
RUN mkdir /src |
|||
WORKDIR /src/ |
|||
|
|||
RUN apt install -y --no-install-recommends build-essential libncurses-dev srecord bsdmainutils |
|||
|
|||
RUN adduser --disabled-password --gecos "" builder |
|||
@ -0,0 +1,23 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=..\..\..\Tools |
|||
|
|||
set PATH=%TOOLS%\zxcc;%PATH% |
|||
|
|||
set CPMDIR80=%TOOLS%/cpm/ |
|||
|
|||
zxcc z80asm -dist/FM |
|||
zxcc z80asm -main/FM |
|||
zxcc z80asm -exec/FM |
|||
zxcc z80asm -eval/FM |
|||
zxcc z80asm -asmb/FM |
|||
zxcc z80asm -cmos/FM |
|||
zxcc z80asm -math/FM |
|||
zxcc z80asm -hook/FM |
|||
zxcc z80asm -data/FM |
|||
|
|||
zxcc slrnk -/v,/a:0100,dist,main,exec,eval,asmb,math,hook,cmos,/p:4B00,data,bbcbasic/n,/e |
|||
|
|||
copy /Y bbcbasic.com ..\..\..\Binary\Apps\ || exit /b |
|||
copy /Y bbcbasic.txt ..\..\..\Binary\Apps\ || exit /b |
|||
@ -0,0 +1,9 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.com del *.com |
|||
if exist *.lst del *.lst |
|||
if exist *.hex del *.hex |
|||
if exist *.prn del *.prn |
|||
if exist *.rel del *.rel |
|||
if exist *.sym del *.sym |
|||
@ -0,0 +1,11 @@ |
|||
OBJECTS = bbcbasic.com |
|||
DOCS = bbcbasic.txt |
|||
DEST = ../../../Binary/Apps |
|||
DOCDEST = ../../../Binary/Apps |
|||
TOOLS = ../../../Tools |
|||
OTHERS = *.rel |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
|
|||
bbcbasic.com: dist.rel main.rel exec.rel eval.rel asmb.rel cmos.rel math.rel hook.rel data.rel |
|||
$(ZXCC) SLRNK -/V,/A:0100,DIST,MAIN,EXEC,EVAL,ASMB,MATH,HOOK,CMOS,/P:4B00,DATA,BBCBASIC/N,/E |
|||
File diff suppressed because it is too large
@ -0,0 +1,455 @@ |
|||
This is a RomWBW HBIOS adaptation of BBCBASIC v5.00. The |
|||
cursor and screen management assumes the use of an ANSI/VT-100 terminal |
|||
which is generally correct for RomWBW. Support for a hardware system |
|||
timer is also implemented. If your system does not have a hardware |
|||
timer, the TIME function will always return 0 and the timeout |
|||
parameter of the INKEY(n) function will not be observed (will never |
|||
timeout). |
|||
|
|||
What follows is some basic information on BBCBASIC from the |
|||
distribution. Note that it starts with the v3.00 information and |
|||
later on provides information on the changes in v5.00. |
|||
|
|||
-- WBW 1:15 PM 5/30/2024 |
|||
|
|||
|
|||
|
|||
|
|||
BBC BASIC (Z80) |
|||
|
|||
Generic CP/M Version 3.00 |
|||
|
|||
(C) Copyright R.T.Russell 1982-1999 |
|||
|
|||
1. INTRODUCTION |
|||
|
|||
BBC BASIC (Z80) has been designed to be as compatible as possible with |
|||
Version 4 of the 6502 BBC BASIC resident in the BBC Micro Master series. |
|||
The language syntax is not always identical to that of the 6502 version, |
|||
but in most cases the Z80 version is more tolerant. |
|||
|
|||
BBC BASIC (Z80) is as machine independent as possible and, as supplied, |
|||
it will run on any CP/M 2.2 (or later) system using a Z80 processor |
|||
(checks are carried out to ensure that the processor is a Z80 and that |
|||
the version of CP/M is at least 2.2). It is minimally configured for an |
|||
ADM3a-compatible VDU. |
|||
|
|||
Few CP/M systems offer colour graphics of the quality provided as |
|||
standard on the BBC Microcomputer, and no software can provide colour |
|||
high-resolution graphics from a monochrome character-orientated computer. |
|||
However, many CP/M system users are interested in the advanced program |
|||
structures available from BBC BASIC and, within the limitations of the |
|||
host computer, BBC BASIC (Z80) provides the programming structures and |
|||
the non-graphic commands and functions specified for BBC BASIC. |
|||
|
|||
In order to make full use of the facilities available in BBC BASIC (Z80) |
|||
it is necessary to install a small patch to adapt it to the capabilities |
|||
of the host computer. The source code of the patch present in the |
|||
distribution version is supplied as BBCDIST.MAC. |
|||
|
|||
This documentation should be read in conjunction with a standard BBC |
|||
BASIC manual. Only those features which differ from the standard Acorn |
|||
versions are documented here. |
|||
|
|||
|
|||
2. MEMORY UTILISATION |
|||
|
|||
BBC BASIC (Z80) requires about 16 Kbytes of code space, resulting in a |
|||
value of PAGE of about &3E00. The remainder of the user memory is |
|||
available for BASIC programs, variables (heap) and stack. Depending on |
|||
the system configuration, HIMEM can have a value up to &FE00. |
|||
|
|||
|
|||
3. COMMANDS, STATEMENTS AND FUNCTIONS |
|||
|
|||
The syntax of BASIC commands, statements and functions is in most cases |
|||
identical to that of the BBC Micro version (BASIC 4). The few |
|||
differences are documented here: |
|||
|
|||
ADVAL |
|||
This function is not implemented. |
|||
|
|||
CALL |
|||
CALL sets up a table in RAM containing details of the parameters; the |
|||
processor's IX register is set to the address of this parameter table. |
|||
The other processor registers are initialised as follows: |
|||
|
|||
A is initialised to the least significant byte of A% |
|||
B is initialised to the least significant byte of B% |
|||
C is initialised to the least significant byte of C% |
|||
D is initialised to the least significant byte of D% |
|||
E is initialised to the least significant byte of E% |
|||
F is initialised to the least significant byte of F% |
|||
H is initialised to the least significant byte of H% |
|||
L is initialised to the least significant byte of L% |
|||
|
|||
The parameter types are: |
|||
|
|||
Code No. Parameter Type Example |
|||
0 Byte (8 bits) ?A% |
|||
4 Word (32 bits) !A% or A% |
|||
5 Real (40 bits) A |
|||
128 Fixed string $A% |
|||
129 Movable string A$ |
|||
|
|||
On entry to the subroutine the parameter table contains the following |
|||
values: |
|||
|
|||
Number of parameters 1 byte (at IX) |
|||
|
|||
Parameter type 1 byte (at IX+1) |
|||
Parameter address 2 bytes (at IX+2, IX+3, LSB first) |
|||
|
|||
Parameter type ) repeated as often as necessary |
|||
Parameter address ) |
|||
|
|||
Except in the case of a movable string (normal string variable), the |
|||
parameter address given is the absolute address at which the item is |
|||
stored. In the case of movable strings (type 129) it is the address of a |
|||
4-byte parameter block containing the current length, the maximum length |
|||
and the start address of the string (LSB first) in that order. |
|||
|
|||
Integer variables are stored in twos complement form with their least |
|||
significant byte first. |
|||
|
|||
Fixed strings are stored as the characters of the string followed by a |
|||
carriage return (&0D). |
|||
|
|||
Floating point variables are stored in binary floating point format with |
|||
their least significant byte first; the fifth byte is the exponent. The |
|||
mantissa is stored as a binary fraction in sign and magnitude format. |
|||
Bit 7 of the most significant byte is the sign bit and, for the purposes |
|||
of calculating the magnitude of the number, this bit is assumed to be set |
|||
to one. The exponent is stored as an integer in excess 127 format (to |
|||
find the exponent subtract 127 from the value in the fifth byte). |
|||
|
|||
If the exponent byte of a floating point number is zero, the number is an |
|||
integer stored in integer format in the mantissa bytes. Thus an integer |
|||
can be represented in two different ways in a real variable. For example |
|||
the value +5 can be stored as: |
|||
|
|||
05 00 00 00 00 Integer 5 |
|||
00 00 00 20 82 (0.5 + 0.125) * 2^3 |
|||
|
|||
COLOUR (COLOR) |
|||
This statement is not implemented. |
|||
|
|||
DRAW |
|||
This statement is not implemented. |
|||
|
|||
EDIT |
|||
A command to edit or concatenate and edit the specified program line(s). |
|||
The specified lines (including their line numbers) are listed as a single |
|||
line. By changing only the line number you can use EDIT to duplicate a |
|||
line. |
|||
|
|||
EDIT 230 |
|||
EDIT 200,230 |
|||
|
|||
The following control functions are active both in the EDIT mode and in |
|||
the immediate entry mode (i.e. at the BASIC prompt): |
|||
|
|||
Move the cursor one character position to the left |
|||
Move the cursor one character position to the right |
|||
Move the cursor to the start of the line |
|||
Move the cursor to the end of the line |
|||
Insert a space at the current cursor position |
|||
Delete the character at the current cursor position |
|||
Backspace and delete the character to the left of the cursor |
|||
Delete all characters to the left of the cursor |
|||
Delete all characters from the cursor to the end of the line |
|||
|
|||
The choice of which keys activate these functions is made when BBC BASIC |
|||
is configured for a particular system. The distribution version uses ^H, |
|||
^I, ^K, ^J, ^A, ^E, DEL (&7F), ^L and ^X. |
|||
|
|||
To exit EDIT mode and replace the edited line, type RETURN (ENTER). |
|||
|
|||
To abort the edit and leave the line unchanged, type ESCape. |
|||
|
|||
ENVELOPE |
|||
This statement is not implemented. |
|||
|
|||
GET |
|||
This function waits for a character to be typed at the keyboard, and |
|||
returns the ASCII code. |
|||
|
|||
GET can also be used to read data from a processor I/O port; full 16-bit |
|||
port addressing is available: |
|||
|
|||
N% = GET(X%) : REM input from port X% |
|||
|
|||
INKEY |
|||
This function waits for a specified maximum number of centiseconds for a |
|||
character to be typed at the keyboard. If no character is typed in that |
|||
time, the value -1 is returned. In the distribution version the delay is |
|||
determined by a simple software timing loop, and may be very inaccurate. |
|||
The customisation patch allows this to be adjusted to suit the system in |
|||
use. |
|||
|
|||
INPUT# |
|||
The format of data files is different from that used by the BBC Micro, in |
|||
part to improve compatibility with standard CP/M files. Numeric values |
|||
are stored as five bytes in the format documented under CALL; if the |
|||
fifth byte is zero the value is an integer. Strings are stored as the |
|||
characters of the string (in the correct order!) followed by a carriage |
|||
return (&0D). |
|||
|
|||
MODE |
|||
This statement is not implemented. |
|||
|
|||
MOVE |
|||
This statement is not implemented. |
|||
|
|||
PLOT |
|||
This statement is not implemented. |
|||
|
|||
POINT |
|||
This function is not implemented. |
|||
|
|||
PRINT# |
|||
The format of data files is different from that used by the BBC Micro, in |
|||
part to improve compatibility with standard CP/M files. Numeric values |
|||
are stored as five bytes in the format documented under CALL; if the |
|||
fifth byte is zero the value is an integer. Strings are stored as the |
|||
characters of the string (in the correct order!) followed by a carriage |
|||
return (&0D). |
|||
|
|||
PUT |
|||
A statement to output data to a processor port. Full 16-bit addressing |
|||
is available. |
|||
|
|||
PUT A%,N% : REM Output N% to port A% |
|||
|
|||
SOUND |
|||
This statement is not implemented. |
|||
|
|||
TIME |
|||
This pseudo-variable is not implemented in the distribution version, but |
|||
can be supported by means of the customisation patch. See BBCDIST.MAC. |
|||
|
|||
USR |
|||
As with CALL, the processor's registers are initialised as follows: |
|||
|
|||
A is initialised to the least significant byte of A% |
|||
B is initialised to the least significant byte of B% |
|||
C is initialised to the least significant byte of C% |
|||
D is initialised to the least significant byte of D% |
|||
E is initialised to the least significant byte of E% |
|||
F is initialised to the least significant byte of F% |
|||
H is initialised to the least significant byte of H% |
|||
L is initialised to the least significant byte of L% |
|||
|
|||
USR returns a 32-bit integer result composed of the processor's H, L, H' |
|||
and L' registers, with H being the most significant. |
|||
|
|||
|
|||
4. RESIDENT Z80 ASSEMBLER |
|||
|
|||
The in-line assembler is accessed in exactly the same way as the 6502 |
|||
assembler in the BBC Micro version of BBC BASIC. That is, '[' enters |
|||
assembler mode and ']' exits assembler mode. |
|||
|
|||
All standard Zilog mnemonics are accepted: ADD, ADC and SBC must be |
|||
followed by A or HL. For example, ADD A,C is accepted but ADD C is not. |
|||
However, the brackets around the port number in IN and OUT are optional. |
|||
Thus both OUT (5),A and OUT 5,A are accepted. The instruction IN F,(C) |
|||
is not accepted, but the equivalent code is produced from IN (HL),C |
|||
|
|||
The pseudo-ops DEFB, DEFW and DEFM are included. DEFM works like EQUS in |
|||
the 6502 version. |
|||
|
|||
|
|||
5. OPERATING SYSTEM INTERFACE |
|||
|
|||
The following resident Operating System ("star") commands are |
|||
implemented. They may be accessed directly (e.g. *BYE) or via the OSCLI |
|||
statement (OSCLI "BYE"). |
|||
|
|||
Control characters, lower-case characters, DEL and quotation marks may be |
|||
incorporated in filenames by using the 'escape' character '|'. However, |
|||
there is no equivalent to the BBC Microcomputer's '|!' to set bit 7. |
|||
|
|||
*BYE |
|||
Returns control to the operating system (CP/M). |
|||
|
|||
*CPM |
|||
Same as *BYE. |
|||
|
|||
*. [filespec] |
|||
*DIR [filespec] |
|||
List the files which match the (optional) ambiguous filespec. If the |
|||
filespec is omitted, all .BBC files are listed: |
|||
*DIR List all .BBC files on the disk |
|||
*DIR B:*.* List all files on disk B: |
|||
*.*.* List all files on the current disk |
|||
|
|||
*DRIVE d: |
|||
Select drive d as the default drive for subsequent disk operations. |
|||
|
|||
*ERA filespec |
|||
Erase (delete) the specified disk file or files. The extension defaults |
|||
to .BBC if omitted. |
|||
|
|||
*ESC [ON|OFF] |
|||
*ESC OFF disables the abort action of the ESCape key; after *ESC OFF the |
|||
ESCape key simply returns the ASCII code ESC (27). *ESC ON, or *ESC, |
|||
restores the normal action of the ESCape key. |
|||
|
|||
*EXEC filespec |
|||
Accept console input from the specified file instead of from the |
|||
keyboard. If the extension is omitted, .BBC is assumed. |
|||
|
|||
*LOAD filespec aaaa |
|||
Loads the specified file into memory at address aaaa. The load address |
|||
must be specified. If the extension is omitted, .BBC is assumed. |
|||
|
|||
*OPT [n] |
|||
Select the destination for console output characters. The value n is in |
|||
the range 0 to 2, as follows: |
|||
|
|||
0 Send characters to the console output |
|||
1 Send characters to the auxiliary output |
|||
2 Send characters to the printer (list) output |
|||
|
|||
*REN newfile=oldfile |
|||
*RENAME newfile=oldfile |
|||
Renames 'oldfile' as 'newfile'. If the extension is omitted, .BBC is |
|||
assumed. |
|||
|
|||
*RESET |
|||
Rest the disk system (CP/M function 13). This command does not close any |
|||
files nor does it perform any other housekeeping function. You should |
|||
use *RESET after you have changed a disk. |
|||
|
|||
*SAVE filespec aaaa bbbb |
|||
*SAVE filespec aaaa +llll |
|||
This command saves a specified range of memory to disk. The address range |
|||
is specified either as start (aaaa) and end+1 (bbbb) or as start (aaaa) |
|||
and length (llll). If the extension is omitted, .BBC is assumed. |
|||
|
|||
*SPOOL [filespec] |
|||
Copy all subsequent console output to the specified file. If the filename |
|||
is omitted, any current spool file is closed and spooling is terminated. |
|||
If the extension is omitted, .BBC is assumed. |
|||
|
|||
*TYPE filespec |
|||
Type the specified file to the screen. If the extension is omitted, .BBC |
|||
is assumed. |
|||
|
|||
*| comment |
|||
This is a comment line. Anything following the | is ignored. |
|||
|
|||
|
|||
6. ERROR MESSAGES AND CODES |
|||
|
|||
Untrappable: |
|||
|
|||
No room RENUMBER space |
|||
Silly LINE space |
|||
Sorry Bad program |
|||
|
|||
Trappable - BASIC: |
|||
|
|||
1 Out of range 24 Exp range |
|||
2 25 |
|||
3 26 No such variable |
|||
4 Mistake 27 Missing ) |
|||
5 Missing , 28 Bad HEX |
|||
6 Type mismatch 29 No such FN/PROC |
|||
7 No FN 30 Bad call |
|||
8 31 Arguments |
|||
9 Missing " 32 No FOR |
|||
10 Bad DIM 33 Can't match FOR |
|||
11 DIM space 34 FOR variable |
|||
12 Not LOCAL 35 |
|||
13 No PROC 36 No TO |
|||
14 Array 37 |
|||
15 Subscript 38 No GOSUB |
|||
16 Syntax error 39 ON syntax |
|||
17 Escape 40 ON range |
|||
18 Division by zero 41 No such line |
|||
19 String too long 42 Out of DATA |
|||
20 Too big 43 No REPEAT |
|||
21 -ve root 44 |
|||
22 Log range 45 Missing # |
|||
23 Accuracy lost |
|||
|
|||
Trappable - OS: |
|||
|
|||
190 Directory full 214 File not found |
|||
192 Too many open files 222 Channel |
|||
196 File exists 253 Bad string |
|||
198 Disk full 254 Bad command |
|||
200 Close error 255 CP/M error |
|||
204 Bad name |
|||
|
|||
|
|||
New features in BBC BASIC (Z80) version 5.00, May 2024: |
|||
|
|||
1. BASIC V statements |
|||
|
|||
1.1 WHILE...ENDWHILE |
|||
1.2 Multi-line IF...THEN...ELSE...ENDIF |
|||
1.3 CASE...WHEN...OTHERWISE...ENDCASE |
|||
1.4 LOCAL DATA / RESTORE DATA |
|||
1.5 ON ERROR LOCAL / RESTORE ERROR |
|||
1.6 DIM var LOCAL size |
|||
1.7 ERROR err, message$ |
|||
1.8 RESTORE +n |
|||
1.9 SWAP var1,var2 |
|||
1.10 BPUT #file,string$[;] |
|||
1.11 QUIT |
|||
|
|||
2. BASIC V functions |
|||
|
|||
2.1 DIM(array()[,sub]) |
|||
2.2 END (pointer to free space) |
|||
2.3 REPORT$ |
|||
2.4 Binary constants |
|||
2.5 LEFT$ & RIGHT$ with last parameter omitted |
|||
2.6 MOD(array) |
|||
2.7 SUM(array) |
|||
2.8 SUMLEN(array) |
|||
2.9 GET$#file |
|||
|
|||
3. BASIC V whole array operations |
|||
|
|||
3.1 Pass a whole array to a FN/PROC |
|||
3.2 Pass a whole array to CALL |
|||
3.3 Whole array assignment |
|||
3.4 Whole array arithmetic * |
|||
3.5 Array dot-product operator |
|||
3.6 Array initialisation lists |
|||
3.7 Array compound assignment (+= etc.) |
|||
3.8 Make a whole array LOCAL |
|||
3.9 DIM a LOCAL array (on the stack) + |
|||
|
|||
* String array expressions A$() = B$() + C$() are not currently supported. |
|||
+ LOCAL string arrays should be initialised to their maximum needed length |
|||
to eliminate the risk of a memory leak each time the PROC/FN is called: |
|||
LOCAL a$() : DIM a$(size%) : a$() = STRING$(max%, "a") : a$() = "" |
|||
|
|||
4. Miscellaneous BASIC V features |
|||
|
|||
4.1 Bit-shifts <<, >>, >>> |
|||
4.2 Floating-point indirection (|) |
|||
4.3 RETURNed parameters from FN/PROC |
|||
4.4 Compound assignment (+=, -=, *=, /= etc.) |
|||
4.5 Assigning to a sub-string: LEFT$()=, MID$()= , RIGHT$()= |
|||
4.6 Hooks for CIRCLE,ELLIPSE,FILL,LINE,MOUSE,ORIGIN,RECTANGLE,TINT,SYS,WAIT |
|||
4.7 Hooks for WIDTH function, TINT function, MODE function |
|||
|
|||
5. Extensions to Acorn's BASIC V, compatible with BB4W, BBCSDL and BBCTTY |
|||
|
|||
5.1 EXIT REPEAT / WHILE / FOR [var] |
|||
5.2 Address-of operator ^ |
|||
5.3 Byte variables and arrays (& suffix) |
|||
5.4 'BY len' and 'TO term' qualifiers to GET$#file |
|||
5.5 ELSE IF <condition> THEN; (trailing semicolon) |
|||
5.6 == synonymous with = in comparisons |
|||
5.7 DIM a global array inside a FN/PROC (use RETURN) |
|||
|
|||
Note: The token for PUT has changed from &CE in version 3 to &0E in version 5. |
|||
If this token is present in existing programs it will list as ENDWHILE rather |
|||
than PUT, and the programs will need to be modified to restore functionality. |
|||
File diff suppressed because it is too large
@ -0,0 +1,69 @@ |
|||
TITLE BBC BASIC (C) R.T.RUSSELL 1981-2024 |
|||
NAME ('DATA') |
|||
; |
|||
;RAM MODULE FOR BBC BASIC INTERPRETER |
|||
;FOR USE WITH VERSION 5.0 OF BBC BASIC |
|||
;(C) COPYRIGHT R.T.RUSSELL 1981-2024 |
|||
; |
|||
GLOBAL ACCS |
|||
GLOBAL BUFFER |
|||
GLOBAL ONERSP |
|||
GLOBAL LIBASE |
|||
GLOBAL PAGE |
|||
GLOBAL LOMEM |
|||
GLOBAL FREE |
|||
GLOBAL HIMEM |
|||
GLOBAL RANDOM |
|||
GLOBAL COUNT |
|||
GLOBAL WIDTH |
|||
GLOBAL ERL |
|||
GLOBAL ERR |
|||
GLOBAL ERRTRP |
|||
GLOBAL ERRTXT |
|||
GLOBAL TRACEN |
|||
GLOBAL AUTONO |
|||
GLOBAL INCREM |
|||
GLOBAL LISTON |
|||
GLOBAL DATPTR |
|||
GLOBAL FNPTR |
|||
GLOBAL PROPTR |
|||
GLOBAL STAVAR |
|||
GLOBAL OC |
|||
GLOBAL PC |
|||
GLOBAL DYNVAR |
|||
GLOBAL CURLIN |
|||
GLOBAL USER |
|||
; |
|||
;n.b. ACCS, BUFFER & STAVAR must be on page boundaries. |
|||
; |
|||
ACCS: DEFS 256 ;STRING ACCUMULATOR |
|||
BUFFER: DEFS 256 ;STRING INPUT BUFFER |
|||
STAVAR: DEFS 27*4 ;STATIC VARIABLES |
|||
OC EQU STAVAR+15*4 ;CODE ORIGIN (O%) |
|||
PC EQU STAVAR+16*4 ;PROGRAM COUNTER (P%) |
|||
DYNVAR: DEFS 54*2 ;DYN. VARIABLE POINTERS |
|||
FNPTR: DEFS 2 ;DYN. FUNCTION POINTER |
|||
PROPTR: DEFS 2 ;DYN. PROCEDURE POINTER |
|||
; |
|||
PAGE: DEFS 2 ;START OF USER PROGRAM |
|||
LOMEM: DEFS 2 ;START OF DYN. STORAGE |
|||
FREE: DEFS 2 ;FIRST FREE-SPACE BYTE |
|||
HIMEM: DEFS 2 ;FIRST BYTE ABOVE STACK |
|||
LIBASE: DEFS 2 ;START OF FIRST LIBRARY |
|||
; |
|||
TRACEN: DEFS 2 ;TRACE FLAG AND NUMBER |
|||
AUTONO: DEFS 2 ;AUTO FLAG AND NUMBER |
|||
ERRTRP: DEFS 2 ;ON ERROR STMT POINTER \ |
|||
ONERSP: DEFS 2 ;ON ERROR LOCAL STKPTR / |
|||
ERRTXT: DEFS 2 ;ERROR MESSAGE POINTER |
|||
DATPTR: DEFS 2 ;DATA POINTER |
|||
ERL: DEFS 2 ;LINE NO OF LAST ERROR |
|||
CURLIN: DEFS 2 ;POINTER TO CURRENT LINE |
|||
RANDOM: DEFS 5 ;RANDOM NUMBER |
|||
COUNT: DEFS 1 ;PRINT POSITION |
|||
WIDTH: DEFS 1 ;PRINT WIDTH |
|||
ERR: DEFS 1 ;ERROR NUMBER |
|||
LISTON: DEFS 1 ;LISTO & OPT FLAG |
|||
INCREM: DEFS 1 ;AUTO INCREMENT |
|||
; |
|||
USER: END |
|||
@ -0,0 +1,241 @@ |
|||
TITLE BBCDIST.Z80 (C) R.T.RUSSELL 1982-2024 |
|||
NAME ('DIST3') |
|||
; |
|||
;BBC BASIC (Z80) - CP/M VERSION 2.20 & 3.00 |
|||
;(C) COPYRIGHT R.T.RUSSELL, 1982-2024. |
|||
;ALL RIGHTS RESERVED. |
|||
; |
|||
;THIS PROGRAM ALLOWS THE USER TO ADAPT BBC BASIC TO THE |
|||
;PARTICULAR CHARACTERISTICS OF HIS SYSTEM HARDWARE ETC. |
|||
; |
|||
;THE PROGRAM RESIDES AT 100H FOR EASE OF LOADING. |
|||
;*** IT MUST NOT EXCEED 256 BYTES IN TOTAL LENGTH *** |
|||
; |
|||
;PLEASE NOTE THAT A Z80 PROCESSOR AND CP/M VERSION 2.2 |
|||
;OR LATER ARE REQUIRED. |
|||
; |
|||
;R.T.RUSSELL, 11-03-1984, 03-05-1989, 12-05-2024 |
|||
; |
|||
CPM EQU 5 |
|||
COLD EQU 200H |
|||
; |
|||
CR EQU 0DH |
|||
LF EQU 0AH |
|||
ESC EQU 1BH |
|||
; |
|||
GLOBAL CLRSCN |
|||
GLOBAL PUTCSR |
|||
GLOBAL GETCSR |
|||
GLOBAL PUTIME |
|||
GLOBAL GETIME |
|||
GLOBAL GETKEY |
|||
GLOBAL BYE |
|||
GLOBAL BEGIN |
|||
; GLOBAL BDOS |
|||
; |
|||
; EXTRN PRTDEC16 |
|||
; |
|||
;ASEG |
|||
;ORG 100H |
|||
; |
|||
;JUMP TABLE - BASIC makes calls to hardware-dependent |
|||
;features via this table: |
|||
; |
|||
BEGIN: JP INIT |
|||
CLRSCN: JP CLS ;CLEAR SCREEN |
|||
PUTCSR: JP PCSR ;SET CURSOR POSN. |
|||
GETCSR: JP GCSR ;READ CURSOR POSN. |
|||
PUTIME: JP PTIME ;SET ELAPSED TIME |
|||
GETIME: JP GTIME ;READ ELAPSED TIME |
|||
GETKEY: JP INKEY ;READ KEY (TIME LIMIT) |
|||
BYE: JP REBOOT ;RETURN TO CP/M |
|||
; |
|||
;BDOS - Save the IX and IY registers and before performing a |
|||
; CP/M function call. |
|||
; |
|||
BDOS: PUSH IX |
|||
PUSH IY |
|||
CALL CPM |
|||
POP IY |
|||
POP IX |
|||
RET |
|||
; |
|||
;INIT - Perform hardware initialisation (if any). |
|||
; |
|||
INIT: LD HL,40H ;CPM/HBIOS MARKER LOC |
|||
LD A,'W' |
|||
CP (HL) |
|||
JR NZ,FAIL |
|||
INC HL |
|||
LD A,NOT 'W' |
|||
CP (HL) |
|||
JR NZ,FAIL |
|||
JP COLD |
|||
FAIL: LD DE,NOTHB |
|||
LD C,9 |
|||
CALL BDOS |
|||
RST 0 |
|||
; |
|||
NOTHB: DEFB 'CP/M w/ HBIOS required$' |
|||
; |
|||
;REBOOT - Switch off interrupts and return to CP/M |
|||
; |
|||
REBOOT: RST 0 |
|||
; |
|||
;GTIME - Read elapsed-time clock. |
|||
; Outputs: DEHL = elapsed time (centiseconds) |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
GTIME: JR TICKS |
|||
; |
|||
;PTIME - Load elapsed-time clock. |
|||
; Inputs: DEHL = time to load (centiseconds) |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
PTIME: |
|||
LD BC,0F9D0H |
|||
SRL D |
|||
RR E |
|||
RR H |
|||
RR L |
|||
RST 08 |
|||
RET |
|||
; |
|||
; Get OS elapsed-time clock |
|||
; Outputs: DEHL = time (centiseconds) |
|||
; Destroys: A,B,C,D,E,H,L,F |
|||
; |
|||
TICKS: LD BC,0F8D0H |
|||
RST 08 |
|||
SLA L |
|||
RL H |
|||
RL E |
|||
RL D |
|||
RET |
|||
; |
|||
;INKEY - Sample keyboard with specified wait. |
|||
; Inputs: HL = Time to wait (centiseconds) |
|||
; Outputs: Carry reset indicates time-out. |
|||
; If carry set, A = character typed. |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
INKEY: PUSH BC |
|||
PUSH HL |
|||
CALL TICKS |
|||
POP DE |
|||
ADD HL,DE |
|||
WAIT: PUSH HL |
|||
LD C,6 |
|||
LD E,0FFH |
|||
CALL BDOS |
|||
POP HL |
|||
OR A |
|||
SCF |
|||
JR NZ,INKEY1 |
|||
PUSH HL |
|||
CALL TICKS |
|||
POP DE |
|||
SBC HL,DE |
|||
EX DE,HL |
|||
JR C,WAIT |
|||
INKEY1: POP BC |
|||
RET |
|||
; |
|||
;CLS - Clear screen. |
|||
; (Customise to suit your VDU) |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
CLS: |
|||
LD DE,CLSSTR |
|||
LD C,9 |
|||
JP BDOS |
|||
; |
|||
CLSSTR: DEFB ESC,'[H',ESC,'[2J$' |
|||
; |
|||
;PCSR - Move cursor to specified position. |
|||
; Inputs: DE = horizontal position (LHS=0) |
|||
; HL = vertical position (TOP=0) |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
PCSR: LD B,L ; vertical = line (row) |
|||
CALL CONV ; normalized and convert to decimal |
|||
LD (LIN),HL ; and store into string |
|||
LD B,E ; horizontal = column |
|||
CALL CONV ; normalized and convert to decimal |
|||
LD (COL),HL ; and store into string |
|||
LD C,9 ; output string command |
|||
LD DE,CURS ; start of string |
|||
JP BDOS ; output string to terminal |
|||
; |
|||
; VT100 sequence for cursor positioning |
|||
CURS: DEFB 27, '[' |
|||
LIN: DEFW 0 ; high byte, low byte for decimal line |
|||
DEFB ';' |
|||
COL: DEFW 0 ; high byte, low byte for decimal column |
|||
DEFB 'H$' |
|||
; |
|||
; convert binary B (0 <= B < 99, not checked) into B+1 in decimal. |
|||
; L = upper byte, H = lower byte. ready for LD (...), HL |
|||
; destroys A, B, L, H |
|||
; optimized for space over time |
|||
; |
|||
CONV: INC B ; normalize, home in VT100 is (1,1) |
|||
LD A,'0' ; A is counter for low byte of result |
|||
LD L,A ; L is counter for high byte of result |
|||
CONVLP: INC A ; now B times increment AL in decimal |
|||
CP '9'+1 ; low byte overflow? |
|||
JR NZ,CONT ; no, continue incrementing |
|||
LD A,'0' ; reset low byte |
|||
INC L ; and increment high byte |
|||
CONT: DJNZ CONVLP ; B times |
|||
LD H,A ; put low byte into right place |
|||
RET |
|||
; |
|||
;GCSR - Return cursor coordinates. |
|||
; Outputs: DE = X coordinate (POS) |
|||
; HL = Y coordinate (VPOS) |
|||
; Destroys: A,D,E,H,L,F |
|||
; |
|||
GCSR: LD DE,0 |
|||
LD HL,0 |
|||
RET |
|||
; |
|||
;COUT - Output a character to the console |
|||
; Inputs: A = character |
|||
; Destroys: A,F |
|||
; |
|||
COUT: PUSH BC |
|||
PUSH DE |
|||
PUSH HL |
|||
LD E,A |
|||
LD C,2 |
|||
CALL BDOS |
|||
POP HL |
|||
POP DE |
|||
POP BC |
|||
RET |
|||
; |
|||
;IF $ GT 1F0H |
|||
IF $-BEGIN GT 0F0H |
|||
ERROR 'INSUFFICIENT SPACE' |
|||
ENDIF |
|||
; |
|||
;ORG 1F0H |
|||
DEFS 0F0H - ($ - BEGIN) |
|||
; |
|||
OFFLO: DEFW 0 ;TIME OFFSET LO |
|||
OFFHI: DEFW 0 ;TIME OFFSET HI |
|||
DEFB 80 ;WIDTH |
|||
DEFB 'G' AND 1FH ;CURSOR UP |
|||
DEFB 'O' AND 1FH ;CURSOR DOWN |
|||
DEFB 'F' AND 1FH ;START OF LINE |
|||
DEFB 'N' AND 1FH ;END OF LINE |
|||
DEFB 'X' AND 1FH ;DELETE TO END OF LINE |
|||
DEFB 08H ;BACKSPACE & DELETE |
|||
DEFB 'U' AND 1FH ;DEL TO START OF LINE |
|||
DEFB 'J' AND 1FH ;CURSOR LEFT |
|||
DEFB 'L' AND 1FH ;CURSOR RIGHT |
|||
DEFB 'R' AND 1FH ;DELETE CHARACTER |
|||
DEFB 'Q' AND 1FH ;INS/OVR TOGGLE |
|||
; |
|||
FIN: END |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -0,0 +1,64 @@ |
|||
NAME ('HOOK') |
|||
; |
|||
GLOBAL CLG |
|||
GLOBAL COLOUR |
|||
GLOBAL DRAW |
|||
GLOBAL ENVEL |
|||
GLOBAL GCOL |
|||
GLOBAL MODE |
|||
GLOBAL MOVE |
|||
GLOBAL PLOT |
|||
GLOBAL SOUND |
|||
GLOBAL PUTIMS |
|||
GLOBAL CIRCLE |
|||
GLOBAL ELLIPSE |
|||
GLOBAL FILL |
|||
GLOBAL MOUSE |
|||
GLOBAL ORIGIN |
|||
GLOBAL RECTAN |
|||
GLOBAL LINE |
|||
GLOBAL TINT |
|||
GLOBAL WAIT |
|||
GLOBAL SYS |
|||
; |
|||
GLOBAL ADVAL |
|||
GLOBAL POINT |
|||
GLOBAL GETIMS |
|||
GLOBAL TINTFN |
|||
GLOBAL MODEFN |
|||
GLOBAL WIDFN |
|||
; |
|||
EXTRN EXTERR |
|||
; |
|||
CLG: |
|||
COLOUR: |
|||
DRAW: |
|||
ENVEL: |
|||
GCOL: |
|||
MODE: |
|||
MOVE: |
|||
PLOT: |
|||
SOUND: |
|||
ADVAL: |
|||
POINT: |
|||
GETIMS: |
|||
PUTIMS: |
|||
CIRCLE: |
|||
ELLIPSE: |
|||
FILL: |
|||
MOUSE: |
|||
ORIGIN: |
|||
RECTAN: |
|||
LINE: |
|||
TINT: |
|||
TINTFN: |
|||
MODEFN: |
|||
WIDFN: |
|||
WAIT: |
|||
SYS: |
|||
XOR A |
|||
CALL EXTERR |
|||
DEFM 'Sorry' |
|||
DEFB 0 |
|||
; |
|||
END |
|||
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,21 +1,32 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.bin del *.bin |
|||
if exist *.com del *.com |
|||
if exist *.lst del *.lst |
|||
if exist *.hex del *.hex |
|||
if exist *.prn del *.prn |
|||
call :clean syscopy || exit /b |
|||
call :clean assign || exit /b |
|||
call :clean format || exit /b |
|||
call :clean talk || exit /b |
|||
call :clean mode || exit /b |
|||
call :clean rtc || exit /b |
|||
call :clean timer || exit /b |
|||
call :clean sysgen || exit /b |
|||
call :clean XM || exit /b |
|||
call :clean FDU || exit /b |
|||
call :clean Tune || exit /b |
|||
call :clean FAT || exit /b |
|||
call :clean Test || exit /b |
|||
call :clean ZMP || exit /b |
|||
call :clean ZMD || exit /b |
|||
call :clean Dev || exit /b |
|||
call :clean VGM || exit /b |
|||
call :clean cpuspd || exit /b |
|||
call :clean reboot || exit /b |
|||
call :clean Survey || exit /b |
|||
call :clean HTalk || exit /b |
|||
call :clean BBCBASIC || exit /b |
|||
call :clean copysl || exit /b |
|||
|
|||
pushd XM && call Clean || exit /b 1 & popd |
|||
pushd FDU && call Clean || exit /b 1 & popd |
|||
pushd Tune && call Clean || exit /b 1 & popd |
|||
pushd FAT && call Clean || exit /b 1 & popd |
|||
pushd Test && call Clean || exit /b 1 & popd |
|||
pushd ZMP && call Clean || exit /b 1 & popd |
|||
pushd ZMD && call Clean || exit /b 1 & popd |
|||
pushd Dev && call Clean || exit /b 1 & popd |
|||
pushd VGM && call Clean || exit /b 1 & popd |
|||
pushd cpuspd && call Clean || exit /b 1 & popd |
|||
pushd Survey && call Clean || exit /b 1 & popd |
|||
pushd HTalk && call Clean || exit /b 1 & popd |
|||
goto :eof |
|||
|
|||
:clean |
|||
pushd %1 && call Clean || exit /b & popd |
|||
goto :eof |
|||
|
|||
@ -1,41 +1,31 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=../../../Tools |
|||
set APPBIN=..\..\Binary\Apps |
|||
|
|||
set TOOLS=..\..\..\Tools |
|||
set PATH=%TOOLS%\tasm32;%TOOLS%\zxcc;%PATH% |
|||
|
|||
set TASMTABS=%TOOLS%\tasm32 |
|||
|
|||
set CPMDIR80=%TOOLS%/cpm/ |
|||
|
|||
pushd DMAmon && call Build || exit /b & popd |
|||
pushd tstdskng && call Build || exit /b & popd |
|||
pushd inttest && call Build || exit /b & popd |
|||
pushd ppidetst && call Build || exit /b & popd |
|||
pushd ramtest && call Build || exit /b & popd |
|||
pushd I2C && call Build || exit /b & popd |
|||
pushd rzsz && call Build || exit /b & popd |
|||
pushd vdctest && call Build || exit /b & popd |
|||
pushd kbdtest && call Build || exit /b & popd |
|||
pushd ps2info && call Build || exit /b & popd |
|||
pushd 2piotst && call Build || exit /b & popd |
|||
pushd piomon && call Build || exit /b & popd |
|||
pushd banktest && call Build || exit /b & popd |
|||
pushd portscan && call Build || exit /b & popd |
|||
pushd sound && call Build || exit /b & popd |
|||
|
|||
goto :eof |
|||
call :build DMAmon || exit /b |
|||
call :build tstdskng || exit /b |
|||
call :build inttest || exit /b |
|||
call :build ppidetst || exit /b |
|||
call :build ramtest || exit /b |
|||
call :build I2C || exit /b |
|||
call :build rzsz || exit /b |
|||
call :build vdctest || exit /b |
|||
call :build kbdtest || exit /b |
|||
call :build ps2info || exit /b |
|||
call :build 2piotst || exit /b |
|||
call :build piomon || exit /b |
|||
call :build banktest || exit /b |
|||
call :build portscan || exit /b |
|||
call :build sound || exit /b |
|||
call :build testh8p || exit /b |
|||
|
|||
:asm |
|||
echo. |
|||
echo Building %1... |
|||
tasm -t80 -g3 -fFF %1.asm %1.com %1.lst || exit /b |
|||
goto :eof |
|||
|
|||
:asm180 |
|||
echo. |
|||
echo Building %1... |
|||
tasm -t180 -g3 -fFF %1.asm %1.com %1.lst || exit /b |
|||
:build |
|||
echo Building %1 |
|||
pushd %1 && call Build || exit /b & popd |
|||
goto :eof |
|||
|
|||
@ -1,6 +1,6 @@ |
|||
OBJECTS = |
|||
SUBDIRS = DMAmon I2C inttest ppidetst ramtest tstdskng rzsz vdctest kbdtest ps2info 2piotst piomon banktest portscan sound |
|||
DEST = ../../../Binary/Apps/Test |
|||
# OBJECTS =
|
|||
SUBDIRS = DMAmon I2C inttest ppidetst ramtest tstdskng rzsz vdctest kbdtest ps2info 2piotst piomon banktest portscan sound testh8p |
|||
# DEST = ../../../Binary/Apps/Test
|
|||
TOOLS =../../../Tools |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
@ -0,0 +1,44 @@ |
|||
INTTEST |
|||
======= |
|||
|
|||
RomWBW includes an API allowing applications to "hook" interrupts. |
|||
The `INTTEST` utility allows you to test this functionality. |
|||
|
|||
|
|||
** Syntax ** |
|||
|
|||
`INTTEST` |
|||
|
|||
|
|||
** Usage ** |
|||
|
|||
`INTTEST` is an interactive application. At startup, it will display |
|||
a list of the interrupt vector slots in your system along with the |
|||
current vector address for each of them. |
|||
|
|||
It then prompts you to enter the slot number (in hex) of a vector to |
|||
hook. After entering this, the application will watch the hooked |
|||
vector and countdown from 0xFF to 0x00 as interrupts are noted. |
|||
|
|||
When the counter reaches 0x00, the interrupt is unhooked and the |
|||
application terminates. The application can also be terminated by |
|||
pressing <esc>. |
|||
|
|||
|
|||
** Notes ** |
|||
|
|||
If your system is running without interrupts active, the application |
|||
will terminate immediately. |
|||
|
|||
All slots have vectors even if the corresponding interrupt is not |
|||
doing anything. In this case, the vector is pointing to the "bad |
|||
interrupt" handler. |
|||
|
|||
If you hook a vector that is not receiving any interrupts, the |
|||
down-counter will not do anything. |
|||
|
|||
|
|||
** Etymology* * |
|||
|
|||
The `INTTEST` command is an original product and the source code is |
|||
provided in the RomWBW distribution. |
|||
@ -0,0 +1,10 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
set TOOLS=../../../../Tools |
|||
set PATH=%TOOLS%\tasm32;%PATH% |
|||
set TASMTABS=%TOOLS%\tasm32 |
|||
|
|||
tasm -t80 -g3 -fFF testh8p.asm testh8p.com testh8p.lst || exit /b |
|||
|
|||
copy /Y testh8p.com ..\..\..\..\Binary\Apps\Test\ || exit /b |
|||
@ -0,0 +1,6 @@ |
|||
@echo off |
|||
setlocal |
|||
|
|||
if exist *.com del *.com |
|||
if exist *.lst del *.lst |
|||
if exist *.bin del *.bin |
|||
@ -0,0 +1,9 @@ |
|||
OBJECTS = testh8p.com |
|||
# DOCS = testh8p.doc
|
|||
DEST = ../../../../Binary/Apps/Test |
|||
DOCDEST = ../../../../Binary/Apps/Test |
|||
TOOLS =../../../../Tools |
|||
|
|||
USETASM=1 |
|||
|
|||
include $(TOOLS)/Makefile.inc |
|||
@ -0,0 +1,238 @@ |
|||
;=============================================================================== |
|||
; H8 Panel Test |
|||
;=============================================================================== |
|||
; |
|||
; AUTHOR: WAYNE WARTHEN (wwarthen@gmail.com) |
|||
;_______________________________________________________________________________ |
|||
; |
|||
; |
|||
; Trivial utility to test the register pair display functionality of the |
|||
; Heath H8 Front Panel. |
|||
; |
|||
; Program will display a set of known register values on the console, |
|||
; then go into an infinite loop. The H8 panel can then be checked to |
|||
; see if the correct values are displayed. |
|||
; |
|||
; There is no way to exit this program. You must reset your system. |
|||
; |
|||
;=============================================================================== |
|||
; Definitions |
|||
;=============================================================================== |
|||
; |
|||
stksiz .equ $40 ; Working stack size |
|||
; |
|||
restart .equ $0000 ; CP/M restart vector |
|||
bdos .equ $0005 ; BDOS invocation vector |
|||
; |
|||
regA .equ $11 |
|||
regBC .equ $2233 |
|||
regDE .equ $4455 |
|||
regHL .equ $6677 |
|||
; |
|||
;=============================================================================== |
|||
; Code Section |
|||
;=============================================================================== |
|||
; |
|||
; |
|||
.org $100 |
|||
; |
|||
; setup stack (save old value) |
|||
ld (stksav),sp ; save stack |
|||
ld sp,stack ; set new stack |
|||
; |
|||
ld de,str_prefix |
|||
call prtstr |
|||
; |
|||
ld de,str_A |
|||
ld hl,regA |
|||
call prtreg |
|||
ld de,str_BC |
|||
ld hl,regBC |
|||
call prtreg |
|||
ld de,str_DE |
|||
ld hl,regDE |
|||
call prtreg |
|||
ld de,str_HL |
|||
ld hl,regHL |
|||
call prtreg |
|||
ld de,str_SP |
|||
ld hl,regSP |
|||
call prtreg |
|||
ld de,str_PC |
|||
ld hl,regPC |
|||
call prtreg |
|||
; |
|||
ld a,regA |
|||
ld bc,regBC |
|||
ld de,regDE |
|||
ld hl,regHL |
|||
regPC: jr $ |
|||
; |
|||
; |
|||
; |
|||
prtreg: |
|||
call prtstr ; print label |
|||
ld a,h ; first byte |
|||
call prtoctbyte ; print it |
|||
ld a,'.' ; separator |
|||
call prtchr ; print it |
|||
ld a,l ; second byte |
|||
call prtoctbyte ; print it |
|||
ret |
|||
; |
|||
; |
|||
; |
|||
prtoctbyte: |
|||
rlca ; 2 ms bits |
|||
rlca |
|||
push af |
|||
and %00000011 ; isolate |
|||
add a,'0' ; make char |
|||
call prtchr ; show it |
|||
pop af |
|||
rlca ; next 3 bits |
|||
rlca |
|||
rlca |
|||
push af |
|||
and %00000111 ; isolate |
|||
add a,'0' ; make char |
|||
call prtchr ; show it |
|||
pop af |
|||
rlca ; next 3 bits |
|||
rlca |
|||
rlca |
|||
push af |
|||
and %00000111 ; isolate |
|||
add a,'0' ; make char |
|||
call prtchr ; show it |
|||
pop af |
|||
ret |
|||
; |
|||
; Print character in A without destroying any registers |
|||
; |
|||
prtchr: |
|||
push bc ; save registers |
|||
push de |
|||
push hl |
|||
ld e,a ; character to print in E |
|||
ld c,$02 ; BDOS function to output a character |
|||
call bdos ; do it |
|||
pop hl ; restore registers |
|||
pop de |
|||
pop bc |
|||
ret |
|||
; |
|||
; Print a zero terminated string at (DE) without destroying any registers |
|||
; |
|||
prtstr: |
|||
push de |
|||
; |
|||
prtstr1: |
|||
ld a,(de) ; get next char |
|||
or a |
|||
jr z,prtstr2 |
|||
call prtchr |
|||
inc de |
|||
jr prtstr1 |
|||
; |
|||
prtstr2: |
|||
pop de ; restore registers |
|||
ret |
|||
; |
|||
; Start a new line |
|||
; |
|||
crlf2: |
|||
call crlf ; two of them |
|||
crlf: |
|||
push af ; preserve AF |
|||
ld a,13 ; <CR> |
|||
call prtchr ; print it |
|||
ld a,10 ; <LF> |
|||
call prtchr ; print it |
|||
pop af ; restore AF |
|||
ret |
|||
; |
|||
; Print the value in A in hex without destroying any registers |
|||
; |
|||
prthex: |
|||
push af ; save AF |
|||
push de ; save DE |
|||
call hexascii ; convert value in A to hex chars in DE |
|||
ld a,d ; get the high order hex char |
|||
call prtchr ; print it |
|||
ld a,e ; get the low order hex char |
|||
call prtchr ; print it |
|||
pop de ; restore DE |
|||
pop af ; restore AF |
|||
ret ; done |
|||
; |
|||
; print the hex word value in hl |
|||
; |
|||
prthexword: |
|||
push af |
|||
ld a,h |
|||
call prthex |
|||
ld a,l |
|||
call prthex |
|||
pop af |
|||
ret |
|||
; |
|||
; print the hex dword value in de:hl |
|||
; |
|||
prthex32: |
|||
push bc |
|||
push de |
|||
pop bc |
|||
call prthexword |
|||
push hl |
|||
pop bc |
|||
call prthexword |
|||
pop bc |
|||
ret |
|||
; |
|||
; Convert binary value in A to ascii hex characters in DE |
|||
; |
|||
hexascii: |
|||
ld d,a ; save A in D |
|||
call hexconv ; convert low nibble of A to hex |
|||
ld e,a ; save it in E |
|||
ld a,d ; get original value back |
|||
rlca ; rotate high order nibble to low bits |
|||
rlca |
|||
rlca |
|||
rlca |
|||
call hexconv ; convert nibble |
|||
ld d,a ; save it in D |
|||
ret ; done |
|||
; |
|||
; Convert low nibble of A to ascii hex |
|||
; |
|||
hexconv: |
|||
and $0F ; low nibble only |
|||
add a,$90 |
|||
daa |
|||
adc a,$40 |
|||
daa |
|||
ret |
|||
; |
|||
;=============================================================================== |
|||
; Storage Section |
|||
;=============================================================================== |
|||
; |
|||
rtcbuf .fill 6,$FF ; RTC data buffer |
|||
; |
|||
str_prefix .db "\r\n\r\nRegisters: ",0 |
|||
; |
|||
str_A .db "A=",0 |
|||
str_BC .db ", BC=",0 |
|||
str_DE .db ", DE=",0 |
|||
str_HL .db ", HL=",0 |
|||
str_SP .db ", SP=",0 |
|||
str_PC .db ", PC=",0 |
|||
; |
|||
stksav .dw 0 ; stack pointer saved at start |
|||
.fill stksiz,0 ; stack |
|||
stack .equ $ ; stack top |
|||
regSP: |
|||
; |
|||
.end |
|||
File diff suppressed because it is too large
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue