Browse Source

Merge pull request #81 from wwarthen/master

Resync
pull/84/head
b1ackmai1er 6 years ago
committed by GitHub
parent
commit
26a24be24e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      Binary/Apps/Makefile
  2. 6
      Binary/Apps/Tunes/Makefile
  3. 1
      Doc/ChangeLog.txt
  4. 2
      ReadMe.txt
  5. 52
      Readme.unix
  6. 4
      Source/Apps/FDU/FDU.asm
  7. 15
      Source/Apps/OSLdr.asm
  8. 4
      Source/Apps/Tune/Makefile
  9. 9
      Source/Apps/Tune/Tunes/Makefile
  10. 2
      Source/BPBIOS/Makefile
  11. 93
      Source/CBIOS/cbios.asm
  12. 2
      Source/CBIOS/ver.inc
  13. 2
      Source/CPM22/ver.inc
  14. 6
      Source/CPM3/Makefile
  15. 25
      Source/CPM3/biosldr.z80
  16. 131
      Source/CPM3/boot.z80
  17. 30
      Source/CPM3/diskio.z80
  18. 2
      Source/CPM3/ver.inc
  19. 70
      Source/HBIOS/Build.sh
  20. 17
      Source/HBIOS/Makefile
  21. 4
      Source/HBIOS/hbios.asm
  22. 2
      Source/HBIOS/nascom.asm
  23. 2
      Source/HBIOS/sd.asm
  24. 2
      Source/HBIOS/ver.inc
  25. 40
      Source/Images/Makefile
  26. 6
      Source/Images/diskdefs
  27. 6
      Source/Makefile
  28. 9
      Source/ZPM3/Makefile
  29. 2
      Source/ZSDOS/ver.inc
  30. 15
      Tools/Makefile.inc
  31. 1
      Tools/unix/bst/Makefile
  32. 8
      Tools/unix/casefn.sh
  33. 7
      Tools/unix/cpmtools/Makefile
  34. 2
      Tools/unix/cpmtools/config.h
  35. 29
      Tools/unix/cpmtools/cpmfs.c
  36. 2
      Tools/unix/uz80as/pp.c
  37. 49
      Tools/unix/uz80as/uz80as.c

6
Binary/Apps/Makefile

@ -1,7 +1,9 @@
TOOLS = ../../Tools
SUBDIRS = Tunes
include $(TOOLS)/Makefile.inc
all::
mkdir -p Tunes
clean::
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN
rm -f *.bin *.com *.img *.rom *.pdf *.log *.eeprom *.COM *.BIN Tunes/*

6
Binary/Apps/Tunes/Makefile

@ -1,6 +0,0 @@
TOOLS = ../../../Tools
include $(TOOLS)/Makefile.inc
clean::
rm -f *.pt? *.mym

1
Doc/ChangeLog.txt

@ -49,6 +49,7 @@ Version 2.9.2
- PMS: Added "user" rom module template
- PMS: Added CP/M 3 manuals
- WBW: Boot from any slice
- C?M: Added Unix build process
Version 2.9.1
-------------

2
ReadMe.txt

@ -7,7 +7,7 @@
***********************************************************************
Wayne Warthen (wwarthen@gmail.com)
Version 2.9.2-pre.31, 2020-02-18
Version 2.9.2-pre.32, 2020-02-20
https://www.retrobrewcomputers.org/
RomWBW is a ROM-based implementation of CP/M-80 2.2 and Z-System for

52
Readme.unix

@ -1,7 +1,49 @@
prerequisites:
this tree now contains makefiles and tools to build on Linux and MacosX
Linux is rather more thoroughly tested compared to os-x.
gcc
yacc
make
g++
to get here, TASM and the propeller generation tools needed to be replaced,
and since the unix filesystem is usually case-sensitive, and CP/M and windows
are not, the cpm tools were made case-insensitive.
TASM was replaced with uz80as, which implements a subset of TASM and fixes some
bugs. however, I needed to add some functionality to make it build the sources
as they exist in this tree. in particular, one thing to be very careful of is
that TASM is not entirely consistent with respect to the .DS directive.
it's usually a bad idea to mix .DS, .FILL, .DB with .ORG.
.DS n is best thought of as .ORG $ + n
.ORG changes the memory pointer, but does not change the file output point.
it works a lot more like M80, SLR* .phase
it assumes that you have some standard system tools and libraries installed
specifically: gcc, gnu make, libncurses
to build:
cd to the top directory and type make.
heavy use is made of make's include facility and pattern rules.
the master rule set is in Tools/Makefile.inc. changes here will affect
almost every Makefile, and where exceptions are needed, the overrides are
applied in the lower Makefiles.
these tools can run a windows-linux regression test, where all the binaries are
compared to a baseline windows build.
Credit:
uz80as was written by Jorge Giner Cordero, jorge.giner@hotmail.com,
and the original source can be found at https://github.com/jorgicor/uz80as
the propeller tools use bstc and openspin, parallax tools from
http://www.fnarfbargle.com/bst.html https://github.com/parallaxinc/OpenSpin
note that bst is not open source or even currently maintained, so I could
not generate a version for 64 bit osx.
cpmtools were the most current I could find, and it has been hacked to do
case-insensitivity. these are not marked, and are not extensive.
zx is from distributed version, and also has local hacks for case insensitivity.
both zx and cpmtools ship with an overly complicated makefile generation system
and this is ignored.
this whole linux build framework is the work of Curt Mayer, curt@zen-room.org.
use it for whatever you like; this is not my day job.

4
Source/Apps/FDU/FDU.asm

@ -2168,7 +2168,7 @@ FSST_COUNT .EQU (($ - FSST) / FSST_ENTSIZ) ; # ENTRIES IN TABLE
;
FCP_CMD .DB 000H ; INPUT: COMMAND CODE
FCP_BUFLEN .DB 00H
FCP_BUF .DS 10H
FCP_BUF .FILL 10H
FCP_BUFSIZ .EQU $-FCP_BUF
FCP_XFRCNT .DW 00H ; BYTES TRANSFERRED DURING COMMAND PHASE
;
@ -2182,7 +2182,7 @@ FXP_BC .DW 00H ; LAST VALUE OF REG BC RECORDED DURING EXECUTION
FXP_DE .DW 00H ; LAST VALUE OF REG DE RECORDED DURING EXECUTION
FXP_HL .DW 00H ; LAST VALUE OF REG HL RECORDED DURING EXECUTION
FXP_BUFLEN .DB 00H
FXP_BUF .DS 50H ; USED FOR CERTAIN EXEC ROUTINES (FORMAT TRACK)
FXP_BUF .FILL 50H ; USED FOR CERTAIN EXEC ROUTINES (FORMAT TRACK)
FXP_BUFSIZ .EQU $-FXP_BUF
;
; FDC STATUS

15
Source/Apps/OSLdr.asm

@ -58,6 +58,9 @@
; could occur if the BIOS image does not conform to the
; expected structure (size, meta data location, entry point
; location, etc.)
; 3) Hardware platform has been removed from the bootloader, so the
; platform check has been removed for OS loading. This is fine
; unless you attempt to switch between UNA and RomWBW.
;_______________________________________________________________________________
;
;===============================================================================
@ -476,11 +479,11 @@ chkos:
; check for signature
; Already verified in chkhdr
; compare platform id
ld a,(bioplt) ; get current HBIOS platform ID
ld hl,osplt ; point to OS image platform ID
cp (hl) ; compare
jp nz,errplt ; if not equal platform error
;; compare platform id
;ld a,(bioplt) ; get current HBIOS platform ID
;ld hl,osplt ; point to OS image platform ID
;cp (hl) ; compare
;jp nz,errplt ; if not equal platform error
; bypass version check if UNA running
ld a,(unamod) ; get UNA mode flag
@ -991,7 +994,7 @@ bufptr .dw 0 ; active pointer into buffer
;
; Messages
;
msgban .db "OSLDR v1.1 for RomWBW, 16-Jan-2018",0
msgban .db "OSLDR v1.2 for RomWBW, 20-Feb-2020",0
msghb .db " (HBIOS Mode)",0
msgub .db " (UBIOS Mode)",0
msguse .db "Usage: OSLDR [/F] <osimg> [<hbiosimg>]\r\n"

4
Source/Apps/Tune/Makefile

@ -1,4 +1,3 @@
SUBDIRS = Tunes
OBJECTS = Tune.com
DEST = ../../../Binary/Apps
TOOLS = ../../../Tools
@ -7,3 +6,6 @@ include $(TOOLS)/Makefile.inc
Tune.com: Tune.asm
$(TASM) Tune.asm Tune.com
all::
cp Tunes/* $(DEST)/Tunes

9
Source/Apps/Tune/Tunes/Makefile

@ -1,9 +0,0 @@
OBJECTS = *.pt3 *.mym
NODELETE = $(OBJECTS)
DEST = ../../../../Binary/Apps/Tunes
TOOLS = ../../../../Tools
include $(TOOLS)/Makefile.inc
clobber::
-rm -f $(DEST)/*.pt3 $(DEST)/*.mym

2
Source/BPBIOS/Makefile

@ -31,7 +31,7 @@ zcpr33n.rel zcpr33t.rel:
all:: $(HD0IMG)
clobber::
rm -f $(HD0IMG)
@rm -f $(HD0IMG)
%.img: zcpr33n.rel zcpr33t.rel
$(eval VER := $(subst .img,,$(subst bp,,$@)))

93
Source/CBIOS/cbios.asm

@ -1886,10 +1886,6 @@ INIT:
LD A,DEF_IOBYTE ; LOAD DEFAULT IOBYTE
LD (IOBYTE),A ; STORE IT
; INIT DEFAULT DRIVE TO A: FOR NOW
XOR A ; ZERO
LD (DEFDRIVE),A ; STORE IT
; CBIOS BANNER
CALL NEWLINE2 ; FORMATTING
LD DE,STR_BANNER ; POINT TO BANNER
@ -1998,23 +1994,49 @@ AUTOSUB:
;
; SETUP AUTO SUBMIT COMMAND (IF REQUIRED FILES EXIST)
LD A,(DEFDRIVE) ; GET DEFAULT DRIVE
;CALL PRTHEXBYTE
PUSH AF
INC A ; CONVERT FROM DRIVE NUM TO FCB DRIVE CODE
LD (FCB_SUB),A ; SET DRIVE OF SUBMIT.COM FCB
LD (FCB_PRO),A ; SET DRIVE OF PROFILE.SUB FCB
;
LD C,13 ; RESET DISK SYSTEM
CALL BDOS
;CALL PC_PERIOD
POP AF
;
;DEC A ; BACK TO ZERO INDEX
;LD E,A ; PUT IN E
;LD C,14 ; SELECT DISK FUNCTION
;CALL BDOS ; DO IT
;CALL PC_PERIOD
;
LD C,17 ; BDOS FUNCTION: FIND FIRST
LD DE,FCB_SUB ; CHECK FOR SUBMIT.COM
CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE
;CALL PRTHEXBYTE
INC A ; CHECK FOR ERR, $FF --> $00
RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT
;
LD C,17 ; BDOS FUNCTION: FIND FIRST
LD DE,FCB_PRO ; CHECK FOR PROFILE.SUB
CALL BDOS ; INVOKE BDOS TO LOOK FOR FILE
;CALL PRTHEXBYTE
INC A ; CHECK FOR ERR, $FF --> $00
RET Z ; ERR, DO NOT ATTEMPT AUTO SUBMIT
;
LD HL,CMD ; ADDRESS OF STARTUP COMMANDs
LD HL,CMD ; ADDRESS OF STARTUP COMMANDS
LD DE,CCP_LOC + 7 ; START OF COMMAND BUFFER IN CCP
LD BC,CMDLEN ; LENGTH OF AUTOSTART COMMAND
LDIR ; PATCH COMMAND LINE INTO CCP
@ -2273,6 +2295,9 @@ CLRRAM3:
#IFDEF PLTUNA
;
DRV_INIT:
; INIT DEFAULT DRIVE TO A: FOR NOW
XOR A ; ZERO
LD (DEFDRIVE),A ; STORE IT
;
; PERFORM UBIOS SPECIFIC INITIALIZATION
; BUILD DRVMAP BASED ON AVAILABLE UBIOS DISK DEVICE LIST
@ -2391,6 +2416,14 @@ DRV_INIT:
; GET BOOT UNIT/SLICE INFO
LD DE,(HCB + HCB_BOOTVOL) ; BOOT VOLUME (UNIT, SLICE)
LD (BOOTVOL),DE ; D -> UNIT, E -> SLICE
;
; INIT DEFAULT
LD A,D ; BOOT UNIT?
CP 1 ; IF ROM BOOT, DEF DRIVE SHOULD BE B:
JR Z,DRV_INIT1 ; ... SO LEAVE AS IS AND SKIP AHEAD
XOR A ; ELSE FORCE TO DRIVE A:
DRV_INIT1:
LD (DEFDRIVE),A ; STORE IT
;
; SETUP THE DRVMAP STRUCTURE
LD HL,(HEAPTOP) ; GET CURRENT HEAP TOP
@ -2502,6 +2535,14 @@ DRV_INIT5:
; LD B,E ; COUNT TO B
; LD C,0 ; USE C AS DEVICE LIST INDEX
;
LD DE,(HCB + HCB_BOOTVOL) ; BOOT VOLUME (UNIT, SLICE)
LD A,1 ; ROM DISK UNIT?
CP D ; CHECK IT
JR Z,DRV_INIT5A ; IF SO, SKIP BOOT DRIVE
LD B,1 ; JUST ONE SLICE PLEASE
CALL DRV_INIT8A ; DO THE BOOT DEVICE
;
DRV_INIT5A:
LD A,(DRVLSTC) ; ACTIVE DRIVE LIST COUNT TO ACCUM
LD B,A ; ... AND MOVE TO B FOR LOOP COUNTER
LD HL,DRVLST ; HL IS PTR TO ACTIVE DRIVE LIST
@ -2532,7 +2573,21 @@ DRV_INIT7: ; PROCESS UNIT
LD A,(HDSPV) ; GET SLICES PER VOLUME TO ACCUM
LD B,A ; MOVE TO B FOR LOOP COUNTER
;
DRV_INIT8: ; SLICE CREATION LOOP
DRV_INIT8:
; SLICE CREATION LOOP
; DE=UNIT/SLICE, B=SLICE CNT
LD A,(BOOTVOL + 1) ; GET BOOT UNIT
CP 1 ; ROM BOOT?
JR Z,DRV_INIT8A ; IF SO, OK TO CONTINUE
CP D ; COMPARE TO CUR UNIT
JR NZ,DRV_INIT8A ; IF NE, OK TO CONTINUE
LD A,(BOOTVOL) ; GET BOOT SLICE
CP E ; COMPARE TO CUR SLICE
JR NZ,DRV_INIT8A ; IF NE, OK TO CONTINUE
INC E ; IS BOOT DU/SLICE, SKIP IT
JR DRV_INIT8 ; AND RESTART LOOP
;
DRV_INIT8A: ; ENTRY POINT TO SKIP BOOT DISK/LU CHECK
;
; INC DRVMAP ENTRY COUNT AND ENFORCE FOR 16 ENTRY MAXIMUM
LD HL,(DRVMAPADR) ; POINT TO DRIVE MAP
@ -2615,20 +2670,20 @@ DPH_INIT1:
CALL PRTDRV ; PRINT DRIVE INFO
LD A,D ; A := UNIT
PUSH HL ; SAVE DRIVE MAP POINTER
PUSH AF ; SAVE UNIT
; MATCH AND SAVE DEFAULT DRIVE BASED ON BOOT UNIT/SLICE
LD HL,BOOTVOL + 1 ; POINT TO BOOT UNIT
LD A,D ; LOAD CURRENT UNIT
CP (HL) ; MATCH?
JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT UNIT
DEC HL ; POINT TO BOOT SLICE
LD A,E ; LOAD CURRENT SLICE
CP (HL) ; MATCH?
JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT SLICE
LD A,C ; LOAD THE CURRENT DRIVE NUM
LD (DEFDRIVE),A ; SAVE AS DEFAULT
;PUSH AF ; SAVE UNIT
;; MATCH AND SAVE DEFAULT DRIVE BASED ON BOOT UNIT/SLICE
;LD HL,BOOTVOL + 1 ; POINT TO BOOT UNIT
;LD A,D ; LOAD CURRENT UNIT
;CP (HL) ; MATCH?
;JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT UNIT
;DEC HL ; POINT TO BOOT SLICE
;LD A,E ; LOAD CURRENT SLICE
;CP (HL) ; MATCH?
;JR NZ,DPH_INIT1A ; BYPASS IF NOT BOOT SLICE
;LD A,C ; LOAD THE CURRENT DRIVE NUM
;LD (DEFDRIVE),A ; SAVE AS DEFAULT
DPH_INIT1A:
POP AF ; RESTORE UNIT
;POP AF ; RESTORE UNIT
LD DE,(DPHTOP) ; GET ADDRESS OF NEXT DPH
PUSH DE ; ... AND SAVE IT
; INVOKE THE DPH BUILD ROUTINE

2
Source/CBIOS/ver.inc

@ -2,4 +2,4 @@
#DEFINE RMN 9
#DEFINE RUP 2
#DEFINE RTP 0
#DEFINE BIOSVER "2.9.2-pre.31"
#DEFINE BIOSVER "2.9.2-pre.32"

2
Source/CPM22/ver.inc

@ -2,4 +2,4 @@
#DEFINE RMN 9
#DEFINE RUP 2
#DEFINE RTP 0
#DEFINE BIOSVER "2.9.2-pre.31"
#DEFINE BIOSVER "2.9.2-pre.32"

6
Source/CPM3/Makefile

@ -11,7 +11,7 @@ TOOLS = ../../Tools
include $(TOOLS)/Makefile.inc
BIOSOBJS = bioskrnl.rel scb.rel boot.rel chario.rel
BIOSOBJS += move.rel drvtbl.rel diskio.rel
BIOSOBJS += move.rel drvtbl.rel diskio.rel util.rel
COMMA := ,
NULL :=
SPACE := $(NULL) $(NULL)
@ -21,10 +21,10 @@ DEFCPM3 = bnk
#DEFCPM3 = res
clean:: biosclean
rm -f bios3.spr bnkbios3.spr zpmbios3.spr cpmldr.com gencpm.dat options.lib
@rm -f bios3.spr bnkbios3.spr zpmbios3.spr cpmldr.com gencpm.dat options.lib
biosclean:
rm -f $(BIOSOBJS)
@rm -f $(BIOSOBJS)
cpm3res:
make biosclean

25
Source/CPM3/biosldr.z80

@ -67,10 +67,14 @@ boot1:
pop af
sub '0'
jr c,boot1
cp 10 ; !!! Need to test against max disk unit num !!!
jr nc,boot1
ld (unit),a
jr c,selerr
ld bc,0F810h ; HBIOS, get disk unit count
call 0FFF0h ; do it, E := disk unit count
ld a,(unit) ; get unit num back
cp e ; compare to entry
jr nc,selerr ; loop if too high
ld de,msgslc
call writestr
@ -80,11 +84,19 @@ boot1:
pop af
sub '0'
jr c,boot1
cp 10
jr nc,boot1
ld (slice),a
jr c,selerr
cp 10
jr nc,selerr
jr boot2
selerr:
ld de,msginv
call writestr
jr boot1
boot2:
ld de,crlf
call writestr
@ -346,6 +358,7 @@ mult8_noadd:
msgunit db 13,10,13,10,'Boot CP/M 3 from Disk Unit: $'
msgslc db ' Slice: $'
msginv db 13,10,13,10,'*** Invalid Selection ***$'
crlf db 13,10,'$'
dpb$start:

131
Source/CPM3/boot.z80

@ -124,20 +124,6 @@ dinit:
or a ; set flags
ret z ; !!! handle zero devices (albeit poorly) !!!
; ; loop thru devices to count total hard disk volumes
; push bc ; save the device count
; ld c,0 ; use c as device list index
; ld e,0 ; init e for hard disk volume count
;
;dinit2:
; push bc ; save loop control
; call dinit3 ; check drive
; pop bc ; restore loop control
; inc c ; next unit
; djnz dinit2 ; loop
; pop bc ; restore unit count in b
; jr dinit4 ; continue
; loop thru devices to count total hard disk volumes
ld c,0 ; init c as device list index
ld d,0 ; init d as total device count
@ -152,17 +138,6 @@ dinit2:
ld (drvlstc),a ; save the count
jr dinit4 ; continue
;dinit3:
; push de ; save de (hard disk volume counter)
; ld b,017h ; hbios func: report device info
; rst 08 ; call hbios, unit to c
; ld a,d ; device type to a
; pop de ; restore de
; cp 050h ; hard disk device?
; ret c ; nope, return
; inc e ; increment hard disk count
; ret ; and return
dinit3:
push de ; save de (hard disk volume counter)
push hl ; save drive list ptr
@ -204,16 +179,6 @@ dinit3a:
ret ; and return
;dinit4: ; set slices per volume (hdspv) based on hard disk volume count
; ld a,e ; hard disk volume count to a
; ld e,8 ; assume 8 slices per volume
; dec a ; dec accum to check for count = 1
; jr z,dinit5 ; yes, skip ahead to implement 8 hdspv
; ld e,4 ; now assume 4 slices per volume
; dec a ; dec accum to check for count = 2
; jr z,dinit5 ; yes, skip ahead to implement 4 hdspv
; ld e,2 ; in all other cases, we use 2 hdspv
dinit4: ; set slices per volume (hdspv) based on hard disk volume count
; ; *** debug ***
@ -240,40 +205,24 @@ dinit4: ; set slices per volume (hdspv) based on hard disk volume count
jr z,dinit5 ; yes, skip ahead to implement 4 hdspv
ld e,2 ; in all other cases, we use 2 hdspv
;dinit5:
; ld a,e ; slices per volume value to accum
; ld (hdspv),a ; save it
;
; ; setup to enumerate devices to build drvmap
; ld b,0F8h ; SYS GET
; ld c,010h ; Disk Drive Unit Count
; rst 08 ; e := disk unit count
; ld b,e ; count to b
; ld c,0 ; use c as device list index
; ld hl,0 ; dph index
dinit5:
ld a,e ; slices per volume value to accum
ld (hdspv),a ; save it
ld hl,0 ; dph index
ld a,(@bootdu) ; boot disk unit
ld d,a ; ... to d
ld a,(@bootsl) ; boot slice
ld e,a ; ... to e
ld b,1 ; one slice please
call dinit8a ; make DPH for A:
ld a,(drvlstc) ; active drive list count to accum
ld b,a ; ... and move to b for loop counter
ld de,drvlst ; de is ptr to active drive list
ld hl,0 ; dph index
;dinit6: ; loop thru all units available
; push bc ; preserve loop control
; push hl ; preserve dph pointer
; ld b,017h ; hbios func: report device info
; rst 08 ; call hbios, d := device type
; pop hl ; restore dph pointer
; pop bc ; get unit index back in c
; push bc ; resave loop control
; call dinit7 ; update dph entries
; pop bc ; restore loop control
; inc c ; increment list index
; djnz dinit6 ; loop as needed
dinit6: ; loop thru all units available
dinit6:
; loop thru all units available
push de ; preserve drive list ptr
ex de,hl ; list ptr to hl
ld c,(hl) ; get unit num from list
@ -310,18 +259,28 @@ dinit6a:
djnz dinit6a
ret ; finished
dinit7: ; process unit
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 050h ; hard disk device?
cp 030h ; hard disk device?
jr c,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
dinit8:
; d=unit, e=slice, l=dph#
dinit8: ; test to avoid reallocating boot disk unit/slice
ld a,(@bootdu) ; boot disk unit to accum
cp d ; compare to cur unit
jr nz,dinit8a ; if ne, ok to continue
ld a,(@bootsl) ; boot slice to accum
cp e ; compare to cur slice
jr nz,dinit8a ; if ne, ok to continue
inc e ; is boot du/slice, skip it
jr dinit8 ; and restart loop
dinit8a:
; d=unit, e=slice, l=dph#, b=slice cnt
ld a,l ; dph # to accum
cp 16 ; dph table size
ret z ; bail out if overflow
@ -337,9 +296,9 @@ dinit8:
ld (hl),e ; update slice number
dec hl ; backup to unit number
ld (hl),d ; update unit number
inc e ; next slice
pop hl ; restore dph #
inc hl ; next dph #
inc e ; next slice
djnz dinit8 ; loop till done with unit
ret
@ -362,25 +321,25 @@ stpsiz equ $ - stpimg
?ldccp:
if zpm
; Swap A: and system drive (make A: the system drive)
ld bc,(@dtbl) ; get drive A DPH
ld hl,@dtbl ; point to boot drive DPH
ld a,(@sysdr)
rlca
call addhla
ld e,(hl) ; set boot drive to drive A DPH
ld (hl),c ; ... and save boot drive DPH
inc hl
ld d,(hl)
ld (hl),b
ld (@dtbl),de ; set drive a DPH to boot drive
xor a ; update @sysdr
ld (@sysdr),a
endif
;if zpm
;
;; Swap A: and system drive (make A: the system drive)
;ld bc,(@dtbl) ; get drive A DPH
;ld hl,@dtbl ; point to boot drive DPH
;ld a,(@sysdr)
;rlca
;call addhla
;ld e,(hl) ; set boot drive to drive A DPH
;ld (hl),c ; ... and save boot drive DPH
;inc hl
;ld d,(hl)
;ld (hl),b
;ld (@dtbl),de ; set drive a DPH to boot drive
;
;xor a ; update @sysdr
;ld (@sysdr),a
;
;endif
; Force CCP to use system boot drive as initial default
ld a,(@sysdr) ; get system boot drive

30
Source/CPM3/diskio.z80

@ -323,21 +323,21 @@ dpb_fd111: ; 8" DS/DD Floppy Drive (1.11M)
; called for first time initialization.
dsk$init:
ld a,(@rdrv) ; unit being initialized
ld hl,@bootdu
cp (hl) ; compare to boot unit
ret nz ; done if no match
inc de ; point to slice in XDPH
inc de
inc de
ld a,(de) ; get slice
ld hl,@bootsl
cp (hl) ; compare to boot slice
ret nz ; done if not zero
ld a,(@adrv) ; get cp/m drive
ld (@sysdr),a ; and save it
;ld a,(@rdrv) ; unit being initialized
;ld hl,@bootdu
;cp (hl) ; compare to boot unit
;ret nz ; done if no match
;
;inc de ; point to slice in XDPH
;inc de
;inc de
;ld a,(de) ; get slice
;ld hl,@bootsl
;cp (hl) ; compare to boot slice
;ret nz ; done if not zero
;
;ld a,(@adrv) ; get cp/m drive
;ld (@sysdr),a ; and save it
ret
; lxi h,init$table

2
Source/CPM3/ver.inc

@ -3,5 +3,5 @@ rmn equ 9
rup equ 2
rtp equ 0
biosver macro
db "2.9.2-pre.31"
db "2.9.2-pre.32"
endm

70
Source/HBIOS/Build.sh

@ -36,13 +36,14 @@ fi
echo Building for $romname for $platform $config $romsize
if [ $platform == UNA ] ; then
CBIOS=../CBIOS/cbios_una.bin
BIOS=una
else
CBIOS=../CBIOS/cbios_wbw.bin
BIOS=wbw
fi
Apps=(assign fdu format mode osldr rtc survey syscopy sysgen talk timer xm inttest)
timestamp=$(date +%Y-%m-%d)
timestamp="2020-02-20"
blankfile=Blank${romsize}.dat
romdiskfile=RomDisk.tmp
@ -52,15 +53,6 @@ outdir=../../Binary
echo "creating empty rom disk of size $romsize in $blankfile"
LANG=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$blankfile bs=1024 count=`expr $romsize - 128`
# # Initialize working variables
# $OutDir = "../../Binary" # Output directory for final image file
# $RomFmt = "wbw_rom${RomSize}" # Location of files to imbed in ROM disk
# $BlankROM = "Blank${RomSize}KB.dat" # An initial "empty" image for the ROM disk of propoer size
# $RomDiskFile = "RomDisk.tmp" # Temporary filename used to create ROM disk image
# $RomFile = "${OutDir}/${RomName}.rom" # Final name of ROM image
# $ComFile = "${OutDir}/${RomName}.com" # Final name of COM image (command line loadable HBIOS/CBIOS)
# $ImgFile = "${OutDir}/${RomName}.img" # Final name of IMG image (memory loadable HBIOS/CBIOS image)
cat <<- EOF > build.inc
; RomWBW Configured for $platform $config $timestamp
;
@ -72,44 +64,54 @@ ROMSIZE .EQU $romsize
;
EOF
cp ../CPM22/OS2CCP.bin ccp.bin
cp ../CPM22/OS3BDOS.bin bdos.bin
cp ../ZCPR-DJ/zcpr.bin zcpr.bin
cp ../ZSDOS/zsdos.bin zsdos.bin
cp ../Forth/camel80.bin camel80.bin
cp ../Fonts/font*.asm .
make -f Makefile dbgmon.bin prefix.bin romldr.bin eastaegg.bin nascom.bin \
tastybasic.bin imgpad.bin imgpad0.bin
make dbgmon.bin prefix.bin romldr.bin eastaegg.bin nascom.bin \
tastybasic.bin game.bin usrrom.bin imgpad.bin imgpad0.bin
if [ $platform != UNA ] ; then
make -f Makefile hbios_rom.bin hbios_app.bin hbios_img.bin
make hbios_rom.bin hbios_app.bin hbios_img.bin
fi
cat ccp.bin bdos.bin $CBIOS >cpm.bin
cat zcpr.bin zsdos.bin $CBIOS >zsys.bin
cat prefix.bin cpm.bin >cpm.sys
cat prefix.bin zsys.bin >zsys.sys
echo "Building $romname output files..."
cat romldr.bin eastaegg.bin dbgmon.bin cpm.bin zsys.bin >osimg.bin
cat camel80.bin nascom.bin tastybasic.bin imgpad0.bin >osimg1.bin
cat romldr.bin eastaegg.bin dbgmon.bin ../CPM22/cpm_$BIOS.bin ../ZSDOS/zsys_$BIOS.bin >osimg.bin
cat camel80.bin nascom.bin tastybasic.bin game.bin imgpad0.bin usrrom.bin >osimg1.bin
echo "Building ${romsize}KB $romname ROM disk data file..."
cp $blankfile $romdiskfile
$CPMCP -f $romfmt $romdiskfile ../RomDsk/ROM_${romsize}KB/*.* 0:
if [ $(find ../RomDsk/$platform -type f -print 2>/dev/null | wc -l) -gt 0 ] ; then
$CPMCP -f $romfmt $romdiskfile ../RomDsk/$platform/*.* 0:
fi
echo placing files into $romdiskfile
for i in ${apps[@]} ; do
$CPMCP -f $romfmt $romdiskfile ../../Binary/Apps/$i.com 0:
for file in $(ls -1 ../RomDsk/ROM_${romsize}KB/* | sort -V) ; do
echo " " $file
$CPMCP -f $romfmt $romdiskfile $file 0:
done
for i in *.sys ; do
$CPMCP -f $romfmt $romdiskfile $i 0:
if [ -d ../RomDsk/$platform ] ; then
for file in ../RomDsk/$platform/* ; do
echo " " $file
$CPMCP -f $romfmt $romdiskfile $file 0:
done
fi
echo "adding apps to $romdiskfile"
for i in assign fdu format mode osldr rtc survey syscopy sysgen talk timer xm inttest ; do
f=$(../../Tools/unix/casefn.sh ../../Binary/Apps/$i.com)
if [ "$f" = "nofile" ] ; then
echo " " $i "not found"
else
echo " " $f
$CPMCP -f $romfmt $romdiskfile $f 0:
fi
done
if [ $platform != UNA ] ; then
echo "copying systems to $romdiskfile"
$CPMCP -f $romfmt $romdiskfile ../CPM22/cpm_$BIOS.sys 0:cpm.sys
$CPMCP -f $romfmt $romdiskfile ../ZSDOS/zsys_$BIOS.sys 0:zsys.sys
if [ $platform = UNA ] ; then
cp osimg.bin $outdir/UNA_WBW_SYS.bin
cp $romdiskfile $outdir/UNA_WBW_ROM$romsize.bin
cat ../UBIOS/UNA-BIOS.BIN osimg.bin ../UBIOS/FSFAT.BIN $romdiskfile >$romname.rom

17
Source/HBIOS/Makefile

@ -1,10 +1,25 @@
OBJECTS = ZETA2_std.rom
MOREDIFF = camel80.bin game.bin hbios_rom.bin nascom.bin prefix.bin usrrom.bin \
dbgmon.bin hbios_app.bin imgpad0.bin osimg1.bin romldr.bin \
eastaegg.bin hbios_img.bin imgpad.bin osimg.bin tastybasic.bin \
game.bin usrrom.bin
SUBDIRS =
DEST = ../../Binary/Apps
DEST = ../../Binary
TOOLS =../../Tools
OTHERS = *.bin *.z80 cpm.sys zsys.sys Build.inc
include $(TOOLS)/Makefile.inc
DIFFPATH = $(DIFFTO)/Binary
ZETA2_std.rom:
bash Build.sh ZETA2 std 512
hbios_rom.bin: hbios.asm
$(TASM) -dROMBOOT hbios.asm hbios_rom.bin
hbios_app.bin: hbios.asm
$(TASM) -dAPPBOOT hbios.asm hbios_app.bin
hbios_img.bin: hbios.asm
$(TASM) -dIMGBOOT hbios.asm hbios_img.bin

4
Source/HBIOS/hbios.asm

@ -658,7 +658,7 @@ HBX_BUF .FILL HBX_BUFSIZ,0
.DW HBX_IDENT ; ADDRESS OF HBIOS PROXY START (DEPRECATED)
.DW HBX_IDENT ; ADDRESS OF HBIOS IDENT INFO DATA BLOCK
;
.FILL $MEMTOP - $ ; FILL TO END OF MEMORY (AS NEEDED)
.FILL MEMTOP - $ ; FILL TO END OF MEMORY (AS NEEDED)
.ORG HBX_IMG + HBX_SIZ ; RESET ORG
;
;==================================================================================================
@ -3778,7 +3778,7 @@ PS_FLP_DSTR: .TEXT "SD$" ; PS_FLPSD
; CHARACTER DEVICE STRINGS
;
PS_SDSTRREF:
.DW PS_SDUART, PS_SDASCI, PS_SDTERM,
.DW PS_SDUART, PS_SDASCI, PS_SDTERM
.DW PS_SDPRPCON, PS_SDPPPCON, PS_SDSIO, PS_SDACIA, PS_SDPIO,PS_SDUF
;
PS_SDUART .TEXT "UART$"

2
Source/HBIOS/nascom.asm

@ -512,7 +512,7 @@ ERRORS: .BYTE "NEXT without FOR",0
.BYTE "Out of string space",0
.BYTE "String too long",0
.BYTE "String formula too complex",0
.BYTE "Can't CONTinue",0
.BYTE "Can",$27,"t CONTinue",0
.BYTE "Undefined FN function",0
.BYTE "Missing operand",0
.BYTE "HEX",0

2
Source/HBIOS/sd.asm

@ -735,7 +735,7 @@ SD_RESET:
CALL SD_SELUNIT ; SET CUR UNIT
; RE-INITIALIZE THE SD CARD TO ACCOMMODATE HOT SWAPPING
CALL SD_INITCARD ; RE-INIT SELECTED UNIT
#IF (SDTRACE == 1)
#IF (SDTRACE >= 3)
CALL SD_PRTERR ; PRINT ANY ERRORS
#ENDIF
OR A ; SET RESULT FLAGS

2
Source/HBIOS/ver.inc

@ -2,4 +2,4 @@
#DEFINE RMN 9
#DEFINE RUP 2
#DEFINE RTP 0
#DEFINE BIOSVER "2.9.2-pre.31"
#DEFINE BIOSVER "2.9.2-pre.32"

40
Source/Images/Makefile

@ -9,13 +9,15 @@ HDIMGS = hd_cpm22.img hd_zsdos.img hd_nzcom.img \
hd_cpm3.img hd_zpm3.img hd_ws4.img hd_bp.img
OBJECTS = $(FDIMGS) $(HDIMGS) hd_combo.img
OTHERS = $(SYSTEMS) blank144 blankhd
OTHERS = blank144 blankhd
DEST=../../Binary
TOOLS = ../../Tools
include $(TOOLS)/Makefile.inc
DIFFPATH = $(DIFFTO)/Binary
hd_combo.img: $(HDIMGS)
cat $(HDIMGS) > $@
@ -37,7 +39,7 @@ blankhd:
@echo Making Blank Hd of size $(HDSIZE)k
@LANG=en_US.US-ASCII tr '\000' '\345' </dev/zero | dd of=$@ bs=1024 count=$(HDSIZE) 2>/dev/null
%.img:: $(SYSTEMS) blank144 blankhd
%.img: $(SYSTEMS) blank144 blankhd Makefile
@sys= ; \
case $@ in \
(*cpm22*) sys=../CPM22/cpm_wbw.sys;; \
@ -52,17 +54,28 @@ blankhd:
d=$$(echo $(basename $@) | sed s/$$type//) ; \
echo Generating $@ ; \
cp $$proto $@ ; \
if [ "$$sys" ] ; then \
echo copying system $$sys to $@ ; \
$(BINDIR)/mkfs.cpm -f $$fmt -b $$sys $@ ; \
fi ; \
for u in $$(seq 0 15) ; do \
dir=d_$$d/u$$u ; \
if [ -d $$dir ] ; then \
echo " " copying directory $$dir ; \
$(CPMCP) -f $$fmt $@ $$($(CASEFN) $$dir/*.*) $$u: ; \
for i in $$dir/* ; do \
f=$$($(CASEFN) $$i) ; \
echo " " $$f ; \
$(CPMCP) -f $$fmt $@ $$f $$u: ; \
done ; \
fi ; \
done ; \
if [ -f d_$$d.txt ] ; then \
echo " " copying files from d_$$d.txt ; \
grep -v ^# d_$$d.txt | tr -d '\r' | while read file user ; do \
rf=$$($(CASEFN) $$file) ; \
hack= ; \
if [ "$$file" = "../../Binary/Apps/Tunes/*.*" ] ; then hack=../../Binary/Apps/Tunes/Makefile ; fi ; \
rf=$$($(CASEFN) $$hack $$file | sort -V) ; \
echo " " $$rf ; \
if [ "$$rf" = nofile ] ; then \
echo " " $$file missing ; \
else \
@ -70,8 +83,19 @@ blankhd:
fi ; \
done ; \
fi ; \
if [ "$$sys" ] ; then \
echo copying system $$sys to $@ ; \
dd if=$$sys of=$@ conv=notrunc 2>/dev/null ; \
fi
clean::
@rm -f *.ls
imgdiff:
@for i in $(FDIMGS) $(HDIMGS) ; do \
echo $$i ; \
if echo $$i | grep -q ^f ; then \
fmt=wbw_fd144 ; \
else \
fmt=wbw_hd0 ; \
fi ; \
$(BINDIR)/cpmls -i -f $$fmt $$i > $$i.ls ; \
$(BINDIR)/cpmls -i -f $$fmt $(DIFFPATH)/$$i > $$i.diff.ls ; \
done \

6
Source/Images/diskdefs

@ -332,7 +332,8 @@ diskdef wbw_hd0
maxdir 512
skew 0
boottrk 1
os 2.2
# os 2.2
os 3
end
diskdef wbw_hd1
@ -389,7 +390,8 @@ diskdef wbw_fd144
maxdir 256
skew 0
boottrk 2
os 2.2
# os 2.2
os 3
end
# RomWBW 360K floppy media

6
Source/Makefile

@ -4,13 +4,13 @@
NOTDONE = Doc
SUBDIRS = Prop
SUBDIRS += Apps
SUBDIRS += CBIOS HBIOS
SUBDIRS += CPM22 ZCPR ZCPR-DJ ZSDOS CPM3
SUBDIRS += CBIOS
SUBDIRS += CPM22 ZCPR ZCPR-DJ ZSDOS
SUBDIRS += HBIOS CPM3
SUBDIRS += ZPM3
SUBDIRS += Forth
NOTDONE += Fonts
SUBDIRS += BPBIOS
SUBDIRS += HBIOS
SUBDIRS += Images
TOOLS = ../Tools
include $(TOOLS)/Makefile.inc

9
Source/ZPM3/Makefile

@ -1,6 +1,9 @@
OBJECTS = zpmldr.com zpmldr.sys cpm3.sys zinstal.zpm startzpm.com zccp.com \
OBJECTS = zpmldr.com zpmldr.sys cpm3.sys startzpm.com zccp.com \
setz3.com clrhist.com autotog.com
OTHERS = biosldr.rel gencpm.com gencpm.dat bnkbios3.spr
ifndef REBUILD_ZPM_TOOLS
NODELETE = setz3.com clrhist.com autotog.com
endif
OTHERS = zpmldr.bin loader.bin biosldrd.rel biosldrc.rel gencpm.com gencpm.dat bnkbios3.spr
TOOLS =../../Tools
include $(TOOLS)/Makefile.inc
@ -43,8 +46,10 @@ zinstal.zpm: ../ZCCP/zinstal.zpm
startzpm.com: ../ZCCP/startzpm.com
cp $< $@
ifdef REBUILD_ZPM_TOOLS
setz3.com: setz3.z80
clrhist.com: clrhist.z80
autotog.com: autotog.z80
endif

2
Source/ZSDOS/ver.inc

@ -2,4 +2,4 @@
#DEFINE RMN 9
#DEFINE RUP 2
#DEFINE RTP 0
#DEFINE BIOSVER "2.9.2-pre.31"
#DEFINE BIOSVER "2.9.2-pre.32"

15
Tools/Makefile.inc

@ -24,7 +24,7 @@ RELPATH := $(subst $(TREEROOT),,$(HERE))
#
# where's a copy of this tree for windows so we can diff binaries
#
DIFFTO := /Volumes/Github/RomWBW
DIFFTO := $(shell cd $(TREEROOT)/../RomWBW.windows; pwd)
DIFFPATH := $(DIFFTO)/$(RELPATH)
#
@ -121,13 +121,13 @@ all:: $(OBJECTS)
done ; fi
clean::
-rm -f $$($(CASEFN) make.out *.sym *.lst *.prn *.diff *.dump $(OTHERS) $(filter-out $(NODELETE),$(OBJECTS)))
@-rm -f $$($(CASEFN) make.out *.sym *.lst *.prn *.diff *.dump $(OTHERS) $(filter-out $(NODELETE),$(OBJECTS)))
@for dir in $(SUBDIRS) ; do \
( echo "cleaning in `pwd`/$$dir" ; cd "$$dir" ; make clean ) ; \
done
clobber:: clean
-rm -f $$($(CASEFN) $(filter-out $(NODELETE),$(OBJECTS)))
@-rm -f $$($(CASEFN) $(filter-out $(NODELETE),$(OBJECTS)))
@for dir in $(SUBDIRS) ; do \
( echo "clobbering in `pwd`/$$dir" ; cd "$$dir" ; make clobber ) ; \
done
@ -140,13 +140,16 @@ diff::
@for dir in $(SUBDIRS) ; do \
( echo "diff in $(HERE)/$$dir" ; cd "$$dir" ; make diff ) ; \
done
@for i in $(OBJECTS) ; do \
@for i in $(OBJECTS) $(MOREDIFF) ; do \
sf=$$($(CASEFN) $$i) ; \
df=$$($(CASEFN) $(DIFFPATH)/$$i) ; \
if [ -f $$df -a -f $$sf ] ; then \
if [ "$(VERBOSEDIFF)" ] ; then \
echo compare $$sf and $$df ; \
fi ; \
if ! cmp -s $$sf $$df ; then \
echo $$sf and $$df differ ; \
if [ "$(VERBOSEDIFF)" ] ; then \
echo " " $$sf and $$df differ ; \
if [ "$(VERBOSEDIFF)" = "2" ] ; then \
cmp -bl $$sf $$df ; \
hexdump -Cv $$sf > $$sf.dump ; \
hexdump -Cv $$df > $$(basename $$df).dump.diff ; \

1
Tools/unix/bst/Makefile

@ -13,6 +13,7 @@ DEST = ../../$(UNAME)
all: $(DEST)
-for i in *.$(SUFFIX) ; do \
chmod +x $$i ; \
cp $$i $(DEST)/$$(basename $$i .$(SUFFIX)) ; \
done

8
Tools/unix/casefn.sh

@ -12,7 +12,7 @@ function cleanup {
rm -f $all $search $in
}
trap cleanup EXIT
#trap cleanup EXIT
cleanup
if [ $# -lt 1 ] ; then
@ -53,10 +53,14 @@ for dn in ${dirs[@]} ; do
cd $here
cd $dn
for i in * ; do
# skip any file names containing a space
if echo "$i" | grep -sq " " ; then
continue
fi
echo $dn/$(echo "$i" | tr '[A-Z]' '[a-z]')",$dn/$i" >> $in
done
done
sort $in > $all
sort -t, -k 1,1 $in > $all
join -t, -o 1.2 $all $search | sort -u > $in
if [ $(wc -l < $in) -gt 0 ] ; then

7
Tools/unix/cpmtools/Makefile

@ -10,11 +10,14 @@ CFLAGS = -g
DEFFORMAT = ibm-3740
DEVICE = posix
DISKDEFS=$(shell cd ../../cpmtools ; pwd)/diskdefs
DEFFORMAT=wbw_fd144
CPPFLAGS = -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\"
DEVICEOBJ = device_posix.o
OBJECTS = cpmls cpmrm cpmcp cpmchmod cpmchattr mkfs.cpm fsck.cpm
OBJECTS = cpmls cpmrm cpmcp cpmchmod cpmchattr mkfs.cpm fsck.cpm fsed.cpm
all: $(OBJECTS) $(DEST)
cp $(OBJECTS) $(DEST)
@ -41,7 +44,7 @@ fsck.cpm: fsck.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ)
$(CC) $(LDFLAGS) -o $@ fsck.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ)
fsed.cpm: fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ)
$(CC) $(LDFLAGS) -o $@ fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ)
$(CC) $(LDFLAGS) -o $@ fsed.cpm.o cpmfs.o getopt.o getopt1.o $(DEVICEOBJ) -lncurses
$(DEST):
mkdir -p $(DEST)

2
Tools/unix/cpmtools/config.h

@ -8,7 +8,7 @@
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_MODE_T 0
#define NEED_NCURSES 0
#define NEED_NCURSES 1
#define HAVE_NCURSES_NCURSES_H 0
#if HAVE_SYS_STAT_H

29
Tools/unix/cpmtools/cpmfs.c

@ -668,6 +668,24 @@ void cpmglob(int optin, int argc, char * const argv[], struct cpmInode *root, in
}
/*}}}*/
FILE *open_diskdefs()
{
FILE *fp;
char *ddenv = getenv("DISKDEFS");
if (fp=fopen("diskdefs","r"))
return fp;
if (fp=fopen(DISKDEFS,"r"))
return fp;
if (ddenv)
if (fp=fopen(ddenv,"r"))
return fp;
fprintf(stderr,"%s: Neither diskdefs%s%s%s nor %s could be opened.\n",
cmd,
ddenv ? ", ": "", ddenv ? ddenv : "", ddenv ? "," : "" , DISKDEFS);
exit(1);
}
/* superblock management */
/* diskdefReadSuper -- read super block from diskdefs file */ /*{{{*/
static int diskdefReadSuper(struct cpmSuperBlock *d, const char *format)
@ -675,18 +693,11 @@ static int diskdefReadSuper(struct cpmSuperBlock *d, const char *format)
char line[256];
FILE *fp;
int insideDef=0,found=0;
char *ddenv = getenv("DISKDEFS");
d->libdskGeometry[0] = '\0';
d->type=0;
if (
(fp=fopen("diskdefs","r"))==(FILE*)0 &&
(ddenv && ((fp=fopen(ddenv,"r"))==(FILE*)0)) &&
(fp=fopen(DISKDEFS,"r"))==(FILE*)0)
{
fprintf(stderr,"%s: Neither `diskdefs' nor `" DISKDEFS "' could be opened.\n",cmd);
exit(1);
}
fp = open_diskdefs();
while (fgets(line,sizeof(line),fp)!=(char*)0)
{
int argc;

2
Tools/unix/uz80as/pp.c

@ -631,7 +631,7 @@ static void pif(const char *p)
return;
p = skipws(p + sizeof(IFSTR) - 1);
if (!expr(p, &v, s_pc, 0, &ex_ec, &ep)) {
if (!expr(p, &v, s_pc, 1, &ex_ec, &ep)) {
s_skipon = 1;
exprint(ex_ec, s_line, ep);
newerr();

49
Tools/unix/uz80as/uz80as.c

@ -51,6 +51,7 @@ static const char *d_export(const char *);
static const char *d_end(const char *);
static const char *d_equ(const char *);
static const char *d_fill(const char *);
static const char *d_ds(const char *);
static const char *d_list(const char *);
static const char *d_lsfirst(const char *);
static const char *d_module(const char *);
@ -76,7 +77,7 @@ static struct direc {
{ "CHK", d_chk },
{ "CODES", d_codes },
{ "DB", d_byte },
{ "DS", d_fill },
{ "DS", d_ds },
{ "DW", d_word },
{ "ECHO", d_echo },
{ "EJECT", d_eject },
@ -466,6 +467,7 @@ found:
static const char *
d_null(const char *p)
{
p = sync(p);
while (*p != '\0' && *p != '\\') {
if (!isspace(*p)) {
wprint(_("invalid characters after directive\n"));
@ -514,6 +516,7 @@ static const char *d_codes(const char *p)
static const char *d_module(const char *p)
{
p = sync(p);
while (*p != '\0' && *p != '\\') {
if (!isspace(*p)) {
wprint(_("invalid characters after directive\n"));
@ -681,6 +684,50 @@ static const char *d_fill(const char *p)
return p;
}
static const char *d_ds(const char *p)
{
int n, v, er;
const char *q;
enum expr_ecode ecode;
const char *ep, *eps;
eps = p;
er = 0;
p = expr(p, &n, s_pc, 0, &ecode, &ep);
if (p == NULL) {
exprint(ecode, s_pline, ep);
newerr();
return NULL;
}
if (n < 0) {
eprint(_("number of positions to space over is negative (%d)\n"), n);
eprcol(s_pline, eps);
exit(EXIT_FAILURE);
}
v = 255;
p = skipws(p);
if (*p == ',') {
p = skipws(p + 1);
q = expr(p, &v, s_pc, s_pass == 0, &ecode, &ep);
if (q == NULL) {
er = 1;
exprint(ecode, s_pline, ep);
newerr();
} else {
p = q;
}
}
s_pc += n;
if (er)
return NULL;
else
return p;
}
static const char *d_lsfirst(const char *p)
{
s_msbword = 0;

Loading…
Cancel
Save