Files
RomWBW/Source/Images/d_bp/u15/ERROR2.MAC
b1ackmai1er 78f65522b7 Dev (#108)
* added hack to handle tunes

* quiet clean

* added chmod for execution

* suppress warnings

* Multi-boot fixes

* the windows build somehow thinks that these filesystems are cpm3.

* credit and primitive instructions

* Update sd.asm

Cosmetic fix.

* make compile shut up about conditionals

* Add bin2asm for linus and update build to process font files under linix

* fixed quoted double quote bug, added tests

* added tests

* added bin2asm for font file source creation

* Revert linux bin2asm font stuff

* added rule for font source generation

* build fonts

* added directory mapping cache.  if the same directory is being hit
as last run, we don't need to rebuild the map.  will likely break if
you are running more than one at a time, in that the cache will be
ineffective.  also, if the directory contents change, this will also break.

* removed strip.  breaks osx

* added directory tag so . isn't matched all over the place

* added real cache validation

* fixed build

* this file is copied from optdsk.lib or optcmd.lib

* install to ../HBIOS

* prerequisite verbosity

* diff soft failure and casefn speedup

* added lzsa

* added lzsa

* removed strip. breaks on osx

* added clobber

* added code to handle multiple platform rom builds with rom size override

* added align and 0x55 hex syntax

* default to hd64180

* added N8 capability

* added SBC_std.rom to default build

* added support for binary diff

* diff fixes

* clean, identical build.  font source generator emitted .align.  this does not match the windows build

* Upgrade NZCOM to latest

* Misc. Cleanup

* fixed expression parser bug : ~(1|2) returned 0xfe

* added diff build option

* Update Makefile

Makefile enhancement to better handle ncurses library from Bob Dunlop.

* Update sd.asm

Back out hack for uz80as now that Curt fixed it.

* Misc. Cleanup

* UNA Catchup

UNA support was lacking some of the more recent behavior changes.  This corrects most of it.

* Add github action for building RomWBW

* Bump Pre-release Version

* Update build.yml

Added "make clean" which will remove temporary files without removing final binary outputs.

* Update Makefile

Build all ROM variants by default in Linux/Mac build.

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update Makefile

* Update for GitHub Build

Case issue in TASM includes showing up in GitHub build.  This should correct that.

* Added an gitignore files to exclude generated files

* Removed Tunes/clean.cmd and Tunes/ReadMe.txt - as make clean removes them

* Build.sh: marked as executable

chmod +x Build.sh

* Fix to HBIOS/build.sh

When adding files to rom disk, if files were missing, it would error out.

It appears the intent is to skip non-existing files.

Updated to log out correctly for missing files - and continue operation.

* Update Microsoft NASCOM BASIC.docx

Nascom manual, text version by Jan S (full name unknown)

* Fix issue with Apps/Tune not making

If dest directory does not exist, fails to make Apps

* Create ReadMe.txt

* Update Makefile

* Update Build.sh

* Make .gitignores for Tools/unix more specific

* cpmtools Update

Updated cpmtools applications (Windows only).  Removed hack in diskdefs that is no longer required.

* HBIOS Proxy Temp Stack Enhancement

Reuse the bounce buffer area as the temporary stack space required briefly in HBX_INVOKE when transitioning banks.  Increases size of temporary stack space to 64 bytes.

* Update ReadMe.txt

* HBIOS - clean up TMPSTK

* Update hbios.asm

Minor cosmetic changes.

* Build Process Updates

Minor udpates to build process to improve consistency between Windows and Mac/Linux builds.

* Update hbios.asm

Add improved interrupt protection to HBIOS PEEK, POKE, and BNKCPY functions.

* hbios - wrap hbx_bnkcpy

* hbios - adjust hbx_peek hbx_poke guards

* Update hbios.asm

Adjusted used of DI/EI for PEEK and POKE to regain a bit of INTSTK space.  Added code so that HB_INVBNK can be used as a flag indicating if HBIOS is active, $FF is inactive, anything else means active.

* Add HBIOS MuTex

* Initial Nascom basic ecb-vdu graphics

set and reset for 80x25b screen with 256 character mod

* Finalize Pre-release 34

Final support for FreeRTOS

* Update nascom.asm

Optimization, cleanup, tabs and white spaces

* IDE & PPIDE Cleanup

* Clean up

Make version include files common.

* Update Makefile

* Update Makefile

* Build Test

* Build Test

* Build Fixes

* Update nascom.asm

Cleanup

* Update nascom.asm

Optimization

* hbios - temp stack tweak

* Update hbios.asm

Comments on HBX_BUF usage.

* Update nascom.asm

Optimization

* Update nascom.asm

Setup ECB-VDU build option, remove debug code

* Update nascom.asm

Set default build. update initialization

* Update nascom.asm

Make CLS clear vdu screen

* Update nascom.asm

Fixup top screen line not showing

* Add SC131 Support

Also cleaned up some ReadMe files.

* HBIOS SCZ180 - remove mutex special files

* HBIOS SCZ180 - adjust mutex comment

* Misc. Cleanup

Includes some minor improvements to contents in some disk images.

* Delete FAT.COM

Changing case of FAT.COM extension to lowercase.

* Create FAT.com

Completing change of case in extension of FAT.com.

* Update Makefile

Remove ROM variants that just have the HBIOS MUTEX enabled.  Users can easily enable this in a custom build.

* Cleanup

Removed hack from Images Makefile.  Fixed use of DEFSERCFG in various places.

* GitHub CI Updates

Adds automation of build and release assets upon release.

* Prerelease 36

General cleanup

* Build Script Cleanups

* Config File Cleanups

* Update RomWBW Architecture

General refresh for v2.9.2

* Update vdu.asm

Removed a hack in VDU driver that has existed for 8 years.  :-)

* Fix CONSOLE Constant

Rename CIODEV_CONSOLE constant to CIO_CONSOLE because it is a unit code, not a device type code.

Retabify TastyBasic.

* Minor Bug Fixes

- Disk assignment edge case
- CP/M 3 accidental fall thru
- Cosmetic updates

* Update util.z80

* Documentation Cleanup

* Documentation Update

* Documentation Update

* Documentation Updates

* Documentation Updates

* Create Common.inc

* Documentation Updates

* Documentation Updates

* doc - a few random fixes

* Documentation Cleanup

* Fix IM 0 Build Error in ACIA

* Documentation Updates

* Documentation Cleanup

* Remove OSLDR

The OSLDR application was badly broken and almost impossible to fix with new expanded OS support.

* Bug Fixes

- Init RAM disk at boot under CP/M 3
- Fix ACR activation in TUNE

* FD Motor Timeout

- Made FDC motor timeout smaller and more consistent across different speed CPUs
- Added "boot" messaging to RTC

* Cleanup

* Cleanup

- Fix SuperZAP to work under NZCOM and ZPM3
- Finalize standard config files

* Minor Changes

- Slight change to ZAP configuration
- Added ZSDOS.ZRL to NZCOM image

* ZDE Upgrade

- Upgraded ZDE 1.6 -> 1.6a

* Config File Tuning

* Pre-release for Testing

* cfg - mutex consistent config language

* Bump to Version 3.0

* Update SD Card How-To

Thanks David!

* update ReadMe.md

Remove some odd `\`.

* Update ReadMe.txt

* Update ReadMe.md

* Update Generated Doc Files

* Improve XModem Startup

- Extended startup timeout for XM.COM so that it doesn't timeout so quickly while host is selecing a file to send.
- Updated SD Card How-To from David Reese.

* XModem Timing Refinements

* TMS Driver Z180 Improvements

- TMS driver udpated to insert Z180 I/O waitstates internally so other code can run at full speed.
- Updated How-To documents from David.
- Fixed TUNE app to properly restore Z180 I/O waitstates after manipulating them.

* CLRDIR and ZDE updates

- CLRDIR has been updated by Max Scane for CP/M 3 compatibility.
- A minor issue in the preconfigured ZDE VT100 terminal escape sequences was corrected.

* Fix Auto CRT Console Switch on CP/M 3

* Handle lack of RTC better

DSRTC driver now correctly returns an error if there is no RTC present.

* Minor RTC Updates

* Finalize v3.0.1

Cleanup release for v3.0

* New ROMLDR and INTRTC driver

- Refactored romldr.asm
- Added new periodic timer based RTC driver

* CP/M 3 Date Hack

- Hack to allow INTRTC to increment time without destroying the date

* Update romldr.asm

Work around minor Linux build inconsistency

* Update Apps for New Version

* Revert "Update Apps for New Version"

This reverts commit ad80432252.

* Revert "Update romldr.asm"

This reverts commit 4a9825cd57.

* Revert "CP/M 3 Date Hack"

This reverts commit 153b494e61.

* Revert "New ROMLDR and INTRTC driver"

This reverts commit d9bed4563e.

* Start v3.1 Development

* Update FDISK80.COM

Updated FDISK80 to allow reserving up to 256 slices.

* Update sd.asm

For Z180 CSIO, ensure that xmit is finished, before asserting CS for next transaction.

* Add RC2014 UART, Improve SD protocol fix

- RC2014 and related platforms will autodetect a UART at 0xA0 and 0xA8
- Ensure that CS fully brackets all SD I/O

* ROMLDR Improvements

.com files can now be started from CP/M and size of .com files has been reduced so they always fit.

* Update commit.yml

Run commit build in all branches

* Update commit.yml

Run commit build for master and dev branches

* Improved clock driver auto-detect/fallback

* SIO driver now CTC aware

The SIO driver can now use a CTC (if available) to provide much more flexible baud rate programming.

* CTC driver fine tuning

* Update xmdm125.asm

Fixed a small issue in core XM125 code that caused a file write error message to not be displayed when it should be.

* CF Card compatibility improvement

Older CF Cards did not reset IDE registers to defaults values when reset.  Implemented a work around.

* Update ACIA detection

ACIA should no longer be detected if there is also a UART module in the system.

* Handle CTC anomaly

Small update to accommodate CTC behavior that occurs when the CTC trigger is more than half the CTC clock.

* Update acia.asm

Updated ACIA detection to use primary ACIA port instead of phantom port.

* Update acia.asm

Fix bug in ACIA detection.

Thanks Alan!

* MacOS Build Improvement

Build script updated to improve compatibility with MacOS.

Credit to Fredrik Axtelius for this.

* HBIOS Makefile - use env vars for target

Allow build ROM targets to be restricted to just one platform thru use of ENV vars:

ROM_PLATFORM - if defined to a known platform, only this platform is build - defaults to std config
ROM_CONFIG - sets the desired platform config - defaults to std

if the above ENVs are not defined, builds all ROMs

* Added some more gitignores

* Whitespace changes (crlf)

* HBIOS: Force the assembly to fail for vdu drivers if function table count is not correct

* Whitespace: trailing whitespaces

* makefile: updated some make scripts to use  when calling subdir makefiles

* linux build: update to Build.sh fix for some platforms

The initialization of the Rom dat file used the pipe (|) operator to build an initial empty file.

But the pipe operator | may sometimes return a non-zero exit code for some linux platforms, if the
the streams are closed before dd has fully processed the stream.

This issue occured on a travis linux ubuntu image.

Solution was to change to redirection.

* Bump version

* Enhance CTC periodic timer

Add ability to use TIMER mode in CTC driver to generate priodic interrupts.

* HBIOS: Added support for sound drivers

New sound driver support with initial support for the SN76489 chip

New build configuration entry:
* SN76489ENABLE

Ports are currently locked in with:
* SN76489_PORT_LEFT       .EQU    $FC     ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT)
* SN76489_PORT_RIGHT      .EQU    $F8     ; PORTS FOR ACCESSING THE SN76489 CHIP (LEFT)

* Miscellaneous Cleanup

No functional changes.

Co-authored-by: curt mayer <curt@zen-room.org>
Co-authored-by: Wayne Warthen <wwarthen@gmail.com>
Co-authored-by: ed <linux@maidavale.org>
Co-authored-by: Dean Netherton <dnetherton@dius.com.au>
Co-authored-by: ed <ed@maidavale.org>
Co-authored-by: Phillip Stevens <phillip.stevens@gmail.com>
Co-authored-by: Dean Netherton <dean.netherton@gmail.com>
2020-04-24 06:17:22 +08:00

368 lines
8.3 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
;
; Program: ERROR2
; Author: Richard Conn
; Version: 1.0
; Date: 5 Mar 84
;
version equ 10
;
; This error handler displays the error line to the user and
; provides him with four options as to how to process this line:
; 1. Replace the command in error with a new command
; 2. Skip the command in error and resume execution
; with the next command
; 3. Replace the command line as it now stands
; 4. Throw away the command line and resume user
; control
;
; Unlike ERROR1, ERROR2 is screen-oriented, using the Z3TCAP
; for support.
;
; This program is transportable from one ZCPR3 system to another
; provided it is reassembled with the correct address for the ZCPR3
; Environment Descriptor (Z3ENV) or DDT is used to patch this address
; (which is the first two bytes after the opening JMP). If an external
; ZCPR3 Environment Descriptor is not available, one will have to be
; provided by setting the Z3ENV equate to 0 and providing SYSENV.LIB in
; the current directory at assembly time.
;
;
; Equates for Key Values
;
z3env SET 0f400h ;address of ZCPR3 environment
cmtch equ ';' ;comment character
cr equ 0dh
lf equ 0ah
;
; External Z3LIB and SYSLIB Routines
;
ext z3vinit
ext print,pstr,codend,capine,bbline,crlf,moveb
ext erradr,puter1,puterc ;Error Handler Routines
ext qprint ;Quiet Mode Prints
ext getenv,getefcb,getcl1,qerror ;Z3 Messages et al
ext at,cls,stndout,stndend,gotoxy,vprint,gxymsg ;VLIB Routines
;
; Environment Definition
;
if z3env ne 0
;
; External ZCPR3 Environment Descriptor
;
jmp start
db 'Z3ENV' ;This is a ZCPR3 Utility
db 1 ;External Environment Descriptor
z3eadr:
dw z3env
start:
lhld z3eadr ;pt to ZCPR3 environment
;
else
;
; Internal ZCPR3 Environment Descriptor
;
MACLIB Z3BASE.LIB
MACLIB SYSENV.LIB
z3eadr:
jmp start
SYSENV
start:
lxi h,z3eadr ;pt to ZCPR3 environment
endif
;
; Start of Program -- Initialize ZCPR3 Environment
;
call z3vinit ;initialize the ZCPR3 Environment
;
; Print Banner
;
call qprint
db 'ERROR2, Version '
db (version/10)+'0','.',(version mod 10)+'0'
db cr,lf,0
;
; Determine if Program Invoked as an Error Handler or By the User
;
call qerror ;error?
jz handler ;handle error
;
; Invoked by the User, so Install as an Error Handler
;
call getenv ;must have a Z3TCAP entry
lxi d,80h ;pt to Z3TCAP
dad d
mov a,m ;must not be space or less
cpi ' '+1
jnc start0
call print
db cr,lf,' No Z3TCAP - Aborting',0
ret
;
; Determine Name of Routine
;
start0:
call getefcb ;pt to external FCB
jz start1 ;proceed if external FCB not available
;
; Make Name Invoked by User the Name of the Error Handler
;
inx h ;pt to first char
lxi d,ername ;pt to name of error handler message
mvi b,8 ;at most 8 bytes
call moveb ;copy into buffer
;
; Make Command Line in Buffer the Error Handler
;
start1:
lxi h,ername ;make name in buffer the error handler
call puterc ;set command
mvi a,0ffh ;set error code
call puter1 ;set message
call print
db ' Error Handler Installed',0
ret
;
; Handle Error
;
handler:
call erradr ;get address of error line
xchg ;HL pts to free area, DE pts to error line
call codend ;get ptr to free area
shld badcmd ;save ptr to bad command
;
; Extract Bad Command and Store It in Memory Starting at BADCMD
; DE pts to bad command, HL pts to location to store it at
;
savebad:
ldax d ;get next char
mov m,a ;put it
ora a ;done?
jz sbad1
cpi cmtch ;check for comment
jz sbad1
inx h ;pt to next
inx d
jmp savebad
;
; Set ending 0 in bad command buffer and check for continuation
;
sbad1:
mvi m,0 ;store ending zero
inx h ;pt to next
cpi cmtch ;more?
jnz sbad2
inx d ;pt to rest of command
sbad2:
shld restcmd ;save rest of command line
;
; Extract Rest of Command Line and Store It in Memory Starting at RESTCMD
;
saverest:
ldax d ;get next
mov m,a ;put it
inx h ;pt to next
inx d
ora a ;done?
jnz saverest
shld scratch ;save ptr to scratch area
;
; Prompt User for Action
;
prompt:
call cls ;clear screen
call gxymsg
db 3,22
db '>>>> ',1,'VIDEO ERROR HANDLER',2,' <<<<',0
call gxymsg
db 5,28
db '-- Error Line --',0
call at
db 6,10
call stndout ;reverse video
call erradr ;get address of error line
call pstr
call stndend ;normal video
mvi h,10 ;position cursor
mvi l,15
shld infoxy
call gxymsg
db 8,30
db '-- Options --',0
call atinfo
call vprint
db '1. Replace Command in Error with a New Command',0
call atinfo
call vprint
db ' Replace ',1,0
lhld badcmd
call pstr
call atinfo
call atinfo
call vprint
db 2,'2. Advance to Next Command and Resume Processing',0
call atinfo
call vprint
db ' Advance to ',1,0
lhld restcmd
call pstr
call atinfo
call atinfo
call vprint
db 2,'3. Replace Entire Line with a New Line',0
call atinfo
call vprint
db ' Replace ',1,0
call erradr ;pt to error line
call pstr
call atinfo
call atinfo
call vprint
db 2,'4. Throw Away Entire Line and Continue',0
call atinfo
call vprint
db ' Throw Away ',1,0
call erradr ;pt to error line
call pstr
call stndend
userin:
call gxymsg
db 22,20
db 'Select Option - ',0
call capine
cpi '1' ;option 1
jz replace ;replace command in error
cpi '2' ;option 2
jz advance ;advance to next command
cpi '3' ;option 3
jz newline ;enter new line
cpi '4' ;option 4
jz flush ;throw away line
call print
db 8,' Invalid Option - Retry',0 ;backspace over error
jmp userin
;
; Position at INFOXY and advance ptr to next line
;
atinfo:
lhld infoxy ;pt to next position
call gotoxy ;go there
inr h ;next line
shld infoxy
ret
;
; Replace Command in Error
;
replace:
call print
db ' Replacement Command?',cr,lf,' ',0
lhld restcmd ;pt to rest of command line in DE
xchg
mvi a,0ffh ;capitalize
call bbline ;get line from user
call build ;build and run command
jmp prompt ;continue if error
;
; Advance to Rest of Command Line
;
advance:
lhld restcmd ;pt to it
xchg
lxi h,empty ;HL pts to empty command, DE pts to tail
call build ;build and run command
jmp prompt ;continue if error
;
; Enter New Line
;
newline:
call print
db ' New Command?',cr,lf,' ',0
mvi a,0ffh ;capitalize
call bbline ;get line from user
lxi d,empty ;HL pts to user command, DE pts to empty command
call build ;build and run command
jmp prompt ;continue if error
;
; Flush Commands
;
flush:
ret ;simply exit if no more commands
;
; Build New Command Line in SCRATCH Area and Run it by returning to ZCPR3
; On input, HL pts to header, DE pts to tail
;
build:
lxi b,1 ;set char count (1 for ending zero)
push d ;save ptr to tail
push h ;save ptr to header
lhld scratch ;pt to scratch area
pop d ;get ptr to header
ldax d ;get first char
ora a ;any there?
cnz copy ;copy line into buffer
pop d ;get ptr to tail
ldax d ;anything there?
ora a
jz bldt ;terminate build if not
mvi m,cmtch ;begin with semicolon
inx h ;pt to next
call copy
bldt:
mvi m,0 ;store ending zero
;
; Store Command Line into MCL Buffer
;
call getcl1 ;pt to command line
cmp c ;check for char count within range
rc
mov a,b ;check for line too long
ora a ;line too long?
rnz ;error if so
lxi d,4 ;pt to first char
push h ;save ptr to current
dad d
pop d ;get ptr to current
xchg ;DE pts to first char position, HL pts to CL buffer
mov m,e ;set address to resume processing
inx h
mov m,d
lhld scratch ;pt to new line
xchg ;in DE, while HL pts to first char position
call copy ;copy it
mov m,a ;store ending zero
pop d ;clear stack
ret ;resume processing
;
; Copy string pted to by DE into buffer pted to by HL
;
copy:
ldax d ;get next char
ora a ;done?
rz
mov m,a ;store it
inx b ;increment count
inx h ;pt to next
inx d
jmp copy
;
; Buffers
;
ername:
db 'ERROR2 ',0 ;name of error handler
empty:
db 0 ;empty command line
infoxy:
ds 2 ;xy-coordinate for display
badcmd:
ds 2 ;ptr to bad command extracted
restcmd:
ds 2 ;ptr to tail of bad command line
scratch:
ds 2 ;ptr to scratch area used to build new lines
end