Compare commits

...

20 Commits

Author SHA1 Message Date
Wayne Warthen
b90e4d932a Update fd.asm
- Fix typo
2023-06-20 16:12:49 -07:00
Wayne Warthen
5457a7e7fd Improve OS Boot Drive Assignment
- Modified the Disk Device function call (DIODEVICE) to provide new attributes related to disk size and removability.
- Leveraged API change to allow handling drive assignment differently depending on ATAPI vs. ATA interface.
2023-06-20 15:52:34 -07:00
Wayne Warthen
8f5cc510ee Missing Files 2023-06-16 15:18:49 -07:00
Wayne Warthen
0475f5e853 Minor Cleanup
- Update FPLED port values for some configs
- Fix Linux/MacOS build for new disk images
2023-06-16 14:56:20 -07:00
Wayne Warthen
5b7dee0689 Merge pull request #348 from rprouse/issue/347
Adds programming and games disk images
2023-06-16 13:37:25 -07:00
Rob Prouse
6532f61747 Remove DELBR.COM 2023-06-16 10:51:20 -04:00
Rob Prouse
4bdae4eccb Remove USQ.COM 2023-06-16 10:47:55 -04:00
Rob Prouse
efb9840b86 Remove MBASIC85 2023-06-16 08:57:19 -04:00
Wayne Warthen
308a11cb32 Merge pull request #350 from wwarthen/master
Update pull_request_template.md
2023-06-15 12:51:55 -07:00
Wayne Warthen
3a7421de33 Update pull_request_template.md 2023-06-15 12:50:51 -07:00
Wayne Warthen
21a58397b6 Merge pull request #349 from wwarthen/master
Create pull_request_template.md
2023-06-15 12:16:59 -07:00
Wayne Warthen
9ae61806dc Create pull_request_template.md 2023-06-15 12:15:37 -07:00
Rob Prouse
87ac6f07f8 Fix spelling mistake, Tory -> Tony 2023-06-15 13:37:17 -04:00
Rob Prouse
1cd5313259 Remove all HLP files that I added 2023-06-15 13:28:44 -04:00
Rob Prouse
04c1ff04ac Remove CPM2.HLP 2023-06-15 13:19:55 -04:00
Rob Prouse
0e1a0afa2c Replace HI-TECH C with latest version from https://github.com/agn453/HI-TECH-Z80-C 2023-06-15 13:16:52 -04:00
Rob Prouse
5227bb68b5 Added documentation for the new disk images 2023-06-14 14:10:15 -04:00
Rob Prouse
fb68941768 Adds programming and games disk images 2023-06-14 12:45:41 -04:00
Wayne Warthen
8747ec8d02 Clean-up of ATAPI Support
- Improved media handling and error reporting.
2023-06-13 17:02:13 -07:00
Wayne Warthen
abd939625f Support ATAPI in IDE and PPIDE Drivers
- Support is limited to 512 byte sectors.  So, devices such as ATAPI Zip Drives will work.  CD-ROM devices will not because they use a larger sector size.
2023-06-12 15:56:36 -07:00
235 changed files with 83769 additions and 551 deletions

11
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,11 @@
<!--
BEFORE YOU CREATE A PULL REQUEST:
- Please base all pull requests against the dev branch
- Include a clear description of your change
- Reference related Issue(s) (e.g., "Resolves Issue #123")
Thank you for contributing to RomWBW! I will review your pull request as soon as possible.
DELETE EVERYTHING IN THIS COMMENT BLOCK AND REPLACE WITH YOUR COMMENTS
-->

Binary file not shown.

View File

@@ -10,6 +10,8 @@ Version 3.3
- WBW: Support for EMM Zip Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for PPA Zip Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for SyQuest SparQ Drive on PPI interface (much inspiration from Alan Cox)
- WBW: Support for ATAPI Disk Drives (not CD-ROMs) on IDE and PPIDE interfaces
- R?P: Added new disk images: Aztec C, MS BASIC Compiler, MS Fortran, Games, HiTech-C, Turbo Pascal, SLR Z80ASM
Version 3.2.1
-------------

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -6,8 +6,8 @@
*** ***
***********************************************************************
This directory ("Doc") is part of the RomWBW System Software
distribution archive. It contains documentation for components of
This directory ("Doc") is part of the RomWBW System Software
distribution archive. It contains documentation for components of
the system.
ChangeLog.txt
@@ -34,9 +34,9 @@ ROM Applications documents.
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
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.
@@ -59,7 +59,7 @@ Manual for the DDTZ v2.7 debug tool included on the ROM drive.
FDisk Manual ("FDisk Manual.pdf")
---------------------------------
The operational manual for John Coffman's hard disk partitioning
The operational manual for John Coffman's hard disk partitioning
program. This program is included in RomWBW as FDISK80.
@@ -78,9 +78,9 @@ NZCOM operating system operation manual.
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
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")
@@ -92,9 +92,9 @@ 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
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.
Microsoft Basic-80 Reference Manual v5.0 (Microsoft Basic-80 Reference Manual v5.0.pdf)
@@ -110,7 +110,6 @@ QP/M 2.7 Features and Facilities ("qcp27.pdf")
Official documentation set for QP/M 2.7 from original QP/M distribution.
SIO+CTC Baud Rate Options (SIO+CTC Baud Rate Options.pdf)
---------------------------------------------------------
@@ -133,4 +132,37 @@ UCSD p-System Users Manual ("UCSD p-System Users Manual.pdf")
Official user manual for p-System operating system included with
RomWBW.
--WBW 5:18 PM 3/16/2023
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.
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.
Borland TurboPascal User Manual (Turbo_Pascal_Version_3.0_Reference_Manual_1986.pdf)
------------------------------------------------------------------------------------
Official user manual Borland TurboPascal included in the pascal disk image.
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.
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.
--WBW 5:18 PM 6/14/2023

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because one or more lines are too long

Binary file not shown.

View File

@@ -3,7 +3,7 @@
**RomWBW ReadMe** \
Version 3.3 \
Wayne Warthen ([wwarthen@gmail.com](mailto:wwarthen@gmail.com)) \
06 Jun 2023
20 Jun 2023
# Overview
@@ -183,6 +183,10 @@ let me know if I missed you!
- The RomWBW Disk Catalog document was produced by Mykl Orders.
- Rob Prouse has created many of the supplemental disk images including
Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft BASIC Compiler,
Microsoft Fortran Compiler, and a Games compendium.
Contributions of all kinds to RomWBW are very welcome.
# Licensing

View File

@@ -1,6 +1,6 @@
RomWBW ReadMe
Wayne Warthen (wwarthen@gmail.com)
06 Jun 2023
20 Jun 2023
@@ -185,6 +185,10 @@ let me know if I missed you!
- The RomWBW Disk Catalog document was produced by Mykl Orders.
- Rob Prouse has created many of the supplemental disk images
including Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft
BASIC Compiler, Microsoft Fortran Compiler, and a Games compendium.
Contributions of all kinds to RomWBW are very welcome.

View File

@@ -30,11 +30,11 @@
; 2021-12-06 [WBW] Fix inverted ROM/RAM DPB mapping in buffer alloc
; 2022-02-28 [WBW] Use HBIOS to swap banks under CP/M 3
; Use CPM3 BDOS direct BIOS call to get DRVTBL adr
; 2023-06-19 [WBW] Update for revised DIODEVICE API
;_______________________________________________________________________________
;
; ToDo:
; 1) Do something to prevent assigning slices when device does not support them
; 2) ASSIGN C: causes drive map to be reinstalled unnecessarily
; 1) ASSIGN C: causes drive map to be reinstalled unnecessarily
;_______________________________________________________________________________
;
;===============================================================================
@@ -1405,12 +1405,11 @@ chkdev: ; HBIOS variant
; get device/unit info
ld b,$17 ; hbios func: diodevice
ld c,a ; unit to C
rst 08 ; call hbios, D := device, E := unit
ld a,d ; device to A
rst 08 ; call hbios, C := device attributes
;
; check slice support
cp $30 ; A has device/unit, in hard disk range?
jr c,chkdev1 ; if not hard disk, check slice val
bit 5,c ; high capacity device?
jr z,chkdev1 ; if not high cap, check slice val
xor a ; otherwise, signal OK
ret
;
@@ -1943,10 +1942,10 @@ stack .equ $ ; stack top
; Messages
;
indent .db " ",0
msgban1 .db "ASSIGN v1.5 for RomWBW CP/M ",0
msgban1 .db "ASSIGN v1.6 for RomWBW CP/M ",0
msg22 .db "2.2",0
msg3 .db "3",0
msbban2 .db ", 28-Feb-2022",0
msbban2 .db ", 16-Jun-2023",0
msghb .db " (HBIOS Mode)",0
msgub .db " (UBIOS Mode)",0
msgban3 .db "Copyright 2021, Wayne Warthen, GNU GPL v3",0

View File

@@ -2291,8 +2291,8 @@ INIT2:
LD C,(HL) ; PUT UNIT NUM IN C
RST 08 ; CALL HBIOS
LD A,C ; GET ATTRIBUTES
AND %00111000 ; ISOLATE TYPE BITS
CP %00101000 ; TYPE = RAM?
AND %10001111 ; ISOLATE TYPE BITS
CP %00000101 ; NOT FLOPPY, TYPE = RAM?
JR NZ,INIT2X ; IF NOT THEN DONE
;
; CHECK IF SECOND UNIT IS ROM OR FLASH
@@ -2303,10 +2303,10 @@ INIT2:
LD C,(HL) ; PUT UNIT NUM IN C
RST 08 ; CALL HBIOS
LD A,C ; GET ATTRIBUTES
AND %00111000 ; ISOLATE TYPE BITS
CP %00100000 ; TYPE = ROM?
AND %10001111 ; ISOLATE TYPE BITS
CP %00000100 ; NOT FLOPPY, TYPE = ROM?
JR Z,INIT2A ; IF SO, ADJUST DEF DRIVE
CP %00111000 ; TYPE = FLASH?
CP %00000111 ; NOT FLOPPY, TYPE = FLASH?
JR NZ,INIT2X ; IF NOT THEN DONE
;
INIT2A:
@@ -2904,61 +2904,51 @@ DRV_INIT:
LD HL,DRVLST ; INIT HL PTR TO DRIVE LIST
;
DRV_INIT2:
PUSH BC ; SAVE LOOP CNT & UNIT
CALL DRV_INIT3 ; CHECK DRIVE
POP BC ; RECOVER LOOP CNT & UNIT
INC C ; NEXT UNIT
DJNZ DRV_INIT2 ; LOOP
LD A,D ; TOTAL DEVICE COUNT TO D
LD A,D ; TOTAL DEVICE COUNT TO A
LD (DRVLSTC),A ; SAVE THE COUNT
JR DRV_INIT4 ; CONTINUE
;
DRV_INIT3:
; GET DEVICE ATTRIBUTES
PUSH DE ; SAVE DE (HARD DISK VOLUME COUNTER)
PUSH HL ; SAVE DRIVE LIST PTR
PUSH BC ; SAVE LOOP CONTROL
LD B,BF_DIODEVICE ; HBIOS FUNC: REPORT DEVICE INFO
RST 08 ; CALL HBIOS, UNIT TO C
LD A,D ; DEVICE TYPE TO A
LD A,C ; DEVICE ATTRIBUTES TO A
POP BC ; RESTORE LOOP CONTROL
POP HL ; RESTORE DRIVE LIST PTR
POP DE ; RESTORE DE
CP DIODEV_IDE ; HARD DISK DEVICE?
JR NC,DRV_INIT3A ; IF SO, HANDLE SPECIAL
LD (HL),C ; SAVE UNIT NUM IN LIST
INC HL ; BUMP PTR
INC D ; INC TOTAL DEVICE COUNT
RET
LD B,A ; ATTRIBUTES TO B
;
DRV_INIT3A:
; CHECK FOR HARD DISK REMOVABLE CARTRIDGE DRIVES
CP DIODEV_PPA ; PPA (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
CP DIODEV_IMM ; IMM (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
CP DIODEV_SYQ ; IMM (ZIP DRIVE) IS REMOVABLE
JR Z,DRV_INIT3B ; IF SO, SKIP MEDIA CHECK
; CHECK FOR ACTIVE AND RETURN IF NOT
; IF DEVICE IS NOT REMOVABLE, THEN CHECK TO ENSURE IT IS
; ACTUALLY ONLINE. IF NOT, SKIP UNIT ENTIRELY.
BIT 6,B ; REMOVABLE?
JR NZ,DRV_INIT3A ; IF SO, SKIP MEDIA CHECK
PUSH DE ; SAVE DE (HARD DISK VOLUME COUNTER)
PUSH HL ; SAVE DRIVE LIST PTR
PUSH BC ; SAVE LOOP CONTROL
LD B,BF_DIOMEDIA ; HBIOS FUNC: SENSE MEDIA
LD E,1 ; PERFORM MEDIA DISCOVERY
RST 08
RST 08 ; DO IT
POP BC ; RESTORE LOOP CONTROL
POP HL ; RESTORE DRIVE LIST PTR
POP DE ; RESTORE DE
RET NZ ; IF NO MEDIA, JUST RETURN
DRV_INIT3B:
; IF ACTIVE...
RET NZ ; OFFLINE, SKIP ENTIRE UNIT
;
DRV_INIT3A:
LD (HL),C ; SAVE UNIT NUM IN LIST
INC HL ; BUMP PTR
INC D ; INC TOTAL DEVICE COUNT
BIT 5,B ; HIGH CAPACITY?
RET Z ; DONE IF NOT
INC E ; INCREMENT HARD DISK COUNT
RET ; AND RETURN
RET ; DONE
;
DRV_INIT4: ; SET SLICES PER VOLUME (HDSPV) BASED ON HARD DISK VOLUME COUNT
LD A,E ; HARD DISK VOLUME COUNT TO A
@@ -2987,7 +2977,8 @@ DRV_INIT6: ; LOOP THRU ALL UNITS AVAILABLE
LD C,(HL) ; GET UNIT NUM FROM LIST
PUSH BC ; PRESERVE LOOP CONTROL
LD B,BF_DIODEVICE ; HBIOS FUNC: REPORT DEVICE INFO
RST 08 ; CALL HBIOS, D := DEVICE TYPE
RST 08 ; CALL HBIOS, C := DEVICE ATTRIBUTES
LD A,C ; DEVICE ATTRIBUTES TO A
POP BC ; GET UNIT INDEX BACK IN C
PUSH BC ; RESAVE LOOP CONTROL
CALL DRV_INIT7 ; MAKE DRIVE MAP ENTRY(S)
@@ -3001,10 +2992,9 @@ DRV_INIT6: ; LOOP THRU ALL UNITS AVAILABLE
DRV_INIT7: ; PROCESS UNIT
LD E,0 ; INITIALIZE SLICE INDEX
LD B,1 ; DEFAULT LOOP COUNTER
LD A,D ; DEVICE TYPE TO ACCUM
LD D,C ; UNIT NUMBER TO D
CP DIODEV_IDE ; HARD DISK DEVICE?
JR C,DRV_INIT8 ; NOPE, LEAVE LOOP COUNT AT 1
BIT 5,A ; HIGH CAPACITY DEVICE?
JR Z,DRV_INIT8 ; NOPE, LEAVE LOOP COUNT AT 1
LD A,(HDSPV) ; GET SLICES PER VOLUME TO ACCUM
LD B,A ; MOVE TO B FOR LOOP COUNTER
;
@@ -3415,7 +3405,7 @@ DIRBUF .DW 0 ; DIR BUF POINTER
HEAPTOP .DW BUFPOOL ; CURRENT TOP OF HEAP
BOOTVOL .DW 0 ; BOOT VOLUME, MSB=BOOT UNIT, LSB=BOOT SLICE
HDSPV .DB 2 ; SLICES PER VOLUME FOR HARD DISKS (MUST BE >= 1)
DRVLST .FILL 32 ; ACTIVE DRIVE LIST USED DURINT DRV_INIT
DRVLST .FILL 32 ; ACTIVE DRIVE LIST USED DURING DRV_INIT
DRVLSTC .DB 0 ; ENTRY COUNT FOR ACTIVE DRIVE LIST
;
#IFDEF PLTWBW

View File

@@ -156,7 +156,9 @@ dinit:
ld hl,drvlst ; init hl ptr to drive list
;
dinit2:
push bc ; save loop cnt & unit
call dinit3 ; check drive
pop bc ; recover loop cnt & unit
inc c ; next unit
djnz dinit2 ; loop
ld a,d ; total device count to d
@@ -169,48 +171,35 @@ dinit3:
push bc ; save loop control
ld b,17h ; hbios func: report device info
rst 08 ; call hbios, unit to c
ld a,d ; device type to a
ld a,c ; device attributes to a
pop bc ; restore loop control
pop hl ; restore drive list ptr
pop de ; restore de
cp 30h ; hard disk device?
jr nc,dinit3a ; if so, handle special
ld (hl),c ; save unit num in list
inc hl ; bump ptr
inc d ; inc total device count
ret
ld b,a ; attributes to b
;
dinit3a:
; check for hard disk removable cartridge drives
cp 0A0h ; ppa (zip drive) is removable
jr z,dinit3b ; if so, skip media check
cp 0B0h ; imm (zip drive) is removable
jr z,dinit3b ; if so, skip media check
cp 0C0h ; syq (syquest drive) is removable
jr z,dinit3b ; if so, skip media check
; check for active and return if not
; if device is not removable, then check to ensure it is
; actually online. if not, skip unit entirely.
bit 6,b ; removable?
jr nz,dinit3a ; if so, skip media check
push de ; save de (hard disk volume counter)
push hl ; save drive list ptr
push bc ; save loop control
ld b,18h ; hbios func: sense media
ld e,1 ; perform media discovery
rst 08
rst 08 ; do it
pop bc ; restore loop control
pop hl ; restore drive list ptr
pop de ; restore de
ret nz ; if no media, just return
dinit3b:
; if active...
ret nz ; offline, skip entire unit
;
dinit3a:
ld (hl),c ; save unit num in list
inc hl ; bump ptr
inc d ; inc total device count
bit 5,b ; high capacity?
ret z ; done if not
inc e ; increment hard disk count
ret ; and return
ret ; done
dinit4: ; set slices per volume (hdspv) based on hard disk volume count
ld a,e ; hard disk volume count to a
@@ -247,7 +236,8 @@ dinit6:
push bc ; preserve loop control
push hl ; preserve dph pointer
ld b,17h ; hbios func: report device info
rst 08 ; call hbios, d := device type
rst 08 ; call hbios, a := device attributes
ld a,c ; device attributes to a
pop hl ; restore dph pointer
pop bc ; get unit index back in c
push bc ; resave loop control
@@ -262,10 +252,9 @@ dinit6:
dinit7: ; process a unit (all slices)
ld e,0 ; initialize slice index
ld b,1 ; default loop counter
ld a,d ; device type to accum
ld d,c ; unit number to d
cp 030h ; hard disk device?
jr c,dinit8 ; nope, leave loop count at 1
bit 5,a ; high capacity device?
jr z,dinit8 ; nope, leave loop count at 1
ld a,(hdspv) ; get slices per volume to accum
ld b,a ; move to b for loop counter

View File

@@ -172,6 +172,11 @@ please let me know if I missed you!
* The RomWBW Disk Catalog document was produced by Mykl Orders.
* Rob Prouse has created many of the supplemental disk images
including Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft
BASIC Compiler, Microsoft Fortran Compiler, and a Games
compendium.
Contributions of all kinds to RomWBW are very welcome.
# Licensing

View File

@@ -757,28 +757,36 @@ of memory because it avoids a double copy.
Reports device information about the specified Disk Unit (C). The
Status (A) is a standard HBIOS result code.
Bit 7 of the Device Attribute (C) value returned indicates whether the
device is a floppy disk. If it is a floppy disk, the Device Attribute
(C) value is encoded as follows:
The Device Attribute (C) value returned indicates various
feature indicators related to the device being referenced
by the specified Disk Unit (C). The high 3 bits apply to
all devices. The definition of the low 5 bits depends on
whether the device is a Floppy (indicated by bit 5).
The common bits are:
| **Bits** | **Definition** |
|---------:|--------------------------------------------------|
| 7 | = 1 (Floppy Disk) |
| 6-5 | Form Factor: 0=8", 1=5.25", 2=3.5", 3=Other |
| 4 | Sides: 0=SS, 1=DS |
| 3-2 | Density: 0=SD, 1=DD, 2=HD, 3=ED |
| 1-0 | Reserved |
If the Disk Unit (C) specified is a not floppy disk, then the Device
Attribute (C) encoding is as follows:
| **Bits** | **Definition** |
|---------:|--------------------------------------------------|
| 7 | = 0 (not Floppy Disk) |
| 7 | Floppy |
| 6 | Removable |
| 5-3 | Type: 0=Hard, 1=CF, 2=SD, 3=USB, |
| | 4=ROM, 5=RAM, 6=RAMF, 7=FLASH |
| 2-0 | Reserved |
| 5 | High Capacity (>8 MB) |
The Floppy specific bits are:
| **Bits** | **Definition** |
|---------:|--------------------------------------------------|
| 4-3 | Form Factor: 0=8", 1=5.25", 2=3.5", 3=Other |
| 2 | Sides: 0=SS, 1=DS |
| 1-0 | Density: 0=SD, 1=DD, 2=HD, 3=ED |
The non-Floppy specific bits are:
| **Bits** | **Definition** |
|---------:|--------------------------------------------------|
| 4 | LBA Capable |
| 3-0 | Media Type: 0=Hard Disk, 1=CF, 2=SD, 3=USB, |
| | 4=ROM, 5=RAM, 6=RAMF, 7=FLASH, 8=CD-ROM, |
| | 9=Cartridge |
Device Type (D) indicates the specific hardware driver that handles the
specified Disk Unit (C). Values are listed at the start of this

View File

@@ -2213,18 +2213,23 @@ file which is bootable.
output will be garbled if no such terminal or emulator
is used for console output.
* There is no straightforward mechanism to move files in
* There is no built-in mechanism to move files in
and out of p-System. However, the .vol files in Source/pSys
can be read and modified by CiderPress. CiderPress is able
to add and remove individual files.
Andrew Davidson has created a Python script that can extract p-System
volumes from an existing disk image file. The script is also capable
of inserting a modified volume back into the disk image file.
This tool is available at
<https://github.com/robosnacks/psysimg>.
## FreeRTOS
Phillip Stevens has ported FreeRTOS to run under RomWBW. FreeRTOS is
not provided in the RomWBW distribution. FreeRTOS is available under
the
[MIT licence](https://www.freertos.org/a00114.html) and further general
information is available at
the [MIT licence](https://www.freertos.org/a00114.html)
and further general information is available at
[FreeRTOS](https://www.freertos.org/RTOS.html).
You can also contact Phillip for detailed information on the Z180
@@ -3152,6 +3157,46 @@ directed to complete a partial flash using the /P command line switch.
`E>FLASH WRITE ROM.UPD /P`
# Related Projects
Outside of the hardware platforms adapted to RomWBW, there are a variety
of software projects that either target RomWBW specifically or provide
a RomWBW-specific variation.
## Z88DK
Z88DK is a software powerful development kit for Z80 computers
supporting both C and assembly language. This kit now provides
specific library support for RomWBW HBIOS. The Z88DK project is
hosted at <https://github.com/z88dk/z88dk>.
## Paleo Editor
Steve Garcia has created a Windows-hosted IDE that is tailored to
development of RomWBW. The project can be found at
<https://github.com/alloidian/PaleoEditor>.
## p-System Volume Management Script
Andrew Davidson has created a Python script to automate the insertion
and deletion of volumes within the p-System disk image. These scripts
are hosted at <https://github.com/robosnacks/psysimg>.
## Z80 fig-FORTH
Dimitri Theulings' implementation of fig-FORTH for the Z80 has a
RomWBW-specific variant. This fig-FORTH is built into the RomWBW
ROM. However, the project itself is hosted at
<https://github.com/dimitrit/figforth>.
## RomWBW Date/Time Utility
Kevin Boone has created a generic application that will display or
set the date/time of an RTC on RomWBW. The application runs on all of
the CP/M OS variants. This tool (`WDATE`) is included on the RomWBW
OS disk images. The project is hosted at
<https://github.com/kevinboone/wdate-cpm>.
# Acknowledgments
I want to acknowledge that a great deal of the code and inspiration
@@ -3217,6 +3262,11 @@ please let me know if I missed you!
* The RomWBW Disk Catalog document was produced by Mykl Orders.
* Rob Prouse has created many of the supplemental disk images
including Aztec C, HiTech C, SLR Z80ASM, Turbo Pascal, Microsoft
BASIC Compiler, Microsoft Fortran Compiler, and a Games
compendium.
Contributions of all kinds to RomWBW are very welcome.
# Licensing

View File

@@ -34,8 +34,10 @@ Z180_CLKDIV .SET 1 ; Z180: CHK DIV: 0=OSC/2, 1=OSC, 2=OSC*2
Z180_MEMWAIT .SET 0 ; Z180: MEMORY WAIT STATES (0-3)
Z180_IOWAIT .SET 1 ; Z180: I/O WAIT STATES TO ADD ABOVE 1 W/S BUILT-IN (0-3)
;
FPLED_ENABLE .SET FALSE ; FP: ENABLES FRONT PANEL LEDS
FPSW_ENABLE .SET FALSE ; FP: ENABLES FRONT PANEL SWITCHES
FPLED_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .SET $A0 ; FP: PORT ADDRESS FOR FP LEDS
FPSW_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .SET $A0 ; FP: PORT ADDRESS FOR FP SWITCHES
;
LEDENABLE .SET TRUE ; ENABLE STATUS LED (SINGLE LED)
;

View File

@@ -35,7 +35,9 @@ Z180_MEMWAIT .SET 0 ; Z180: MEMORY WAIT STATES (0-3)
Z180_IOWAIT .SET 1 ; Z180: I/O WAIT STATES TO ADD ABOVE 1 W/S BUILT-IN (0-3)
;
FPLED_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .SET $A0 ; FP: PORT ADDRESS FOR FP LEDS
FPSW_ENABLE .SET TRUE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .SET $A0 ; FP: PORT ADDRESS FOR FP SWITCHES
;
LEDENABLE .SET TRUE ; ENABLE STATUS LED (SINGLE LED)
;

View File

@@ -260,7 +260,7 @@ LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT0BASE .EQU $0C ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)

View File

@@ -264,7 +264,7 @@ LPTENABLE .EQU FALSE ; LPT: ENABLE CENTRONICS PRINTER DRIVER (LPT.ASM)
LPTMODE .EQU LPTMODE_MG014 ; LPT: DRIVER MODE: LPTMODE_[NONE|SPP|MG014]
LPTCNT .EQU 1 ; LPT: NUMBER OF CHIPS TO DETECT (1-2)
LPTTRACE .EQU 1 ; LPT: TRACE LEVEL (0=NO,1=ERRORS,2=ALL)
LPT0BASE .EQU $18 ; LPT 0: REGISTERS BASE ADR
LPT0BASE .EQU $0C ; LPT 0: REGISTERS BASE ADR
LPT1BASE .EQU $00 ; LPT 1: REGISTERS BASE ADR
;
PPAENABLE .EQU FALSE ; PPA: ENABLE PPA DISK DRIVER (PPA.ASM)

View File

@@ -67,7 +67,7 @@ SKZENABLE .EQU FALSE ; ENABLE SERGEY'S Z80-512K FEATURES
WDOGMODE .EQU WDOG_NONE ; WATCHDOG MODE: WDOG_[NONE|EZZ80|SKZ]
;
FPLED_ENABLE .EQU TRUE ; FP: ENABLES FRONT PANEL LEDS
FPLED_IO .EQU $0D ; FP: PORT ADDRESS FOR FP LEDS
FPLED_IO .EQU $00 ; FP: PORT ADDRESS FOR FP LEDS
FPLED_DSKACT .EQU TRUE ; FP: ENABLES DISK I/O ACTIVITY ON FP LEDS
FPSW_ENABLE .EQU FALSE ; FP: ENABLES FRONT PANEL SWITCHES
FPSW_IO .EQU $00 ; FP: PORT ADDRESS FOR FP SWITCHES

View File

@@ -231,12 +231,12 @@ FDMM_8 .DB FDM111, $FF
; FDT_ VALUES DEFINED IN STD.ASM
;
FD_DEVATTR:
.DB %11100000 ; DRIVE TYPE NONE
.DB %11010100 ; DRIVE TYPE 3.5 DD
.DB %11011000 ; DRIVE TYPE 3.5 HD
.DB %10110100 ; DRIVE TYPE 5.25 DD
.DB %10111000 ; DRIVE TYPE 5.25 HD
.DB %10010100 ; DRIVE TYPE 8
.DB %11000000 ; DRIVE TYPE NONE
.DB %11010101 ; DRIVE TYPE 3.5 DD
.DB %11010110 ; DRIVE TYPE 3.5 HD
.DB %11001101 ; DRIVE TYPE 5.25 DD
.DB %11001110 ; DRIVE TYPE 5.25 HD
.DB %11000101 ; DRIVE TYPE 8
;
; FDC COMMANDS
;

View File

@@ -6744,7 +6744,7 @@ PS_DISK:
;
; DEVICE COLUMN
LD B,BF_DIODEVICE ; FUNC=GET DEVICE INFO, UNIT NUM STILL IN C
RST 08 ; DE:=DEVTYP/NUM, H:=DISK ATTRIBUTES
RST 08 ; DE:=DEVTYP/NUM, C:=DISK ATTRIBUTES
PUSH BC ; SAVE ATTRIBUTES
LD HL,PS_DDMD ; POINT TO DISK DEVICE TYPE NAME TABLE
CALL PS_PRTDEV ; PRINT DISK DEVICE NMEMONIC PADDED TO FIELD WIDTH
@@ -6768,7 +6768,7 @@ PS_PRTDT:
LD C,E
LD DE,PS_DTHARD
LD A,00111000B
LD A,00001111B
CALL PRTIDXMSK
CALL PS_PAD18 ; PAD TO 18 SPACES
RET
@@ -6780,10 +6780,7 @@ PS_PRTDC:
LD A,E ; ATTRIBUTE TO ACCUM
BIT 7,A ; TEST FOR FLOPPY
JR NZ,PS_PRTDC2 ; HANDLE FLOPPY
RRCA ; ISOLATE TYPE BITS
RRCA
RRCA
AND $07
AND $0F ; ISOLATE TYPE BITS
CP 4 ; ROM DISK?
JR Z,PS_PRTDC1 ; PRINT CAPACITY IN KB
CP 5 ; RAM DISK?
@@ -6821,15 +6818,15 @@ PS_PRTDC1:
PS_PRTDC2:
LD C,E ; ATTRIBUTE TO C FOR SAFE KEEPING
;
LD A,01100000B ; DISPLAY FORM FACTOR
LD A,%00011000 ; DISPLAY FORM FACTOR
LD DE,PS_FLP_FSTR ; WHICH IS DEFINED IN
CALL PRTIDXMSK ; BITS 5 AND 6.
;
LD A,00010000B ; DISPLAY SIDES
LD A,%00000100 ; DISPLAY SIDES
LD DE,PS_FLP_SSTR ; WHICH IS DEFINED
CALL PRTIDXMSK ; IN BIT 4
;
LD A,00001100B ; DISPLAY DENSITY
LD A,%00000011 ; DISPLAY DENSITY
LD DE,PS_FLP_DSTR ; WHICH IS DEFINED IN
CALL PRTIDXMSK ; BITS 2 AND 3.
;
@@ -7183,6 +7180,8 @@ PS_DTROM .TEXT "ROM Disk$"
PS_DTRAM .TEXT "RAM Disk$"
PS_DTRF .TEXT "RAM Floppy$"
PS_DTFSH .TEXT "Flash Drive$"
PS_DTCD .TEXT "CD-ROM$"
PS_DTCRT .TEXT "Cartridge$"
PS_DTOTHER .TEXT "???$"
;
; FLOPPY ATTRIBUTE STRINGS

View File

@@ -166,7 +166,7 @@ HDSK_GEOM:
HDSK_DEVICE:
LD D,DIODEV_HDSK ; D := DEVICE TYPE
LD E,(IY+HDSK_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%00000000 ; C := ATTRIBUTES, NON-REMOVABLE HARD DISK
LD C,%00110000 ; C := ATTRIBUTES, NON-REMOVABLE HARD DISK
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,HDSK_IO ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

File diff suppressed because it is too large Load Diff

View File

@@ -405,7 +405,7 @@ IMM_RESET:
IMM_DEVICE:
LD D,DIODEV_IMM ; D := DEVICE TYPE
LD E,(IY+IMM_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01000000 ; C := REMOVABLE HARD DISK
LD C,%01111001 ; C := REMOVABLE HARD DISK
LD H,(IY+IMM_MODE) ; H := MODE
LD L,(IY+IMM_IOBASE) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -21,9 +21,9 @@ MD_LBA .EQU 2 ; OFFSET OF LBA (DWORD)
MD_MID .EQU 6 ; OFFSET OF MEDIA ID (BYTE)
MD_ATTRIB .EQU 7 ; OFFSET OF ATTRIBUTE (BYTE)
;
MD_AROM .EQU %00100000 ; ROM ATTRIBUTE
MD_ARAM .EQU %00101000 ; RAM ATTRIBUTE
MD_AFSH .EQU %00111000 ; FLASH ATTRIBUTE
MD_AROM .EQU %00010100 ; ROM ATTRIBUTE
MD_ARAM .EQU %00010101 ; RAM ATTRIBUTE
MD_AFSH .EQU %00010111 ; FLASH ATTRIBUTE
;
MD_FDBG .EQU 0 ; FLASH DEBUG CODE
MD_FVBS .EQU 1 ; FLASH VERBOSE OUTPUT

View File

@@ -402,7 +402,7 @@ PPA_RESET:
PPA_DEVICE:
LD D,DIODEV_PPA ; D := DEVICE TYPE
LD E,(IY+PPA_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01000000 ; C := REMOVABLE HARD DISK
LD C,%01111001 ; C := REMOVABLE HARD DISK
LD H,(IY+PPA_MODE) ; H := MODE
LD L,(IY+PPA_IOBASE) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -5,6 +5,7 @@
;
; TODO:
; - GOPARTNER NEEDS TO HANDLE "NO PARTNER" CONDITION
; - DATA TRANSFERS LIMITED TO 512 BYTES WHICH IS INSUFFICIENT FOR CD=ROM MEDIA
;
; NOTES:
; - WELL KNOWN PPIDE PORT ADDRESSES:
@@ -135,6 +136,8 @@ PPIDE_REG_LBA0 .EQU PPIDE_CTL_CS1 | $03 ; LBA BYTE 0 (BITS 0-7) (R/W)
PPIDE_REG_LBA1 .EQU PPIDE_CTL_CS1 | $04 ; LBA BYTE 1 (BITS 8-15) (R/W)
PPIDE_REG_LBA2 .EQU PPIDE_CTL_CS1 | $05 ; LBA BYTE 2 (BITS 16-23) (R/W)
PPIDE_REG_LBA3 .EQU PPIDE_CTL_CS1 | $06 ; LBA BYTE 3 (BITS 24-27) (R/W)
PPIDE_REG_BCL .EQU PPIDE_CTL_CS1 | $04 ; PKT BYTE COUNT LOW (BITS 0-7) (R/W)
PPIDE_REG_BCH .EQU PPIDE_CTL_CS1 | $05 ; PKT BYTE COUNT HIGH (BITS 8-15) (R/W)
PPIDE_REG_STAT .EQU PPIDE_CTL_CS1 | $07 ; STATUS REGISTER (R)
PPIDE_REG_CMD .EQU PPIDE_CTL_CS1 | $07 ; COMMAND REGISTER (EXECUTE) (W)
PPIDE_REG_ALTSTAT .EQU PPIDE_CTL_CS3 | $06 ; ALTERNATE STATUS REGISTER (R)
@@ -143,13 +146,14 @@ PPIDE_REG_DRVADR .EQU PPIDE_CTL_CS3 | $07 ; DRIVE ADDRESS REGISTER (R)
;
; COMMAND BYTES
;
PPIDE_CIDE_NOP .EQU $00
PPIDE_CIDE_DEVRES .EQU $08
PPIDE_CMD_NOP .EQU $00
PPIDE_CMD_DEVRES .EQU $08
PPIDE_CMD_RECAL .EQU $10
PPIDE_CMD_READ .EQU $20
PPIDE_CMD_WRITE .EQU $30
PPIDE_CIDE_DEVDIAG .EQU $90
PPIDE_CIDE_IDPKTDEV .EQU $A1
PPIDE_CMD_DEVDIAG .EQU $90
PPIDE_CMD_PACKET .EQU $A0
PPIDE_CMD_IDPKTDEV .EQU $A1
PPIDE_CMD_IDDEV .EQU $EC
PPIDE_CMD_SETFEAT .EQU $EF
;
@@ -175,6 +179,7 @@ PPIDE_STRDYTO .EQU -5
PPIDE_STDRQTO .EQU -6
PPIDE_STBSYTO .EQU -7
PPIDE_STNOTSUP .EQU -8
PPIDE_STNOTRDY .EQU -9
;
; DRIVE SELECTION BYTES (FOR USE IN DRIVE/HEAD REGISTER)
;
@@ -407,10 +412,6 @@ PPIDE_INIT5:
JP NZ,PPIDE_PRTSTATSTR ; EXIT VIA PRINT STATUS STRING
;
PPIDE_INIT6:
LD A,(IY+PPIDE_TYPE) ; GET DEVICE TYPE
CP PPIDE_TYPEATA ; ATA?
RET NZ ; IF NOT, THEN DONE
;
LD DE,PPIDE_STR_8BIT
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
CALL NZ,WRITESTR
@@ -526,12 +527,12 @@ PPIDE_IO:
PUSH HL ; ... TO FILTER ALL EXITS
#ENDIF
PUSH BC ; SAVE COUNTERS
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
CALL PPIDE_CHKERR ; CHECK FOR ERR STATUS AND RESET IF SO
POP BC ; RESTORE COUNTERS
JR NZ,PPIDE_IO3 ; BAIL OUT ON ERROR
PPIDE_IO1:
PUSH BC ; SAVE COUNTERS
CALL PPIDE_SELUNIT ; HARDWARE SELECTION OF TARGET UNIT
LD HL,(PPIDE_IOFNADR) ; GET PENDING IO FUNCTION ADDRESS
CALL JPHL ; ... AND CALL IT
JR NZ,PPIDE_IO2 ; IF ERROR, SKIP INCREMENT
@@ -571,10 +572,14 @@ PPIDE_STATUS:
PPIDE_DEVICE:
LD D,DIODEV_PPIDE ; D := DEVICE TYPE
LD E,(IY+PPIDE_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01111001 ; ATAPI ATTRIBUTES
LD A,(IY+PPIDE_TYPE) ; CHECK TYPE VALUE
CP PPIDE_TYPEATAPI ; ATAPI?
JR Z,PPIDE_DEVICE1 ; IF SO, DONE
LD C,%00110001 ; COMPACTFLASH ATTRIBUTES
BIT 0,(IY+PPIDE_MED) ; TEST CF BIT IN FLAGS
LD C,%00000000 ; ASSUME NON-REMOVABLE HARD DISK
JR Z,PPIDE_DEVICE1 ; IF Z, WE ARE DONE
LD C,%01001000 ; OTHERWISE REMOVABLE COMPACT FLASH
JR NZ,PPIDE_DEVICE1 ; IF SET, DONE
LD C,%00110000 ; GENERIC HARD DISK ATTRIBUTES
PPIDE_DEVICE1:
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,(IY+PPIDE_DATALO) ; L := BASE I/O ADDRESS
@@ -644,8 +649,6 @@ PPIDE_GEOM:
; FUNCTION SUPPORT ROUTINES
;=============================================================================
;
;
;
PPIDE_SETFEAT:
PUSH AF
#IF (PPIDETRACE >= 3)
@@ -674,32 +677,6 @@ PPIDE_SETFEAT:
;
;
;
PPIDE_NOP:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" NOP$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_IO_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
;
; EXECUTE THE NOP COMMAND, BUT DON'T WAIT FOR DRDY, JUST
; MAKE SURE BUSY IS CLEAR. THIS COMMAND IS USED DURING
; DEVICE DETECTION/INITIALIZATION AND ATAPI DEVICES WILL
; NOT ASSERT DRDY AFTER RESET.
LD A,PPIDE_CIDE_NOP ; CMD = NOP
LD (PPIDE_CMD),A ; SAVE IT
CALL PPIDE_WAITBSY
RET NZ
JP PPIDE_RUNCMD1 ; RUN COMMAND AND EXIT
;
;
;
PPIDE_IDENTIFY:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
@@ -715,8 +692,13 @@ PPIDE_IDENTIFY:
#ENDIF
LD A,PPIDE_CMD_IDDEV
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
CALL PPIDE_RUNCMD_ND
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 3,A ; IS DRQ SET?
JP Z,PPIDE_NOMEDIA
;
LD HL,HB_WRKBUF
JP PPIDE_GETBUF ; EXIT THRU BUFRD
@@ -729,21 +711,21 @@ PPIDE_IDENTIFYPACKET:
PRTS(" IDPKTDEV$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_IO_DRVHD),A
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,PPIDE_CIDE_IDPKTDEV
LD A,PPIDE_CMD_IDPKTDEV
LD (PPIDE_CMD),A
CALL PPIDE_RUNCMD
CALL PPIDE_RUNCMD_ND
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 6,A ; IS DRQ SET?
BIT 3,A ; IS DRQ SET?
JP Z,PPIDE_NOMEDIA
;
LD HL,HB_WRKBUF
@@ -751,6 +733,33 @@ PPIDE_IDENTIFYPACKET:
;
;
;
PPIDE_PACKET:
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" PACKET$")
#ENDIF
LD A,(PPIDE_DRVHD)
;OUT (PPIDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
XOR A ; ZERO
CALL PPIDE_OUT
.DB PPIDE_REG_FEAT ; FEATURE REG = 0
CALL PPIDE_OUT
.DB PPIDE_REG_BCL
LD A,8
CALL PPIDE_OUT
.DB PPIDE_REG_BCH ; BYTE COUNT = 512????
LD A,PPIDE_CMD_PACKET
LD (PPIDE_CMD),A
JP PPIDE_RUNCMD_ND
;
;
;
PPIDE_RDSEC:
;
#IF (PPIDETRACE >= 3)
@@ -764,6 +773,17 @@ PPIDE_RDSEC:
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,(IY+PPIDE_TYPE)
CP PPIDE_TYPEATA
JR Z,PPIDE_ATA_RDSEC
CP PPIDE_TYPEATAPI
JR Z,PPIDE_PKT_RDSEC
JP PPIDE_CMDERR
;
PPIDE_ATA_RDSEC:
#IF (PPIDETRACE >= 3)
PRTS(" ATA$")
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_READ
@@ -773,6 +793,38 @@ PPIDE_RDSEC:
LD HL,(PPIDE_DSKBUF)
JP PPIDE_GETBUF
;
PPIDE_PKT_RDSEC:
#IF (PPIDETRACE >= 3)
PRTS(" PKT$")
#ENDIF
; SETUP LBA
;
#IF (DSKYENABLE)
LD A,PPIDE_LBA
CALL LDHLIYA
CALL HB_DSKACT ; SHOW ACTIVITY
#ENDIF
;
; 3 BYTES, LITTLE ENDIAN -> BIG ENDIAN
LD HL,PPIDE_PKTCMD_RW10+3 ; START OF LBA FIELD IN CDB (MSB)
LD A,(IY+PPIDE_LBA+2) ; THIRD BYTE OF LBA FIELD IN CFG (MSB)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+1)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+0)
LD (HL),A
INC HL
LD HL,PPIDE_PKTCMD_RW10
LD A,SCSI_CMD_READ10
LD (HL),A
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
RET
;
;
;
PPIDE_WRSEC:
@@ -788,6 +840,17 @@ PPIDE_WRSEC:
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
CALL PRTHEXBYTE
#ENDIF
LD A,(IY+PPIDE_TYPE)
CP PPIDE_TYPEATA
JR Z,PPIDE_ATA_WRSEC
CP PPIDE_TYPEATAPI
JR Z,PPIDE_PKT_WRSEC
JP PPIDE_CMDERR
;
PPIDE_ATA_WRSEC:
#IF (PPIDETRACE >= 3)
PRTS(" ATA$")
#ENDIF
CALL PPIDE_SETADDR ; SETUP CYL, TRK, HEAD
LD A,PPIDE_CMD_WRITE
@@ -797,6 +860,38 @@ PPIDE_WRSEC:
LD HL,(PPIDE_DSKBUF)
JP PPIDE_PUTBUF
;
PPIDE_PKT_WRSEC:
#IF (PPIDETRACE >= 3)
PRTS(" PKT$")
#ENDIF
; SETUP LBA
;
#IF (DSKYENABLE)
LD A,PPIDE_LBA
CALL LDHLIYA
CALL HB_DSKACT ; SHOW ACTIVITY
#ENDIF
;
; 3 BYTES, LITTLE ENDIAN -> BIG ENDIAN
LD HL,PPIDE_PKTCMD_RW10+3 ; START OF LBA FIELD IN CDB (MSB)
LD A,(IY+PPIDE_LBA+2) ; THIRD BYTE OF LBA FIELD IN CFG (MSB)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+1)
LD (HL),A
INC HL
LD A,(IY+PPIDE_LBA+0)
LD (HL),A
INC HL
LD HL,PPIDE_PKTCMD_RW10
LD A,SCSI_CMD_WRITE10
LD (HL),A
OR $FF ; WRITE DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
RET
;
;
;
PPIDE_SETADDR:
@@ -807,8 +902,8 @@ PPIDE_SETADDR:
CALL HB_DSKACT ; SHOW ACTIVITY
#ENDIF
; SEND 3 LOWEST BYTES OF LBA IN REVERSE ORDER
; IDE_IO_LBA3 HAS ALREADY BEEN SET
; HSTLBA2-0 --> IDE_IO_LBA2-0
; IDE_REG_LBA3 HAS ALREADY BEEN SET
; HSTLBA2-0 --> IDE_REG_LBA2-0
LD A,(IY+PPIDE_LBA+2)
#IF (PPIDETRACE >= 3)
CALL PC_SPACE
@@ -847,6 +942,16 @@ PPIDE_SETADDR:
; COMMAND PROCESSING
;=============================================================================
;
; RUN AN ATA COMMAND. THERE ARE TWO ENTRY POINTS. THE NORMAL ENTRY
; POINT WILL WAIT FOR DRIVE READY. THE _ND ENTRY POINT ONLY WAITS
; FOR THE DEVICE TO BE NOT BUSY. THE CORRECT ENTRY POINT DEPENDS ON
; THE COMMAND.
;
PPIDE_RUNCMD_ND:
CALL PPIDE_WAITBSY ; WAIT WHILE DEVICE BUSY
RET NZ ; BAIL OUT ON TIMEOUT
JR PPIDE_RUNCMD1 ; CONTINUE
PPIDE_RUNCMD:
CALL PPIDE_WAITRDY ; WAIT FOR DRIVE READY
RET NZ ; BAIL OUT ON TIMEOUT
@@ -871,54 +976,153 @@ PPIDE_RUNCMD1:
JP NZ,PPIDE_CMDERR
RET
;
; PACKET COMMAND PROCESSOR
; HL: ADDRESS OF PACKET COMMAND BUFFER
;
PPIDE_RUNPCMD:
PUSH HL
CALL PPIDE_PACKET
POP HL
RET NZ ; BAIL OUT ON ERROR
;
#IF (PPIDETRACE >= 3)
PRTS("\r\nPKTCMD:$")
PUSH HL
POP DE
LD A,12
CALL PRTHEXBUF
#ENDIF
;
; IF ZIP DRIVE HAS FALLEN ASLEEP, THEN IT WILL NEED EXTRA
; TIME HERE TO WAKE UP BEFORE ACCEPTING THE COMMAND. USE
; LONG TIMEOUT TO ACCOMMODATE THIS.
LD DE,(PPIDE_TIMEOUT) ; GET CURRENT TIMEOUT
PUSH DE ; SAVE IT
LD DE,PPIDE_TOSLOW ; SLOW TIMEOUT FOR THIS
LD (PPIDE_TIMEOUT),DE ; SET IT
LD B,6 ; 6 WORDS ALWAYS
CALL PPIDE_PUT
POP DE ; RECOVER TIMEOUT
LD (PPIDE_TIMEOUT),DE ; SET IT
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_STAT
BIT 3,A ; IS DRQ SET?
RET Z ; IF NOT, ALL DONE
;
CALL PPIDE_IN
.DB PPIDE_REG_BCL
LD C,A
CALL PPIDE_IN
.DB PPIDE_REG_BCH
LD B,A
;
; BELOW ASSUMES MAX TRANSFER OF 512 BYTES!!!
PUSH BC ; SAVE BYTE COUNT
SRL B ; CONVERT
RR C ; ... TO WORDS
LD B,C
;LD HL,HB_WRKBUF ; SET XFR BUFFER
LD HL,(PPIDE_DSKBUF) ; SET XFR BUFFER
LD A,(PPIDE_XFRDIR)
OR A
JR NZ,PPIDE_RUNPCMD2 ; NZ = WRITE
CALL PPIDE_GET ; GET SOME DATA
JR PPIDE_RUNPCMD3
PPIDE_RUNPCMD2:
CALL PPIDE_PUT ; PUT SOME DATA
PPIDE_RUNPCMD3:
POP BC ; RESTORE BYTE COUNT
RET NZ ; BAIL OUT ON ERRORS
;
XOR A
RET
;
; THE FOLLOWING IS USED TO ASSESS ANY ERROR THAT OCCURS DURING
; RUNCMD AND SET AN APPROPRIATE ERROR CODE.
;
PPIDE_CHKPCMD:
;
LD HL,HB_WRKBUF
LD (PPIDE_DSKBUF),HL
LD HL,PPIDE_PKTCMD_SENSE
CALL PPIDE_RUNPCMD
RET NZ
;
CALL PPIDE_IN
.DB PPIDE_REG_BCL
;
#IF (PPIDETRACE >= 3)
CALL NEWLINE
LD DE,HB_WRKBUF
CALL PRTHEXBUF
#ENDIF
;
; ASSESS SENSE DATA AND SET APPROPRIATE ERROR
LD A,(HB_WRKBUF+12)
CP $3A
JP Z,PPIDE_NOMEDIA
CP $04
JP Z,PPIDE_NOTRDY
;
JP PPIDE_CMDERR
;
; HL=BUFFER
;
PPIDE_GETBUF:
LD B,0
; FALL THRU!!!
;
; HL=BUFFER
; B=WORD COUNT, 0=256
;
PPIDE_GET:
#IF (PPIDETRACE >= 3)
PRTS(" GETBUF$")
PRTS(" GET$")
#ENDIF
;
; WAIT FOR BUFFER
PUSH BC
PUSH HL
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
POP HL
POP BC
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
;OUT (PPIDE_REG_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := READ UNASSERTED
XOR PPIDE_CTL_DIOR ; SWAP THE READ LINE BIT
LD D,A ; D := READ ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD A,B ; LOOP COUNTER IN A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_GETBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_GETBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_GETBUF2 ; CONTINUE
PPIDE_GETBUF1:
CALL PPIDE_GETBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_GETBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_GETBUF2:
JR Z,PPIDE_GET1 ; IF NOT, DO 16 BIT
CALL PPIDE_GET8 ; 8-BIT READ
JR PPIDE_GET2 ; CONTINUE
PPIDE_GET1:
CALL PPIDE_GET16 ; 16-0BIT READ
PPIDE_GET2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_GETBUF8: ; 8 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
PPIDE_GET8: ; 8 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_REG_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
@@ -926,12 +1130,19 @@ PPIDE_GETBUF8: ; 8 BIT WIDE READ LOOP
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF8 ; LOOP UNTIL DONE
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
INI ; READ FROM LSB
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
DEC A
JR NZ,PPIDE_GET8 ; LOOP UNTIL DONE
RET
;
PPIDE_GETBUF16: ; 16 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_IO_CTL
PPIDE_GET16: ; 16 BIT WIDE READ LOOP
; ENTER W/ C = PPIDE_REG_CTL
OUT (C),D ; ASSERT READ
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
@@ -940,30 +1151,41 @@ PPIDE_GETBUF16: ; 16 BIT WIDE READ LOOP
INI ; READ MSB FOR 16 BIT
INC C ; MSB -> CTL
OUT (C),E ; DEASSERT READ
CP B ; B == A == 0?
JR NZ,PPIDE_GETBUF16 ; LOOP UNTIL DONE
DEC A
JR NZ,PPIDE_GET16 ; LOOP UNTIL DONE
RET
;
;
; HL=BUFFER
;
PPIDE_PUTBUF:
LD B,0
; FALL THRU!!!
;
; HL=BUFFER
; B=WORD COUNT, 0=256
;
PPIDE_PUT:
#IF (PPIDETRACE >= 3)
PRTS(" PUTBUF$")
PRTS(" PUT$")
#ENDIF
;
; WAIT FOR BUFFER
PUSH BC
PUSH HL
CALL PPIDE_WAITDRQ ; WAIT FOR BUFFER READY
POP HL
POP BC
RET NZ ; BAIL OUT IF TIMEOUT
;
; SETUP PPI TO WRITE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
; SELECT READ/WRITE IDE REGISTER
LD A,PPIDE_REG_DATA ; DATA REGISTER
;OUT (PPIDE_IO_CTL),A ; DO IT
;OUT (PPIDE_REG_CTL),A ; DO IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A ; DO IT
LD E,A ; E := WRITE UNASSERTED
@@ -971,26 +1193,22 @@ PPIDE_PUTBUF:
LD D,A ; D := WRITE ASSERTED
;
; LOOP SETUP
XOR A ; IMPORTANT, NEEDED FOR LOOP END COMPARISON
LD B,0 ; 256 ITERATIONS
LD A,B ; LOOP COUNTER IN A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
;
BIT 1,(IY+PPIDE_ACC) ; 8 BIT?
JR Z,PPIDE_PUTBUF1 ; IF NOT, DO 16 BIT
CALL PPIDE_PUTBUF8 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_PUTBUF2 ; CONTINUE
PPIDE_PUTBUF1:
CALL PPIDE_PUTBUF16 ; FIRST PASS (FIRST 256 BYTES)
CALL PPIDE_PUTBUF16 ; SECOND PASS (LAST 256 BYTES)
PPIDE_PUTBUF2:
JR Z,PPIDE_PUT1 ; IF NOT, DO 16 BIT
CALL PPIDE_PUT8 ; SECOND PASS (LAST 256 BYTES)
JR PPIDE_PUT2 ; CONTINUE
PPIDE_PUT1:
CALL PPIDE_PUT16 ; FIRST PASS (FIRST 256 BYTES)
PPIDE_PUT2:
CALL PPIDE_WAITRDY ; PROBLEMS IF THIS IS REMOVED!
RET NZ
CALL PPIDE_GETRES
JP NZ,PPIDE_IOERR
RET
;
PPIDE_PUTBUF8: ; 8 BIT WIDE WRITE LOOP
PPIDE_PUT8: ; 8 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
@@ -998,11 +1216,18 @@ PPIDE_PUTBUF8: ; 8 BIT WIDE WRITE LOOP
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF8 ; LOOP UNTIL DONE
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
INC C ; LSB -> MSB
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
DEC A
JR NZ,PPIDE_PUT8 ; LOOP UNTIL DONE
RET
;
PPIDE_PUTBUF16: ; 16 BIT WIDE WRITE LOOP
PPIDE_PUT16: ; 16 BIT WIDE WRITE LOOP
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
OUTI ; WRITE NEXT BYTE (LSB)
@@ -1011,8 +1236,8 @@ PPIDE_PUTBUF16: ; 16 BIT WIDE WRITE LOOP
INC C ; MSB -> CTL
OUT (C),D ; ASSERT WRITE
OUT (C),E ; DEASSERT WRITE
CP B ; B == A == 0?
JR NZ,PPIDE_PUTBUF16 ; LOOP UNTIL DONE
DEC A
JR NZ,PPIDE_PUT16 ; LOOP UNTIL DONE
RET
;
;
@@ -1057,7 +1282,7 @@ PPIDE_RESET:
;
; SETUP PPI TO READ
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
;
@@ -1082,13 +1307,13 @@ PPIDE_RESET:
PRTS(" HARD$")
#ENDIF
LD A,PPIDE_CTL_RESET
;OUT (PPIDE_IO_CTL),A
;OUT (PPIDE_REG_CTL),A
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
OUT (C),A
LD DE,20 ; DELAY 320US (SPEC IS >= 25US)
CALL VDELAY
XOR A
;OUT (PPIDE_IO_CTL),A
;OUT (PPIDE_REG_CTL),A
OUT (C),A
LD DE,20
CALL VDELAY
@@ -1125,7 +1350,7 @@ PPIDE_RESET2:
PRTS(" SOFT$")
#ENDIF
LD A,%00001110 ; ASSERT RESET, NO INTERRUPTS
;OUT (PPIDE_IO_CTRL),A
;OUT (PPIDE_REG_CTRL),A
CALL PPIDE_OUT
.DB PPIDE_REG_CTRL
LD DE,20 ; DELAY 320US (SPEC IS >= 25US)
@@ -1224,7 +1449,7 @@ PPIDE_PROBE:
;
; SELECT DEVICE (MASTER/SLAVE)
LD A,(PPIDE_DRVHD)
;OUT (IDE_IO_DRVHD),A
;OUT (IDE_REG_DRVHD),A
CALL PPIDE_OUT
.DB PPIDE_REG_DRVHD
#IF (PPIDETRACE >= 3)
@@ -1275,7 +1500,7 @@ PPIDE_PROBE:
;
; TEST FOR PRESENCE OF IDE REGISTERS. USE LBA0/1 TO SEE
; IF VALUE CAN BE PERSISTED. THE USE OF BOTH LBA0 AND LBA1
; IS TO MAINTAIN CONSISTENCY WITH TGHE THE PPIDE DRIVER BECAUSE
; IS TO MAINTAIN CONSISTENCY WITH THE THE PPIDE DRIVER BECAUSE
; PPI ITSELF WILL PERSIST THE LAST VALUE WRITTEN, SO WE USE
; MULTIPLE REGISTERS TO WORK AROUND THIS FALSE POSITIVE.
;
@@ -1326,22 +1551,26 @@ PPIDE_INITDEV:
PRTS(" INITDEV$") ; LABEL FOR IO ADDRESS
#ENDIF
;
; IF THE IDE STATUS BYTE IS $00, WE HAVE EITHER A NON-PRESENT SLAVE
; OR AN ATAPI DEVICE. TO DIFFERENTIATE THESE POSSIBILITIES, WE RUN
; A NOP COMMAND. IF WE HAVE AN ATAPI DEVICE, THIS WILL CAUSE THE
; STATUS BYTE TO BE "NORMAL" (NON-ZERO). IF THE STATUS IS STILL
; ZERO, WE ABORT WITH A NO MEDIA STATUS. NOTE THAT THE NOP COMMAND
; RETURNS A COMMAND ERROR BY DESIGN. WE JUST IGNORE THE ERROR.
#IF (PPIDETRACE >= 3)
CALL PPIDE_REGDUMP
#ENDIF
;
; ON ENTRY, WE HAVE ALREADY CHECKED THAT THE BUSY BIT IS CLEARED AND
; DRDY SHOULD BE SET. IF DRDY IS NOT SET, IF COULD MEAN EITHER A
; NON-EXISTENT SLAVE DEVICE OR AN ATAPI DEVICE. TO AVOID UNNECESSARY
; TIMEOUTS, WE CHECK FOR DRDY. IF IT IS NOT SET, THEN WE ASSUME THIS
; MUST BE AN ATAPI DEVICE AND GO TRY TO DO THE ATAPI INITIALIZATION.
; IF THIS WAS ACTUALLY A NON-EXISTENT SLAVE, THE ATAPI INITIALIZATION
; WILL HANDLE THIS PRETTY WELL.
;
CALL PPIDE_NOP
CALL PPIDE_IN
.DB PPIDE_REG_STAT
OR A
JP Z,PPIDE_NOMEDIA
BIT 6,A ; DRDY?
JR Z,PPIDE_INITPDEV ; ODD, MIGHT BE ATAPI
;
; WE NEED TO SETUP 8-BIT MODE BEFORE DOING ANYTHING ELSE
;
PPIDE_INITDEV0A:
BIT 1,(IY+PPIDE_ACC) ; 8 BIT ACCESS?
JR Z,PPIDE_INITDEV0 ; NO, DO 16 BIT INIT
LD A,PPIDE_FEAT_ENABLE8BIT ; FEATURE VALUE = ENABLE 8-BIT PIO
@@ -1358,8 +1587,12 @@ PPIDE_INITDEV0:
;
PPIDE_INITDEV00:
;
; WE NOW USE AN IDENTIFY DEVICE COMMAND TO CONFIRM THE
; DEVICE IS REALLY THERE AND GET SOME ATTRIBUTES. IF THE
; COMMAND FAILS, IT MAY BE THAT WE HAVE AN ATAPI DEVICE AND
; SO WE GO TO THE ATAPI INITIALIZATION ON FAILURE.
CALL PPIDE_IDENTIFY ; EXECUTE PPIDENTIFY COMMAND
JR NZ,PPIDE_INITDEVP ; ON ERROR, TRY PACKET DEVICE
JR NZ,PPIDE_INITPDEV ; TRY ATAPI ON FAILURE
;
; DECLARE WE ARE ATA
LD A,PPIDE_TYPEATA ; OTHERWISE TYPE=ATA
@@ -1371,13 +1604,6 @@ PPIDE_INITDEV00:
#ENDIF
;
LD (IY+PPIDE_MED),0 ; CLEAR MEDIA FLAGS
;
; DETERMINE IF CF DEVICE BY TESTING FOR CF CARD SIGNATURES
; IN THEORY, THERE ARE SOME OTHER POSSIBLE VARIATIONS, BUT
; THEY ARE NOT RECOMMENDED BY THE CF CARD SPEC AND MIGHT
; OVERLAP WITH "REAL" HARD DISK SIGNATURES. I HAVE NEVER
; SEEN A CF CARD THAT DID NOT USE ONE OF THE BELOW.
; CREDIT TO LASZLO SZOLNOKI
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
@@ -1417,9 +1643,15 @@ PPIDE_INITDEV2:
;
RET ; RETURN, A=0, Z SET
;
; (RE)INITIALIZE PACKET DEVICE
;
PPIDE_INITPDEV:
;
#IF (PPIDETRACE >= 3)
CALL PPIDE_PRTPREFIX
PRTS(" INITPDEV$") ; LABEL FOR IO ADDRESS
#ENDIF
;
PPIDE_INITDEVP:
CALL PPIDE_IDENTIFYPACKET ; EXECUTE IDENTIFY COMMAND
RET NZ ; BAIL OUT ON ERROR
;
@@ -1432,17 +1664,98 @@ PPIDE_INITDEVP:
CALL DUMP_BUFFER ; DUMP IT IF DEBUGGING
#ENDIF
;
LD (IY+PPIDE_MED),0 ; CLEAR FLAGS
LD (IY+PPIDE_MED),0 ; CLEAR FLAGS
SET 1,(IY+PPIDE_MED) ; SET FLAGS BIT FOR LBA (ASSUMED)
;
; DONE FOR NOW, ATAPI NOT INPLEMENTED
; WAIT FOR UNIT READY
LD B,0 ; MAX LOOPS
LD C,4 ; MAX ERRORS
PPIDE_INITPDEV1:
DEC B ; CHECK LOOP COUNTER EXCEEDED
JP Z,PPIDE_NOMEDIA ; TREAT AS NO MEDIA
PUSH BC ; SAVE LOOP CONTROL
LD HL,PPIDE_PKTCMD_TSTRDY ; TEST UNIT READY
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD ; ISSUE PACKET COMMAND
CALL NZ,PPIDE_CHKPCMD ; IF ERROR, DIAGNOSE IT
POP BC ; RESTORE LOOP CONTROL
JR Z,PPIDE_INITPDEV2 ; IF NO ERROR, CONTINUE
CP PPIDE_STNOMEDIA ; EXPLICIT NO MEDIA RESULT?
RET Z ; EXIT REPORTING NO MEDIA
CP PPIDE_STNOTRDY ; BECOMING READY?
JR Z,PPIDE_INITDEVP1A ; IF SO, NOT AN ERROR, LOOP
DEC C ; DEC ERROR LIMIT
RET Z ; BAIL OUT, ERR LIMIT EXCEEDED
JR PPIDE_INITPDEV1 ; LOOP
PPIDE_INITDEVP1A:
LD DE,100000/16 ; WAIT 1/10 SECOND
CALL VDELAY ; DO IT
JR PPIDE_INITPDEV1 ; AND LOOP
;
; RETURN NOT SUPPORTED STATUS
JP PPIDE_NOTSUP ; NOT SUPPORTED
PPIDE_INITPDEV2:
#IF (PPIDETRACE >= 3)
LD A,B
NEG
PRTS("\r\nLOOPS=$")
CALL PRTHEXBYTE
#ENDIF
;
; ; RECORD STATUS OK
; XOR A ; A := 0 (STATUS = OK)
; LD (IY+PPIDE_STAT),A ; SAVE IT
; RET
; GET AND RECORD CAPACITY
LD HL,HB_WRKBUF
LD (PPIDE_DSKBUF),HL
LD HL,PPIDE_PKTCMD_RDCAP
XOR A ; READ DIRECTION
LD (PPIDE_XFRDIR),A ; SAVE IT
CALL PPIDE_RUNPCMD
JP NZ,PPIDE_CHKPCMD
;
#IF (PPIDETRACE >= 3)
PRTS("\r\nRDCAP:$")
LD A,8
LD DE,HB_WRKBUF
CALL PRTHEXBUF
#ENDIF
;
; CAPACITY IS RETURNED IN A 4 BYTE, BIG ENDIAN FIELD AND
; INDICATES THE LAST LBA VALUE. WE NEED TO CONVERT THIS TO
; LITTLE ENDIAN AND INCREMENT THE VALUE TO MAKE IT A CAPACITY
; COUNT INSTEAD OF A LAST LBA VALUE.
LD A,PPIDE_MEDCAP ; OFFSET IN CFG FOR CAPACITY
CALL LDHLIYA ; POINTER TO HL
PUSH HL ; SAVE IT
LD HL,HB_WRKBUF ; POINT TO VALUE IN CMD RESULT
CALL LD32 ; LOAD IT TO DE:HL
LD A,L ; FLIP BYTES
LD L,D ; ... BIG ENDIAN
LD D,A ; ... TO LITTLE ENDIAN
LD A,H
LD H,E
LD E,A
CALL INC32 ; INCREMENT TO FINAL VALUE
POP BC ; RECOVER SAVE LOCATION
CALL ST32 ; STORE VALUE
;
; CHECK BLOCK LENGTH. WE CURRENTLY ONLY SUPPORT 512 BYTE
; BLOCKS. CD-ROM DEVICES (WHICH USE 2k BLOCKS) WILL FAIL
; HERE AS NOT SUPPORTED.
LD HL,HB_WRKBUF+4 ; POINT TO BLK SIZE IN RESULT
CALL LD32 ; LOAD IT TO DE:HL
; VALUE IS BIG ENDIAN, SO LH:ED MUST BE EXACTLY 0000:0200
LD A,L ; CHECK THAT LH
OR H ; ... IS ZERO
JP NZ,PPIDE_NOTSUP ; IF NOT, FAIL AS NOT SUP
LD A,D ; LOAD D
OR A ; SET FLAGS
JP NZ,PPIDE_NOTSUP ; IF NOT ZERO, FAIL AS NOT SUP
LD A,E ; LOAD E
CP 2 ; CHECK IT IF IS 2
JP NZ,PPIDE_NOTSUP ; IF NOT, FAIL AS NOT SUP
;
; RECORD STATUS OK
XOR A ; A := 0 (STATUS = OK)
LD (IY+PPIDE_STAT),A ; SAVE IT
RET
;
; SWITCH IY POINTER FROM CURRENT UNIT CFG TO PARTNER UNIT CFG
;
@@ -1535,19 +1848,19 @@ PPIDE_IN:
EX (SP),HL ; GET PARM POINTER ; 19TS
PUSH BC ; SAVE INCOMING BC ; 11TS
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ ; 7TS
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD ; 19TS
OUT (C),A ; WRITE IT ; 12TS
;
LD B,(HL) ; GET CTL PORT VALUE ; 7TS
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE
;LD C,PPIDE_REG_CTL ; SETUP PORT TO WRITE
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS ; 4TS
OUT (C),B ; SET ADDRESS LINES ; 12TS
SET 6,B ; TURN ON READ BIT ; 8TS
OUT (C),B ; ASSERT READ LINE ; 12TS
;
;IN A,(PPIDE_IO_DATALO) ; GET DATA VALUE FROM DEVICE
;IN A,(PPIDE_REG_DATALO) ; GET DATA VALUE FROM DEVICE
DEC C ; 4TS
DEC C ; 4TS
IN A,(C) ; GET DATA VALUE FROM DEVICE ; 12
@@ -1569,13 +1882,13 @@ PPIDE_OUT:
PUSH BC ; SAVE INCOMING BC
PUSH AF ; PRESERVE INCOMING VALUE
LD A,PPIDE_DIR_WRITE ; SET DATA BUS DIRECTION TO WRITE
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
POP AF ; RECOVER VALUE TO WRITE
;
LD B,(HL) ; GET IDE ADDRESS VALUE
;LD C,PPIDE_IO_CTL ; SETUP PORT TO WRITE
;LD C,PPIDE_REG_CTL ; SETUP PORT TO WRITE
;LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
DEC C ; SET IDE ADDRESS
OUT (C),B ; SET ADDRESS LINES
@@ -1584,7 +1897,7 @@ PPIDE_OUT:
;
DEC C
DEC C
;OUT (PPIDE_IO_DATALO),A ; SEND DATA VALUE TO DEVICE
;OUT (PPIDE_REG_DATALO),A ; SEND DATA VALUE TO DEVICE
OUT (C),A ; SEND DATA VALUE TO DEVICE
INC C
INC C
@@ -1634,6 +1947,10 @@ PPIDE_NOTSUP:
LD A,PPIDE_STNOTSUP
JR PPIDE_ERR
;
PPIDE_NOTRDY:
LD A,PPIDE_STNOTRDY
JR PPIDE_ERR
;
PPIDE_ERR:
LD (IY+PPIDE_STAT),A ; SAVE NEW STATUS
;
@@ -1706,6 +2023,9 @@ PPIDE_PRTSTATSTR:
INC A
LD DE,PPIDE_STR_STNOTSUP
JR Z,PPIDE_PRTSTATSTR1
INC A
LD DE,PPIDE_STR_STNOTRDY
JR Z,PPIDE_PRTSTATSTR1
LD DE,PPIDE_STR_STUNK
PPIDE_PRTSTATSTR1:
CALL WRITESTR
@@ -1723,7 +2043,7 @@ PPIDE_REGDUMP:
CALL PC_SPACE
CALL PC_LBKT
LD A,PPIDE_DIR_READ ; SET DATA BUS DIRECTION TO READ
;OUT (PPIDE_IO_PPI),A ; DO IT
;OUT (PPIDE_REG_PPI),A ; DO IT
LD C,(IY+PPIDE_PPI) ; PPI CONTROL WORD
OUT (C),A ; WRITE IT
LD C,(IY+PPIDE_CTL) ; SET IDE ADDRESS
@@ -1731,12 +2051,12 @@ PPIDE_REGDUMP:
LD B,7
PPIDE_REGDUMP1:
LD A,E ; REGISTER ADDRESS
;OUT (PPIDE_IO_CTL),A ; SET IT
;OUT (PPIDE_REG_CTL),A ; SET IT
OUT (C),A ; REGISTER ADDRESS
XOR PPIDE_CTL_DIOR ; SET BIT TO ASSERT READ LINE
;OUT (PPIDE_IO_CTL),A ; ASSERT READ
;OUT (PPIDE_REG_CTL),A ; ASSERT READ
OUT (C),A ; ASSERT READ
;IN A,(PPIDE_IO_DATALO) ; GET VALUE
;IN A,(PPIDE_REG_DATALO) ; GET VALUE
DEC C ; CTL -> MSB
DEC C ; MSB -> LSB
IN A,(C) ; GET VALUE
@@ -1744,7 +2064,7 @@ PPIDE_REGDUMP1:
INC C ; MSB -> CTL
CALL PRTHEXBYTE ; DISPLAY IT
;LD A,C ; RELOAD ADDRESS W/ READ UNASSERTED
;OUT (PPIDE_IO_CTL),A ; AND SET IT
;OUT (PPIDE_REG_CTL),A ; AND SET IT
OUT (C),E ; RELOAD ADDRESS W/ READ UNASSERTED
;DEC C ; NEXT LOWER REGISTER
DEC E ; NEXT LOWER REGISTER
@@ -1785,6 +2105,7 @@ PPIDE_STR_STRDYTO .TEXT "READY TIMEOUT$"
PPIDE_STR_STDRQTO .TEXT "DRQ TIMEOUT$"
PPIDE_STR_STBSYTO .TEXT "BUSY TIMEOUT$"
PPIDE_STR_STNOTSUP .TEXT "NOT SUPPORTED$"
PPIDE_STR_STNOTRDY .TEXT "NOT READY$"
PPIDE_STR_STUNK .TEXT "UNKNOWN ERROR$"
;
PPIDE_STR_NO .TEXT "NO$"
@@ -1806,5 +2127,14 @@ PPIDE_IOFNADR .DW 0 ; PENDING IO FUNCTION ADDRESS
PPIDE_DRVHD .DB 0 ; CURRENT DRIVE/HEAD MASK
;
PPIDE_DSKBUF .DW 0 ; ACTIVE DISK BUFFER
PPIDE_XFRDIR .DB 0 ; 0=READ, NON-0=WRITE
;
PPIDE_DEVNUM .DB 0 ; TEMP DEVICE NUM USED DURING INIT
;
; SCSI COMMAND TEMPLATES (ALWAYS 12 BYTES FOR ATAPI)
;
PPIDE_PKTCMD_RW .DB $00, $00, $00, $00, $01, $00, $00, $00, $00, $00, $00, $00 ; READ/WRITE SECTOR
PPIDE_PKTCMD_SENSE .DB $03, $00, $00, $00, $FF, $00, $00, $00, $00, $00, $00, $00 ; REQUEST SENSE DATA
PPIDE_PKTCMD_RDCAP .DB $25, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; READ CAPACITY
PPIDE_PKTCMD_RW10 .DB $28, $00, $00, $00, $00, $00, $00, $00, $01, $00, $00, $00 ; READ/WRITE SECTOR
PPIDE_PKTCMD_TSTRDY .DB $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00, $00 ; TEST UNIT READY

View File

@@ -689,7 +689,7 @@ PPPSD_RESET:
PPPSD_DEVICE:
LD D,DIODEV_PPPSD ; D := DEVICE TYPE
LD E,(IY+PPPSD_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01010000 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD C,%01110010 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,PPPBASE ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -546,7 +546,7 @@ PRPSD_RESET:
PRPSD_DEVICE:
LD D,DIODEV_PRPSD ; D := DEVICE TYPE
LD E,(IY+PRPSD_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01010000 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD C,%01110010 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,PRP_IOBASE ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -178,7 +178,7 @@ RF_GEOM:
RF_DEVICE:
LD D,DIODEV_RF ; D := DEVICE TYPE
LD E,(IY+RF_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%00110000 ; C := ATTRIBUTES, NON-REMOVABLE RAM FLOPPY
LD C,%00010110 ; C := ATTRIBUTES, NON-REMOVABLE RAM FLOPPY
LD H,0 ; H := 0, DRIVER HAS NO MODES
LD L,(IY+RF_IOAD) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -450,10 +450,9 @@ fp_hdboot1:
push bc ; save loop control
ld b,BF_DIODEVICE ; HBIOS Disk Device func
rst 08 ; unit in C, do it
bit 5,C ; high capacity disk?
pop bc ; restore loop control
ld a,d ; device type to A
cp DIODEV_IDE ; type IDE or greater is HD
jr c,fp_hdboot2 ; if not, continue loop
jr z,fp_hdboot2 ; if not, continue loop
push bc ; save loop control
ld b,BF_DIOMEDIA ; HBIOS Sense Media
ld e,1 ; perform media discovery
@@ -488,11 +487,10 @@ fp_flopboot1:
push de ; save floppy down ctr
ld b,BF_DIODEVICE ; HBIOS Disk Device func
rst 08 ; unit in C, do it
ld a,d ; device type to A
bit 7,c ; floppy device?
pop de ; restore loop control
pop bc ; restore floppy down ctr
cp DIODEV_FD ; type FD?
jr nz,fp_flopboot3 ; if not floppy, skip
jr z,fp_flopboot3 ; if not floppy, skip
dec e ; decrement down ctr
jr z,fp_flopboot2 ; if ctr expired, boot this unit
fp_flopboot3:
@@ -1017,6 +1015,18 @@ diskboot:
cp e ; compare to count
jp nc,err_nodisk ; handle no disk err
;
; If non-zero slice requested, confirm device can handle it
ld a,(bootslice) ; get slice
or a ; set flags
jr z,diskboot0 ; slice 0, skip slice check
ld a,(bootunit) ; get disk unit
ld c,a ; put in C for func call
ld b,BF_DIODEVICE ; HBIOS func: device info
rst 08 ; do it
bit 5,c ; high capacity device?
jp z,err_noslice ; no such slice, handle err
;
diskboot0:
; Sense media
ld a,(bootunit) ; get boot disk unit
ld c,a ; put in C for func call
@@ -1026,18 +1036,6 @@ diskboot:
jp nz,err_diskio ; handle error
ld a,e ; media id to A
ld (mediaid),a ; save media id
;
; If non-zero slice requested, confirm device can handle it
ld a,(bootslice) ; get slice
or a ; set flags
jr z,diskboot1 ; slice 0, skip slice check
ld a,(bootunit) ; get disk unit
ld c,a ; put in C for func call
ld b,BF_DIODEVICE ; HBIOS func: device info
rst 08 ; do it
ld a,d ; device type to A
cp DIODEV_IDE ; IDE is max slice device type
jp c,err_noslice ; no such slice, handle err
;
#endif
;

View File

@@ -928,7 +928,7 @@ SD_RESET:
SD_DEVICE:
LD D,DIODEV_SD ; D := DEVICE TYPE
LD E,(IY+SD_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01010000 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD C,%01110010 ; C := ATTRIBUTES, REMOVABLE, SD CARD
LD H,SDMODE ; H := MODE
LD L,(SD_IOBASE) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -457,13 +457,15 @@ SPD_LOW .EQU 2 ; PLATFORM CAN CHANGE SPEED, STARTS LOW
;
; SCSI COMMAND CODES (SHOULD BE IT IT'S OWN FILE)
;
SCSI_CMD_READ .EQU $08
SCSI_CMD_INQ .EQU $12
SCSI_CMD_TEST .EQU $00
SCSI_CMD_START .EQU $1B
SCSI_CMD_SENSE .EQU $03
SCSI_CMD_WRITE .EQU $0A
SCSI_CMD_RDCAP .EQU $25
SCSI_CMD_TSTRDY .EQU $00
SCSI_CMD_SENSE .EQU $03
SCSI_CMD_READ .EQU $08
SCSI_CMD_WRITE .EQU $0A
SCSI_CMD_INQ .EQU $12
SCSI_CMD_START .EQU $1B
SCSI_CMD_RDCAP .EQU $25
SCSI_CMD_READ10 .EQU $28
SCSI_CMD_WRITE10 .EQU $2A
;
#INCLUDE "build.inc" ; INCLUDE USER CONFIG, ADD VARIANT, TIMESTAMP, & ROMSIZE
;

View File

@@ -461,7 +461,7 @@ SYQ_RESET:
SYQ_DEVICE:
LD D,DIODEV_SYQ ; D := DEVICE TYPE
LD E,(IY+SYQ_DEV) ; E := PHYSICAL DEVICE NUMBER
LD C,%01000000 ; C := REMOVABLE HARD DISK
LD C,%01111001 ; C := REMOVABLE HARD DISK
LD H,(IY+SYQ_MODE) ; H := MODE
LD L,(IY+SYQ_IOBASE) ; L := BASE I/O ADDRESS
XOR A ; SIGNAL SUCCESS

View File

@@ -14,6 +14,13 @@ call BuildDisk.cmd cpm3 fd wbw_fd144 ..\cpm3\cpmldr.sys || exit /b
call BuildDisk.cmd zpm3 fd wbw_fd144 ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 fd wbw_fd144 || exit /b
call BuildDisk.cmd qpm fd wbw_fd144 d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_fd144 || exit /b
call BuildDisk.cmd aztecc hd wbw_fd144 || exit /b
call BuildDisk.cmd hitechc hd wbw_fd144 || exit /b
call BuildDisk.cmd tpascal hd wbw_fd144 || exit /b
call BuildDisk.cmd bascomp hd wbw_fd144 || exit /b
call BuildDisk.cmd fortran hd wbw_fd144 || exit /b
call BuildDisk.cmd games hd wbw_fd144 || exit /b
echo.
echo Building Hard Disk Images (512 directory entry format)...
@@ -26,6 +33,13 @@ call BuildDisk.cmd zpm3 hd wbw_hd512 ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 hd wbw_hd512 || exit /b
call BuildDisk.cmd dos65 hd wbw_hd512 ..\zsdos\zsys_wbw.sys || exit /b
call BuildDisk.cmd qpm hd wbw_hd512 d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_hd512 || exit /b
call BuildDisk.cmd aztecc hd wbw_hd512 || exit /b
call BuildDisk.cmd hitechc hd wbw_hd512 || exit /b
call BuildDisk.cmd tpascal hd wbw_hd512 || exit /b
call BuildDisk.cmd bascomp hd wbw_hd512 || exit /b
call BuildDisk.cmd fortran hd wbw_hd512 || exit /b
call BuildDisk.cmd games hd wbw_hd512 || exit /b
if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp hd wbw_hd512 || exit /b
@@ -43,6 +57,13 @@ call BuildDisk.cmd cpm3 hd wbw_hd1k ..\cpm3\cpmldr.sys || exit /b
call BuildDisk.cmd zpm3 hd wbw_hd1k ..\zpm3\zpmldr.sys || exit /b
call BuildDisk.cmd ws4 hd wbw_hd1k || exit /b
call BuildDisk.cmd qpm hd wbw_hd1k d_qpm\u0\qpm.sys || exit /b
call BuildDisk.cmd z80asm hd wbw_hd1k || exit /b
call BuildDisk.cmd aztecc hd wbw_hd1k || exit /b
call BuildDisk.cmd hitechc hd wbw_hd1k || exit /b
call BuildDisk.cmd tpascal hd wbw_hd1k || exit /b
call BuildDisk.cmd bascomp hd wbw_hd1k || exit /b
call BuildDisk.cmd fortran hd wbw_hd1k || exit /b
call BuildDisk.cmd games hd wbw_hd1k || exit /b
if exist ..\BPBIOS\bpbio-ww.rel call BuildDisk.cmd bp hd wbw_hd1k || exit /b

Binary file not shown.

View File

@@ -0,0 +1,369 @@
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


View File

@@ -0,0 +1,225 @@
TITLE BBCDIST.Z80 (C) R.T.RUSSELL 1982
;
;BBC BASIC (Z80) - CP/M VERSION 2.30 & 3.00
;(C) COPYRIGHT R.T.RUSSELL, 1982.
;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
;ALTERNATE REGISTERS SAVED FOR BDOS CALL, 04-06-2000
;
CPM EQU 5
COLD EQU 200H
;
GLOBAL CLRSCN
GLOBAL PUTCSR
GLOBAL GETCSR
GLOBAL PUTIME
GLOBAL GETIME
GLOBAL GETKEY
GLOBAL BYE
;
ASEG
ORG 100H
;
;JUMP TABLE - BASIC makes calls to hardware-dependent
;features via this table:
;
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
;
;THE CODE WHICH FOLLOWS IS A SKELETON VERSION SUITABLE
;FOR ANY CP/M SYSTEM. IT HAS BEEN CONFIGURED FOR A VT100 TO SOME DEGREE
;BY PETER SCHORN.
;
PRSTR EQU 9
;INIT - Perform hardware initialisation (if any).
;
INIT: LD A,2
INC A
LD DE,NOTZ80
JP PE,FAIL
LD C,12
CALL BDOS
OR A
LD DE,NOTV2
JP NZ,COLD
FAIL: LD C,PRSTR
CALL BDOS
RST 0
;
NOTZ80: DEFB 'Wrong processor$'
NOTV2: DEFB 'Wrong CP/M version$'
;
;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: LD DE,0
LD HL,0
RET
;
;PTIME - Load elapsed-time clock.
; Inputs: DEHL = time to load (centiseconds)
; Destroys: A,D,E,H,L,F
;
PTIME: RET
;
;CLS - Clear screen for VT100.
; Destroys: A,D,E,H,L,F
;
CLS: PUSH BC ; save BC
LD C,PRSTR ; command for output string
LD DE,CLSSTR ; start address of string
CALL BDOS ; output to terminal
POP BC ; restore BC
RET
CLSSTR: DEFB 27,'[2J$' ; VT100 string for clear screen
;
;INKEY - Sample keyboard with specified wait.
; This version uses a simple software timing loop.
; Modify to use hardware/interrupt timer if available.
; 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
LD C,6
LD E,0FFH
CALL BDOS ;CONSOLE INPUT
POP HL
POP BC
OR A
SCF
RET NZ ;KEY PRESSED
OR H
OR L
RET Z ;TIME-OUT
PUSH BC
LD A,-1
LD BC,1250 ;DELAY CONSTANT
WAIT: DEC BC
CP B
JP NZ,WAIT ;WAIT FOR APPROX 10ms
POP BC
DEC HL
JR INKEY
;
;PCSR - Move cursor to specified position.
; Inputs: DE = horizontal position (LHS=0)
; HL = vertical position (TOP=0)
; called by TAB(column, row)
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,PRSTR ; output string command
LD DE,CURS ; start of string
JR 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
;BDOS - Save the IX and IY and alternate registers
; before performing a CP/M function call.
;
BDOS: PUSH IX
PUSH IY
EXX
PUSH BC
PUSH DE
PUSH HL
EXX
EX AF,AF'
PUSH AF
EX AF,AF'
CALL CPM
EX AF,AF'
POP AF
EX AF,AF'
EXX
POP HL
POP DE
POP BC
EXX
POP IY
POP IX
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
;
IF $ GT 1F4H
ERROR 'INSUFFICIENT SPACE'
ENDIF
;
ORG 1F4H
;
DEFB 80 ;WIDTH
DEFB 'E' AND 1FH ;CURSOR UP
DEFB 'X' AND 1FH ;CURSOR DOWN
DEFB 'A' AND 1FH ;START OF LINE
DEFB 'F' AND 1FH ;END OF LINE
DEFB 'T' AND 1FH ;DELETE TO END OF LINE
DEFB 'H' AND 1FH ;BACKSPACE
DEFB 'U' AND 1FH ;CANCEL LINE
DEFB 'S' AND 1FH ;CURSOR LEFT
DEFB 'D' AND 1FH ;CURSOR RIGHT
DEFB 'G' AND 1FH ;DELETE CHARACTER
DEFB 'V' AND 1FH ;INSERT CHARACTER
;
FIN: END


View File

@@ -0,0 +1,13 @@
; patch BBCBASIC with BBCDIST
; need M80 and L80
xsub
m80 =bbcdist/z
l80 bbcdist,bbcdist/n/e
ddt bbcbasic.org
ibbcdist.com
r
g0
save 58 bbcbasic.com
era bbcdist.rel
era bbcdist.com


Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -4,20 +4,29 @@
SYSTEMS = ../CPM22/cpm_wbw.sys ../ZSDOS/zsys_wbw.sys ../CPM3/cpmldr.sys ../ZPM3/zpmldr.sys
FDIMGS = fd144_cpm22.img fd144_zsdos.img fd144_nzcom.img \
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img
fd144_cpm3.img fd144_zpm3.img fd144_ws4.img fd144_qpm.img \
fd144_z80asm.img fd144_aztecc.img fd144_hitechc.img \
fd144_bascomp.img fd144_fortran.img fd144_games.img \
fd144_tpascal.img
HD512IMGS = hd512_cpm22.img hd512_zsdos.img hd512_nzcom.img \
hd512_cpm3.img hd512_zpm3.img hd512_ws4.img
HD512XIMGS = hd512_z80asm.img hd512_aztecc.img hd512_hitechc.img \
hd512_bascomp.img hd512_fortran.img hd512_games.img \
hd512_tpascal.img hd512_dos65.img hd512_qpm.img
# HDIMGS += hd512_bp.img
HD1KIMGS = hd1k_cpm22.img hd1k_zsdos.img hd1k_nzcom.img \
hd1k_cpm3.img hd1k_zpm3.img hd1k_ws4.img
HD1KXIMGS = hd1k_z80asm.img hd1k_aztecc.img hd1k_hitechc.img \
hd1k_bascomp.img hd1k_fortran.img hd1k_games.img \
hd1k_tpascal.img hd1k_qpm.img
# HD1KIMGS += hd1k_bp.img
HD512PREFIX =
HD1KPREFIX = hd1k_prefix.dat
OBJECTS = $(FDIMGS)
OBJECTS += $(HD512IMGS) hd512_combo.img hd512_dos65.img hd512_qpm.img$(HD512PREFIX)
OBJECTS += $(HD1KIMGS) hd1k_combo.img hd1k_qpm.img $(HD1KPREFIX)
OBJECTS += $(HD512IMGS) $(HD512XIMGS) hd512_combo.img $(HD512PREFIX)
OBJECTS += $(HD1KIMGS) $(HD1KXIMGS) hd1k_combo.img $(HD1KPREFIX)
OTHERS = blank144 blankhd512 blankhd1k
@@ -61,7 +70,7 @@ blankhd512:
@echo Making Blank HD512 of size $(HD512SIZE)k
@LC_ALL=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HD512SIZE)
@hexdump $@
blankhd1k:
@echo Making Blank HD1K of size $(HD1KSIZE)k
@LC_ALL=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HD1KSIZE)
@@ -122,7 +131,7 @@ clean::
@rm -f *.ls
imgdiff:
@for i in $(FDIMGS) $(HD512IMGS) $(HD1KIMGS) ; do \
@for i in $(FDIMGS) $(HD512IMGS) $(HD512XIMGS) $(HD1KIMGS) $(HD1KXIMGS) ; do \
echo $$i ; \
if echo $$i | grep -q ^fd144_ ; then \
fmt=wbw_fd144 ; \

View File

@@ -0,0 +1,26 @@
===== Aztec C II compiler v1.06D =====
Aztec C is a discontinued programming language for a variety of platforms
including MS-DOS, Apple II DOS 3.3 and PRoDOS, Commodore 64, Macintosh and
Amiga. This disk contains the CP/M version of that compiler. A cross-compiler
for MS-DOS or Windows XP is also available.
For full documentation, see https://www.aztecmuseum.ca/
The user manual is available in the Doc directory
Aztec_C_1.06_User_Manual_Mar84.pdf
== License ==
I herewith grant you a non-exclusive conditional licence to use any and
all of my work included with this compiler for whatever use you deem fit,
provided you do not take credit for my work, and that you leave my
copyright notices intact in all of it.
I believe everything I have written to be correct. Regardless, I, Bill
Buckels, do not guarantee, or warranty, in whole or in part, any of this,
and further do not offer support for any of this. All of this is provided
as-is.
Bill Buckels
bbuckels@mts.net

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,9 @@
main()
{
char buf[80];
printf("please enter your name: ");
gets(buf);
printf("hello, %s, welcome to the growing community of Aztec C users\n", buf);
}


View File

@@ -0,0 +1,267 @@
libc.h
/* Copyright (C) 1981, 1982 by Manx Software Systems */
extern int errno;
#define FLT_FAULT 0 /* vector for floating-point faults */
extern int (*Sysvec[])();
#define NULL 0
#define EOF -1
#define BUFSIZ 1024
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
} FILE;
extern FILE Cbuffs[];
extern char *Stdbufs; /* free list of buffers */
long ftell();
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
errno.h
extern int errno;
#define ENOENT -1
#define E2BIG -2
#define EBADF -3
#define ENOMEM -4
#define EEXIST -5
#define EINVAL -6
#define ENFILE -7
#define EMFILE -8
#define ENOTTY -9
#define EACCES -10
#define ERANGE -20
#define EDOM -21
fcntl.h
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_CREAT 0x0100
#define O_TRUNC 0x0200
#define O_EXCL 0x0400
#define O_APPEND 0x0800
io.h
/* Copyright (C) 1982 by Manx Software Systems */
/*
* if MAXCHAN is changed then the initialization of chantab in croot.c
* should be adjusted so that it initializes EXACTLY MAXCHAN elements of
* the array. If this is not done, the I/O library may exhibit
* strange behavior.
*/
#define MAXCHAN 11 /* maximum number of I/O channels */
/*
* argument to device routines.
* this is a typedef to allow future redeclaration to guarantee
* enough space to store either a pointer or an integer.
*/
typedef char *_arg;
/*
* device control structure
*/
struct device {
char d_read;
char d_write;
char d_ioctl; /* used by character special devices (eg CON:) */
char d_seek; /* used by random I/O devices (eg: a file) */
int (*d_open)(); /* for special open handling */
};
/*
* device table, contains names and pointers to device entries
*/
struct devtabl {
char *d_name;
struct device *d_dev;
_arg d_arg;
};
/*
* channel table: relates fd's to devices
*/
struct channel {
char c_read;
char c_write;
char c_ioctl;
char c_seek;
int (*c_close)();
_arg c_arg;
} ;
extern struct channel chantab[MAXCHAN];
struct fcb {
char f_driv;
char f_name[8];
char f_type[3];
char f_ext;
char f_resv[2];
char f_rc;
char f_sydx[16];
char f_cr;
unsigned f_record; char f_overfl;
};
struct fcbtab {
struct fcb fcb;
char offset;
char flags;
char user;
};
#define OPNFIL 15
#define CLSFIL 16
#define DELFIL 19
#define READSQ 20
#define WRITSQ 21
#define MAKFIL 22
#define SETDMA 26
#define GETUSR 32
#define READRN 33
#define WRITRN 34
#define FILSIZ 35
#define SETREC 36
#define Wrkbuf ((char *)0x80)
math.h
double sin(), cos(), tan(), cotan();
double asin(), acos(), atan(), atan2();
double ldexp(), frexp(), modf();
double floor(), ceil();
double log(), log10(), exp(), sqrt(), pow();
double sinh(), cosh(), tanh(), fabs();
#define HUGE 5.2e+151
#define LOGHUGE 349.3
#define TINY 7.5e-155
#define LOGTINY -354.8
setjmp.h
/* Copyright (C) 1983 by Manx Software Systems */
#define JBUFSIZE (5*sizeof(int))
typedef char jmp_buf[JBUFSIZE];
sgtty.h
/* Copyright (C) 1983 by Manx Software Systems */
#define TIOCGETP 0 /* read contents of tty control structure */
#define TIOCSETP 1 /* set contents of tty control structure */
#define TIOCSETN 1 /* ditto only don't wait for output to flush */
struct sgttyb {
char sg_erase; /* ignored */
char sg_kill; /* ignored */
short sg_flags; /* control flags */
};
/* settings for flags */
#define _VALID 0x3a
#define RAW 0x20 /* no echo or mapping of input/output BDOS(6) */
#define CRMOD 0x10 /* map input CR to NL, output NL to CR LF */
#define ECHO 0x08 /* ignored unless CBREAK is set */
#define CBREAK 0x02 /* input using BDOS(1), unless echo off then */
/* same as RAW */
stdio.h
/* Copyright (C) 1982, 1984 by Manx Software Systems */
#define fgetc getc
#define fputc putc
#define NULL 0
#define EOF -1
#ifdef TINY
struct fcb {
char f_driv;
char f_name[8];
char f_type[3];
char f_ext;
char f_resv[2];
char f_rc;
char f_sydx[16];
char f_cr;
unsigned f_record; char f_overfl;
};
typedef struct {
char *_bp;
struct fcb _fcb;
char user;
} FILE;
#else
#define BUFSIZ 1024
#define MAXSTREAM 11
#define _BUSY 0x01
#define _ALLBUF 0x02
#define _DIRTY 0x04
#define _EOF 0x08
#define _IOERR 0x10
typedef struct {
char *_bp; /* current position in buffer */
char *_bend; /* last character in buffer + 1 */
char *_buff; /* address of buffer */
char _flags; /* open mode, etc. */
char _unit; /* token returned by open */
char _bytbuf; /* single byte buffer for unbuffer streams */
int _buflen; /* length of buffer */
} FILE;
extern FILE Cbuffs[];
FILE *fopen();
long ftell();
#define stdin (&Cbuffs[0])
#define stdout (&Cbuffs[1])
#define stderr (&Cbuffs[2])
#define getchar() agetc(stdin)
#define putchar(c) aputc(c, stdout)
#define feof(fp) (((fp)->_flags&_EOF)!=0)
#define ferror(fp) (((fp)->_flags&_IOERR)!=0)
#define clearerr(fp) ((fp)->_flags &= ~(_IOERR|_EOF))
#define fileno(fp) ((fp)->_unit)
#define fflush(fp) flsh_(fp,-1)
#endif
ctype.h
/* Copyright (C) 1984 by Manx Software Systems */
extern char ctp_[];
#define isalpha(x) (ctp_[(x)+1]&0x03)
#define isupper(x) (ctp_[(x)+1]&0x01)
#define islower(x) (ctp_[(x)+1]&0x02)
#define isdigit(x) (ctp_[(x)+1]&0x04)
#define isxdigit(x) (ctp_[(x)+1]&0x08)
#define isalnum(x) (ctp_[(x)+1]&0x07)
#define isspace(x) (ctp_[(x)+1]&0x10)
#define ispunct(x) (ctp_[(x)+1]&0x40)
#define iscntrl(x) (ctp_[(x)+1]&0x20)
#define isprint(x) (ctp_[(x)+1]&0xc7)
#define isgraph(x) (ctp_[(x)+1]&0x47)
#define isascii(x) (((x)&0x80)==0)
#define toascii(x) ((x)&127)
#define _tolower(x) ((x)|0x20)
#define _toupper(x) ((x)&0x5f)


Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,404 @@
r.c
/* Copyright (C) 1984 by Manx Software Systems */
#include <stdio.h>
main(argc, argv)
char **argv;
{
register int (*func)();
int (*prgload())();
if (argc < 2) {
fprintf(stderr, "usage: r progname args ...\n");
exit(4);
}
++argv;
if ((func = prgload(*argv)) == 0) {
fprintf(stderr, "Cannot load program\n");
exit(4);
}
(*func)(argc-1, argv);
}
#define OVMAGIC 0xf1
struct header {
int magic;
unsigned ovaddr;
unsigned ovsize;
unsigned ovbss;
int (*ovbgn)();
};
static int (*prgload(argv0))()
char *argv0;
{
int fd;
char *topmem, *ovend, *sbrk();
unsigned size;
struct header header;
char name[20];
strcpy(name, argv0);
strcat(name, ".ovr");
if ((fd = open(name, 0)) < 0)
return 0;
if (read(fd, &header, sizeof header) < 0)
return 0;
/* check magic number on overlay file */
if (header.magic != OVMAGIC || header.ovsize == 0)
return 0;
topmem = sbrk(0);
ovend = header.ovaddr + header.ovsize + header.ovbss;
if (topmem < ovend) {
if (sbrk(ovend - topmem) == (char *)-1)
return 0;
}
if (read(fd, header.ovaddr, header.ovsize) < header.ovsize)
return 0;
close(fd);
return header.ovbgn;
}
crbegin.asm
; Copyright (C) 1983 by Manx Software Systems
; :ts=8
public .ovbgn
extrn main_
extrn _Uorg_, _Uend_
bss saveret,2
.ovbgn:
lxi h,_Uorg_
lxi b,_Uend_-_Uorg_
mvi e,0
clrbss:
mov m,e
inx h
dcx b
mov a,c
ora b
jnz clrbss
;
pop h
shld saveret
call main_
lhld saveret ;get return addr
pchl ;return to caller
end .ovbgn
rext.asm
extrn .begin
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puterr_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml
mrext.asm
extrn .begin
extrn atof_
extrn frexp_, ldexp_, modf_
extrn ftoa_
extrn asin_
extrn acos_
extrn arcsine_
extrn atan2_
extrn atan_
extrn exp_
extrn floor_
extrn ceil_
extrn log10_
extrn log_
extrn pow_
extrn ran_
extrn randl_
extrn cos_
extrn sin_
extrn sinh_
extrn cosh_
extrn sqrt_
extrn cotan_
extrn tan_
extrn tanh_
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml
ovloader.c
/* Copyright (C) 1983, 1984 by Manx Software Systems */
#define OVMAGIC 0xf1
struct header {
int magic;
unsigned ovaddr;
unsigned ovsize;
unsigned ovbss;
int (*ovbgn)();
};
static char *ovname;
#asm
public ovloader
ovloader:
lxi h,2
dad sp
mov e,m
inx h
mov d,m
xchg
shld ovname_
;
call _ovld_
pchl
#endasm
static
_ovld()
{
int fd, flag;
auto struct header hdr;
extern char *_mbot;
auto char filename[64];
flag = 0;
strcpy(filename, ovname);
for (;;) {
strcat(filename, ".ovr");
if ((fd = open(filename, 0)) >= 0)
break;
if (flag++)
loadabort(10);
strcpy(filename, "a:");
strcat(filename, ovname);
}
if (read(fd, &hdr, sizeof hdr) != sizeof hdr)
loadabort(20);
/* check magic number on overlay file */
if (hdr.magic != OVMAGIC)
loadabort(30);
if (_mbot < hdr.ovaddr+hdr.ovsize+hdr.ovbss)
loadabort(40);
if (read(fd, hdr.ovaddr, hdr.ovsize) < hdr.ovsize)
loadabort(50);
close(fd);
return hdr.ovbgn;
}
static
loadabort(code)
{
char buffer[80];
sprintf(buffer, "Error %d loading overlay: %s$", code, ovname);
bdos(9, buffer);
exit(10);
}
ovbgn.asm
; Copyright (C) 1983, 1984 by Manx Software Systems
; :ts=8
public .ovbgn, ovexit_
extrn ovmain_
extrn _Uorg_, _Uend_
bss ovstkpt,2
bss saveret,2
bss bcsave,2
bss ixsave,2
bss iysave,2
;
.ovbgn:
lxi h,_Uorg_
lxi b,_Uend_-_Uorg_
mvi e,0
clrbss:
mov m,e
inx h
dcx b
mov a,c
ora b
jnz clrbss
;
mov h,b
mov l,c
shld bcsave
xra a
adi 3
jpe savedone
db 221
shld ixsave
db 253
shld iysave
savedone:
pop h
shld saveret
pop d
lxi h,0
dad sp
shld ovstkpt ;save stack pointer for ovexit
call ovmain_
xchg ;save return value
ovret:
lhld saveret ;get return addr
push h ;place dummy overlay name ptr on stack
push h ;place return addr on stack
xchg ;restore return value to hl
ret ;return to caller
;
ovexit_:
lhld bcsave
mov b,h
mov c,l
xra a
adi 3
jpe restdone
db 221
lhld ixsave
db 253
lhld iysave
restdone:
lxi h,2 ;get return value
dad sp
mov e,m
inx h
mov d,m
lhld ovstkpt ;restore original stack pointer
sphl
jmp ovret
end .ovbgn


Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
as rext.asm
ln -ro r.com r.o rext.o -lc
pip r.lib=r.rsm[o],rbegin.o[o]


View File

@@ -0,0 +1,73 @@
extrn .begin
extrn execv_
extrn execl_
extrn agetc_
extrn aputc_
extrn atoi_
extrn atol_
extrn calloc_
extrn Croot_
extrn fdopen_
extrn fgets_
extrn fopen_
extrn freopen_
extrn format_
extrn fprintf_
extrn fputs_
extrn fread_
extrn fscanf_
extrn fseek_
extrn ftell_
extrn fwrite_
extrn getchar_
extrn gets_
extrn getw_
extrn ioctl_
extrn isatty_
extrn lseek_
extrn realloc_
extrn malloc_
extrn free_
extrn creat_
extrn open_
extrn close_
extrn posit_
extrn printf_
extrn fclose_
extrn putchar_
extrn puterr_
extrn puts_
extrn putw_
extrn qsort_
extrn rename_
extrn scanfmt_
extrn scanf_
extrn setbuf_
extrn sprintf_
extrn sscanf_
extrn ungetc_
extrn unlink_
extrn bios_
extrn index_
extrn movmem_
extrn rindex_
extrn sbrk_
extrn rsvstk_
extrn setjmp_
extrn setmem_
extrn strcat_
extrn strncat_
extrn strcmp_
extrn strncmp_
extrn strcpy_
extrn strlen_
extrn strncpy_
extrn swapmem_
extrn toupper_
extrn tolower_
extrn getusr_
extrn setusr_
extrn rstusr_
extrn .dv,.ud
extrn .ml


Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,332 @@
croot.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983 by Manx Software Systems */
#define MAXARGS 30
static char *Argv[MAXARGS];
static char Argbuf[128];
static int Argc;
Croot()
{
register char *cp;
movmem((char *)0x81, Argbuf, 127);
Argbuf[*(char *)0x80 & 0x7f] = 0;
Argv[0] = "";
cp = Argbuf;
Argc = 1;
while (Argc < MAXARGS) {
while (*cp == ' ' || *cp == '\t')
++cp;
if (*cp == 0)
break;
Argv[Argc++] = cp;
while (*++cp)
if (*cp == ' ' || *cp == '\t') {
*cp++ = 0;
break;
}
}
main(Argc,Argv);
_exit();
}
exit(code)
{
_exit();
}
getchar()
{
register int c;
if ((c = bdos(1)) == '\r') {
bdos(2,'\n');
c = '\n';
} else if (c == 0x1a)
c = -1;
return c;
}
putchar(c)
{
if (c == '\n')
bdos(2,'\r');
bdos(2,c);
return c&255;
}
fprintf.c
/* Copyright (C) 1981,1982 by Manx Software Systems */
/* Copyright (C) 1982 Thomas Fenwick */
#include "stdio.h"
static FILE *Stream;
fprintf(stream,fmt,args)
FILE *stream; char *fmt; unsigned args;
{
int fpsub();
Stream = stream;
return format(fpsub,fmt,&args);
}
static
fpsub(c)
{
return aputc(c,Stream);
}
printf.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983 by Manx Software Systems */
printf(fmt,args)
char *fmt; unsigned args;
{
int putchar();
format(putchar,fmt,&args);
}
format(putsub, fmt, args)
register int (*putsub)(); register char *fmt; unsigned *args;
{
register int c;
char *ps;
char s[8];
static char *dconv(), *hexconv();
while ( c = *fmt++ ) {
if ( c == '%' ) {
switch ( c = *fmt++ ) {
case 'x':
ps = hexconv(*args++, s+7);
break;
case 'u':
ps = dconv(*args++, s+7);
break;
case 'd':
if ( (int)*args < 0 ) {
ps = dconv(-*args++, s+7);
*--ps = '-';
} else
ps = dconv(*args++, s+7);
break;
case 's':
ps = *args++;
break;
case 'c':
c = *args++;
default:
goto deflt;
}
while ( *ps )
(*putsub)(*ps++);
} else
deflt:
(*putsub)(c);
}
}
static char *
dconv(n, s)
register char *s; register unsigned n;
{
*s = 0;
do {
*--s = n%10 + '0';
} while ( (n /= 10) != 0 );
return s;
}
static char *
hexconv(n, s)
register char *s; register unsigned n;
{
*s = 0;
do {
*--s = "0123456789abcdef" [n&15];
} while ( (n >>= 4) != 0 );
return s;
}
fopen.c
/* Copyright (C) 1981, 1982 by Manx Software Systems */
/* Copyright (C) 1983, 1984 by Manx Software Systems */
#include "stdio.h"
#include "errno.h"
#define MAXFILE 4
#define RBUFSIZ 1024
#define WBUFSIZ 1024
#define RDNSCT (RBUFSIZ/128)
#define WRNSCT (WBUFSIZ/128)
#define OPNFIL 15
#define CLSFIL 16
#define DELFIL 19
#define READSQ 20
#define WRITSQ 21
#define MAKFIL 22
#define SETDMA 26
#define READRN 33
#define WRITRN 34
#define FILSIZ 35
#define SETREC 36
static FILE Cbuffs[MAXFILE];
static char writbuf[WBUFSIZ];
static char readbuf[RBUFSIZ];
static char *bufeof;
static FILE *curread;
static FILE *writfp;
FILE *
fopen(name,mode)
char *name,*mode;
{
register FILE *fp;
int user;
fp = Cbuffs;
while ( fp->_bp ) {
if ( ++fp >= Cbuffs+MAXFILE ) {
errno = ENFILE;
return (NULL);
}
}
if ((user = fcbinit(name,&fp->_fcb)) == -1) {
errno = EINVAL;
return NULL;
}
if (user == 255)
user = getusr();
fp->user = user;
setusr(user);
if (*mode == 'r') {
if (bdos(OPNFIL,&fp->_fcb) == 0xff) {
errno = ENOENT;
rstusr();
return NULL;
}
fp->_bp = readbuf;
curread = 0;
} else {
if ( writfp )
return NULL;
bdos(DELFIL, &fp->_fcb);
if (bdos(MAKFIL,&fp->_fcb) == 0xff) {
errno = ENOENT;
rstusr();
return NULL;
}
fp->_bp = writbuf;
writfp = fp;
}
rstusr();
fp->_fcb.f_overfl = fp->_fcb.f_record = 0;
return fp;
}
fclose(ptr)
register FILE *ptr;
{
register int err;
err = 0;
if (ptr == writfp) { /* if writing flush buffer */
err = flush(ptr->_bp - writbuf);
writfp = 0;
} else if (ptr == curread)
curread = 0;
setusr(ptr->user);
if (bdos(CLSFIL,&ptr->_fcb) == 0xff)
err = -1;
rstusr();
ptr->_bp = 0;
return err;
}
agetc(ptr)
register FILE *ptr;
{
register int c;
top:
if ((c = getc(ptr)) != EOF) {
switch (c &= 127) {
case 0x1a:
--ptr->_bp;
return EOF;
case '\r':
case 0:
goto top;
}
}
return c;
}
getc(ptr)
register FILE *ptr;
{
register int j;
if (ptr != curread) {
readit:
curread = 0; /* mark nobody as current read */
setusr(ptr->user);
if ((j = RDNSCT - blkrd(&ptr->_fcb,readbuf,RDNSCT)) == 0)
return -1;
rstusr();
ptr->_fcb.f_record -= j;
bufeof = readbuf + j*128;
curread = ptr;
}
if (ptr->_bp >= bufeof) {
ptr->_fcb.f_record += (bufeof-readbuf) >> 7;
ptr->_bp = readbuf;
goto readit;
}
return *ptr->_bp++ & 255;
}
aputc(c,ptr)
register int c; register FILE *ptr;
{
c &= 127;
if (c == '\n')
if (putc('\r',ptr) == EOF)
return EOF;
return putc(c,ptr);
}
putc(c,ptr)
int c; register FILE *ptr;
{
*ptr->_bp++ = c;
if (ptr->_bp >= writbuf+WBUFSIZ) {
if (flush(WBUFSIZ))
return EOF;
ptr->_bp = writbuf;
}
return (c&255);
}
flush(len)
register int len;
{
while (len & 127)
writbuf[len++] = 0x1a;
setusr(writfp->user);
if (len != 0 && blkwr(&writfp->_fcb,writbuf,len>>7) != 0) {
rstusr();
return EOF;
}
rstusr();
return 0;
}


View File

@@ -0,0 +1,11 @@
===== Microsoft Basic-80 Compiler v.5.30a =====
The Microsoft BASIC Compiler is a highly efficient programming tool that
converts BASIC programs from BASIC source code into machine code. This
provides much faster BASIC program execution than has previously been
possible. It can make programs run an average of 3 to 10 times faster than
programs run under BASIC-80. Compiled programs can be up to 30 times
faster than interpreted programs if maximum use of integer variables is
made.
View BASCOM.HLP included in the disk image using HELP.COM for documentation.

Binary file not shown.

View File

@@ -0,0 +1,379 @@
Introduction
Format notation
A sample session
Writing a Basic program to be compiled
Compiler-interpreter differences
New programming features
Second menu: Compiling, linking & loading, errors
:INTRODUCTION
The Microsoft BASIC Compiler is a highly efficient programming tool that
converts BASIC programs from BASIC source code into machine code. This
provides much faster BASIC program execution than has previously been
possible. It can make programs run an average of 3 to 10 times faster than
programs run under BASIC-80. Compiled programs can be up to 30 times
faster than interpreted programs if maximum use of integer variables is
made.
:FORMAT NOTATION
Wherever the format for a statement or command is given throughout this
HELP file, the following rules apply:
1. Items in capital letters must be input as shown.
2. Items in lower case letters enclosed in angle brackets ( < > )
are to be supplied by the user.
3. Items in sqare brackets ( [ ] ) are optional.
4. All punctuation except angle brackets and square brackets
(i.e., commas, parentheses, semicolons, hyphens, and equal
signs) must be included where shown.
5. Items followed by an ellipsis ( ... ) may be repeated any
number of times (up to the length of the line).
6. Items separated by a vertical bar ( \ ) are mutually exclusive;
choose one.
:SAMPLE SESSION
The following instructions will take you step by step through the compila-
tion process, from typing in the program to running the compiled version of
it.
STEP 1: PRELIMINARIES
Load BASIC-80 (NOT included in the BASCOM package) from disk. The program
will sign on and the letters
ok
will appear on the screen. Now enter:
AUTO 100, 100
This command instructs BASIC-80 to automatically generate line numbers,
beginning with line 100 and incrementing by 100 each time you press ENTER.
STEP 2: ENTER THE PROGRAM
You are now ready to begin typing in your BASIC program. Anything that you
know runs in BASIC-80 will do. Alternatively, just read in a BASIC-80
program you already use.
STEP 3: SAVE THE PROGRAM
In order for the compiler to process it, you must save your source program
in ASCII format. To do so, enter:
SAVE "MYPROG",A
There is now a BASIC program called MYPROG.BAS on your diskette that is
ready to be compiled. (A program that is not yet compiled is called the
source file.)
Return to CP/M by typing SYSTEM.
STEP 4: CHECK FOR ERRORS
At this point, it is a good idea to check the program for syntax errors.
Removing syntax errors now will reduce the possibility of having to recom-
pile later. To do this, enter:
BASCOM =MYPROG
This command loads the BASIC Compiler and compiles the source file without
producing an object or listing file. If you have made any syntax errors, a
two-letter code will appear on the screen. If this happens, return to STEP
1, use the BASIC-80 interpreter again, and correct the errors.
If no errors were encountered, you are ready to continue.
STEP 5: COMPILE SOURCE FILE
These commands instruct the BASIC Compiler to compile MYPROG.BAS, to put
the object in a file named MYPROG.REL, and to put the listing in a file
named MYPROG.LST. (.REL and .LST are default extensions supplied by the
BASIC Compiler.)
There are now a relocatable object file called MYPROG.REL and a listing
file called MYPROG.LST on the disk. The object file contains the machine-
readable code generated by the compiler. The listing file contains the
BASIC program statements along with the machine language generated by each
statement.
STEP 6: LOAD AND EXECUTE THE PROGRAM
The LINK-80 linking loader is used to produce an executable program. To use
it, enter:
L80 MYPROG,MYPROG/N/E
This command runs LINK-80, which in turn loads the object file MYPROG.REL
into the correct memory locations, then writes it to disk as a .COM file.
During this process (which can take some time), runtime routines are drawn
from the BASLIB.REL runtime library.
The compiled program which you stored on your own diskette can be run at
any time, all by itself, without using any part of the BASIC Compiler. It
works just like a standard CP/M command file. To execute, just enter:
MYPROG
The program should then work just as it did in the interpreter .. only much
faster.
:WRITING A BASIC PROGRAM TO BE COMPILED
BASIC programs which are to be compiled are, for most part, written in just
the same way you have always written them to run with the interpreter.
However, there are some differences between the statements and commands
implemented in BASIC-80 and those implemented in the BASIC Compiler that
must be taken into consideration.
The Compiler interacts with the console only to read compiler commands.
These specify what files are to be compiled. There is no "direct mode", as
with the MBASIC interpreter. Commands that are usually issued in the direct
mode with MBASIC are not implemented on the compiler. The following state-
ments and commands are not implemented and will generate an error message.
AUTO CLEAR* CLOAD CSAVE CONT
DELETE EDIT LIST LLIST RENUM
SAVE LOAD MERGE NEW COMMON*
SYSTEM
*
(Note: Newer releases of the compiler which include the BRUN runtime module
do support CHAINing with COMMON and CLEAR with certain restrictions.)
:FEATURES USED DIFFERENTLY BY THE BASIC COMPILER
DEFINT/SNG/DBL/STR
The compiler does not "execute" DEFxxx statements; it reacts to the static
occurrence of these statements, regardless of the order in which program
lines are executed. A DEFxxx statement takes effect as soon as its line is
encountered. Once the type has been defined for a given letter, it remains
in effect until the end of the program or until a different DEfxxx state
ment with that letter takes effect.
USRn Functions
USRn functions are significantly different from the interpreter versions.
The argument to the USRn function is ignored and an integer result is
returned in the HL registers. It is recommended that USRn functions be
replaced by the CALL statement. (See New BASIC Programming Features for
definition of CALL.)
DIM and ERASE
The DIM statement is similar to the DEFxxx statement in that it is scanned
rather than executed. That is, DIM takes effect when its line is encoun-
tered. If the default dimension (10) has already been established for an
array variable and that variable is later encountered in a DIM statement, a
DD (redimensioned array) error results. There is no ERASE statement in the
compiler, so arrays cannot be erased and redimensioned. An ERASE statement
will produce a fatal error.
Also note that the values of the subscripts in a DIM statement must be
integer constants; they may not be variables, arithmetic expressions, of
floating point values. For example,
DIM A1(I)
DIM A1(3+4)
are both illegal statements.
END
During execution of a compiled program, an END statement closes files and
returns control to the operating system. The compiler assumes an END at the
end of the program, so it is not necessary to insert an END statement in
order to get proper program termination.
FOR/NEXT
All FOR/NEXT loops must be statically nested with only 1 NEXT statement for
each FOR statement.
ON ERROR GOTO/RESUME <line number>
If a program contains ON ERROR GOTO and RESUME <line number> statements,
the /E compilation switch must be used. If the RESUME NEXT, RESUME, or
RESUME 0 form is used, the /X switch must also be included.
REM
REM statements or remarks starting with a single quotation mark do not make
up time or space during execution, and so may be used as freely as desired.
STOP
The STOP statement is identical to the END statement. Open files are closed
and control returns to the operating system.
TRON/TROFF
In order to use TRON/TROFF, the /D compilation switch must be used. Other-
wise, TRON and TROFF are ignored and a warning message is generated.
:NEW BASIC PROGRAMMING FEATURES
The BASIC Compiler also adds new features that will add power and
efficiency to your programming. Keep in mind when utilizing these new
features that while they will compile with no problems, you cannot run a
program using these features with your interpreter, since BASIC-80
doesn't recognize them.
CALL Statement
The CALL Statement allows you to call and transfer flow to an assembly
language or FORTRAN subroutine.
The format of the CALL Statement is:
CALL <variable name> [(<argument list>)]
where <variable name> and <ergument list> are supplied by you.
<variable name> is the name of the subroutine you wish to call. This name
must be 1 to 6 characters long and must be recognized by LINK-80 as a
global symbol. (<variable name> must be the name of the subroutine in a
FORTRAN SUBROUTINE statement or a PUBLIC symbol in an assembly language
routine.)
<argument list> is optional and contains the arguments that are passed to
the assembly language or FORTRAN subroutine.
Example: 120 CALL MYROUT (I,J,K)
CHAIN (or RUN)
The CHAIN and RUN statements both perform the same function: they allow you
to load a file from diskette into memory and run it. CHAIN (or RUN) closes
all open files and deletes the current contents of memory before loading
the designated program. The format of the CHAIN (or RUN) statement is as
follows:
CHAIN <filename>
OR
RUN <filename>
where <filename> is the name used when the file was saved. (With CP/M the
default extension .BAS is supplied.)
WHILE...WEND
The WHILE...WEND statement is a conditional statement that executes a
series of statements in a loop as long as a given condition is true.
The format of WHILE...WEND is:
WHILE <expression>
-
-
<loop statements>
-
-
WEND
where <expression> and <loop statements> are supplied by you.
As long as <expression> is true (i.e., not zero), loop statements are
executed until the WEND statement is encountered. BASIC then returns to the
WHILE statement and checks "expression". If it is still true, the process
is repeated. If it is not true, execution resumes with the statement
following the WEND statement.
WHILE/WEND loops may be nested to any level, as long as they are statically
nested. Each WEND will match the most recent WHILE. An unmatched WHILE
statement causes a "WHILE without WEND" error, and an unmatched WEND state-
ment causes a "WEND without WHILE" error.
Example:
090 'BUBBLE SORT ARRAY A$
100 FLIPS=1 'FORCE ONE PASS THRU LOOP
110 WHILE FLIPS
115 FLIPS=0
120 FOR I=1 TO J=1
130 IF A$(I)>A$(I+1) THEN
SWAP A$(I),A$(I+1):FLIPS=1
140 NEXT I
150 WEND
Double Precision Transendental Functions
SIN, COS, TAN, SQR, LOG, and EXP now return double precision results if
given double precision arguments. Exponentiation with double precision
operands will return double precision results.
Long Variable Names
Variable names may be up to 40 characters long with all 40 characters
significant. Letters, numbers, and the decimal characters are allowed in
variable names, but the name must begin with a letter. Variable names may
also include all BASIC-80 commands, statements, function names, and
operator names.
Expression Evaluation in the BASIC Compiler
During program compilation, when the BASIC Compiler evaluates expressions,
the operands of each operator are converted to the same type, that of the
most precise operand. For example,
QR=J%+A!+Q
causes J% to be converted to single precision and added to A!. This result
is coverted to single precision and added to Q.
The Compiler is more limited than the interpreter in handling numeric
overflow. For example, when run on the interpreter the following program
I%=20000
J%=20000
K%=-30000
M%=I%+J%-K%
yields 10000 for M%. That is, it adds I% to J% and, because the number is
too large, it converts the result into a floating point number. K% is then
converted to floating point nd subtracted. The result of 10000 is found,
and is converted back to integer and saved as M%.
The Compiler, however, must make type conversion decisions during compila-
tion. It cannot defer until the actual values are known. Thus, the compiler
would generate code to perform the entire operation in integer mode. If the
/D switch were set, the error would be detected. otherwise, an incorrect
answer would be produced.
In order to produce optimum efficiency in the compiled program, the
compiler may perform any number of valid algebraic transformations before
generating the code. For axample, the program
I%=20000
J%=-18000
K%=20000
M%=I%+J%+K%
could produce an incorrect result when run. If the compiler actually per-
forms the arithmetic in the order shown, no overflow occurs. However, if
the compiler performs I%+K% first and then adds J%, an overflow will occur.
The Compiler follows the rules of operator precedence and parenthetic
modification of such precedence, but no other guarantee of evaluation order
can be made.
Using Integer Variables To Optimize Speed
In order to produce the fastest and most compact object code possible, make
use of integer variables. For example, this program
FOR I=1 TO 10
A(I)=0
NEXT I
can execute approximately 30 times faster by simply substituting "I%" for
"I". It is especially advantageous to use integer variables to compute
array subscripts. The generated code is significantly faster and more
compact.
Maximum Line Length
The Compiler cannot accept a physical line that is more than 253 characters
in length. A logical statement, however, may contain as many physical lines
as desired. Use line feed to start a new physical line within a logical
statement.
::BASCOM2.HQP

a random file.
51 Internal error
An internal malfunc

View File

@@ -0,0 +1,691 @@
Compiling a program
Compilation switches
Compile-time error messages
The LINK-80 linking loader
LINK-80 error messages
Storing your program on disk
Running your compiled program
Runtime error messages
Using M80
:COMPILING A PROGRAM
Is your BASIC program now saved in ASCII format on your diskette? (To save
your program in ASCII format when using the interpreter, add an "A" switch
to the "SAVE" command, as shown in SAMPLE SESSION, Step 3:
SAVE "<filename>[.<ext>]",A
Return to CP/M command level and enter:
BASCOM
BASIC will return the prompt: "*", informing you that the BASIC
Compiler is loaded and ready to accept a command.
Now enter the command of the form:
objfile,lstfile=source file
where objfile is the relocatable object file, lstfile is the listing file,
and source file is the BASIC source program file.
A command to BASIC conveys the name of the source file to be compiled, and
the names of the file(s) to be created. With CP/M filenames are up to eight
characters long with a three-character extension. The default filename
extensions supplied to CP/M are:
REL Relocatable object file
LST Listing file
BAS BASIC source file
MAC MACRO-80 source file
FOR FORTRAN-80 source file
COB COBOL-80 source file
COM Executable command file
If you have a multi-drive system, you can tell the compiler where to obtain
or put the files you are working with by adding a drive number to each
filename. For example:
A:MYPROG.REL=B:TEST
finds the program TEST.BAS on the diskette that is in drive B, compiles it,
and puts the object in MYPROG.REL (on the diskette that is in drive A).
If a drive is NOT specified, the object and listing files are placed on the
diskette that is in the default drive.
Either the object file or the listing file or both may be omitted. An
object file is created only if the lstfile field is filled. Therefore, if
you wish to omit either, simply leave its filename out of the command.
Examples:
TESTOBJ=TEST.BAS Compile the program TEST.BAS
and put object in TESTOBJ.REL
without producing listing file.
TEST,TEST=TEST Compile TEST.BAS, put object in
TEST.REL and listing in
TEST.LST.
,=TEST.BAS Compile TEST.BAS but produce no
object or listing file. Useful
for checking for errors.
RABBIT=TEST Compile the program TEST.BAS
and put object in RABBIT.REL
without producing listing file.
:BASIC COMPILATION SWITCHES
You can specify special parameters to be used during compilation by adding
a switch to the end of the command string. Switches are always preceded by
a slash, and more than one switch may be used in the same command. An
example of the format would be:
TEST,TEST=TEST/D/X
The default switch settings used if you don't specify any switches are:
/Z/4/T
The available switches and their actions are as follows:
SWITCH ACTION
/E The /E switch tells the compiler that the program contains the ON
ERROR GOTO statement. If a RESUME statement other than RESUME
<line number> is used with the ON ERROR GOTO statement, use /X
instead (see below). To handle ON ERROR GOTO properly, in a
compiled environment, BASIC must generate some extra code for the
GOSUB and RETURN statements. Therefore, do not use this switch
unless your program contains the ON ERROR GOTO statement. The /E
switch also causes line numbers to be included in the binary
file, so runtime error messages will include the number of the
line in error.
SWITCH ACTION
/X The /X switch tells the BASIC Compiler that the program contains
one or more RESUME, RESUME NEXT, or RESUME 0 statements. The /E
switch is assumed when the /X switch is specified. To handle
RESUME statements properly in a compiled environment, the
compiler must relinquish certain optimizations. Therefore, do not
use this switch unless your program contains RESUME statements
other than RESUME <line number>. The /X switch also causes line
numbers to be included in the binary file, so runtime error
messages will include the number of the line in error.
/N The /N switch prevents listing of the generated code in symbolic
notation. If this switch is not set, the source listing produced
by the compiler will contain the object code generated by each
statement.
SWITCH ACTION
/D The /D switch causes debug/checking code to be generated at
runtime. This switch must be set if you want to use TRON/TROFF.
The BASIC Compiler generates somewhat larger and slower code in
order to perform the following checks:
1. Arithmetic overflow. All arithmetic operations, integer and
floating point, are checked for overflow and underflow.
2. Array bounds. All array references are checked to see if the
subscripts are within the bounds specified in the DIM state-
ment.
3. Line numbers are included in the generated binary so that
runtime errors can indicate the statement which contains the
error.
4. RETURN is checked for a prior GOSUB.
/Z The /Z switch tells the compiler to use Z80 opcodes.
SWITCH ACTION
/S The /S switch forces the compiler to write long quoted strings
(i.e. more than 4 characters) to the binary file as they are
encountered. This allows large programs with many quoted strings
to compile in less memory. However, there are two disadvantages:
1. Memory space is wasted if identical, long quoted strings
appear in the program.
2. Code generated while the -S switch is set cannot be placed
in ROM.
SWITCH ACTION
/4 The /4 switch allows the compiler to use the lexical conventions
of Microsoft 4.51 Disk BASIC interpreter. That is, spaces are
insignificant, variables with imbedded reserved words are
illegal, variable names are restricted to two significant
characters, etc. this feature is useful if you wish to compile a
source program that was coded without spaces, and contains lines
such as
FORI=ATOBSTEPC
Without the /4 switch, the compiler would assign the variable
"ATOBSTEPC" to the variable FORI. With the /4 switch, it would
recognize it as a FOR statement.
SWITCH ACTION
/C The /C switch tells the compiler to relax line numbering con-
straints. Whene /C is specified, line numbers may be in any
order, or they may be eliminated entirely. Lines are compiled
normally, but of course cannot be targets for GOTO's, GOSUB's,
etc. While /C is set, the underline character causes the
remainder of the physical line to be ignored, and the next
physical line is considered to be a continuation of the current
logical line. NOTE: /C and /4 may not be used together.
/T Use 4.51 execution conventions
/O (Newer versions only). Tells the compiler to construct a stand-
alone program instead of one requiring presence of the BRUN.COM
runtime module. This generates much bigger programs because all
of the runtime routines must be included.
:BASIC COMPILER ERROR MESSAGES
The following errors may occur while a program is compiling. The BASIC
Compiler outputs the two-character code for the err, along with an arrow.
The arrow indicates where in the line the error occurred. In those cases
where the compiler has read ahead before it discovered an error, the arrow
points a few characters beyond the error, or at the end of the line. The
error codes are as follows:
FATAL ERRORS
CODE ERROR
SN Syntax Error. Caused by one of the following:
Illegal argument name
Illegal assignment target
Illegal constant format
Illegal debug request
Illegal DEFxxx character specification
Illegal expression syntax
Illegal function argument list
Illegal function name
CODE ERROR
SN Syntax Error. Caused by one of the following:
Illegal function formal parameter
Illegal separator
Illegal format for statement number
Illegal subroutine syntax
Invalid character
Missing AS
Missing equal sign
Missing GOTO or GOSUB
Missing comma
Missing INPUT
Missing line number
Missing left parenthesis
Missing minus sign
Missing operand in expression
Missing right parenthesis
Missing semicolon
Name too long
Expected GOTO or GOSUB
CODE ERROR
SN Syntax Error. Caused by one of the following:
String assignment required
String expression required
String variable required here
Illegal syntax
Variable required here
Wrong number of arguments
Formal parameters must be unique
Single variable only allowed
Missing TO
Illegal FOR loop index variable
Missin THEN
Missing BASE
Illegal subroutine name
OM Out of memory
Array too big
Data memory overflow
Too many statement numbers
Program memory overflow
CODE ERROR
SQ Sequence Error
Duplicate statement number
Statement out of sequence
TM Type Mismatch
Data type conflict
Variables must be of same type
BS Bad Subscript
Illegal dimension value
Wrong number of subscripts
LL Line Too Long
UC Unrecognizable Command
Statement unrecognizable
Command not implemented
OV Math Overflow
/0 Division by Zero
DD Array Already Dimensioned
FN FOR/NEXT Error
FOR loop index variable already in use
FOR without NEXT
NEXT without FOR
CODE ERROR
FD Function Already Defined
UF Function Not Defined
WE WHILE/WEND Error
WHILE without WEND
WEND without WHILE
/E Missing "/E" Switch
/X Missing "/X" Switch
WARNING ERRORS
ND Array Not Dimensioned
SI Statement Ignored
Statement ignored
Unimplemented command
If the BASIC Compiler informs you of any of these errors, return to the
source program for debugging and try again.
If no errors were encountered during compilation, and if you so chose, you
now have an object file containing machine readable code on your diskette.
Also on your diskette is a listing file which contains the BASIC program
statements along with the machine language generated by each statement.
The next step in the process is loading and executing the program with
LINK-80.
:LINK-80 LINKING LOADER
As demonstrated in SAMPLE SESSION, compiled BASIC object files are loaded
into memory and executed using the LINK-80 linking loader. The loader has
many uses. You may wish to simply load one compiled program and run it, or
you may load several programs, subprograms, or assembly language
subroutines at the same time. Programs may be loaded at user-specified
locations, and program areas and data areas may be separated in memory. A
memory image of the executable file produced by LINK-80 can be saved on
disk and run at a later time.
RUNNING LINK-80
At CP/M command level, enter:
L80
This loads LINK-80, which will respond with: * . The loader exits back
to CP/M if a CONTROL-C is typed after the asterisk. (The loader also exits
back to CP/M after an /E switch or /G switch is executed. More on these
switches later.)
LINK-80 COMMAND FORMAT
A command to LINK-80 is made up of the filename(s) of the file(s) to be
loaded. For example, to load the compiled program MYPROG.REL, enter:
MYPROG
(It is not necessary to type the default extension .REL.) This loads the
program but does not run it. Whenever LINK-80 loads a BASIC Compiler
program, it automatically searches the BASIC library for the necessary
routines and loads these as well. Therefore, BASLIB.REL must be on the
default drive during the loading process.
To run MYPROG, enter:
/G
This is the "go" or execute switch. LINK-80 prints two numbers and a BEGIN
EXECUTION message. LINK-80 always returns to TRSDOS after a /G switch has
been executed.
As you probably have guessed, it is not necessary to perform these
operations with separate commands. It is possible to type one command line
that runs LINK-80, loads MYPROG.REL and executes it. To do this, enter:
L80 MYPROG/G
MORE COMMANDS AND SWITCHES
LINK-80 provides other capabilities besides loading and executing
programs, such as looking at output without saving the program or
resetting the loader so that you can correct a mistake. Switches are
used to inform LINK-80 that you wish to perform special tasks.
Here is an example that loads and saves a program called TEST.REL.
>L80
*TEST,TEST/N/E
The first part of the command (TEST) loads the program called TEST.REL. The
next part (TEST/N) saves a copy of the loaded program on disk in a file
called TEST.COM. The last part (/E) causes LINK-80 to exit back to CP/M.
THE /N SWITCH
Take note of the /N switch. This switch saves a memory image of the
executable file on disk. The default extension for the saved file is .COM,
and this file is called a "command file". Once saved on disk, you need only
type the filename at CP/M command level to run the program. The /N switch
must immediately follow the filename of each file you wish to save, and it
does not take effect until a /E or /G switch is done.
The following example links several object files, saves the main program
image and executes the program TAXES.REL.
>L80
*SUB1,SUB2,TAXES/N,TAXES/G
Two subroutines (SUB1) and (SUB2) and an object file (TAXES) are linked and
loaded. The program is executed and the command file TAXES.COM is saved on
disk.
THE /R SWITCH
Another handy switch is /R. It returns LINK-80 to it's initial state by
"unloading" whatever you've loaded. Use it to reset the loader if you've
made a typing mistake or loaded the wrong program. The /R switch takes
effect as soon as LINK-80 sees it, so if you enter it at any time while
LINK-80 is running, the loader will reset. For example:
>L80
*INVEN1
*/R (oops-- meant to load INVEN2)
*INVEN2 (now only INVEN2 is loaded)
SPECIAL SWITCHES
For typical BASIC Compiler operation, only the above switches will be
needed. Some users may find that their applications require more
specialized capabilities. For this reason, the following switches are also
provided with LINK-80.
In these examples, all programs have been loaded at the default origins
of CP/M. In special cases, the user may wish to specify the origins of
the programs and data that are loaded. LINK-80 provides special switches to
do this.
/E:Name This is an optional form of the /E switch. Name is a global
symbol previously defined in one of the modules. LINK-80
uses Name for the start address of the program.
/G:Name This is an optional form of the /G switch. Name is a global
symbol previously defined in one of the modules. LINK-80
uses Name for the start address of the program.
/P and /D /P and /D allow the origin(s) to be set for the next program
loaded. /P and /D take effect when seen (not deferred), and
they have no effect on programs already loaded. The form is
/P:<address> or /D:<address>, where <address> is the desired
origin in the current typeout radix. (Default radix is
hexadecimal. /O sets radix to octal; /H to hex.) LINK-80
does a default /P:<link origin> (i.e., 100h).
If no /D is given, data areas are loaded before program
areas for each module. If a /D is given, All Data and Common
areas are loaded starting at the data origin and the program
area at the program origin. Example:
*/P:200,FOO
DATA 200 300
*/R
*/P:200-D:400,FOO
DATA 400 480
PROGRAM 200 280
/U List the origin and end of the program and data area and all
undefined globals as soon as the current command line has
been interpreted. The program information is only printed if
a /D has been done. Otherwise, the program is stored in the
data area.
/M List the origin and end of the program and data area, all
undefined globals and their values, and all undefined
globals followed by an asterisk. The program information is
only printed if a /D has been done. Otherwise, the program
is stored in the data area.
/X If a filename/N was specified, /X will cause the file to be
saved in INTEL ascii HEX format with an extension of .HEX.
/Y If a filename/N was specified, /Y will create a filename.SYM
file when /E is entered. This file contains the names and
addresses of all Globals for use with Digital Research's SID
and ZSID debuggers.
SYSTEM LIBRARY SEARCHES
Whenever a BASIC Compiler program is loaded, LINK-80 automatically searches
the BASIC Compiler library for the routines it needs and loads them. If you
gat an "Undefined" error, it means the compiler couldn't find something it
needed to finish compiling the program. Usually this is the name of a
subroutine that you forgot to load.
If you are using the BASIC Compiler in conjunction with Microsoft's
FORTRAN-80, you may also be referencing some of FORTRAN's library routines.
For this reason, the /S switch is included in LINK-80 to force a search of
particular library modules. For example:
*FORLIB/S,TEST/G
Unless you are using FORLIB (supplied with FORTRAN-80), you should not need
the /S switch.
:LINK-80 ERROR MESSAGES
LINK-80 has the following error messages:
?No Start Address A /G switch was issued, but no main
program had been loaded.
?Loading Error The last file given for input was
not a properly formatted LINK-80
object file.
?Out of Memory Not enough memory to load program.
?Command Error Unrecognizable LINK-80 command.
?<file> Not Found <file>, as given in the command string,
did not exist.
%2nd COMMON larger The first definition of COMMON
block /XXXXXX/ was not the largest
definition. Reorder module loading
sequence or change COMMON block
definitions.
%Mult. Def. Global YYYYYY
More than one definition for the
global (internal) symbol YYYYYY was
encountered during the loading
process.
%Overlaying Program Area ,Start = xxxx
Data ,Public = <symbol name>(xxxx)
,External = <symbol name>(xxxx)
A /D or /P will cause already
loaded data to be destroyed.
?Intersecting Program Area
Data The program and data area intersect
and an address or external chain
entry is in this intersection. The
final value cannot be converted to
a current value since it is in the
area intersection.
?Start Symbol - <name> - Undefined
After a /E: or /G: is given, the
symbol specified was not defined.
Origin Above (Below) Loader Memory, Move Anyway (Y or N)?
After a /E or /G was given, either
the data or program area has an
origin or top which lies outside
loader memory (i.e., loader origin
to top of memory). If a Y CR is
given, LINK-80 will move the area
and continue. If anything else is
given, LINK-80 will exit. In either
case, if a /N was given, the image
will already have been saved.
?Can't save Object File A disk error occurred when the file was being
saved.
:STORING YOUR PROGRAM ON DISKETTE
Once it has been loaded by LINK-80, the object file is in a form that can
be executed by any CP/M computer. You can save this compiled program on
your own diskette so that it can be executed at a later time without using
the BASIC Compiler at all.
The /N switch (discussed in the LINK-80 section) is the switch that causes
your object file to be saved. The default extension for the saved file is
.COM and this file is called a "command file".
:RUNNING YOUR COMPILED PROGRAM
Your compiled program (previously saved on your own diskette) can now be
executed any time you wish. When you are at CP/M command level the diskette
on which you saved your program is inserted into a drive, simply enter:
<filename>
At this point, your program should execute and your output should appear on
the screen. However, you may get a runtime error message. If you do, look
it up in the following list, and debug your program as best you can before
trying to store it on diskette again.
:RUNTIME ERROR MESSAGES
The following errors may occur while a compiled program is executing. The
error numbers match those issued by the BASIC-80 interpreter. The compiler
runtime system prints long error messages followed by an address, unless
/D, /E, or /X is specified. In those cases the error message is followed by
the number of the line in which the error occurred.
NUMBER MESSAGE
2 Syntax error
A line is encountered that contains an incorrect
sequence of characters in a DATA statement.
3 RETURN without GOSUB
A RETURN statement is encountered for which there
is no previous, unmatched GOSUB ststement.
4 Out of Data
A READ statement is executed when there are no
DATA statements with unread data remaining in the
program.
NUMBER MESSAGE
5 Illegal function call
A parameter that is out of range is passed to a
math or string function. An FC error may also
occur as the result of:
1. a negative or unreasonably large subscript
2. a negative or zero argument with LOG
3. a negative argument to SQR
4. a negative mantissa with a non-integer
exponent
5. a call to a USR function for which the
starting address has not yet been given
6. an improper argument to ASC, CHR$, MID$,
LEFT$, RIGHT$, INP, OUT, WAIT, PEEK, POKE,
TAB, SPC, STRING$, SPACE$, INSTR, or
ON...GOTO
7. a string concatenation that is longer than
255 characters
NUMBER MESSAGE
6 Floating overflow or integer overflow
The result of a calculation is too large to be
represented in BASIC-80's number format. If
underflow occurs, the result is zero and execution
continues without an error.
9 Subscript out of range
An array element is referenced with a subscript
that is outside the dimensions of the array.
11 Division by zero
A division by zero is encountered in an
expression, or the operation of involution results
in zero being raised to a negative power. Machine
infinity with the sign of the numerator is
supplied as the result of the division, or
positive machine infinity is supplied as the
result of the involution, and execution continues.
14 Out of string space
String variables exceed the allocated amount of
string space.
NUMBER MESSAGE
20 RESUME without error
A RESUME statement is encountered before an error
trapping routine is entered.
21 Unprintable error
An error message is not available for the error
condition which exists. This is usually caused by
an ERROR with an undefined error code.
50 Field overflow
A FIELD statement is attempting to allocate more
bytes than were specified for the record length of
a random file.
51 Internal error
An internal malfunction has occurred in Disk
BASIC-80. Report to Microsoft the conditions under
which the message appeared.
52 Bad file number
A statement or command references a file with a
file number that is not OPEN or is out of the
range of file numbers specified at initialization.
NUMBER MESSAGE
53 File not found
A RUN, CHAIN, KILL, or OPEN statement references a
file that does not exist on the current disk.
54 Bad file mode
An attempt is made to use PUT, GET, or LOF with a
sequential or to execute an OPEN with a file mode
other than I, O, R, D.
55 File already open
A sequential output mode OPEN is issued for a file
that is already open; or a KILL is given for a
file that is open.
57 Disk I/O error
An I/O error occurred on a disk I/O operation. It
is a fatal error, i.e., theoperating system cannot
recover from the error.
58 File already exists
The filename specified is identical to a filename
already in use on the disk.
61 Disk Full
All disk storage space is in use.
NUMBER MESSAGE
62 Input past end
An INPUT statement is executed after all the data
in the file has been INPUT, or for a null (empty)
file. To avoid this error, use the EOF function to
detect the end of file.
63 Bad record number
In a PUT or GET statement, the record number is
either greater than the maximum allowed (32767) or
equal to zero.
64 Bad file name
An illegal form is used for the filename with RUN,
CHAIN, KILL, or OPEN (e.g., a filename with too
many characters).
67 Too many files
An attempt is made to create a new file (using
OPEN) when the directory is full.
::M80.HQP

d file is .COM,
and this file is called a "command file". Once saved

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,17 @@
00100 defint i-n
00200 recsiz%=32
00300 open "R",1,"B:RANTEST.ASC",recsiz%
00400 for i=1 to 20
00500 print #1, using "$$#,###.## ";1000*i,102.34*i*i
00600 put 1,i
00700 next i
00800 for i=1 to 20
00900 get 1,i
01000 line input #1, prices$
01100 print i,prices$
01200 next i
01300 close 1
01400 end
r i=1 to 20
00900 get 1,i
01000 line input #1, prices

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More