Browse Source

initial submission of linux build folder (like XSource technique)

import/raw
doug 13 years ago
parent
commit
85f099898e
  1. 367
      branches/dwg/LSource/Makefile
  2. BIN
      branches/dwg/LSource/bin/CPMCHATTR
  3. BIN
      branches/dwg/LSource/bin/CPMCHMOD
  4. BIN
      branches/dwg/LSource/bin/CPMCP
  5. BIN
      branches/dwg/LSource/bin/CPMLS
  6. BIN
      branches/dwg/LSource/bin/CPMRM
  7. BIN
      branches/dwg/LSource/bin/CVT2LINUX
  8. BIN
      branches/dwg/LSource/bin/TASM
  9. 215
      branches/dwg/LSource/bin/TASM05.TAB
  10. 205
      branches/dwg/LSource/bin/TASM3210.TAB
  11. 456
      branches/dwg/LSource/bin/TASM3225.TAB
  12. 281
      branches/dwg/LSource/bin/TASM48.TAB
  13. 285
      branches/dwg/LSource/bin/TASM51.TAB
  14. 222
      branches/dwg/LSource/bin/TASM65.TAB
  15. 348
      branches/dwg/LSource/bin/TASM68.TAB
  16. 290
      branches/dwg/LSource/bin/TASM70.TAB
  17. 594
      branches/dwg/LSource/bin/TASM80.TAB
  18. 257
      branches/dwg/LSource/bin/TASM85.TAB
  19. 393
      branches/dwg/LSource/bin/TASM96.TAB
  20. 594
      branches/dwg/LSource/bin/tasm180.tab
  21. BIN
      branches/dwg/LSource/src/cpmtools-2.13.tar
  22. 14
      branches/dwg/LSource/src/cpmtools-2.13/.depend
  23. 676
      branches/dwg/LSource/src/cpmtools-2.13/COPYING
  24. 212
      branches/dwg/LSource/src/cpmtools-2.13/INSTALL
  25. 114
      branches/dwg/LSource/src/cpmtools-2.13/Makefile
  26. 114
      branches/dwg/LSource/src/cpmtools-2.13/Makefile.in
  27. 3
      branches/dwg/LSource/src/cpmtools-2.13/NEWS
  28. 43
      branches/dwg/LSource/src/cpmtools-2.13/README
  29. 9
      branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk
  30. 518
      branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt
  31. 7
      branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile
  32. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber
  33. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext
  34. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/extension
  35. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/extno
  36. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom
  37. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/label
  38. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr
  39. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks
  40. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/name
  41. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount
  42. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/status
  43. BIN
      branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps
  44. 1498
      branches/dwg/LSource/src/cpmtools-2.13/config.guess
  45. 55
      branches/dwg/LSource/src/cpmtools-2.13/config.h
  46. 54
      branches/dwg/LSource/src/cpmtools-2.13/config.h.in
  47. 687
      branches/dwg/LSource/src/cpmtools-2.13/config.log
  48. 1014
      branches/dwg/LSource/src/cpmtools-2.13/config.status
  49. 1702
      branches/dwg/LSource/src/cpmtools-2.13/config.sub
  50. 5701
      branches/dwg/LSource/src/cpmtools-2.13/configure
  51. 124
      branches/dwg/LSource/src/cpmtools-2.13/configure.in
  52. 240
      branches/dwg/LSource/src/cpmtools-2.13/cpm.5
  53. 240
      branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in
  54. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr
  55. 86
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1
  56. 86
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in
  57. 112
      branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c
  58. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod
  59. 57
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1
  60. 57
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in
  61. 84
      branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c
  62. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp
  63. 92
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1
  64. 92
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in
  65. 284
      branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c
  66. 21
      branches/dwg/LSource/src/cpmtools-2.13/cpmdir.h
  67. 1561
      branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c
  68. 174
      branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h
  69. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmls
  70. 67
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.1
  71. 67
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in
  72. 383
      branches/dwg/LSource/src/cpmtools-2.13/cpmls.c
  73. BIN
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm
  74. 53
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1
  75. 53
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in
  76. 72
      branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c
  77. 35
      branches/dwg/LSource/src/cpmtools-2.13/device.h
  78. 76
      branches/dwg/LSource/src/cpmtools-2.13/device_libdsk.c
  79. 77
      branches/dwg/LSource/src/cpmtools-2.13/device_posix.c
  80. 658
      branches/dwg/LSource/src/cpmtools-2.13/device_win32.c
  81. 376
      branches/dwg/LSource/src/cpmtools-2.13/diskdefs
  82. BIN
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm
  83. 74
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1
  84. 74
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in
  85. 627
      branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c
  86. BIN
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm
  87. 56
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1
  88. 56
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in
  89. 732
      branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c
  90. 1195
      branches/dwg/LSource/src/cpmtools-2.13/getopt.c
  91. 171
      branches/dwg/LSource/src/cpmtools-2.13/getopt1.c
  92. 226
      branches/dwg/LSource/src/cpmtools-2.13/getopt_.h
  93. 131
      branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h
  94. 520
      branches/dwg/LSource/src/cpmtools-2.13/install-sh
  95. 89
      branches/dwg/LSource/src/cpmtools-2.13/makefile.nt
  96. BIN
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm
  97. 64
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1
  98. 64
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in
  99. 175
      branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c
  100. 62
      branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt

367
branches/dwg/LSource/Makefile

@ -0,0 +1,367 @@
# RomWBW/branches/dwg/XSource/Makefile 10/24/2012 dwg -
#
# GCC based makefile
#
# 09/28/2012 2.2 dwg - updated for Mac OS X 10.8.2 Mountain Lion
#
# 06/18/2012 2.0 dgg - updated for v2.0
#
# 02/22/2012 1.5 dgg - modified for assembly under Linux
#
# 01/11/2011 1.4 wbw - added support for ZSDOS/ZDDOS/ZCPR
#
# 12/22/2011 1.3 wbw - removed all built-in config stuff, operation is now entirely
# dependent on variables CONFIG, ROMSIZE, and CPU
#
# 12/02/2011 1.3 wbw - replaced makever functionality with built-in makefile stuff
#
# 11/29/2011 1.3 dwg - uses makever to generate stdincl.inc from the version.hpp file
#
# 11/19/2011 1.3 dwg - added n8vem_vdu to "usage" and "all" rules
# enhanced clean to get files in $(OUTDIR)
# added custom to "all" rule
#
# The operation of this makefile is entirely dependent on the setting
# of three variables: CONFIG, ROMSIZE, and CPU:
#
# CONFIG determines which configuration to build which means that
# it will determine the config_xxx.asm config settings file to
# include as well as the output file names. So, for example,
# if CONFIG is "n8vem", the config_n8vem.asm file will be used
# for BIOS configuration settings and the output files will be
# n8vem.rom, n8vem.sys, and n8vem.com.
#
# ROMSIZE specifies the size of the ROM image to be produced and
# currently must be either "1024" for a 1MB ROM or "512" for a
# 512KB ROM.
#
# CPU specifies the instruction set to be used in assembly and
# must be either "80" for Z80 or "180" for Z180. Currently,
# you should use 180 for N8 ROMs and 80 for everything else.
#
# SYS specifies the system variant to build in. CPM will
# build traditional CP/M. ZSYS will build ZSystem which
# currently means ZSDOS 1.2 & ZCPR 1.0
#
# ROMNAME names the output file. It defaults to
# CONFIG. The output of the build will be:
# <ROMNAME>.rom, <ROMNAME>.sys, and <ROMNAME>.com.
#
# These variables can be passed into the makefile by the command
# line, hardcoded in this file, or set as environment variables
# in the OS. To use a command line, use the following format:
#
# make CONFIG=<config> ROMSIZE=<romsize> CPU=<cpu> SYS=<sys> ROMNAME=<romname>
#
# An example of this is:
#
# make CONFIG=n8vem ROMSIZE=512 CPU=80 SYS=CPM ROMNAME=n8vem
#
# Alternatively, you can specify the variables by hardcoding them
# in this file. To do so, uncomment the five lines after these
# comments and change the values as desired.
# If the variables are specified this way, you would then invoke
# the make by simply using "make"
#
# If you want to set them as environment variables, you can
# do this with commands like the following at an OS command
# prompt or in a batch file:
#
# SET CONFIG=zeta
# SET ROMSIZE=512
# SET CPU=80
# SET SYS=CPM
# SET ROMNAME=zeta
#
# Note: use "make clean" to delete temporary and output files
#
# A good idea is to do a clean with every build and this can be
# accomplished on one command line doing something like this:
#
# make clean all CONFIG=n8vem ROMSIZE=512 CPU=80 SYS=CPM ROMNAME=n8vem
#
# or, if you are using hard coded variables above:
#
# make clean all
#
# Uncomment and update values below to hardcode settings:
#
CONFIG := n8_2312
ROMSIZE := 512
CPU := 180
SYS := CPM
ROMNAME := n8_2312
ifndef ROMNAME
ROMNAME := $(CONFIG)
endif
CPMCP := bin/CPMCP
CVT := bin/CVT2LINUX
SRC := ../Source/
ROMDSKFILES := ../RomDsk/$(SYS)_$(ROMSIZE)KB/*.* ../RomDsk/cfg_$(CONFIG)/*.* ../Apps/core/*.*
ifeq "$(SYS)" "CPM"
DOSBIN := bdosb01.bin
CPBIN := ccpb03.bin
else
DOSBIN :s= zsdos.bin
CPBIN := zcprw.bin
endif
OUTDIR := ../Output
TASM := bin/TASM
TASMTABS := bin
export TASMTABS
ASMOPT80 := -t$(CPU) -g3
ASMOPT85 := -t85 -g3
ASM80 := $(TASM) $(ASMOPT80)
ASM85 := $(TASM) $(ASMOPT85)
ASMIMG := $(TASM) $(ASMOPT80) -b -fE5
NULL :=
SPACE := ${NULL} ${NULL}
%.bin: %.asm
$(ASM80) $< $@
%.com: %.asm
$(ASM80) $< $@
%.img: %.asm
$(ASMIMG) $< $@
%.exe: %.cpp
$(CC) $< -o $@
ifneq ($(MAKECMDGOALS),clean)
ifeq "$(and $(CONFIG), $(ROMSIZE), $(CPU), $(SYS), $(ROMNAME))" ""
$(error sage: make CONFIG=<config> ROMSIZE=[512|1024] CPU=[80|180] SYS=[CPM|ZSYS] ROMNAME=<romname>)
endif
endif
all: tasm80.tab tasm85.tab $(OUTDIR)/$(ROMNAME).rom $(OUTDIR)/$(ROMNAME).sys $(OUTDIR)/$(ROMNAME).com
tasm80.tab: bin/TASM80.TAB
cp bin/TASM80.TAB tasm80.tab
tasm85.tab: bin/TASM85.TAB
cp bin/TASM85.TAB tasm85.tab
build.inc:
/bin/echo ';' >$@
/bin/echo -n '; RomWBW Configured for '$(CONFIG)' ' >>$@
date >> $@
/bin/echo ; >>$@
/bin/echo -n '#DEFINE TIMESTAMP "' >>$@
date '+%Y %m %d %H%M"' >>$@
/bin/echo ; >>$@
/bin/echo '#DEFINE VARIANT "WBW-$(USERNAME)"' >>$@
/bin/echo ; >>$@
/bin/echo ROMSIZE .EQU $(ROMSIZE) >>$@
/bin/echo ; >>$@
/bin/echo '#INCLUDE "config_'$(CONFIG)'.asm"' >>$@
/bin/echo ; >>$@
bootrom.bin : bootrom.asm std.asm build.inc ver.inc memmgr.asm config_$(CONFIG).asm
$(TASM) $(ASMOPT80) $< $@
bootapp.bin: bootapp.asm std.asm build.inc ver.inc
$(TASM) $(ASMOPT80) $< $@
pgzero.bin: pgzero.asm std.asm build.inc ver.inc
$(TASM) $(ASMOPT80) $< $@
zcprw.bin: zcprw.asm zcpr.asm
$(TASM) $(ASMOPT85) $< $@
zsdos.bin: zsdos.asm zsdos.lib zsdos-gp.z80
$(TASM) $(ASMOPT80) $< $@
cbios.bin: cbios.asm fd_data.asm ide_data.asm ppide_data.asm sd_data.asm prp_data.asm ppp_data.asm uart.asm vdu.asm std.asm ver.inc build.inc infolist.inc
$(TASM) $(ASMOPT80) -dBLD_SYS=SYS_$(SYS) $< $@
dbgmon.bin: dbgmon.asm std.asm ver.inc build.inc
syscfg.bin: syscfg.asm std.asm build.inc ver.inc
os.bin: $(CPBIN) $(DOSBIN) cbios.bin
cat $(CPBIN) $(DOSBIN) cbios.bin >>$@
rom0.bin: pgzero.bin bootrom.bin syscfg.bin loader.bin romfill.bin dbgmon.bin os.bin hbfill.bin
cat pgzero.bin bootrom.bin syscfg.bin loader.bin romfill.bin dbgmon.bin os.bin hbfill.bin >>$@
rom1.bin: pgzero.bin bootrom.bin syscfg.bin loader.bin bnk1.bin
cat pgzero.bin bootrom.bin syscfg.bin loader.bin bnk1.bin >>$@
$(OUTDIR)/$(ROMNAME).rom: rom0.bin rom1.bin $(ROMDISKFILES) $(OUTDIR)/$(ROMNAME).sys diskdefs
cp $(SRC)blank$(ROMSIZE)KB.dat RomDisk.tmp
$(CPMCP) -f rom$(ROMSIZE)KB RomDisk.tmp $(ROMDSKFILES) 0:
$(CPMCP) -f rom$(ROMSIZE)KB RomDisk.tmp ../Output/$(ROMNAME).sys 0:$(SYS).sys
cat rom0.bin rom1.bin RomDisk.tmp >>$@
$(OUTDIR)/$(ROMNAME).com: bootapp.bin syscfg.bin loader.bin bnk1.bin dbgmon.bin os.bin
cat bootapp.bin syscfg.bin loader.bin bnk1.bin dbgmon.bin os.bin >>$@
$(OUTDIR)/$(ROMNAME).sys: prefix.bin os.bin
cat prefix.bin os.bin >>$@
ansi.asm: $(SRC)ansi.asm
cp $< $@
$(CVT) $@
bdosb01.asm: $(SRC)bdosb01.asm
cp $< $@
$(CVT) $@
bnk1.asm: $(SRC)bnk1.asm fd.asm ppide.asm n8v.asm ppk.asm sd.asm tty.asm ansi.asm
cp $(SRC)bnk1.asm $@
$(CVT) $@
bootapp.asm: $(SRC)bootapp.asm
cp $< $@
$(CVT) $@
bootrom.asm: $(SRC)bootrom.asm
cp $< $@
$(CVT) $@
cbios.asm: $(SRC)cbios.asm
cp $< $@
$(CVT) $@
ccpb03.asm: $(SRC)ccpb03.asm
cp $< $@
$(CVT) $@
cnfgdata.inc: $(SRC)cnfgdata.inc
cp $< $@
$(CVT) $@
##config_zeta.asm: $(SRC)config_zeta.asm
## cp $< $@
## $(CVT) $@
config_$(CONFIG).asm: $(SRC)config_$(CONFIG).asm
cp $< $@
$(CVT) $@
dbgmon.asm: $(SRC)dbgmon.asm
cp $< $@
$(CVT) $@
diskdefs: $(SRC)diskdefs
cp $< $@
$(CVT) $@
fd.asm: $(SRC)fd.asm
cp $< $@
$(CVT) $@
fd_data.asm: $(SRC)fd_data.asm
cp $< $@
$(CVT) $@
hbfill.asm: $(SRC)hbfill.asm
cp $< $@
$(CVT) $@
ide_data.asm: $(SRC)ide_data.asm
cp $< $@
$(CVT) $@
infolist.inc: $(SRC)infolist.inc
cp $< $@
$(CVT) $@
loader.asm: $(SRC)loader.asm util.asm
cp $(SRC)loader.asm $@
$(CVT) $@
memmgr.asm: $(SRC)memmgr.asm
cp $< $@
$(CVT) $@
n8v.asm: $(SRC)n8v.asm
cp $< $@
$(CVT) $@
pgzero.asm: $(SRC)pgzero.asm
cp $< $@
$(CVT) $@
ppide.asm: $(SRC)ppide.asm
cp $< $@
$(CVT) $@
ppide_data.asm: $(SRC)ppide_data.asm
cp $< $@
$(CVT) $@
ppk.asm: $(SRC)ppk.asm
cp $< $@
$(CVT) $@
ppp_data.asm: $(SRC)ppp_data.asm
cp $< $@
$(CVT) $@
prefix.asm: $(SRC)prefix.asm
cp $< $@
$(CVT) $@
prp_data.asm: $(SRC)prp_data.asm
cp $< $@
$(CVT) $@
romfill.asm: $(SRC)romfill.asm
cp $< $@
$(CVT) $@
sd.asm: $(SRC)sd.asm
cp $< $@
$(CVT) $@
sd_data.asm: $(SRC)sd_data.asm
cp $< $@
$(CVT) $@
std.asm: $(SRC)std.asm
cp $< $@
$(CVT) $@
syscfg.asm: $(SRC)syscfg.asm config_$(CONFIG).asm cnfgdata.inc
cp $< $@
$(CVT) $@
tty.asm: $(SRC)tty.asm
cp $< $@
$(CVT) $@
uart.asm: $(SRC)uart.asm
cp $< $@
$(CVT) $@
util.asm: $(SRC)util.asm
cp $< $@
$(CVT) $@
vdu.asm: $(SRC)vdu.asm
cp $< $@
$(CVT) $@
ver.inc: $(SRC)ver.inc
cp $< $@
$(CVT) $@
clean:
rm -f *.tab *.TAB *.inc *.asm *.bin *.com *.img *.rom *.lst *.exp *.tmp
rm -f build.inc diskdefs
rm -f $(OUTDIR)/*.*

BIN
branches/dwg/LSource/bin/CPMCHATTR

Binary file not shown.

BIN
branches/dwg/LSource/bin/CPMCHMOD

Binary file not shown.

BIN
branches/dwg/LSource/bin/CPMCP

Binary file not shown.

BIN
branches/dwg/LSource/bin/CPMLS

Binary file not shown.

BIN
branches/dwg/LSource/bin/CPMRM

Binary file not shown.

BIN
branches/dwg/LSource/bin/CVT2LINUX

Binary file not shown.

BIN
branches/dwg/LSource/bin/TASM

Binary file not shown.

215
branches/dwg/LSource/bin/TASM05.TAB

@ -0,0 +1,215 @@
"TASM 6805 Assembler. "
/***************************************************************************
/* $Id
/***************************************************************************
/* This is the instruction set definition table for the 6805 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorported, April 1988.
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
/*-------------------------------------------*/
ADC #* A9 2 NOP 1
ADC ,X F9 1 NOP 1
ADC *,X D9 3 MZERO 1
ADC * C9 3 MZERO 1
ADD #* AB 2 NOP 1
ADD ,X FB 1 NOP 1
ADD *,X DB 3 MZERO 1
ADD * CB 3 MZERO 1
AND #* A4 2 NOP 1
AND ,X F4 1 NOP 1
AND *,X D4 3 MZERO 1
AND * C4 3 MZERO 1
ASLA "" 48 1 NOP 1
ASLX "" 58 1 NOP 1
ASL ,X 78 1 NOP 1
ASL *,X 68 2 NOP 1
ASL * 38 2 NOP 1
ASRA "" 47 1 NOP 1
ASRX "" 57 1 NOP 1
ASR ,X 77 1 NOP 1
ASR *,X 67 2 NOP 1
ASR * 37 2 NOP 1
BCC * 24 2 R1 1
BCLR *,* 11 2 MBIT 1
BCS * 25 2 R1 1
BEQ * 27 2 R1 1
BHCC * 28 2 R1 1
BHCS * 29 2 R1 1
BHI * 22 2 R1 1
BHS * 24 2 R1 1
BIH * 2F 2 R1 1
BIL * 2E 2 R1 1
BIT #* A5 2 NOP 1
BIT ,X F5 1 NOP 1
BIT *,X D5 3 MZERO 1
BIT * C5 3 MZERO 1
BLO * 25 2 R1 1
BLS * 23 2 R1 1
BMC * 2C 2 R1 1
BMI * 2B 2 R1 1
BMS * 2D 2 R1 1
BNE * 26 2 R1 1
BPL * 2A 2 R1 1
BRA * 20 2 R1 1
BRCLR *,*,* 01 3 MBIT 1
BRN * 21 2 R1 1
BRSET *,*,* 00 3 MBIT 1
BSET *,* 10 2 MBIT 1
BSR * AD 2 R1 1
CLC "" 98 1 NOP 1
CLI "" 9A 1 NOP 1
CLRA "" 4F 1 NOP 1
CLRX "" 5F 1 NOP 1
CLR ,X 7F 1 NOP 1
CLR *,X 6F 2 NOP 1
CLR * 3F 2 NOP 1
CMP #* A1 2 NOP 1
CMP ,X F1 1 NOP 1
CMP *,X D1 3 MZERO 1
CMP * C1 3 MZERO 1
CMPX #* A3 2 NOP 1 /* equivalent to CPX */
CMPX ,X F3 1 NOP 1
CMPX *,X D3 3 MZERO 1
CMPX * C3 3 MZERO 1
COMA "" 43 1 NOP 1
COMX "" 53 1 NOP 1
COM ,X 73 1 NOP 1
COM *,X 63 2 NOP 1
COM * 33 2 NOP 1
CPX #* A3 2 NOP 1
CPX ,X F3 1 NOP 1
CPX *,X D3 3 MZERO 1
CPX * C3 3 MZERO 1
DECA "" 4A 1 NOP 1
DECX "" 5A 1 NOP 1
DEX "" 5A 1 NOP 1
DEC ,X 7A 1 NOP 1
DEC *,X 6A 2 NOP 1
DEC * 3A 2 NOP 1
EOR #* A8 2 NOP 1
EOR ,X F8 1 NOP 1
EOR *,X D8 3 MZERO 1
EOR * C8 3 MZERO 1
INCA "" 4C 1 NOP 1
INCX "" 5C 1 NOP 1
INX "" 5C 1 NOP 1
INC ,X 7C 1 NOP 1
INC *,X 6C 2 NOP 1
INC * 3C 2 NOP 1
JMP ,X FC 1 NOP 1
JMP *,X DC 3 MZERO 1
JMP * CC 3 MZERO 1
JSR ,X FD 1 NOP 1
JSR *,X DD 3 MZERO 1
JSR * CD 3 MZERO 1
LDA #* A6 2 NOP 1
LDA ,X F6 1 NOP 1
LDA *,X D6 3 MZERO 1
LDA * C6 3 MZERO 1
LDX #* AE 2 NOP 1
LDX ,X FE 1 NOP 1
LDX *,X DE 3 MZERO 1
LDX * CE 3 MZERO 1
LSLA "" 48 1 NOP 1
LSLX "" 58 1 NOP 1
LSL ,X 78 1 NOP 1
LSL *,X 68 2 NOP 1
LSL * 38 2 NOP 1
LSRA "" 44 1 NOP 1
LSRX "" 54 1 NOP 1
LSR ,X 74 1 NOP 1
LSR *,X 64 2 NOP 1
LSR * 34 2 NOP 1
MUL "" 42 1 NOP 4 /* HC05C4 only */
NEGA "" 40 1 NOP 1
NEGX "" 50 1 NOP 1
NEG ,X 70 1 NOP 1
NEG *,X 60 2 NOP 1
NEG * 30 2 NOP 1
NOP "" 9D 1 NOP 1
ORA #* AA 2 NOP 1
ORA ,X FA 1 NOP 1
ORA *,X DA 3 MZERO 1
ORA * CA 3 MZERO 1
ROLA "" 49 1 NOP 1
ROLX "" 59 1 NOP 1
ROL ,X 79 1 NOP 1
ROL *,X 69 2 NOP 1
ROL * 39 2 NOP 1
RORA "" 46 1 NOP 1
RORX "" 56 1 NOP 1
ROR ,X 76 1 NOP 1
ROR *,X 66 2 NOP 1
ROR * 36 2 NOP 1
RSP "" 9C 1 NOP 1
RTI "" 80 1 NOP 1
RTS "" 81 1 NOP 1
SBC #* A2 2 NOP 1
SBC ,X F2 1 NOP 1
SBC *,X D2 3 MZERO 1
SBC * C2 3 MZERO 1
SEC "" 99 1 NOP 1
SEI "" 9B 1 NOP 1
STA ,X F7 1 NOP 1
STA *,X D7 3 MZERO 1
STA * C7 3 MZERO 1
STOP "" 8E 1 NOP 2 /* M146805 CMOS only */
STX ,X FF 1 NOP 1
STX *,X DF 3 MZERO 1
STX * CF 3 MZERO 1
SUB #* A0 2 NOP 1
SUB ,X F0 1 NOP 1
SUB *,X D0 3 MZERO 1
SUB * C0 3 MZERO 1
SWI "" 83 1 NOP 1
TAX "" 97 1 NOP 1
TSTA "" 4D 1 NOP 1
TSTX "" 5D 1 NOP 1
TST ,X 7D 1 NOP 1
TST *,X 6D 2 NOP 1
TST * 3D 2 NOP 1
TXA "" 9F 1 NOP 1
WAIT "" 8F 1 NOP 2 /* M146805 CMOS only */

205
branches/dwg/LSource/bin/TASM3210.TAB

@ -0,0 +1,205 @@
"TASM TMS32010 Assembler."
/****************************************************************************
/* $Id: tasm3210.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* This is the instruction set definition table
/* for the TMS32010 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorporated
/*
/* See TASM manual for info on table structure.
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT MASK */
/*-------------------------------------------*/
/* Generate opcodes high byte first */
.MSFIRST
/* Don't use '*' as the wild card since it is used for indirect addressing */
/* In this table '@' is the wild card indicating where expression may appear*/
.ALTWILD
/* Use word addressing (not byte addressing)
.WORDADDRS
/* All shift/and stuff applies to opcodes, not args
.NOARGSHIFT
.REGSET *+ A0 1
.REGSET *- 90 1
.REGSET * 80 1
ABS "" 7F88 2 NOP 1
ADD !,@,@ 0000 2 T1 1 8 0F00
ADD !,@ 0008 2 T1 1 8 0F00
ADD ! 0008 2 NOP 1
ADD @,@ 0000 2 TDMA 1 8 0F00
ADD @ 0000 2 T1 1 0 007F
ADDH !,@ 6000 2 T1 1 0 01
ADDH ! 6008 2 NOP 1
ADDH @ 6000 2 T1 1 0 007F
ADDS !,@ 6100 2 T1 1 0 01
ADDS ! 6108 2 NOP 1
ADDS @ 6100 2 T1 1 0 007F
AND !,@ 7900 2 T1 1 0 01
AND ! 7908 2 NOP 1
AND @ 7900 2 T1 1 0 7F
APAC "" 7F8F 2 NOP 1
B @ F900 4 SWAP 1
BANZ @ F400 4 SWAP 1
BGEZ @ FD00 4 SWAP 1
BGZ @ FC00 4 SWAP 1
BIOZ @ F600 4 SWAP 1
BLEZ @ FB00 4 SWAP 1
BLZ @ FA00 4 SWAP 1
BNZ @ FE00 4 SWAP 1
BV @ F500 4 SWAP 1
BZ @ FF00 4 SWAP 1
CALA "" 7F8C 2 NOP 1
CALL @ F800 4 SWAP 1
DINT "" 7F81 2 NOP 1
DMOV !,@ 6900 2 T1 1 0 01
DMOV ! 6908 2 NOP 1
DMOV @ 6900 2 T1 1 0 007F
EINT "" 7F82 2 NOP 1
IN !,@,@ 4000 2 T1 1 8 0700
IN !,@ 4008 2 T1 1 8 0700
IN @,@ 4000 2 TDMA 1 8 0700
LAC !,@,@ 2000 2 T1 1 8 0F00
LAC !,@ 2008 2 T1 1 8 0F00
LAC ! 2008 2 NOP 1
LAC @,@ 2000 2 TDMA 1 8 0F00
LAC @ 2000 2 T1 1 0 007F
LACK @ 7E00 2 T1 1 0 00FF
LAR @,!,@ 3800 2 TAR 1 0 0001
LAR @,! 3808 2 TAR 1 0 0001
LAR @,@ 3800 2 TAR 1 0 007F
LARK @,@ 7000 2 TAR 1 0 00FF
LARP @ 6880 2 T1 1 0 0001
LDP !,@ 6F00 2 T1 1 0 01
LDP ! 6F08 2 NOP 1
LDP @ 6F00 2 T1 1 0 007F
LDPK @ 6E00 2 T1 1 0 01
LST !,@ 7B00 2 T1 1 0 01
LST ! 7B08 2 NOP 1
LST @ 7B00 2 T1 1 0 007F
LT !,@ 6A00 2 T1 1 0 01
LT ! 6A08 2 NOP 1
LT @ 6A00 2 T1 1 0 007F
LTA !,@ 6C00 2 T1 1 0 01
LTA ! 6C08 2 NOP 1
LTA @ 6C00 2 T1 1 0 007F
LTD !,@ 6B00 2 T1 1 0 01
LTD ! 6B08 2 NOP 1
LTD @ 6B00 2 T1 1 0 007F
MAR !,@ 6800 2 T1 1 0 01
MAR ! 6808 2 NOP 1
MAR @ 6800 2 T1 1 0 007F
MPY !,@ 6D00 2 T1 1 0 01
MPY ! 6D08 2 NOP 1
MPY @ 6D00 2 T1 1 0 007F
MPYK @ 8000 2 T1 1 0 1FFF
NOP "" 7F80 2 NOP 1
OR !,@ 7A00 2 T1 1 0 01
OR ! 7A08 2 NOP 1
OR @ 7A00 2 T1 1 0 007F
OUT !,@,@ 4800 2 T1 1 8 0700
OUT !,@ 4808 2 T1 1 8 0700
OUT @,@ 4800 2 TDMA 1 8 0700
PAC "" 7F8E 2 NOP 1
POP "" 7F9D 2 NOP 1
PUSH "" 7F9C 2 NOP 1
RET "" 7F8D 2 NOP 1
ROVM "" 7F8A 2 NOP 1
/* shift count for SACH can only be 0,1, or 4. The mask allows */
/* 0,1,4, or 5. Let the user beware */
SACH !,@,@ 5800 2 T1 1 8 0500
SACH !,@ 5808 2 T1 1 8 0500
SACH ! 5808 2 NOP 1
SACH @,@ 5800 2 TDMA 1 8 0500
SACH @ 5800 2 T1 1 0 007F
/* The data book shows a shift field for SACL but states it must be 0.
/* The previous version of this table left the shift field out
/* for simplicity, but here I have put it back for compatibility.
/* The AND mask is set to zero in this case so a error message
/* will result from non-zero shifts.
SACL !,@,@ 5000 2 T1 1 8 0000
SACL !,@ 5008 2 T1 1 8 0000
SACL ! 5008 2 NOP 1
SACL @,@ 5000 2 TDMA 1 8 0000
SACL @ 5000 2 T1 1 0 007F
SAR @,!,@ 3000 2 TAR 1 0 0001
SAR @,! 3008 2 TAR 1 0 0001
SAR @,@ 3000 2 TAR 1 0 007F
SOVM "" 7F8B 2 NOP 1
SPAC "" 7F90 2 NOP 1
SST !,@ 7C00 2 T1 1 0 0001
SST ! 7C08 2 NOP 1
SST @ 7C00 2 T1 1 0 007F
SUB !,@,@ 1000 2 T1 1 8 0F00
SUB !,@ 1008 2 T1 1 8 0F00
SUB ! 1008 2 NOP 1
SUB @,@ 1000 2 TDMA 1 8 0F00
SUB @ 1000 2 T1 1 0 007F
SUBC !,@ 6400 2 T1 1 0 01
SUBC ! 6408 2 NOP 1
SUBC @ 6400 2 T1 1 0 007F
SUBH !,@ 6200 2 T1 1 0 01
SUBH ! 6208 2 NOP 1
SUBH @ 6200 2 T1 1 0 007F
SUBS !,@ 6300 2 T1 1 0 01
SUBS ! 6308 2 NOP 1
SUBS @ 6300 2 T1 1 0 007F
TBLR !,@ 6700 2 T1 1 0 01
TBLR ! 6708 2 NOP 1
TBLR @ 6700 2 T1 1 0 007F
TBLW !,@ 7D00 2 T1 1 0 01
TBLW ! 7D08 2 NOP 1
TBLW @ 7D00 2 T1 1 0 007F
XOR !,@ 7800 2 T1 1 0 01
XOR ! 7808 2 NOP 1
XOR @ 7800 2 T1 1 0 007F
ZAC "" 7F89 2 NOP 1
ZALH !,@ 6500 2 T1 1 0 01
ZALH ! 6508 2 NOP 1
ZALH @ 6500 2 T1 1 0 007F
ZALS !,@ 6600 2 T1 1 0 01
ZALS ! 6608 2 NOP 1
ZALS @ 6600 2 T1 1 0 007F

456
branches/dwg/LSource/bin/TASM3225.TAB

@ -0,0 +1,456 @@
"TASM TMS32025 Assembler."
/****************************************************************************
/* $Id: tasm3225.tab 1.2 1997/09/28 22:16:44 toma Exp $
/****************************************************************************
/* This is the instruction set definition table
/* for the TMS32025 version of TASM.
/* Bob Stricklin
/*
/* See TASM manual for info on table structure.
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT MASK */
/*-------------------------------------------*/
/* Generate opcodes high byte first */
.MSFIRST
/* Don't use '*' as the wild card since it is used for indirect addressing */
/* In this table '@' is the wild card indicating where expression may appear*/
.ALTWILD
.WORDADDRS
.NOARGSHIFT
/* Addressing mode definitions.
/* Value gets OR'd in to the opcode if the
/* addressing mode is recognized
/* Note: no special classes are defined, so if this
/* table is used for TMS32020, invalid instructions
/* will not result in errors (no BR0+/- addressing mode (for example)
/* The ! character can match any of the patterns in the REGSET:
.REGSET *BR0+ F0 1
.REGSET *BR0- C0 1
.REGSET *0+ E0 1
.REGSET *0- D0 1
.REGSET *+ A0 1
.REGSET *- 90 1
.REGSET * 80 1
ABS "" CE1B 2 NOP 1
ADD !,@,@ 0088 2 T1 1 8 0F00
ADD !,@ 0080 2 T1 1 8 0F00
ADD ! 0080 2 NOP 1
ADD @,@ 0000 2 TDMA 1 8 0F00
ADD @ 0000 2 T1 1 0 007F
ADDC !,@ 4388 2 T1 1 0 0007
ADDC ! 4380 2 NOP 1
ADDC @ 4300 2 T1 1 0 007F
ADDH !,@ 4888 2 T1 1 0 0007
ADDH ! 4880 2 NOP 1
ADDH @ 4800 2 T1 1 0 007F
ADDK @ CC00 2 T1 1 0 00FF ;8 bit constant
ADDS !,@ 4988 2 T1 1 0 0007
ADDS ! 4980 2 NOP 1
ADDS @ 4900 2 T1 1 0 007F
ADDT !,@ 4A88 2 T1 1 0 0007
ADDT ! 4A80 2 NOP 1
ADDT @ 4A00 2 T1 1 0 007F
ADLK @,@ D002 4 TLK 1 8 0F00
ADLK @ D002 4 TLK 1
ADRK @ 7E00 2 T1 1 0 00FF ;8 bit constant
AND !,@ 4E88 2 T1 1 0 0007
AND ! 4E80 2 NOP 1
AND @ 4E00 2 T1 1 0 007F
ANDK @,@ D004 4 TLK 1 8 0F00
ANDK @ D004 4 TLK 1
APAC "" CE15 2 NOP 1
B @,!,@ FF88 4 TLK 1 0 07
B @,! FF80 4 SWAP 1
B @ FF80 4 SWAP 1
BACC "" CE25 2 NOP 1
BANZ @,!,@ FB88 4 TLK 1 0 07
BANZ @,! FB80 4 SWAP 1
BANZ @ FB90 4 SWAP 1 ; Default to the equivalent of
; BANZ loop,*- (as per spec) for
; TMS32010 compatibility.
BBNZ @,!,@ F988 4 TLK 1 0 07
BBNZ @,! F980 4 SWAP 1
BBNZ @ F980 4 SWAP 1
BBZ @,!,@ F888 4 TLK 1 0 07
BBZ @,! F880 4 SWAP 1
BBZ @ F880 4 SWAP 1
BC @,!,@ 5E88 4 TLK 1 0 07
BC @,! 5E80 4 SWAP 1
BC @ 5E80 4 SWAP 1
BGEZ @,!,@ F488 4 TLK 1 0 07
BGEZ @,! F480 4 SWAP 1
BGEZ @ F480 4 SWAP 1
BGZ @,!,@ F188 4 TLK 1 0 07
BGZ @,! F180 4 SWAP 1
BGZ @ F180 4 SWAP 1
BIOZ @,!,@ FA88 4 TLK 1 0 07
BIOZ @,! FA80 4 SWAP 1
BIOZ @ FA80 4 SWAP 1
BIT !,@,@ 9088 2 T1 1 8 0F00 ;8 bit shift
BIT !,@ 9080 2 T1 1 8 0F00
BIT @,@ 9000 2 TDMA 1 8 0F00
BITT !,@ 5788 2 T1 1 0 07
BITT ! 5780 2 T1 1
BITT @ 5700 2 T1 1 0 7F
BLEZ @,!,@ F288 4 TLK 1 0 07
BLEZ @,! F280 4 SWAP 1
BLEZ @ F280 4 SWAP 1
BLKD @,!,@ FD88 4 TLK 1 0 07
BLKD @,! FD80 4 TLK 1 0 07
BLKD @,@ FD00 4 TLK 1 0 FF
BLKP @,!,@ FC88 4 TLK 1 0 07
BLKP @,! FC80 4 TLK 1 0 07
BLKP @,@ FC00 4 TLK 1 0 FF
BLZ @,!,@ F388 4 TLK 1 0 07
BLZ @,! F380 4 SWAP 1
BLZ @ F380 4 SWAP 1
BNC @,!,@ 5F88 4 TLK 1 0 07
BNC @,! 5F80 4 SWAP 1
BNC @ 5F80 4 SWAP 1
BNV @,!,@ F788 4 TLK 1 0 07
BNV @,! F780 4 SWAP 1
BNV @ F780 4 SWAP 1
BNZ @,!,@ F588 4 TLK 1 0 07
BNZ @,! F580 4 SWAP 1
BNZ @ F580 4 SWAP 1
BV @,!,@ F088 4 TLK 1 0 07
BV @,! F080 4 SWAP 1
BV @ F080 4 SWAP 1
BZ @,!,@ F688 4 TLK 1 0 07
BZ @,! F680 4 SWAP 1
BZ @ F680 4 SWAP 1
CALA "" CE24 2 NOP 1
CALL @,!,@ FE88 4 TLK 1 0 07
CALL @,! FE80 4 SWAP 1
CALL @ FE80 4 SWAP 1
CMPL "" CE27 2 NOP 1
CMPR @ CE50 2 T1 1 0 03 ;2 BIT CONTANT
CNFD "" CE04 2 NOP 1
CNFP "" CE05 2 NOP 1
CONF "" CE3C 2 T1 4 0 03 ; c26 ONLY
DINT "" CE01 2 NOP 1
DMOV !,@ 5688 2 T1 1 0 07
DMOV ! 5680 2 NOP 1
DMOV @ 5600 2 T1 1 0 007F
EINT "" CE00 2 NOP 1
FORT @ CE0E 2 T1 1 0 01
IDLE "" CE1F 2 NOP 1
IN !,@,@ 8088 2 T1 1 8 0F00
IN !,@ 8080 2 T1 1 8 0F00
IN @,@ 8000 2 TDMA 1 8 0F00
LAC !,@,@ 2088 2 T1 1 8 0F00
LAC !,@ 2080 2 T1 1 8 0F00
LAC ! 2080 2 NOP 1
LAC @,@ 2000 2 TDMA 1 8 0F00
LAC @ 2000 2 T1 1 0 007F
LACK @ CA00 2 T1 1 0 00FF ;tested for -25
LACT !,@ 4288 2 T1 1 0 07
LACT ! 4280 2 NOP 1
LACT @ 4200 2 T1 1 0 007F
LALK @,@ D001 4 TLK 1 8 0F00
LALK @ D001 4 TLK 1
LAR @,!,@ 3088 2 TAR 1 0 07
LAR @,! 3080 2 TAR 1 0 07
LAR @,@ 3000 2 TAR 1 0 7F
LARK @,@ C000 2 TAR 1 0 00FF
LARP @ 5588 2 T1 1 0 0007
LDP !,@ 5288 2 T1 1 0 07
LDP ! 5280 2 NOP 1
LDP @ 5200 2 T1 1 0 007F
LDPK @ C800 2 T1 1 0 01FF ;9 bit constant
LPH !,@ 5388 2 T1 1 0 07
LPH ! 5380 2 NOP 1
LPH @ 5300 2 T1 1 0 7F
LRLK @,@ D000 4 T5 1 8 0700 ;<arp>, <const16>
LST !,@ 5088 2 T1 1 0 07
LST ! 5080 2 NOP 1
LST @ 5000 2 T1 1 0 7F
LST1 !,@ 5188 2 T1 1 0 07
LST1 ! 5180 2 NOP 1
LST1 @ 5100 2 T1 1 0 7F
LT !,@ 3C88 2 T1 1 0 07
LT ! 3C80 2 NOP 1
LT @ 3C00 2 T1 1 0 7F
LTA !,@ 3D88 2 T1 1 0 07
LTA ! 3D80 2 NOP 1
LTA @ 3D00 2 T1 1 0 7F
LTD !,@ 3F88 2 T1 1 0 07
LTD ! 3F80 2 NOP 1
LTD @ 3F00 2 T1 1 0 7F
LTP !,@ 3E88 2 T1 1 0 07
LTP ! 3E80 2 NOP 1
LTP @ 3E00 2 T1 1 0 7F
LTS !,@ 5B88 2 T1 1 0 07
LTS ! 5B80 2 NOP 1
LTS @ 5B00 2 T1 1 0 7F
MAC @,!,@ 5D88 4 TLK 1 0 07
MAC @,! 5D80 4 TLK 1 0 07
MAC @,@ 5D00 4 TLK 1 0 7F
MACD @,!,@ 5C88 4 TLK 1 0 07
MACD @,! 5C80 4 TLK 1 0 07
MACD @,@ 5C00 4 TLK 1 0 7F
MAR !,@ 5588 2 T1 1 0 07
MAR ! 5580 2 NOP 1
MAR @ 5500 2 T1 1 0 7F
MPY !,@ 3888 2 T1 1 0 07
MPY ! 3880 2 NOP 1
MPY @ 3800 2 T1 1 0 7F
MPYA !,@ 3A88 2 T1 1 0 07
MPYA ! 3A80 2 NOP 1
MPYA @ 3A00 2 T1 1 0 7F
MPYK @ A000 2 T1 1 0 1FFF ;13 BIT CONTSTANT
MPYS !,@ 3B88 2 T1 1 0 07
MPYS ! 3B80 2 NOP 1
MPYS @ 3B00 2 T1 1 0 7F
MPYU !,@ CF88 2 T1 1 0 07
MPYU ! CF80 2 NOP 1
MPYU @ CF00 2 T1 1 0 7F
NEG "" CE23 2 NOP 1
NOP "" 5500 2 NOP 1
NORM ! CE82 2 NOP 1 ; C25
NORM "" CEA2 2 NOP 1 ; C20
OR !,@ 4D88 2 T1 1 0 07
OR ! 4D80 2 NOP 1
OR @ 4D00 2 T1 1 0 7F
ORK @,@ D005 4 TLK 1 8 0F00
ORK @ D005 4 TLK 1
OUT !,@,@ E088 2 T1 1 8 0F00
OUT !,@ E080 2 T1 1 8 0F00
OUT @,@ E000 2 TDMA 1 8 0F00
PAC "" CE14 2 NOP 1
POP "" CE1D 2 NOP 1
POPD !,@ 7A88 2 T1 1 0 07
POPD ! 7A80 2 NOP 1
POPD @ 7A00 2 T1 1 0 7F
PSHD !,@ 5488 2 T1 1 0 07
PSHD ! 5480 2 NOP 1
PSHD @ 5400 2 T1 1 0 7F
PUSH "" CE1C 2 NOP 1
RC "" CE30 2 NOP 1
RET "" CE26 2 NOP 1
RFSM "" CE36 2 NOP 1
RHM "" CE38 2 NOP 1
ROL "" CE34 2 NOP 1
ROR "" CE35 2 NOP 1
ROVM "" CE02 2 NOP 1
RPT !,@ 4B88 2 T1 1 0 07
RPT ! 4B80 2 NOP 1
RPT @ 4B00 2 T1 1 0 7F
RPTK @ CB00 2 T1 1 0 00FF ;8 bit constant
RSXM "" CE06 2 NOP 1
RTC "" CE32 2 NOP 1
RTXM "" CE20 2 NOP 1
RXF "" CE0C 2 NOP 1
/* shift count for SACH can only be 0,1, or 4 FOR 32020
/* 0-7 FOR 320c25. For now, build the table specifically for the 320C25
SACH !,@,@ 6888 2 T1 1 8 0700
SACH !,@ 6880 2 T1 1 8 0700
SACH ! 6880 2 NOP 1
SACH @,@ 6800 2 TDMA 1 8 0700
SACH @ 6800 2 T1 1 0 007F
SACL !,@,@ 6088 2 T1 1 8 0700
SACL !,@ 6080 2 T1 1 8 0700
SACL ! 6080 2 NOP 1
SACL @,@ 6000 2 TDMA 1 8 0700
SACL @ 6000 2 T1 1 0 007F
SAR @,!,@ 7088 2 TAR 1 0 0007
SAR @,! 7080 2 TAR 1 0 0007
SAR @,@ 7000 2 TAR 1 0 007F
SBLK @,@ D003 4 TLK 1 8 0F00
SBLK @ D003 4 TLK 1
SBRK @ 7F00 2 T1 1 0 00FF
SC "" CE31 2 NOP 1
SFL "" CE18 2 NOP 1
SFR "" CE19 2 NOP 1
SFSM "" CE37 2 NOP 1
SHM "" CE39 2 NOP 1
SOVM "" CE03 2 NOP 1
SPAC "" CE16 2 NOP 1
SPH !,@ 7D88 2 T1 1 0 07
SPH ! 7D80 2 NOP 1
SPH @ 7D00 2 T1 1 0 7F
SPL !,@ 7C88 2 T1 1 0 07
SPL ! 7C80 2 NOP 1
SPL @ 7C00 2 T1 1 0 7F
SPM @ CE08 2 T1 1 0 03 ;2 bit constant
SQRA !,@ 3988 2 T1 1 0 07
SQRA ! 3980 2 NOP 1
SQRA @ 3900 2 T1 1 0 7F
SQRS !,@ 5A88 2 T1 1 0 07
SQRS ! 5A80 2 NOP 1
SQRS @ 5A00 2 T1 1 0 7F
SST !,@ 7888 2 T1 1 0 07
SST ! 7880 2 NOP 1
SST @ 7800 2 T1 1 0 7F
SST1 !,@ 7988 2 T1 1 0 07
SST1 ! 7980 2 NOP 1
SST1 @ 7900 2 T1 1 0 7F
SSXM "" CE07 2 NOP 1
STC "" CE33 2 NOP 1
STXM "" CE21 2 NOP 1
SUB !,@,@ 1088 2 T1 1 8 0F00
SUB !,@ 1080 2 T1 1 8 0F00
SUB ! 1080 2 NOP 1
SUB @,@ 1000 2 TDMA 1 8 0F00
SUB @ 1000 2 T1 1 0 007F
SUBB !,@ 4F88 2 T1 1 0 07
SUBB ! 4F80 2 NOP 1
SUBB @ 4F00 2 T1 1 0 7F
SUBC !,@ 4788 2 T1 1 0 07
SUBC ! 4780 2 NOP 1
SUBC @ 4700 2 T1 1 0 7F
SUBH !,@ 4488 2 T1 1 0 07
SUBH ! 4480 2 NOP 1
SUBH @ 4400 2 T1 1 0 7F
SUBK @ CD00 2 T1 1 0 00FF
SUBS !,@ 4588 2 T1 1 0 07
SUBS ! 4580 2 NOP 1
SUBS @ 4500 2 T1 1 0 7F
SUBT !,@ 4688 2 T1 1 0 07
SUBT ! 4680 2 NOP 1
SUBT @ 4600 2 T1 1 0 7F
SXF "" CE0D 2 NOP 1
TBLR !,@ 5888 2 T1 1 0 07
TBLR ! 5880 2 NOP 1
TBLR @ 5800 2 T1 1 0 7F
TBLW !,@ 5988 2 T1 1 0 07
TBLW ! 5980 2 NOP 1
TBLW @ 5900 2 T1 1 0 7F
TRAP "" CE1E 2 NOP 1
XOR !,@ 4C88 2 T1 1 0 07
XOR ! 4C80 2 NOP 1
XOR @ 4C00 2 T1 1 0 7F
XORK @,@ D006 4 TLK 1 8 0F00
XORK @ D006 4 TLK 1
ZAC "" CA00 2 NOP 1
ZALH !,@ 4088 2 T1 1 0 07
ZALH ! 4080 2 NOP 1
ZALH @ 4000 2 T1 1 0 7F
ZALR !,@ 7B88 2 T1 1 0 07
ZALR ! 7B80 2 NOP 1
ZALR @ 7B00 2 T1 1 0 7F
ZALS !,@ 4188 2 T1 1 0 07
ZALS ! 4180 2 NOP 1
ZALS @ 4100 2 T1 1 0 7F

281
branches/dwg/LSource/bin/TASM48.TAB

@ -0,0 +1,281 @@
"TASM 8048 Assembler. "
/****************************************************************************
/* $Id: tasm48.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* This is the instruction set definition table for the 8048 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorported, June 1987.
/* CLASS bits are assigned as follows:
/* bit 0 = 8X48, 8035, 8039, 8049 instructions
/* bit 1 = 8X41A
/* bit 2 = 8022
/* bit 3 = 8021
/* Note that some of the base instructions should be disabled for the
/* 8041, 8022, and 8021, but are not.
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
/*-------------------------------------------*/
ADD A,R0 68 1 NOP 1
ADD A,R1 69 1 NOP 1
ADD A,R2 6A 1 NOP 1
ADD A,R3 6B 1 NOP 1
ADD A,R4 6C 1 NOP 1
ADD A,R5 6D 1 NOP 1
ADD A,R6 6E 1 NOP 1
ADD A,R7 6F 1 NOP 1
ADD A,@R0 60 1 NOP 1
ADD A,@R1 61 1 NOP 1
ADD A,#* 03 2 NOP 1
ADDC A,R0 78 1 NOP 1
ADDC A,R1 79 1 NOP 1
ADDC A,R2 7A 1 NOP 1
ADDC A,R3 7B 1 NOP 1
ADDC A,R4 7C 1 NOP 1
ADDC A,R5 7D 1 NOP 1
ADDC A,R6 7E 1 NOP 1
ADDC A,R7 7F 1 NOP 1
ADDC A,@R0 70 1 NOP 1
ADDC A,@R1 71 1 NOP 1
ADDC A,#* 13 2 NOP 1
ANL A,R0 58 1 NOP 1
ANL A,R1 59 1 NOP 1
ANL A,R2 5A 1 NOP 1
ANL A,R3 5B 1 NOP 1
ANL A,R4 5C 1 NOP 1
ANL A,R5 5D 1 NOP 1
ANL A,R6 5E 1 NOP 1
ANL A,R7 5F 1 NOP 1
ANL A,@R0 50 1 NOP 1
ANL A,@R1 51 1 NOP 1
ANL A,#* 53 2 NOP 1
ANL BUS,#* 98 2 NOP 1
ANL P1,#* 99 2 NOP 1
ANL P2,#* 9A 2 NOP 1
ANLD P4,A 9C 1 NOP 1
ANLD P5,A 9D 1 NOP 1
ANLD P6,A 9E 1 NOP 1
ANLD P7,A 9F 1 NOP 1
CALL * 14 2 JMP 1
CLR A 27 1 NOP 1
CLR C 97 1 NOP 1
CLR F0 85 1 NOP 1
CLR F1 A5 1 NOP 1
CPL A 37 1 NOP 1
CPL C A7 1 NOP 1
CPL F0 95 1 NOP 1
CPL F1 B5 1 NOP 1
DA A 57 1 NOP 1
DEC A 07 1 NOP 1
DEC R0 C8 1 NOP 1
DEC R1 C9 1 NOP 1
DEC R2 CA 1 NOP 1
DEC R3 CB 1 NOP 1
DEC R4 CC 1 NOP 1
DEC R5 CD 1 NOP 1
DEC R6 CE 1 NOP 1
DEC R7 CF 1 NOP 1
DIS I 15 1 NOP 1
DIS TCNTI 35 1 NOP 1
DJNZ R0,* E8 2 JTHISPAGE 1
DJNZ R1,* E9 2 JTHISPAGE 1
DJNZ R2,* EA 2 JTHISPAGE 1
DJNZ R3,* EB 2 JTHISPAGE 1
DJNZ R4,* EC 2 JTHISPAGE 1
DJNZ R5,* ED 2 JTHISPAGE 1
DJNZ R6,* EE 2 JTHISPAGE 1
DJNZ R7,* EF 2 JTHISPAGE 1
EN DMA E5 1 NOP 2 ;8041
EN FLAGS F5 1 NOP 2 ;8041
EN I 05 1 NOP 1
EN TCNTI 25 1 NOP 1
ENT0 CLK 75 1 NOP 1
IN A,DBB 22 1 NOP 2 ;8041
IN A,P0 08 1 NOP 8 ;8021
IN A,P1 09 1 NOP 1
IN A,P2 0A 1 NOP 1
INC A 17 1 NOP 1
INC R0 18 1 NOP 1
INC R1 19 1 NOP 1
INC R2 1A 1 NOP 1
INC R3 1B 1 NOP 1
INC R4 1C 1 NOP 1
INC R5 1D 1 NOP 1
INC R6 1E 1 NOP 1
INC R7 1F 1 NOP 1
INC @R0 10 1 NOP 1
INC @R1 11 1 NOP 1
INS A,BUS 08 1 NOP 1
JB0 * 12 2 JTHISPAGE 1
JB1 * 32 2 JTHISPAGE 1
JB2 * 52 2 JTHISPAGE 1
JB3 * 72 2 JTHISPAGE 1
JB4 * 92 2 JTHISPAGE 1
JB5 * B2 2 JTHISPAGE 1
JB6 * D2 2 JTHISPAGE 1
JB7 * F2 2 JTHISPAGE 1
JMP * 04 2 JMP 1
JC * F6 2 JTHISPAGE 1
JF0 * B6 2 JTHISPAGE 1
JF1 * 76 2 JTHISPAGE 1
JNC * E6 2 JTHISPAGE 1
JNI * 86 2 JTHISPAGE 1
JNIBF * D6 2 JTHISPAGE 2 ;8041
JNT0 * 26 2 JTHISPAGE 1
JNT1 * 46 2 JTHISPAGE 1
JNZ * 96 2 JTHISPAGE 1
JOBF * 86 2 JTHISPAGE 2 ;8041
JTF * 16 2 JTHISPAGE 1
JT0 * 36 2 JTHISPAGE 1
JT1 * 56 2 JTHISPAGE 1
JZ * C6 2 JTHISPAGE 1
JMPP @A B3 1 NOP 1
MOV A,PSW C7 1 NOP 1
MOV A,R0 F8 1 NOP 1
MOV A,R1 F9 1 NOP 1
MOV A,R2 FA 1 NOP 1
MOV A,R3 FB 1 NOP 1
MOV A,R4 FC 1 NOP 1
MOV A,R5 FD 1 NOP 1
MOV A,R6 FE 1 NOP 1
MOV A,R7 FF 1 NOP 1
MOV A,T 42 1 NOP 1
MOV A,@R0 F0 1 NOP 1
MOV A,@R1 F1 1 NOP 1
MOV A,#* 23 2 NOP 1
MOV PSW,A D7 1 NOP 1
MOV R0,A A8 1 NOP 1
MOV R1,A A9 1 NOP 1
MOV R2,A AA 1 NOP 1
MOV R3,A AB 1 NOP 1
MOV R4,A AC 1 NOP 1
MOV R5,A AD 1 NOP 1
MOV R6,A AE 1 NOP 1
MOV R7,A AF 1 NOP 1
MOV R0,#* B8 2 NOP 1
MOV R1,#* B9 2 NOP 1
MOV R2,#* BA 2 NOP 1
MOV R3,#* BB 2 NOP 1
MOV R4,#* BC 2 NOP 1
MOV R5,#* BD 2 NOP 1
MOV R6,#* BE 2 NOP 1
MOV R7,#* BF 2 NOP 1
MOV STS,A 90 1 NOP 2 ;8041
MOV T,A 62 1 NOP 1
MOV @R0,A A0 1 NOP 1
MOV @R1,A A1 1 NOP 1
MOV @R0,#* B0 2 NOP 1
MOV @R1,#* B1 2 NOP 1
MOVD A,P4 0C 1 NOP 1
MOVD A,P5 0D 1 NOP 1
MOVD A,P6 0E 1 NOP 1
MOVD A,P7 0F 1 NOP 1
MOVD P4,A 3C 1 NOP 1
MOVD P5,A 3D 1 NOP 1
MOVD P6,A 3E 1 NOP 1
MOVD P7,A 3F 1 NOP 1
MOVP A,@A A3 1 NOP 1
MOVP3 A,@A E3 1 NOP 1
MOVX A,@R0 80 1 NOP 1
MOVX A,@R1 81 1 NOP 1
MOVX @R0,A 90 1 NOP 1
MOVX @R1,A 91 1 NOP 1
NOP "" 00 1 NOP 1
ORL A,R0 48 1 NOP 1
ORL A,R1 49 1 NOP 1
ORL A,R2 4A 1 NOP 1
ORL A,R3 4B 1 NOP 1
ORL A,R4 4C 1 NOP 1
ORL A,R5 4D 1 NOP 1
ORL A,R6 4E 1 NOP 1
ORL A,R7 4F 1 NOP 1
ORL A,@R0 40 1 NOP 1
ORL A,@R1 41 1 NOP 1
ORL A,#* 43 2 NOP 1
ORL BUS,#* 88 2 NOP 1
ORL P1,#* 89 2 NOP 1
ORL P2,#* 8A 2 NOP 1
ORLD P4,A 8C 1 NOP 1
ORLD P5,A 8D 1 NOP 1
ORLD P6,A 8E 1 NOP 1
ORLD P7,A 8F 1 NOP 1
OUTL BUS,A 02 1 NOP 1
OUT DBB,A 02 1 NOP 2 ;8041
OUTL P0,A 90 1 NOP 8 ;8021
OUTL P1,A 39 1 NOP 1
OUTL P2,A 3A 1 NOP 1
RAD "" 80 1 NOP 4 ;8022
RET "" 83 1 NOP 1
RETI "" 93 1 NOP 4 ;8022
RETR "" 93 1 NOP 1
RL A E7 1 NOP 1
RLC A F7 1 NOP 1
RR A 77 1 NOP 1
RRC A 67 1 NOP 1
SEL AN0 85 1 NOP 4 ;8022
SEL AN1 95 1 NOP 4 ;8022
SEL MB0 E5 1 NOP 1
SEL MB1 F5 1 NOP 1
SEL RB0 C5 1 NOP 1
SEL RB1 D5 1 NOP 1
STOP TCNT 65 1 NOP 1
STRT CNT 45 1 NOP 1
STRT T 55 1 NOP 1
SWAP A 47 1 NOP 1
XCH A,R0 28 1 NOP 1
XCH A,R1 29 1 NOP 1
XCH A,R2 2A 1 NOP 1
XCH A,R3 2B 1 NOP 1
XCH A,R4 2C 1 NOP 1
XCH A,R5 2D 1 NOP 1
XCH A,R6 2E 1 NOP 1
XCH A,R7 2F 1 NOP 1
XCH A,@R0 20 1 NOP 1
XCH A,@R1 21 1 NOP 1
XCHD A,@R0 30 1 NOP 1
XCHD A,@R1 31 1 NOP 1
XRL A,R0 D8 1 NOP 1
XRL A,R1 D9 1 NOP 1
XRL A,R2 DA 1 NOP 1
XRL A,R3 DB 1 NOP 1
XRL A,R4 DC 1 NOP 1
XRL A,R5 DD 1 NOP 1
XRL A,R6 DE 1 NOP 1
XRL A,R7 DF 1 NOP 1
XRL A,@R0 D0 1 NOP 1
XRL A,@R1 D1 1 NOP 1
XRL A,#* D3 2 NOP 1

285
branches/dwg/LSource/bin/TASM51.TAB

@ -0,0 +1,285 @@
"TASM 8051 Assembler. "
/****************************************************************************
/* $Id: tasm51.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* This is the instruction set definition table for the 8051 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorported, June 1987.
/*
.NOARGSHIFT
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
/*-------------------------------------------*/
ACALL * 11 2 JMP 1 0 F800
ADD A,R0 28 1 NOP 1
ADD A,R1 29 1 NOP 1
ADD A,R2 2A 1 NOP 1
ADD A,R3 2B 1 NOP 1
ADD A,R4 2C 1 NOP 1
ADD A,R5 2D 1 NOP 1
ADD A,R6 2E 1 NOP 1
ADD A,R7 2F 1 NOP 1
ADD A,@R0 26 1 NOP 1
ADD A,@R1 27 1 NOP 1
ADD A,#* 24 2 NOP 1
ADD A,* 25 2 NOP 1
ADDC A,R0 38 1 NOP 1
ADDC A,R1 39 1 NOP 1
ADDC A,R2 3A 1 NOP 1
ADDC A,R3 3B 1 NOP 1
ADDC A,R4 3C 1 NOP 1
ADDC A,R5 3D 1 NOP 1
ADDC A,R6 3E 1 NOP 1
ADDC A,R7 3F 1 NOP 1
ADDC A,@R0 36 1 NOP 1
ADDC A,@R1 37 1 NOP 1
ADDC A,#* 34 2 NOP 1
ADDC A,* 35 2 NOP 1
AJMP * 01 2 JMP 1 0 F800
ANL A,R0 58 1 NOP 1
ANL A,R1 59 1 NOP 1
ANL A,R2 5A 1 NOP 1
ANL A,R3 5B 1 NOP 1
ANL A,R4 5C 1 NOP 1
ANL A,R5 5D 1 NOP 1
ANL A,R6 5E 1 NOP 1
ANL A,R7 5F 1 NOP 1
ANL A,@R0 56 1 NOP 1
ANL A,@R1 57 1 NOP 1
ANL A,#* 54 2 NOP 1
ANL A,* 55 2 NOP 1
ANL C,/* b0 2 NOP 1
ANL C,* 82 2 NOP 1
ANL *,A 52 2 NOP 1
ANL *,#* 53 3 COMBINE 1
CJNE A,#*,* b4 3 CR 1
CJNE A,*,* b5 3 CR 1
CJNE R0,#*,* b8 3 CR 1
CJNE R1,#*,* b9 3 CR 1
CJNE R2,#*,* ba 3 CR 1
CJNE R3,#*,* bb 3 CR 1
CJNE R4,#*,* bc 3 CR 1
CJNE R5,#*,* bd 3 CR 1
CJNE R6,#*,* be 3 CR 1
CJNE R7,#*,* bf 3 CR 1
CJNE @R0,#*,* b6 3 CR 1
CJNE @R1,#*,* b7 3 CR 1
CLR A e4 1 NOP 1
CLR C c3 1 NOP 1
CLR * c2 2 NOP 1
CPL A f4 1 NOP 1
CPL C b3 1 NOP 1
CPL * b2 2 NOP 1
DA A d4 1 NOP 1
DEC A 14 1 NOP 1
DEC R0 18 1 NOP 1
DEC R1 19 1 NOP 1
DEC R2 1A 1 NOP 1
DEC R3 1B 1 NOP 1
DEC R4 1C 1 NOP 1
DEC R5 1D 1 NOP 1
DEC R6 1E 1 NOP 1
DEC R7 1F 1 NOP 1
DEC @R0 16 1 NOP 1
DEC @R1 17 1 NOP 1
DEC * 15 2 NOP 1
DIV AB 84 1 NOP 1
DJNZ R0,* d8 2 R1 1
DJNZ R1,* d9 2 R1 1
DJNZ R2,* dA 2 R1 1
DJNZ R3,* dB 2 R1 1
DJNZ R4,* dC 2 R1 1
DJNZ R5,* dD 2 R1 1
DJNZ R6,* dE 2 R1 1
DJNZ R7,* dF 2 R1 1
DJNZ *,* d5 3 CR 1
INC A 04 1 NOP 1
INC R0 08 1 NOP 1
INC R1 09 1 NOP 1
INC R2 0A 1 NOP 1
INC R3 0B 1 NOP 1
INC R4 0C 1 NOP 1
INC R5 0D 1 NOP 1
INC R6 0E 1 NOP 1
INC R7 0F 1 NOP 1
INC @R0 06 1 NOP 1
INC @R1 07 1 NOP 1
INC DPTR a3 1 NOP 1
INC * 05 2 NOP 1
JB *,* 20 3 CR 1
JBC *,* 10 3 CR 1
JC * 40 2 R1 1
JMP @A+DPTR 73 1 NOP 1
JNB *,* 30 3 CR 1
JNC * 50 2 R1 1
JNZ * 70 2 R1 1
JZ * 60 2 R1 1
LCALL * 12 3 SWAP 1
LJMP * 02 3 SWAP 1
MOV A,R0 e8 1 NOP 1
MOV A,R1 e9 1 NOP 1
MOV A,R2 eA 1 NOP 1
MOV A,R3 eB 1 NOP 1
MOV A,R4 eC 1 NOP 1
MOV A,R5 eD 1 NOP 1
MOV A,R6 eE 1 NOP 1
MOV A,R7 eF 1 NOP 1
MOV A,@R0 e6 1 NOP 1
MOV A,@R1 e7 1 NOP 1
MOV A,#* 74 2 NOP 1
MOV A,* e5 2 NOP 1
MOV C,* a2 2 NOP 1
MOV DPTR,#* 90 3 SWAP 1
MOV R0,A f8 1 NOP 1
MOV R1,A f9 1 NOP 1
MOV R2,A fA 1 NOP 1
MOV R3,A fB 1 NOP 1
MOV R4,A fC 1 NOP 1
MOV R5,A fD 1 NOP 1
MOV R6,A fE 1 NOP 1
MOV R7,A fF 1 NOP 1
MOV R0,#* 78 2 NOP 1
MOV R1,#* 79 2 NOP 1
MOV R2,#* 7A 2 NOP 1
MOV R3,#* 7B 2 NOP 1
MOV R4,#* 7C 2 NOP 1
MOV R5,#* 7D 2 NOP 1
MOV R6,#* 7E 2 NOP 1
MOV R7,#* 7F 2 NOP 1
MOV R0,* a8 2 NOP 1
MOV R1,* a9 2 NOP 1
MOV R2,* aA 2 NOP 1
MOV R3,* aB 2 NOP 1
MOV R4,* aC 2 NOP 1
MOV R5,* aD 2 NOP 1
MOV R6,* aE 2 NOP 1
MOV R7,* aF 2 NOP 1
MOV @R0,A f6 1 NOP 1
MOV @R1,A f7 1 NOP 1
MOV @R0,#* 76 2 NOP 1
MOV @R1,#* 77 2 NOP 1
MOV @R0,* a6 2 NOP 1
MOV @R1,* a7 2 NOP 1
MOV *,A f5 2 NOP 1
MOV *,C 92 2 NOP 1
MOV *,R0 88 2 NOP 1
MOV *,R1 89 2 NOP 1
MOV *,R2 8A 2 NOP 1
MOV *,R3 8B 2 NOP 1
MOV *,R4 8C 2 NOP 1
MOV *,R5 8D 2 NOP 1
MOV *,R6 8E 2 NOP 1
MOV *,R7 8F 2 NOP 1
MOV *,@R0 86 2 NOP 1
MOV *,@R1 87 2 NOP 1
MOV *,#* 75 3 COMBINE 1
MOV *,* 85 3 CSWAP 1
MOVC A,@A+DPTR 93 1 NOP 1
MOVC A,@A+PC 83 1 NOP 1
MOVX A,@R0 e2 1 NOP 1
MOVX A,@R1 e3 1 NOP 1
MOVX A,@DPTR e0 1 NOP 1
MOVX @R0,A f2 1 NOP 1
MOVX @R1,A f3 1 NOP 1
MOVX @DPTR,A f0 1 NOP 1
MUL AB a4 1 NOP 1
NOP "" 00 1 NOP 1
ORL A,R0 48 1 NOP 1
ORL A,R1 49 1 NOP 1
ORL A,R2 4A 1 NOP 1
ORL A,R3 4B 1 NOP 1
ORL A,R4 4C 1 NOP 1
ORL A,R5 4D 1 NOP 1
ORL A,R6 4E 1 NOP 1
ORL A,R7 4F 1 NOP 1
ORL A,@R0 46 1 NOP 1
ORL A,@R1 47 1 NOP 1
ORL A,#* 44 2 NOP 1
ORL A,* 45 2 NOP 1
ORL C,/* a0 2 NOP 1
ORL C,* 72 2 NOP 1
ORL *,A 42 2 NOP 1
ORL *,#* 43 3 COMBINE 1
POP * d0 2 NOP 1
PUSH * c0 2 NOP 1
RET "" 22 1 NOP 1
RETI "" 32 1 NOP 1
RL A 23 1 NOP 1
RLC A 33 1 NOP 1
RR A 03 1 NOP 1
RRC A 13 1 NOP 1
SETB C d3 1 NOP 1
SETB * d2 2 NOP 1
SJMP * 80 2 R1 1
SUBB A,R0 98 1 NOP 1
SUBB A,R1 99 1 NOP 1
SUBB A,R2 9A 1 NOP 1
SUBB A,R3 9B 1 NOP 1
SUBB A,R4 9C 1 NOP 1
SUBB A,R5 9D 1 NOP 1
SUBB A,R6 9E 1 NOP 1
SUBB A,R7 9F 1 NOP 1
SUBB A,@R0 96 1 NOP 1
SUBB A,@R1 97 1 NOP 1
SUBB A,#* 94 2 NOP 1
SUBB A,* 95 2 NOP 1
SWAP A c4 1 NOP 1
XCH A,R0 c8 1 NOP 1
XCH A,R1 c9 1 NOP 1
XCH A,R2 cA 1 NOP 1
XCH A,R3 cB 1 NOP 1
XCH A,R4 cC 1 NOP 1
XCH A,R5 cD 1 NOP 1
XCH A,R6 cE 1 NOP 1
XCH A,R7 cF 1 NOP 1
XCH A,@R0 c6 1 NOP 1
XCH A,@R1 c7 1 NOP 1
XCH A,* c5 2 NOP 1
XCHD A,@R0 d6 1 NOP 1
XCHD A,@R1 d7 1 NOP 1
XRL A,R0 68 1 NOP 1
XRL A,R1 69 1 NOP 1
XRL A,R2 6A 1 NOP 1
XRL A,R3 6B 1 NOP 1
XRL A,R4 6C 1 NOP 1
XRL A,R5 6D 1 NOP 1
XRL A,R6 6E 1 NOP 1
XRL A,R7 6F 1 NOP 1
XRL A,@R0 66 1 NOP 1
XRL A,@R1 67 1 NOP 1
XRL A,#* 64 2 NOP 1
XRL A,* 65 2 NOP 1
XRL *,A 62 2 NOP 1
XRL *,#* 63 3 COMBINE 1

222
branches/dwg/LSource/bin/TASM65.TAB

@ -0,0 +1,222 @@
"TASM 6502 Assembler. "
/****************************************************************************
/* $Id: tasm65.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* This is the instruction set definition table for the 6502 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorported, June 1987.
/* Note that there are two classes of extended instructions beyond
/* the standard set. The classes are assigned bits as follows:
/* bit 0 = standard set
/* bit 1 = extended instructions for R65C02
/* bit 2 = extended instructions for R65C00/21
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
/*-------------------------------------------*/
ADC #* 69 2 NOP 1
ADC (*,X) 61 2 NOP 1
ADC (*),Y 71 2 NOP 1
ADC (*) 72 2 NOP 2
ADC *,X 7D 3 ZP 1
ADC *,Y 79 3 NOP 1
ADC * 6D 3 ZP 1
AND #* 29 2 NOP 1
AND (*,X) 21 2 NOP 1
AND (*),Y 31 2 NOP 1
AND (*) 32 2 NOP 2
AND *,X 3D 3 ZP 1
AND *,Y 39 3 NOP 1
AND * 2D 3 ZP 1
ASL A 0A 1 NOP 1
ASL *,X 1E 3 ZP 1
ASL * 0E 3 ZP 1
BBR0 *,* 0f 3 CR 6
BBR1 *,* 1f 3 CR 6
BBR2 *,* 2f 3 CR 6
BBR3 *,* 3f 3 CR 6
BBR4 *,* 4f 3 CR 6
BBR5 *,* 5f 3 CR 6
BBR6 *,* 6f 3 CR 6
BBR7 *,* 7f 3 CR 6
BBS0 *,* 8f 3 CR 6
BBS1 *,* 9f 3 CR 6
BBS2 *,* af 3 CR 6
BBS3 *,* bf 3 CR 6
BBS4 *,* cf 3 CR 6
BBS5 *,* df 3 CR 6
BBS6 *,* ef 3 CR 6
BBS7 *,* ff 3 CR 6
BCC * 90 2 R1 1
BCS * B0 2 R1 1
BEQ * F0 2 R1 1
BMI * 30 2 R1 1
BNE * D0 2 R1 1
BPL * 10 2 R1 1
BRA * 80 2 R1 6
BVC * 50 2 R1 1
BVS * 70 2 R1 1
BIT #* 89 2 NOP 2
BIT *,X 3C 3 ZP 2
BIT * 2C 3 ZP 1
BRK "" 00 1 NOP 1
CLC "" 18 1 NOP 1
CLD "" D8 1 NOP 1
CLI "" 58 1 NOP 1
CLV "" B8 1 NOP 1
CMP #* C9 2 NOP 1
CMP (*,X) C1 2 NOP 1
CMP (*),Y D1 2 NOP 1
CMP (*) D2 2 NOP 2
CMP *,X DD 3 ZP 1
CMP *,Y D9 3 NOP 1
CMP * CD 3 ZP 1
CPX #* E0 2 NOP 1
CPX * EC 3 ZP 1
CPY #* C0 2 NOP 1
CPY * CC 3 ZP 1
DEC A 3A 1 NOP 2
DEC *,X DE 3 ZP 1
DEC * CE 3 ZP 1
DEX "" CA 1 NOP 1
DEY "" 88 1 NOP 1
EOR #* 49 2 NOP 1
EOR (*,X) 41 2 NOP 1
EOR (*),Y 51 2 NOP 1
EOR (*) 52 2 NOP 2
EOR *,X 5D 3 ZP 1
EOR *,Y 59 3 NOP 1
EOR * 4D 3 ZP 1
INC A 1A 1 NOP 2
INC *,X FE 3 ZP 1
INC * EE 3 ZP 1
INX "" E8 1 NOP 1
INY "" C8 1 NOP 1
JMP (*,X) 7C 3 NOP 2
JMP (*) 6C 3 NOP 1
JMP * 4C 3 NOP 1
JSR * 20 3 NOP 1
LDA #* A9 2 NOP 1
LDA (*,X) A1 2 NOP 1
LDA (*),Y B1 2 NOP 1
LDA (*) B2 2 NOP 2
LDA *,X BD 3 ZP 1
LDA *,Y B9 3 NOP 1
LDA * AD 3 ZP 1
LDX #* A2 2 NOP 1
LDX *,Y BE 3 ZP 1
LDX * AE 3 ZP 1
LDY #* A0 2 NOP 1
LDY *,X BC 3 ZP 1
LDY * AC 3 ZP 1
LSR A 4A 1 NOP 1
LSR *,X 5E 3 ZP 1
LSR * 4E 3 ZP 1
MUL "" 02 1 NOP 4 /* R65C00/21 only*/
NOP "" EA 1 NOP 1
ORA #* 09 2 NOP 1
ORA (*,X) 01 2 NOP 1
ORA (*),Y 11 2 NOP 1
ORA (*) 12 2 NOP 2
ORA *,X 1D 3 ZP 1
ORA *,Y 19 3 NOP 1
ORA * 0D 3 ZP 1
PHA "" 48 1 NOP 1
PHP "" 08 1 NOP 1
PHX "" DA 1 NOP 6
PHY "" 5A 1 NOP 6
PLA "" 68 1 NOP 1
PLP "" 28 1 NOP 1
PLX "" FA 1 NOP 6
PLY "" 7A 1 NOP 6
RMB0 * 07 2 NOP 6
RMB1 * 17 2 NOP 6
RMB2 * 27 2 NOP 6
RMB3 * 37 2 NOP 6
RMB4 * 47 2 NOP 6
RMB5 * 57 2 NOP 6
RMB6 * 67 2 NOP 6
RMB7 * 77 2 NOP 6
ROL A 2A 1 NOP 1
ROL *,X 3E 3 ZP 1
ROL * 2E 3 ZP 1
ROR A 6A 1 NOP 1
ROR *,X 7E 3 ZP 1
ROR * 6E 3 ZP 1
RTI "" 40 1 NOP 1
RTS "" 60 1 NOP 1
SBC #* E9 2 NOP 1
SBC (*,X) E1 2 NOP 1
SBC (*),Y F1 2 NOP 1
SBC (*) F2 2 NOP 2
SBC *,X FD 3 ZP 1
SBC *,Y F9 3 NOP 1
SBC * ED 3 ZP 1
SEC "" 38 1 NOP 1
SED "" F8 1 NOP 1
SEI "" 78 1 NOP 1
SMB0 * 87 2 NOP 6
SMB1 * 97 2 NOP 6
SMB2 * a7 2 NOP 6
SMB3 * b7 2 NOP 6
SMB4 * c7 2 NOP 6
SMB5 * d7 2 NOP 6
SMB6 * e7 2 NOP 6
SMB7 * f7 2 NOP 6
STA (*,X) 81 2 NOP 1
STA (*),Y 91 2 NOP 1
STA (*) 92 2 NOP 2
STA *,X 9D 3 ZP 1
STA *,Y 99 3 NOP 1
STA * 8D 3 ZP 1
STX *,Y 96 2 ZP 1
STX * 8E 3 ZP 1
STY *,X 94 2 NOP 1
STY * 8C 3 ZP 1
STZ *,X 9e 3 ZP 2
STZ * 9c 3 ZP 2
TAX "" AA 1 NOP 1
TAY "" A8 1 NOP 1
TRB * 1c 3 ZP 2
TSB * 0c 3 ZP 2
TSX "" BA 1 NOP 1
TXA "" 8A 1 NOP 1
TXS "" 9A 1 NOP 1
TYA "" 98 1 NOP 1

348
branches/dwg/LSource/bin/TASM68.TAB

@ -0,0 +1,348 @@
"TASM 6800-6811 Assembler"
/****************************************************************************
/* $Id: tasm68.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* Originally submitted by Richard P. White, June 4,1989 */
/* Corrected and enhanced by T.N. Anderson, STI */
/* Enhanced for the 68HC11 by George Blat, Nov 3, 1990
/* Class bits defined as follows:
/*
/* bit 0 for 6800
/* bit 1 for 6801/6803
/* bit 2 for 68HC11
/*
/* Note that TASM deviates from motorola syntax for BCLR, BSET,
/* BRCLR, and BRSET instructions. TASM requires commas between
/* each arg. Motorola requires white space before the make and
/* label args.
.MSFIRST
ABA "" 1B 1 NOP 1
ABX "" 3A 1 NOP 2
ABY "" 183A 2 NOP 4
ADCA #* 89 2 NOP 1
ADCA *,Y 18A9 3 NOP 4
ADCA *,X A9 2 NOP 1
ADCA * B9 3 MZERO 1
ADCB #* C9 2 NOP 1
ADCB *,Y 18E9 3 NOP 4
ADCB *,X E9 2 NOP 1
ADCB * F9 3 MZERO 1
ADDA #* 8B 2 NOP 1
ADDA *,Y 18AB 3 NOP 4
ADDA *,X AB 2 NOP 1
ADDA * BB 3 MZERO 1
ADDB #* CB 2 NOP 1
ADDB *,Y 18EB 3 NOP 4
ADDB *,X EB 2 NOP 1
ADDB * FB 3 MZERO 1
ADDD #* C3 3 SWAP 2
ADDD *,Y 18E3 3 NOP 4
ADDD *,X E3 2 NOP 2
ADDD * F3 3 MZERO 2
ANDA #* 84 2 NOP 1
ANDA *,Y 18A4 3 NOP 4
ANDA *,X A4 2 NOP 1
ANDA * B4 3 MZERO 1
ANDB #* C4 2 NOP 1
ANDB *,Y 18E4 3 NOP 4
ANDB *,X E4 2 NOP 1
ANDB * F4 3 MZERO 1
ASL *,Y 1868 3 NOP 4
ASL *,X 68 2 NOP 1
ASL * 78 3 SWAP 1
ASLA "" 48 1 NOP 1
ASLB "" 58 1 NOP 1
ASLD "" 05 1 NOP 2
ASR *,Y 1867 3 NOP 4
ASR *,X 67 2 NOP 1
ASR * 77 3 SWAP 1
ASRA "" 47 1 NOP 1
ASRB "" 57 1 NOP 1
BCC * 24 2 R1 1
BCLR *,X,* 1D 3 COMB 4
BCLR *,Y,* 181D 4 COMB 4
BCLR *,#* 15 3 COMB 4 /* allow # since mask is immediate data
BCLR *,* 15 3 COMB 4
BCS * 25 2 R1 1
BEQ * 27 2 R1 1
BGE * 2C 2 R1 1
BGT * 2E 2 R1 1
BHI * 22 2 R1 1
BHS * 24 2 R1 1
BITA #* 85 2 NOP 1
BITA *,Y 18A5 3 NOP 4
BITA *,X A5 2 NOP 1
BITA * B5 3 MZERO 1
BITB #* C5 2 NOP 1
BITB *,Y 18E5 3 NOP 4
BITB *,X E5 2 NOP 1
BITB * F5 3 MZERO 1
BLE * 2F 2 R1 1
BLO * 25 2 R1 1
BLS * 23 2 R1 1
BLT * 2D 2 R1 1
BMI * 2B 2 R1 1
BNE * 26 2 R1 1
BPL * 2A 2 R1 1
BRA * 20 2 R1 1
BRCLR *,X,*,* 1F 4 3REL 4
BRCLR *,Y,*,* 181F 5 3REL 4
BRCLR *,*,* 13 4 3REL 4
BRN * 21 2 R1 2 /* NOT SURE ABOUT 6803 */
BRSET *,X,*,* 1E 4 3REL 4
BRSET *,Y,*,* 181E 5 3REL 4
BRSET *,*,* 12 4 3REL 4
BSET *,X,* 1C 3 COMB 4
BSET *,Y,* 181C 4 COMB 4
BSET *,#* 14 3 COMB 4 /* allow #
BSET *,* 14 3 COMB 4
BSR * 8D 2 R1 1
BVC * 28 2 R1 1
BVS * 29 2 R1 1
CBA "" 11 1 NOP 1
CLC "" 0C 1 NOP 1
CLI "" 0E 1 NOP 1
CLR *,Y 186F 3 NOP 4
CLR *,X 6F 2 NOP 1
CLR * 7F 3 SWAP 1
CLRA "" 4F 1 NOP 1
CLRB "" 5F 1 NOP 1
CLV "" 0A 1 NOP 1
CMPA #* 81 2 NOP 1
CMPA *,X A1 2 NOP 1
CMPA *,Y 18A1 3 NOP 4
CMPA * B1 3 MZERO 1
CMPB #* C1 2 NOP 1
CMPB *,Y 18E1 3 NOP 4
CMPB *,X E1 2 NOP 1
CMPB * F1 3 MZERO 1
CMPD #* 1A83 4 SWAP 4 /* alias for CPD */
CMPD *,X 1AA3 3 NOP 4
CMPD *,Y CDA3 3 NOP 4
CMPD * 1AB3 4 MZERO 4
COM *,X 63 2 NOP 1
COM *,Y 1863 3 NOP 4
COM * 73 3 SWAP 1
COMA "" 43 1 NOP 1
COMB "" 53 1 NOP 1
CPD #* 1A83 4 SWAP 4
CPD *,X 1AA3 3 NOP 4
CPD *,Y CDA3 3 NOP 4
CPD * 1AB3 4 MZERO 4
CPX #* 8C 3 SWAP 1
CPX *,X AC 2 NOP 1
CPX *,Y CDAC 3 NOP 4
CPX * BC 3 MZERO 1
CPY #* 188C 4 SWAP 4
CPY *,Y 18AC 3 NOP 4
CPY *,X 1AAC 3 NOP 4
CPY * 18BC 4 MZERO 4
DAA "" 19 1 NOP 1
DEC *,Y 186A 3 NOP 4
DEC *,X 6A 2 NOP 1
DEC * 7A 3 SWAP 1
DECA "" 4A 1 NOP 1
DECB "" 5A 1 NOP 1
DES "" 34 1 NOP 1
DEX "" 09 1 NOP 1
DEY "" 1809 2 NOP 4
EORA #* 88 2 NOP 1
EORA *,Y 18A8 3 NOP 4
EORA *,X A8 2 NOP 1
EORA * B8 3 MZERO 1
EORB #* C8 2 NOP 1
EORB *,Y 18E8 3 NOP 4
EORB *,X E8 2 NOP 1
EORB * F8 3 MZERO 1
FDIV "" 03 1 NOP 4
IDIV "" 02 1 NOP 4
INC *,Y 186C 3 NOP 4
INC *,X 6C 2 NOP 1
INC * 7C 3 SWAP 1
INCA "" 4C 1 NOP 1
INCB "" 5C 1 NOP 1
INS "" 31 1 NOP 1
INX "" 08 1 NOP 1
INY "" 1808 2 NOP 4
JMP *,Y 186E 3 NOP 4
JMP *,X 6E 2 NOP 1
JMP * 7E 3 SWAP 1
JSR *,Y 18AD 3 NOP 4
JSR *,X AD 2 NOP 1
JSR * BD 3 MZERO 1
LDAA #* 86 2 NOP 1
LDAA *,Y 18A6 3 NOP 4
LDAA *,X A6 2 NOP 1
LDAA >* B6 3 SWAP 1 /* Force EXT mode */
LDAA * B6 3 MZERO 1
LDAB #* C6 2 NOP 1
LDAB *,Y 18E6 3 NOP 4
LDAB *,X E6 2 NOP 1
LDAB >* F6 3 SWAP 1 /* Force EXT mode */
LDAB * F6 3 MZERO 1
LDD #* CC 3 SWAP 2
LDD *,Y 18EC 3 NOP 4
LDD *,X EC 2 NOP 2
LDD >* FC 3 SWAP 2 /* Force EXT mode */
LDD * FC 3 MZERO 2
LDS #* 8E 3 SWAP 1
LDS *,Y 18AE 3 NOP 4
LDS *,X AE 2 NOP 1
LDS >* BE 3 SWAP 1 /* Force EXT mode */
LDS * BE 3 MZERO 1
LDX #* CE 3 SWAP 1
LDX *,X EE 2 NOP 1
LDX *,Y CDEE 3 NOP 4
LDX >* FE 3 SWAP 1 /* Force EXT mode */
LDX * FE 3 MZERO 1
LDY #* 18CE 4 SWAP 4
LDY *,Y 18EE 3 NOP 4
LDY *,X 1AEE 3 NOP 4
LDY >* 18FE 4 SWAP 4 /* Force EXT mode */
LDY * 18FE 4 MZERO 4
LSL *,Y 1868 3 NOP 4
LSL *,X 68 2 NOP 1 /*SAME AS ASL */
LSL * 78 3 SWAP 1
LSLA "" 48 1 NOP 1
LSLB "" 58 1 NOP 1
LSLD "" 05 1 NOP 2
LSR *,Y 1864 3 NOP 4
LSR *,X 64 2 NOP 1
LSR * 74 3 SWAP 1
LSRA "" 44 1 NOP 1
LSRB "" 54 1 NOP 1
LSRD "" 04 1 NOP 2
MUL "" 3D 1 NOP 2
NEG *,Y 1860 3 NOP 4
NEG *,X 60 2 NOP 1
NEG * 70 3 SWAP 1
NEGA "" 40 1 NOP 1
NEGB "" 50 1 NOP 1
NOP "" 01 1 NOP 1
ORAA #* 8A 2 NOP 1
ORAA *,Y 18AA 3 NOP 4
ORAA *,X AA 2 NOP 1
ORAA * BA 3 MZERO 1
ORAB #* CA 2 NOP 1
ORAB *,Y 18EA 3 NOP 4
ORAB *,X EA 2 NOP 1
ORAB * FA 3 MZERO 1
PSHA "" 36 1 NOP 1
PSHB "" 37 1 NOP 1
PSHX "" 3C 1 NOP 2
PSHY "" 183C 2 NOP 4
PULA "" 32 1 NOP 1
PULB "" 33 1 NOP 1
PULX "" 38 1 NOP 2
PULY "" 1838 2 NOP 4
ROL *,Y 1869 3 NOP 4
ROL *,X 69 2 NOP 1
ROL * 79 3 SWAP 1
ROLA "" 49 1 NOP 1
ROLB "" 59 1 NOP 1
ROR *,Y 1866 3 NOP 4
ROR *,X 66 2 NOP 1
ROR * 76 3 SWAP 1
RORA "" 46 1 NOP 1
RORB "" 56 1 NOP 1
RTI "" 3B 1 NOP 1
RTS "" 39 1 NOP 1
SBA "" 10 1 NOP 1
SBCA #* 82 2 NOP 1
SBCA *,Y 18A2 3 NOP 4
SBCA *,X A2 2 NOP 1
SBCA * B2 3 MZERO 1
SBCB #* C2 2 NOP 1
SBCB *,Y 18E2 3 NOP 4
SBCB *,X E2 2 NOP 1
SBCB * F2 3 MZERO 1
SEC "" 0D 1 NOP 1
SEI "" 0F 1 NOP 1
SEV "" 0B 1 NOP 1
STAA *,Y 18A7 3 NOP 4
STAA *,X A7 2 NOP 1
STAA >* B7 3 SWAP 1 /* Force EXT mode */
STAA * B7 3 MZERO 1
STAB *,Y 18E7 3 NOP 4
STAB *,X E7 2 NOP 1
STAB >* F7 3 SWAP 1 /* Force EXT mode */
STAB * F7 3 MZERO 1
STD *,Y 18ED 3 NOP 4
STD *,X ED 2 NOP 2
STD >* FD 3 SWAP 2 /* Force EXT mode */
STD * FD 3 MZERO 2
STOP "" CF 1 NOP 1
STS *,X AF 2 NOP 1
STS *,Y 18AF 3 NOP 4
STS >* BF 3 SWAP 1 /* Force EXT mode */
STS * BF 3 MZERO 1
STX *,X EF 2 NOP 1
STX *,Y CDEF 3 NOP 4
STX >* FF 3 SWAP 1 /* Force EXT mode */
STX * FF 3 MZERO 1
STY *,Y 18EF 3 NOP 4
STY *,X 1AEF 3 NOP 4
STY >* 18FF 4 SWAP 4 /* Force EXT mode */
STY * 18FF 4 MZERO 4
SUBA #* 80 2 NOP 1
SUBA *,Y 18A0 3 NOP 4
SUBA *,X A0 2 NOP 1
SUBA * B0 3 MZERO 1
SUBB #* C0 2 NOP 1
SUBB *,Y 18E0 3 NOP 4
SUBB *,X E0 2 NOP 1
SUBB * F0 3 MZERO 1
SUBD #* 83 3 SWAP 2
SUBD *,Y 18A3 3 NOP 4
SUBD *,X A3 2 NOP 2
SUBD * B3 3 MZERO 2
SWI "" 3F 1 NOP 1
TAB "" 16 1 NOP 1
TAP "" 06 1 NOP 1
TBA "" 17 1 NOP 1
TEST "" 00 1 NOP 1
TPA "" 07 1 NOP 1
TST *,Y 186D 3 NOP 4
TST *,X 6D 2 NOP 1
TST * 7D 3 SWAP 1
TSTA "" 4D 1 NOP 1
TSTB "" 5D 1 NOP 1
TSX "" 30 1 NOP 1
TSY "" 1830 2 NOP 4
TXS "" 35 1 NOP 1
TYS "" 1835 2 NOP 4
WAI "" 3E 1 NOP 1
XGDX "" 8F 1 NOP 4
XGDY "" 188F 2 NOP 4
/* That's all folks */

290
branches/dwg/LSource/bin/TASM70.TAB

@ -0,0 +1,290 @@
"TASM 7000 Assembler. "
/****************************************************************************
/* $Id: tasm70.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* Table for TMS7000 micros
/* Note that the table does not require the 'Rnn' nomenclature
/* for reference of locations in the register file. Any expression
/* will do, the value of which indicates the register. This is more
/* flexible then making an entry like "ADC R*,A".
/*
/* TASM has trouble with the MOVD +(B),+ instruction so
/* we convert it to MOVD +[B],+
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT OR */
/*-------------------------------------------*/
.ALTWILD+
ADC B,A 69 1 NOP 1
ADC %+,A 29 2 NOP 1
ADC %+,B 59 2 NOP 1
ADC %+,+ 79 3 COMB 1
ADC +,A 19 2 NOP 1
ADC +,B 39 2 NOP 1
ADC +,+ 49 3 COMB 1
ADD B,A 68 1 NOP 1
ADD %+,A 28 2 NOP 1
ADD %+,B 58 2 NOP 1
ADD %+,+ 78 3 COMB 1
ADD +,A 18 2 NOP 1
ADD +,B 38 2 NOP 1
ADD +,+ 48 3 COMB 1
AND B,A 63 1 NOP 1
AND %+,A 23 2 NOP 1
AND %+,B 53 2 NOP 1
AND %+,+ 73 3 COMB 1
AND +,A 13 2 NOP 1
AND +,B 33 2 NOP 1
AND +,+ 43 3 COMB 1
ANDP A,+ 83 2 NOP 1
ANDP B,+ 93 2 NOP 1
ANDP %+,+ A3 3 COMB 1
BTJO B,A,+ 66 2 R1 1
BTJO %+,A,+ 26 3 CREL 1
BTJO %+,B,+ 56 3 CREL 1
BTJO %+,+,+ 76 4 3REL 1
BTJO +,A,+ 16 3 CREL 1
BTJO +,B,+ 36 3 CREL 1
BTJO +,+,+ 46 4 3REL 1
BTJOP A,+,+ 86 3 CREL 1
BTJOP B,+,+ 96 3 CREL 1
BTJOP %+,+,+ A6 4 3REL 1
BTJZ B,A,+ 67 2 R1 1
BTJZ %+,A,+ 27 3 CREL 1
BTJZ %+,B,+ 57 3 CREL 1
BTJZ %+,+,+ 77 4 3REL 1
BTJZ +,A,+ 17 3 CREL 1
BTJZ +,B,+ 37 3 CREL 1
BTJZ +,+,+ 47 4 3REL 1
BTJZP A,+,+ 87 3 CREL 1
BTJZP B,+,+ 97 3 CREL 1
BTJZP %+,+,+ A7 4 3REL 1
BR @+(B) AC 3 SWAP 1
BR @+[B] AC 3 SWAP 1
BR @+ 8C 3 SWAP 1
BR *+ 9C 2 NOP 1
CALL @+(B) AE 3 SWAP 1
CALL @+[B] AE 3 SWAP 1
CALL @+ 8E 3 SWAP 1
CALL *+ 9E 2 NOP 1
CLR A B5 1 NOP 1
CLR B C5 1 NOP 1
CLR + D5 2 NOP 1
CLRC "" B0 1 NOP 1
CMP B,A 6D 1 NOP 1
CMP %+,A 2D 2 NOP 1
CMP %+,B 5D 2 NOP 1
CMP %+,+ 7D 3 COMB 1
CMP +,A 1D 2 NOP 1
CMP +,B 3D 2 NOP 1
CMP +,+ 4D 3 COMB 1
CMPA @+(B) AD 3 SWAP 1
CMPA @+[B] AD 3 SWAP 1
CMPA @+ 8D 3 SWAP 1
CMPA *+ 9D 2 NOP 1
DAC B,A 6E 1 NOP 1
DAC %+,A 2E 2 NOP 1
DAC %+,B 5E 2 NOP 1
DAC %+,+ 7E 3 COMB 1
DAC +,A 1E 2 NOP 1
DAC +,B 3E 2 NOP 1
DAC +,+ 4E 3 COMB 1
DEC A B2 1 NOP 1
DEC B C2 1 NOP 1
DEC + D2 2 NOP 1
DECD A BB 1 NOP 1
DECD B CB 1 NOP 1
DECD + DB 2 NOP 1
DINT "" 06 1 NOP 1
DJNZ A,+ BA 2 R1 1
DJNZ B,+ CA 2 R1 1
DJNZ +,+ DA 3 CREL 1
DSB B,A 6F 1 NOP 1
DSB %+,A 2F 2 NOP 1
DSB %+,B 5F 2 NOP 1
DSB %+,+ 7F 3 COMB 1
DSB +,A 1F 2 NOP 1
DSB +,B 3F 2 NOP 1
DSB +,+ 4F 3 COMB 1
EINT "" 05 1 NOP 1
IDLE "" 01 1 NOP 1
INC A B3 1 NOP 1
INC B C3 1 NOP 1
INC + D3 2 NOP 1
INV A B4 1 NOP 1
INV B C4 1 NOP 1
INV + D4 2 NOP 1
JMP + E0 2 R1 1
JC + E3 2 R1 1
JEQ + E2 2 R1 1
JGE + E5 2 R1 1
JGT + E4 2 R1 1
JHS + E3 2 R1 1
JL + E7 2 R1 1
JN + E1 2 R1 1 /+ ??
JNC + E7 2 R1 1
JNE + E6 2 R1 1
JNZ + E6 2 R1 1
JP + E4 2 R1 1
JPZ + E5 2 R1 1
JZ + E2 2 R1 1
LDA @+(B) AA 3 SWAP 1
LDA @+[B] AA 3 SWAP 1
LDA @+ 8A 3 SWAP 1
LDA *+ 9A 2 NOP 1
LDSP "" 0D 1 NOP 1
MOV A,B C0 1 NOP 1
MOV B,A 62 1 NOP 1
MOV A,+ D0 2 NOP 1
MOV B,+ D1 2 NOP 1
MOV %+,A 22 2 NOP 1
MOV %+,B 52 2 NOP 1
MOV %+,+ 72 3 COMB 1
MOV +,A 12 2 NOP 1
MOV +,B 32 2 NOP 1
MOV +,+ 42 3 COMB 1
MOVD %+[B],+ A8 4 CSWAP 1
MOVD %+,+ 88 4 CSWAP 1
MOVD +,+ 98 3 COMB 1
MOVP A,+ 82 2 NOP 1
MOVP B,+ 92 2 NOP 1
MOVP %+,+ A2 3 COMB 1
MOVP +,A 80 2 NOP 1
MOVP +,B 91 2 NOP 1
MPY B,A 6C 1 NOP 1
MPY %+,A 2C 2 NOP 1
MPY %+,B 5C 2 NOP 1
MPY %+,+ 7C 3 COMB 1
MPY +,A 1C 2 NOP 1
MPY +,B 3C 2 NOP 1
MPY +,+ 4C 3 COMB 1
NOP "" 00 1 NOP 1
OR B,A 64 1 NOP 1
OR %+,A 24 2 NOP 1
OR %+,B 54 2 NOP 1
OR %+,+ 74 3 COMB 1
OR +,A 14 2 NOP 1
OR +,B 34 2 NOP 1
OR +,+ 44 3 COMB 1
ORP A,+ 84 2 NOP 1
ORP B,+ 94 2 NOP 1
ORP %+,+ A4 3 COMB 1
POP A B9 1 NOP 1
POP B C9 1 NOP 1
POP ST 08 1 NOP 1
POP + D9 2 NOP 1
POPST "" 08 1 NOP 1
PUSH A B8 1 NOP 1
PUSH B C8 1 NOP 1
PUSH ST 0E 1 NOP 1
PUSH + D8 2 NOP 1
PUSHST "" 0E 1 NOP 1
RETI "" 0B 1 NOP 1
RETS "" 0A 1 NOP 1
RL A BE 1 NOP 1
RL B CE 1 NOP 1
RL + DE 2 NOP 1
RLC A BF 1 NOP 1
RLC B CF 1 NOP 1
RLC + DF 2 NOP 1
RR A BC 1 NOP 1
RR B CC 1 NOP 1
RR + DC 2 NOP 1
RRC A BD 1 NOP 1
RRC B CD 1 NOP 1
RRC + DD 2 NOP 1
SBB B,A 6B 1 NOP 1
SBB %+,A 2B 2 NOP 1
SBB %+,B 5B 2 NOP 1
SBB %+,+ 7B 3 COMB 1
SBB +,A 1B 2 NOP 1
SBB +,B 3B 2 NOP 1
SBB +,+ 4B 3 COMB 1
SETC "" 07 1 NOP 1
STA @+(B) AB 3 SWAP 1
STA @+[B] AB 3 SWAP 1
STA @+ 8B 3 SWAP 1
STA *+ 9B 2 NOP 1
STSP "" 09 1 NOP 1
SUB B,A 6A 1 NOP 1
SUB %+,A 2A 2 NOP 1
SUB %+,B 5A 2 NOP 1
SUB %+,+ 7A 3 COMB 1
SUB +,A 1A 2 NOP 1
SUB +,B 3A 2 NOP 1
SUB +,+ 4A 3 COMB 1
SWAP A B7 1 NOP 1
SWAP B C7 1 NOP 1
SWAP + D7 2 NOP 1
TRAP + FF 1 SUB 1
TST A B0 1 NOP 1
TSTA "" B0 1 NOP 1
TST B C1 1 NOP 1
TSTB "" C1 1 NOP 1
XCHB A B6 1 NOP 1
XCHB + D6 2 NOP 1
XOR B,A 65 1 NOP 1
XOR %+,A 25 2 NOP 1
XOR %+,B 55 2 NOP 1
XOR %+,+ 75 3 COMB 1
XOR +,A 15 2 NOP 1
XOR +,B 35 2 NOP 1
XOR +,+ 45 3 COMB 1
XORP A,+ 85 2 NOP 1
XORP B,+ 95 2 NOP 1
XORP %+,+ A5 3 COMB 1

594
branches/dwg/LSource/bin/TASM80.TAB

@ -0,0 +1,594 @@
"TASM Z80 Assembler. "
/****************************************************************************
/* $Id: tasm80.tab 1.2 1998/02/28 14:31:22 toma Exp $
/****************************************************************************
/* This is the instruction set definition table
/* for the Z80 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorporated
/* This table authored and submitted by Carl A. Wall, VE3APY.
/*
/* Class bits assigned as follows:
/* Bit-0 = Z80 (base instruction set)
/* Bit-1 = HD64180 (extended instructions)
/* See TASM manual for info on table structure.
/*
/*INSTR ARGS OP BYTES RULE CLASS SHIFT OR */
/*-------------------------------------------*/
ADC A,(HL) 8E 1 NOP 1
ADC A,(IX*) 8EDD 3 ZIX 1
ADC A,(IY*) 8EFD 3 ZIX 1
ADC A,A 8F 1 NOP 1
ADC A,B 88 1 NOP 1
ADC A,C 89 1 NOP 1
ADC A,D 8A 1 NOP 1
ADC A,E 8B 1 NOP 1
ADC A,H 8C 1 NOP 1
ADC A,L 8D 1 NOP 1
ADC A,* CE 2 NOP 1
ADC HL,BC 4AED 2 NOP 1
ADC HL,DE 5AED 2 NOP 1
ADC HL,HL 6AED 2 NOP 1
ADC HL,SP 7AED 2 NOP 1
ADD A,(HL) 86 1 NOP 1
ADD A,(IX*) 86DD 3 ZIX 1
ADD A,(IY*) 86FD 3 ZIX 1
ADD A,A 87 1 NOP 1
ADD A,B 80 1 NOP 1
ADD A,C 81 1 NOP 1
ADD A,D 82 1 NOP 1
ADD A,E 83 1 NOP 1
ADD A,H 84 1 NOP 1
ADD A,L 85 1 NOP 1
ADD A,* C6 2 NOP 1
ADD HL,BC 09 1 NOP 1
ADD HL,DE 19 1 NOP 1
ADD HL,HL 29 1 NOP 1
ADD HL,SP 39 1 NOP 1
ADD IX,BC 09DD 2 NOP 1
ADD IX,DE 19DD 2 NOP 1
ADD IX,IX 29DD 2 NOP 1
ADD IX,SP 39DD 2 NOP 1
ADD IY,BC 09FD 2 NOP 1
ADD IY,DE 19FD 2 NOP 1
ADD IY,IY 29FD 2 NOP 1
ADD IY,SP 39FD 2 NOP 1
AND (HL) A6 1 NOP 1
AND (IX*) A6DD 3 ZIX 1
AND (IY*) A6FD 3 ZIX 1
AND A A7 1 NOP 1
AND B A0 1 NOP 1
AND C A1 1 NOP 1
AND D A2 1 NOP 1
AND E A3 1 NOP 1
AND H A4 1 NOP 1
AND L A5 1 NOP 1
AND * E6 2 NOP 1
BIT *,(HL) 46CB 2 ZBIT 1
BIT *,(IX*) CBDD 4 ZBIT 1 0 4600
BIT *,(IY*) CBFD 4 ZBIT 1 0 4600
BIT *,A 47CB 2 ZBIT 1
BIT *,B 40CB 2 ZBIT 1
BIT *,C 41CB 2 ZBIT 1
BIT *,D 42CB 2 ZBIT 1
BIT *,E 43CB 2 ZBIT 1
BIT *,H 44CB 2 ZBIT 1
BIT *,L 45CB 2 ZBIT 1
CALL C,* DC 3 NOP 1
CALL M,* FC 3 NOP 1
CALL NC,* D4 3 NOP 1
CALL NZ,* C4 3 NOP 1
CALL P,* F4 3 NOP 1
CALL PE,* EC 3 NOP 1
CALL PO,* E4 3 NOP 1
CALL Z,* CC 3 NOP 1
CALL * CD 3 NOP 1
CCF "" 3F 1 NOP 1
CP (HL) BE 1 NOP 1
CP (IX*) BEDD 3 ZIX 1
CP (IY*) BEFD 3 ZIX 1
CP A BF 1 NOP 1
CP B B8 1 NOP 1
CP C B9 1 NOP 1
CP D BA 1 NOP 1
CP E BB 1 NOP 1
CP H BC 1 NOP 1
CP L BD 1 NOP 1
CP * FE 2 NOP 1
CPD "" A9ED 2 NOP 1
CPDR "" B9ED 2 NOP 1
CPIR "" B1ED 2 NOP 1
CPI "" A1ED 2 NOP 1
CPL "" 2F 1 NOP 1
DAA "" 27 1 NOP 1
DEC (HL) 35 1 NOP 1
DEC (IX*) 35DD 3 ZIX 1
DEC (IY*) 35FD 3 ZIX 1
DEC A 3D 1 NOP 1
DEC B 05 1 NOP 1
DEC BC 0B 1 NOP 1
DEC C 0D 1 NOP 1
DEC D 15 1 NOP 1
DEC DE 1B 1 NOP 1
DEC E 1D 1 NOP 1
DEC H 25 1 NOP 1
DEC HL 2B 1 NOP 1
DEC IX 2BDD 2 NOP 1
DEC IY 2BFD 2 NOP 1
DEC L 2D 1 NOP 1
DEC SP 3B 1 NOP 1
DI "" F3 1 NOP 1
DJNZ * 10 2 R1 1
EI "" FB 1 NOP 1
EX (SP),HL E3 1 NOP 1
EX (SP),IX E3DD 2 NOP 1
EX (SP),IY E3FD 2 NOP 1
EX AF,AF' 08 1 NOP 1
EX DE,HL EB 1 NOP 1
EXX "" D9 1 NOP 1
HALT "" 76 1 NOP 1
IM 0 46ED 2 NOP 1
IM 1 56ED 2 NOP 1
IM 2 5EED 2 NOP 1
/* Alternate form of above
IM0 46ED 2 NOP 1
IM1 56ED 2 NOP 1
IM2 5EED 2 NOP 1
IN A,(C) 78ED 2 NOP 1
IN B,(C) 40ED 2 NOP 1
IN C,(C) 48ED 2 NOP 1
IN D,(C) 50ED 2 NOP 1
IN E,(C) 58ED 2 NOP 1
IN H,(C) 60ED 2 NOP 1
IN L,(C) 68ED 2 NOP 1
IN A,(*) DB 2 NOP 1
IN0 A,(*) 38ED 3 NOP 2
IN0 B,(*) 00ED 3 NOP 2
IN0 C,(*) 08ED 3 NOP 2
IN0 D,(*) 10ED 3 NOP 2
IN0 E,(*) 18ED 3 NOP 2
IN0 H,(*) 20ED 3 NOP 2
IN0 L,(*) 28ED 3 NOP 2
INC (HL) 34 1 NOP 1
INC (IX*) 34DD 3 ZIX 1
INC (IY*) 34FD 3 ZIX 1
INC A 3C 1 NOP 1
INC B 04 1 NOP 1
INC BC 03 1 NOP 1
INC C 0C 1 NOP 1
INC D 14 1 NOP 1
INC DE 13 1 NOP 1
INC E 1C 1 NOP 1
INC H 24 1 NOP 1
INC HL 23 1 NOP 1
INC IX 23DD 2 NOP 1
INC IY 23FD 2 NOP 1
INC L 2C 1 NOP 1
INC SP 33 1 NOP 1
IND "" AAED 2 NOP 1
INDR "" BAED 2 NOP 1
INI "" A2ED 2 NOP 1
INIR "" B2ED 2 NOP 1
JP (HL) E9 1 NOP 1
JP (IX) E9DD 2 NOP 1
JP (IY) E9FD 2 NOP 1
JP C,* DA 3 NOP 1
JP M,* FA 3 NOP 1
JP NC,* D2 3 NOP 1
JP NZ,* C2 3 NOP 1
JP P,* F2 3 NOP 1
JP PE,* EA 3 NOP 1
JP PO,* E2 3 NOP 1
JP Z,* CA 3 NOP 1
JP * C3 3 NOP 1
JR C,* 38 2 R1 1
JR NC,* 30 2 R1 1
JR NZ,* 20 2 R1 1
JR Z,* 28 2 R1 1
JR * 18 2 R1 1
LD (BC),A 02 1 NOP 1
LD (DE),A 12 1 NOP 1
LD (HL),A 77 1 NOP 1
LD (HL),B 70 1 NOP 1
LD (HL),C 71 1 NOP 1
LD (HL),D 72 1 NOP 1
LD (HL),E 73 1 NOP 1
LD (HL),H 74 1 NOP 1
LD (HL),L 75 1 NOP 1
LD (HL),* 36 2 NOP 1
LD (IX*),A 77DD 3 ZIX 1
LD (IX*),B 70DD 3 ZIX 1
LD (IX*),C 71DD 3 ZIX 1
LD (IX*),D 72DD 3 ZIX 1
LD (IX*),E 73DD 3 ZIX 1
LD (IX*),H 74DD 3 ZIX 1
LD (IX*),L 75DD 3 ZIX 1
LD (IX*),* 36DD 4 ZIX 1
LD (IY*),A 77FD 3 ZIX 1
LD (IY*),B 70FD 3 ZIX 1
LD (IY*),C 71FD 3 ZIX 1
LD (IY*),D 72FD 3 ZIX 1
LD (IY*),E 73FD 3 ZIX 1
LD (IY*),H 74FD 3 ZIX 1
LD (IY*),L 75FD 3 ZIX 1
LD (IY*),* 36FD 4 ZIX 1
LD (*),A 32 3 NOP 1
LD (*),BC 43ED 4 NOP 1
LD (*),DE 53ED 4 NOP 1
LD (*),HL 22 3 NOP 1
LD (*),IX 22DD 4 NOP 1
LD (*),IY 22FD 4 NOP 1
LD (*),SP 73ED 4 NOP 1
LD A,(BC) 0A 1 NOP 1
LD A,(DE) 1A 1 NOP 1
LD A,(HL) 7E 1 NOP 1
LD A,(IX*) 7EDD 3 ZIX 1
LD A,(IY*) 7EFD 3 ZIX 1
LD A,A 7F 1 NOP 1
LD A,B 78 1 NOP 1
LD A,C 79 1 NOP 1
LD A,D 7A 1 NOP 1
LD A,E 7B 1 NOP 1
LD A,H 7C 1 NOP 1
LD A,I 57ED 2 NOP 1
LD A,L 7D 1 NOP 1
LD A,R 5FED 2 NOP 1
LD A,(*) 3A 3 NOP 1
LD A,* 3E 2 NOP 1
LD B,(HL) 46 1 NOP 1
LD B,(IX*) 46DD 3 ZIX 1
LD B,(IY*) 46FD 3 ZIX 1
LD B,A 47 1 NOP 1
LD B,B 40 1 NOP 1
LD B,C 41 1 NOP 1
LD B,D 42 1 NOP 1
LD B,E 43 1 NOP 1
LD B,H 44 1 NOP 1
LD B,L 45 1 NOP 1
LD B,* 06 2 NOP 1
LD BC,(*) 4BED 4 NOP 1
LD BC,* 01 3 NOP 1
LD C,(HL) 4E 1 NOP 1
LD C,(IX*) 4EDD 3 ZIX 1
LD C,(IY*) 4EFD 3 ZIX 1
LD C,A 4F 1 NOP 1
LD C,B 48 1 NOP 1
LD C,C 49 1 NOP 1
LD C,D 4A 1 NOP 1
LD C,E 4B 1 NOP 1
LD C,H 4C 1 NOP 1
LD C,L 4D 1 NOP 1
LD C,* 0E 2 NOP 1
LD D,(HL) 56 1 NOP 1
LD D,(IX*) 56DD 3 ZIX 1
LD D,(IY*) 56FD 3 ZIX 1
LD D,A 57 1 NOP 1
LD D,B 50 1 NOP 1
LD D,C 51 1 NOP 1
LD D,D 52 1 NOP 1
LD D,E 53 1 NOP 1
LD D,H 54 1 NOP 1
LD D,L 55 1 NOP 1
LD D,* 16 2 NOP 1
LD DE,(*) 5BED 4 NOP 1
LD DE,* 11 3 NOP 1
LD E,(HL) 5E 1 NOP 1
LD E,(IX*) 5EDD 3 ZIX 1
LD E,(IY*) 5EFD 3 ZIX 1
LD E,A 5F 1 NOP 1
LD E,B 58 1 NOP 1
LD E,C 59 1 NOP 1
LD E,D 5A 1 NOP 1
LD E,E 5B 1 NOP 1
LD E,H 5C 1 NOP 1
LD E,L 5D 1 NOP 1
LD E,* 1E 2 NOP 1
LD H,(HL) 66 1 NOP 1
LD H,(IX*) 66DD 3 ZIX 1
LD H,(IY*) 66FD 3 ZIX 1
LD H,A 67 1 NOP 1
LD H,B 60 1 NOP 1
LD H,C 61 1 NOP 1
LD H,D 62 1 NOP 1
LD H,E 63 1 NOP 1
LD H,H 64 1 NOP 1
LD H,L 65 1 NOP 1
LD H,* 26 2 NOP 1
LD HL,(*) 2A 3 NOP 1
LD HL,* 21 3 NOP 1
LD I,A 47ED 2 NOP 1
LD IX,(*) 2ADD 4 NOP 1
LD IX,* 21DD 4 NOP 1
LD IY,(*) 2AFD 4 NOP 1
LD IY,* 21FD 4 NOP 1
LD L,(HL) 6E 1 NOP 1
LD L,(IX*) 6EDD 3 ZIX 1
LD L,(IY*) 6EFD 3 ZIX 1
LD L,A 6F 1 NOP 1
LD L,B 68 1 NOP 1
LD L,C 69 1 NOP 1
LD L,D 6A 1 NOP 1
LD L,E 6B 1 NOP 1
LD L,H 6C 1 NOP 1
LD L,L 6D 1 NOP 1
LD L,* 2E 2 NOP 1
LD R,A 4FED 2 NOP 1
LD SP,(*) 7BED 4 NOP 1
LD SP,HL F9 1 NOP 1
LD SP,IX F9DD 2 NOP 1
LD SP,IY F9FD 2 NOP 1
LD SP,* 31 3 NOP 1
LDD "" A8ED 2 NOP 1
LDDR "" B8ED 2 NOP 1
LDI "" A0ED 2 NOP 1
LDIR "" B0ED 2 NOP 1
NEG "" 44ED 2 NOP 1
NOP "" 00 1 NOP 1
MLT BC 4CED 2 NOP 2
MLT DE 5CED 2 NOP 2
MLT HL 6CED 2 NOP 2
MLT SP 7CED 2 NOP 2
OR (HL) B6 1 NOP 1
OR (IX*) B6DD 3 ZIX 1
OR (IY*) B6FD 3 ZIX 1
OR A B7 1 NOP 1
OR B B0 1 NOP 1
OR C B1 1 NOP 1
OR D B2 1 NOP 1
OR E B3 1 NOP 1
OR H B4 1 NOP 1
OR L B5 1 NOP 1
OR * F6 2 NOP 1
OTDM "" 8BED 2 NOP 2
OTDMR "" 9BED 2 NOP 2
OTDR "" BBED 2 NOP 1
OTIM "" 83ED 2 NOP 2
OTIMR "" 93ED 2 NOP 2
OTIR "" B3ED 2 NOP 1
OUT (C),A 79ED 2 NOP 1
OUT (C),B 41ED 2 NOP 1
OUT (C),C 49ED 2 NOP 1
OUT (C),D 51ED 2 NOP 1
OUT (C),E 59ED 2 NOP 1
OUT (C),H 61ED 2 NOP 1
OUT (C),L 69ED 2 NOP 1
OUT (*),A D3 2 NOP 1
OUT0 (*),A 39ED 3 NOP 2
OUT0 (*),B 01ED 3 NOP 2
OUT0 (*),C 09ED 3 NOP 2
OUT0 (*),D 11ED 3 NOP 2
OUT0 (*),E 19ED 3 NOP 2
OUT0 (*),H 21ED 3 NOP 2
OUT0 (*),L 29ED 3 NOP 2
OUTD "" ABED 2 NOP 1
OUTI "" A3ED 2 NOP 1
POP AF F1 1 NOP 1
POP BC C1 1 NOP 1
POP DE D1 1 NOP 1
POP HL E1 1 NOP 1
POP IX E1DD 2 NOP 1
POP IY E1FD 2 NOP 1
PUSH AF F5 1 NOP 1
PUSH BC C5 1 NOP 1
PUSH DE D5 1 NOP 1
PUSH HL E5 1 NOP 1
PUSH IX E5DD 2 NOP 1
PUSH IY E5FD 2 NOP 1
RES *,(HL) 86CB 2 ZBIT 1
RES *,(IX*) CBDD 4 ZBIT 1 0 8600
RES *,(IY*) CBFD 4 ZBIT 1 0 8600
RES *,A 87CB 2 ZBIT 1
RES *,B 80CB 2 ZBIT 1
RES *,C 81CB 2 ZBIT 1
RES *,D 82CB 2 ZBIT 1
RES *,E 83CB 2 ZBIT 1
RES *,H 84CB 2 ZBIT 1
RES *,L 85CB 2 ZBIT 1
RET "" C9 1 NOP 1
RET C D8 1 NOP 1
RET M F8 1 NOP 1
RET NC D0 1 NOP 1
RET NZ C0 1 NOP 1
RET P F0 1 NOP 1
RET PE E8 1 NOP 1
RET PO E0 1 NOP 1
RET Z C8 1 NOP 1
RETI "" 4DED 2 NOP 1
RETN "" 45ED 2 NOP 1
RL (HL) 16CB 2 NOP 1
RL (IX*) CBDD 4 ZIX 1 0 1600
RL (IY*) CBFD 4 ZIX 1 0 1600
RL A 17CB 2 NOP 1
RL B 10CB 2 NOP 1
RL C 11CB 2 NOP 1
RL D 12CB 2 NOP 1
RL E 13CB 2 NOP 1
RL H 14CB 2 NOP 1
RL L 15CB 2 NOP 1
RLA "" 17 1 NOP 1
RLC (HL) 06CB 2 NOP 1
RLC (IX*) CBDD 4 ZIX 1 0 0600
RLC (IY*) CBFD 4 ZIX 1 0 0600
RLC A 07CB 2 NOP 1
RLC B 00CB 2 NOP 1
RLC C 01CB 2 NOP 1
RLC D 02CB 2 NOP 1
RLC E 03CB 2 NOP 1
RLC H 04CB 2 NOP 1
RLC L 05CB 2 NOP 1
RLCA "" 07 1 NOP 1
RLD "" 6FED 2 NOP 1
RR (HL) 1ECB 2 NOP 1
RR (IX*) CBDD 4 ZIX 1 0 1E00
RR (IY*) CBFD 4 ZIX 1 0 1E00
RR A 1FCB 2 NOP 1
RR B 18CB 2 NOP 1
RR C 19CB 2 NOP 1
RR D 1ACB 2 NOP 1
RR E 1BCB 2 NOP 1
RR H 1CCB 2 NOP 1
RR L 1DCB 2 NOP 1
RRA "" 1F 1 NOP 1
RRC (HL) 0ECB 2 NOP 1
RRC (IX*) CBDD 4 ZIX 1 0 0E00
RRC (IY*) CBFD 4 ZIX 1 0 0E00
RRC A 0FCB 2 NOP 1
RRC B 08CB 2 NOP 1
RRC C 09CB 2 NOP 1
RRC D 0ACB 2 NOP 1
RRC E 0BCB 2 NOP 1
RRC H 0CCB 2 NOP 1
RRC L 0DCB 2 NOP 1
RRCA "" 0F 1 NOP 1
RRD "" 67ED 2 NOP 1
RST 00H C7 1 NOP 1
RST 08H CF 1 NOP 1
RST 10H D7 1 NOP 1
RST 18H DF 1 NOP 1
RST 20H E7 1 NOP 1
RST 28H EF 1 NOP 1
RST 30H F7 1 NOP 1
RST 38H FF 1 NOP 1
/* Alternate form of above
RST 00 C7 1 NOP 1
RST 08 CF 1 NOP 1
RST 10 D7 1 NOP 1
RST 18 DF 1 NOP 1
RST 20 E7 1 NOP 1
RST 28 EF 1 NOP 1
RST 30 F7 1 NOP 1
RST 38 FF 1 NOP 1
SBC A,(HL) 9E 1 NOP 1
SBC A,(IX*) 9EDD 3 ZIX 1
SBC A,(IY*) 9EFD 3 ZIX 1
SBC A,A 9F 1 NOP 1
SBC A,B 98 1 NOP 1
SBC A,C 99 1 NOP 1
SBC A,D 9A 1 NOP 1
SBC A,E 9B 1 NOP 1
SBC A,H 9C 1 NOP 1
SBC A,L 9D 1 NOP 1
SBC HL,BC 42ED 2 NOP 1
SBC HL,DE 52ED 2 NOP 1
SBC HL,HL 62ED 2 NOP 1
SBC HL,SP 72ED 2 NOP 1
SBC A,* DE 2 NOP 1
SCF "" 37 1 NOP 1
SET *,(HL) C6CB 2 ZBIT 1
SET *,(IX*) CBDD 4 ZBIT 1 0 C600
SET *,(IY*) CBFD 4 ZBIT 1 0 C600
SET *,A C7CB 2 ZBIT 1
SET *,B C0CB 2 ZBIT 1
SET *,C C1CB 2 ZBIT 1
SET *,D C2CB 2 ZBIT 1
SET *,E C3CB 2 ZBIT 1
SET *,H C4CB 2 ZBIT 1
SET *,L C5CB 2 ZBIT 1
SLA (HL) 26CB 2 NOP 1
SLA (IX*) CBDD 4 ZIX 1 0 2600
SLA (IY*) CBFD 4 ZIX 1 0 2600
SLA A 27CB 2 NOP 1
SLA B 20CB 2 NOP 1
SLA C 21CB 2 NOP 1
SLA D 22CB 2 NOP 1
SLA E 23CB 2 NOP 1
SLA H 24CB 2 NOP 1
SLA L 25CB 2 NOP 1
SLP "" 76ED 2 NOP 2
SRA (HL) 2ECB 2 NOP 1
SRA (IX*) CBDD 4 ZIX 1 0 2E00
SRA (IY*) CBFD 4 ZIX 1 0 2E00
SRA A 2FCB 2 NOP 1
SRA B 28CB 2 NOP 1
SRA C 29CB 2 NOP 1
SRA D 2ACB 2 NOP 1
SRA E 2BCB 2 NOP 1
SRA H 2CCB 2 NOP 1
SRA L 2DCB 2 NOP 1
SRL (HL) 3ECB 2 NOP 1
SRL (IX*) CBDD 4 ZIX 1 0 3E00
SRL (IY*) CBFD 4 ZIX 1 0 3E00
SRL A 3FCB 2 NOP 1
SRL B 38CB 2 NOP 1
SRL C 39CB 2 NOP 1
SRL D 3ACB 2 NOP 1
SRL E 3BCB 2 NOP 1
SRL H 3CCB 2 NOP 1
SRL L 3DCB 2 NOP 1
SUB (HL) 96 1 NOP 1
SUB (IX*) 96DD 3 ZIX 1
SUB (IY*) 96FD 3 ZIX 1
SUB A 97 1 NOP 1
SUB B 90 1 NOP 1
SUB C 91 1 NOP 1
SUB D 92 1 NOP 1
SUB E 93 1 NOP 1
SUB H 94 1 NOP 1
SUB L 95 1 NOP 1
SUB * D6 2 NOP 1
TST A 3CED 2 NOP 2
TST B 04ED 2 NOP 2
TST C 0CED 2 NOP 2
TST D 14ED 2 NOP 2
TST E 1CED 2 NOP 2
TST H 24ED 2 NOP 2
TST L 2CED 2 NOP 2
TST (HL) 34ED 2 NOP 2
TST * 64ED 3 NOP 2
TSTIO * 74ED 3 NOP 2
XOR (HL) AE 1 NOP 1
XOR (IX*) AEDD 3 ZIX 1
XOR (IY*) AEFD 3 ZIX 1
XOR A AF 1 NOP 1
XOR B A8 1 NOP 1
XOR C A9 1 NOP 1
XOR D AA 1 NOP 1
XOR E AB 1 NOP 1
XOR H AC 1 NOP 1
XOR L AD 1 NOP 1
XOR * EE 2 NOP 1

257
branches/dwg/LSource/bin/TASM85.TAB

@ -0,0 +1,257 @@
"TASM 8085 Assembler. "
/****************************************************************************
/* $Id: tasm85.tab 1.1 1993/07/31 01:12:40 toma Exp $
/****************************************************************************
/* This is the instruction set definition table for the 8085 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorporated
/* This table authored and submitted by Gary Kirk Bach.
/*
/*INSTR ARGS OPCODE BYTES MOD CLASS */
/*-----------------*/
ACI * CE 2 NOP 1
ADC B 88 1 NOP 1
ADC C 89 1 NOP 1
ADC D 8A 1 NOP 1
ADC E 8B 1 NOP 1
ADC H 8C 1 NOP 1
ADC L 8D 1 NOP 1
ADC M 8E 1 NOP 1
ADC A 8F 1 NOP 1
ADD B 80 1 NOP 1
ADD C 81 1 NOP 1
ADD D 82 1 NOP 1
ADD E 83 1 NOP 1
ADD H 84 1 NOP 1
ADD L 85 1 NOP 1
ADD M 86 1 NOP 1
ADD A 87 1 NOP 1
ADI * C6 2 NOP 1
ANA B A0 1 NOP 1
ANA C A1 1 NOP 1
ANA D A2 1 NOP 1
ANA E A3 1 NOP 1
ANA H A4 1 NOP 1
ANA L A5 1 NOP 1
ANA M A6 1 NOP 1
ANA A A7 1 NOP 1
ANI * E6 2 NOP 1
CALL * CD 3 NOP 1
CC * DC 3 NOP 1
CM * FC 3 NOP 1
CMA "" 2F 1 NOP 1
CMC "" 3F 1 NOP 1
CMP B B8 1 NOP 1
CMP C B9 1 NOP 1
CMP D BA 1 NOP 1
CMP E BB 1 NOP 1
CMP H BC 1 NOP 1
CMP L BD 1 NOP 1
CMP M BE 1 NOP 1
CMP A BF 1 NOP 1
CNC * D4 3 NOP 1
CNZ * C4 3 NOP 1
CP * F4 3 NOP 1
CPE * EC 3 NOP 1
CPI * FE 2 NOP 1
CPO * E4 3 NOP 1
CZ * CC 3 NOP 1
DAA "" 27 1 NOP 1
DAD B 09 1 NOP 1
DAD D 19 1 NOP 1
DAD H 29 1 NOP 1
DAD SP 39 1 NOP 1
DCR B 05 1 NOP 1
DCR C 0D 1 NOP 1
DCR D 15 1 NOP 1
DCR E 1D 1 NOP 1
DCR H 25 1 NOP 1
DCR L 2D 1 NOP 1
DCR M 35 1 NOP 1
DCR A 3D 1 NOP 1
DCX B 0B 1 NOP 1
DCX D 1B 1 NOP 1
DCX H 2B 1 NOP 1
DCX SP 3B 1 NOP 1
DI "" F3 1 NOP 1
EI "" FB 1 NOP 1
HLT "" 76 1 NOP 1
IN * DB 2 NOP 1
INR B 04 1 NOP 1
INR C 0C 1 NOP 1
INR D 14 1 NOP 1
INR E 1C 1 NOP 1
INR H 24 1 NOP 1
INR L 2C 1 NOP 1
INR M 34 1 NOP 1
INR A 3C 1 NOP 1
INX B 03 1 NOP 1
INX D 13 1 NOP 1
INX H 23 1 NOP 1
INX SP 33 1 NOP 1
JC * DA 3 NOP 1
JM * FA 3 NOP 1
JMP * C3 3 NOP 1
JNC * D2 3 NOP 1
JNZ * C2 3 NOP 1
JP * F2 3 NOP 1
JPE * EA 3 NOP 1
JPO * E2 3 NOP 1
JZ * CA 3 NOP 1
LDA * 3A 3 NOP 1
LDAX B 0A 1 NOP 1
LDAX D 1A 1 NOP 1
LHLD * 2A 3 NOP 1
LXI B,* 01 3 NOP 1
LXI D,* 11 3 NOP 1
LXI H,* 21 3 NOP 1
LXI SP,* 31 3 NOP 1
MOV B,B 40 1 NOP 1
MOV B,C 41 1 NOP 1
MOV B,D 42 1 NOP 1
MOV B,E 43 1 NOP 1
MOV B,H 44 1 NOP 1
MOV B,L 45 1 NOP 1
MOV B,M 46 1 NOP 1
MOV B,A 47 1 NOP 1
MOV C,B 48 1 NOP 1
MOV C,C 49 1 NOP 1
MOV C,D 4A 1 NOP 1
MOV C,E 4B 1 NOP 1
MOV C,H 4C 1 NOP 1
MOV C,L 4D 1 NOP 1
MOV C,M 4E 1 NOP 1
MOV C,A 4F 1 NOP 1
MOV D,B 50 1 NOP 1
MOV D,C 51 1 NOP 1
MOV D,D 52 1 NOP 1
MOV D,E 53 1 NOP 1
MOV D,H 54 1 NOP 1
MOV D,L 55 1 NOP 1
MOV D,M 56 1 NOP 1
MOV D,A 57 1 NOP 1
MOV E,B 58 1 NOP 1
MOV E,C 59 1 NOP 1
MOV E,D 5A 1 NOP 1
MOV E,E 5B 1 NOP 1
MOV E,H 5C 1 NOP 1
MOV E,L 5D 1 NOP 1
MOV E,M 5E 1 NOP 1
MOV E,A 5F 1 NOP 1
MOV H,B 60 1 NOP 1
MOV H,C 61 1 NOP 1
MOV H,D 62 1 NOP 1
MOV H,E 63 1 NOP 1
MOV H,H 64 1 NOP 1
MOV H,L 65 1 NOP 1
MOV H,M 66 1 NOP 1
MOV H,A 67 1 NOP 1
MOV L,B 68 1 NOP 1
MOV L,C 69 1 NOP 1
MOV L,D 6A 1 NOP 1
MOV L,E 6B 1 NOP 1
MOV L,H 6C 1 NOP 1
MOV L,L 6D 1 NOP 1
MOV L,M 6E 1 NOP 1
MOV L,A 6F 1 NOP 1
MOV M,B 70 1 NOP 1
MOV M,C 71 1 NOP 1
MOV M,D 72 1 NOP 1
MOV M,E 73 1 NOP 1
MOV M,H 74 1 NOP 1
MOV M,L 75 1 NOP 1
MOV M,A 77 1 NOP 1
MOV A,B 78 1 NOP 1
MOV A,C 79 1 NOP 1
MOV A,D 7A 1 NOP 1
MOV A,E 7B 1 NOP 1
MOV A,H 7C 1 NOP 1
MOV A,L 7D 1 NOP 1
MOV A,M 7E 1 NOP 1
MOV A,A 7F 1 NOP 1
MVI B,* 06 2 NOP 1
MVI C,* 0E 2 NOP 1
MVI D,* 16 2 NOP 1
MVI E,* 1E 2 NOP 1
MVI H,* 26 2 NOP 1
MVI L,* 2E 2 NOP 1
MVI M,* 36 2 NOP 1
MVI A,* 3E 2 NOP 1
NOP "" 00 1 NOP 1
ORA B B0 1 NOP 1
ORA C B1 1 NOP 1
ORA D B2 1 NOP 1
ORA E B3 1 NOP 1
ORA H B4 1 NOP 1
ORA L B5 1 NOP 1
ORA M B6 1 NOP 1
ORA A B7 1 NOP 1
ORI * F6 2 NOP 1
OUT * D3 2 NOP 1
PCHL "" E9 1 NOP 1
POP B C1 1 NOP 1
POP D D1 1 NOP 1
POP H E1 1 NOP 1
POP PSW F1 1 NOP 1
PUSH B C5 1 NOP 1
PUSH D D5 1 NOP 1
PUSH H E5 1 NOP 1
PUSH PSW F5 1 NOP 1
RAL "" 17 1 NOP 1
RAR "" 1F 1 NOP 1
RC "" D8 1 NOP 1
RET "" C9 1 NOP 1
RIM "" 20 1 NOP 1
RLC "" 07 1 NOP 1
RM "" F8 1 NOP 1
RNC "" D0 1 NOP 1
RNZ "" C0 1 NOP 1
RP "" F0 1 NOP 1
RPE "" E8 1 NOP 1
RPO "" E0 1 NOP 1
RRC "" 0F 1 NOP 1
RST 0 C7 1 NOP 1
RST 1 CF 1 NOP 1
RST 2 D7 1 NOP 1
RST 3 DF 1 NOP 1
RST 4 E7 1 NOP 1
RST 5 EF 1 NOP 1
RST 6 F7 1 NOP 1
RST 7 FF 1 NOP 1
RZ "" C8 1 NOP 1
SBB B 98 1 NOP 1
SBB C 99 1 NOP 1
SBB D 9A 1 NOP 1
SBB E 9B 1 NOP 1
SBB H 9C 1 NOP 1
SBB L 9D 1 NOP 1
SBB M 9E 1 NOP 1
SBB A 9F 1 NOP 1
SBI * DE 2 NOP 1
SHLD * 22 3 NOP 1
SIM "" 30 1 NOP 1
SPHL "" F9 1 NOP 1
STA * 32 3 NOP 1
STAX B 02 1 NOP 1
STAX D 12 1 NOP 1
STC "" 37 1 NOP 1
SUB B 90 1 NOP 1
SUB C 91 1 NOP 1
SUB D 92 1 NOP 1
SUB E 93 1 NOP 1
SUB H 94 1 NOP 1
SUB L 95 1 NOP 1
SUB M 96 1 NOP 1
SUB A 97 1 NOP 1
SUI * D6 2 NOP 1
XCHG "" EB 1 NOP 1
XRA B A8 1 NOP 1
XRA C A9 1 NOP 1
XRA D AA 1 NOP 1
XRA E AB 1 NOP 1
XRA H AC 1 NOP 1
XRA L AD 1 NOP 1
XRA M AE 1 NOP 1
XRA A AF 1 NOP 1
XRI * EE 2 NOP 1
XTHL "" E3 1 NOP 1

393
branches/dwg/LSource/bin/TASM96.TAB

@ -0,0 +1,393 @@
"TASM 8096 Assembler."
/****************************************************************************
/* $Id: tasm96.tab 1.5 1997/09/28 22:14:30 toma Exp $
/****************************************************************************
;* This is the instruction set definition table
;* for the 8096 version of TASM.
;* Thomas N. Anderson, Speech Technology Incorporated
;*
;* See TASM manual for info on table structure.
;*
;*INSTR ARGS OPCODE BYTES MOD CLASS SHIFT MASK
;*-------------------------------------------*
; Revisions:
; Added I7 rule for single arg direct/far (PUSH/POP)
; Changed ADDB *,*,*[*] entry from rule I1 to I6.
;
; Generate opcodes high byte first/
.MSFIRST
.NOARGSHIFT
;
; Note:
; The I1 rule uses ARGVAL for arg validation. If the combined
; args AND ARGVAL is not equal to the combined args then an
; error message is generated.
;
; The I1 rule also uses ARGOR. The value of that mask is OR'd
; with the first byte of the args.
;
; ARGOR
; BYTES CLASS |
; | | |
;INST ARGS OP v RULE v v ARGVAL
;-----------------------------------------;
;OK ADD
ADD *,*,[*]+ 46 4 I1 1 01 00FeFeFe ;
ADD *,*,[*] 46 4 I1 1 00 00FeFeFe ;
ADD *,*,*[*] 47 6 I6 1 00 00FeFeFe ;
ADD *,*,#* 45 5 I1 1 00 FeFeFFFF ;
ADD *,[*]+ 66 3 I1 1 01 0000FFFe ; 1st arg must be even, make odd
ADD *,[*] 66 3 I1 1 00 0000FFFe ; 1st arg must be even
ADD *,*[*] 67 5 I6 1 00 00FFFFFF ;
ADD *,*,* 4701 6 I3 1 00 0000FeFe ; 3rd arg may be far
ADD *,#* 65 4 I1 1 00 00FeFFFF ; 1st arg must be even
ADD *,* 6701 5 I2 1 00 0000FeFe ; 2nd arg may be far
;OK ADDB
ADDB *,*,[*]+ 56 4 I1 1 01 00000000 ; no validation yet
ADDB *,*,[*] 56 4 I1 1 00 00000000 ; no validation yet
ADDB *,*,*[*] 57 6 I6 1 00 00000000 ; no validation yet
ADDB *,*,#* 55 4 I1 1 00 00000000 ; no validation yet
ADDB *,[*]+ 76 3 I1 1 01 0000FFFe ; 1st arg must be even, make odd
ADDB *,[*] 76 3 I1 1 00 0000FFFe ; 1st arg must be even
ADDB *,*[*] 77 5 I6 1 00 00FeFFFe ; 1st,3rd must be even
ADDB *,*,* 5701 6 I3 1 00 00000000 ; 3rd arg may be far
ADDB *,#* 75 3 I1 1 00 00FFFFFF ; odd args ok for byte operations
ADDB *,* 7701 5 I2 1 00 00000000 ; 2nd arg may be far
; No three arg forms for ADDC or ADDCB
ADDC *,[*]+ A6 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
ADDC *,[*] A6 3 I1 1 00 0000FFFe ;1st arg must be even
ADDC *,*[*] A7 5 I6 1 00 00FFFFFF ;
ADDC *,#* A5 4 I1 1 00 00FeFFFF ;1st arg must be even
ADDC *,* A701 5 I2 1 00 00000000 ;2nd arg may be far
ADDCB *,[*]+ B6 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
ADDCB *,[*] B6 3 I1 1 00 0000FFFe ;1st arg must be even
ADDCB *,*[*] B7 5 I6 1 00 00FFFFFF ;
ADDCB *,#* B5 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
ADDCB *,* B701 5 I2 1 00 00000000 ;2nd arg may be far
; OK AND
AND *,*,[*]+ 42 4 I1 1 01 00000000 ;no validation yet
AND *,*,[*] 42 4 I1 1 00 00000000 ;no validation yet
AND *,*,*[*] 43 6 I6 1 00 00000000 ;no validation yet
AND *,*,#* 41 5 I1 1 00 00000000 ;no validation yet
AND *,[*]+ 62 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
AND *,[*] 62 3 I1 1 00 0000FFFe ;1st arg must be even
AND *,*[*] 63 5 I6 1 00 00FeFFFe ;1st,3rd must be even
AND *,*,* 4301 6 I3 1 00 00000000 ;3rd arg may be far
AND *,#* 61 4 I1 1 00 00FeFFFF ;1st arg must be even
AND *,* 6301 5 I2 1 00 00000000 ;2nd arg may be far
ANDB *,*,[*]+ 52 4 I1 1 01 00000000 ;no validation yet
ANDB *,*,[*] 52 4 I1 1 00 00000000 ;no validation yet
ANDB *,*,*[*] 53 6 I6 1 00 00000000 ;no validation yet
ANDB *,*,#* 51 4 I1 1 00 00000000 ;no validation yet
ANDB *,[*]+ 72 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
ANDB *,[*] 72 3 I1 1 00 0000FFFe ;1st arg must be even
ANDB *,*[*] 73 5 I6 1 00 00FFFFFF ;
ANDB *,*,* 5301 6 I3 1 00 00000000 ;3rd arg may be far
ANDB *,#* 71 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
ANDB *,* 7301 5 I2 1 00 00000000 ;2nd arg may be far
BMOV *,* C1 3 I1 2 00 0000FcFF ;long word ptr to two words
BMOVI *,* AD 3 I1 2 00 0000FcFF ;long word ptr to two words
BR [*] E3 2 I1 1 00 00000000 ;
BR * 2000 2 I5 1 00 00000000 ; Same As SJMP
CLR * 01 2 NOP 1 00 00000000 ;
CLRB * 11 2 NOP 1 00 00000000 ;
CLRC "" F8 1 NOP 1 00 00000000 ;
CLRVT "" FC 1 NOP 1 00 00000000 ;
CMP *,[*]+ 8A 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
CMP *,[*] 8A 3 I1 1 00 0000FFFe ;1st arg must be even
CMP *,*[*] 8B 5 I6 1 00 00FFFFFF ;
CMP *,#* 89 4 I1 1 00 00FeFFFF ;1st arg must be even
CMP *,* 8B01 5 I2 1 00 00000000 ;2nd arg may be far
CMPB *,[*]+ 9A 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
CMPB *,[*] 9A 3 I1 1 00 0000FFFe ;1st arg must be even
CMPB *,*[*] 9B 5 I6 1 00 00FFFFFF ;
CMPB *,#* 99 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
CMPB *,* 9B01 5 I2 1 00 00000000 ;2nd arg may be far
CMPL *,* C5 3 I1 2 00 0000FcFc ;long align multiple of 4
DEC * 05 2 NOP 1 00 00000000 ;
DECB * 15 2 NOP 1 00 00000000 ;
DJNZ *,* E0 3 CREL 1 00 00000000 ;
DJNZW *,* E1 3 CREL 2 00 00000000 ;
DI "" FA 1 NOP 1 00 00000000 ;
DIVU *,[*]+ 8E 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
DIVU *,[*] 8E 3 I1 1 00 0000FFFe ;1st arg must be even
DIVU *,*[*] 8F 5 I6 1 00 0000FFFe ;1st arg must be even
DIVU *,#* 8D 4 I1 1 00 00FeFFFF ;1st arg must be even
DIVU *,* 8F01 5 I2 1 00 00000000 ;2nd arg may be far
DIVUB *,[*]+ 9E 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
DIVUB *,[*] 9E 3 I1 1 00 0000FFFe ;1st arg must be even
DIVUB *,*[*] 9F 5 I6 1 00 0000FFFF ;
DIVUB *,#* 9D 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
DIVUB *,* 9F01 5 I2 1 00 00000000 ;2nd arg may be far
DIV *,[*]+ FE8E 4 I1 1 01 0000FFFe ;1st arg must be even, make odd
DIV *,[*] FE8E 4 I1 1 00 0000FFFe ;1st arg must be even
DIV *,*[*] FE8F 6 I6 1 00 0000FFFe ;1st arg must be even
DIV *,#* FE8D 5 I1 1 00 00FeFFFF ;1st arg must be even
DIV *,* FE8F01 6 I2 1 00 00000000 ;2nd arg may be far
DIVB *,[*]+ FE9E 4 I1 1 01 0000FFFe ;1st arg must be even, make odd
DIVB *,[*] FE9E 4 I1 1 00 0000FFFe ;1st arg must be even
DIVB *,*[*] FE9F 6 I6 1 00 0000FFFF ;
DIVB *,#* FE9D 4 I1 1 00 00FFFFFF ;odd args ok for byte operations;
DIVB *,* FE9F01 6 I2 1 00 00000000 ;2nd arg may be far
DPTS "" EC 1 NOP 2 00 00000000 ;
EPTS "" ED 1 NOP 2 00 00000000 ;
EI "" FB 1 NOP 1 00 00000000 ;
EXT * 06 2 NOP 1 00 00000000 ;
EXTB * 16 2 NOP 1 00 00000000 ;
IDLPD #* F6 2 NOP 2 00 00000000 ;
INC * 07 2 NOP 1 00 00000000 ;
INCB * 17 2 NOP 1 00 00000000 ;
JC * DB 2 R1 1 00 00000000
JNC * D3 2 R1 1 00 00000000
JH * D9 2 R1 1 00 00000000
JNH * D1 2 R1 1 00 00000000
JE * DF 2 R1 1 00 00000000
JNE * D7 2 R1 1 00 00000000
JV * DD 2 R1 1 00 00000000
JNV * D5 2 R1 1 00 00000000
JGE * D6 2 R1 1 00 00000000
JLT * DE 2 R1 1 00 00000000
JVT * DC 2 R1 1 00 00000000
JNVT * D4 2 R1 1 00 00000000
JGT * D2 2 R1 1 00 00000000
JLE * DA 2 R1 1 00 00000000
JST * D8 2 R1 1 00 00000000
JNST * D0 2 R1 1 00 00000000
JBC *,*,* 30 3 I4 1 00 00000000
JBS *,*,* 38 3 I4 1 00 00000000
LJMP * E7 3 R2 1 00 00000000
LCALL * EF 3 R2 1 00 00000000
LD *,[*]+ A2 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
LD *,[*] A2 3 I1 1 00 0000FFFe ;1st arg must be even
LD *,*[*] A3 5 I6 1 00 00FFFFFF ;
LD *,#* A1 4 I1 1 00 00FFFFFF ;
LD *,* A301 5 I2 1 00 00000000 ;2nd arg may be far
LDB *,[*]+ B2 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
LDB *,[*] B2 3 I1 1 00 0000FFFe ;1st arg must be even
LDB *,*[*] B3 5 I6 1 00 00FFFFFF ;
LDB *,#* B1 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
LDB *,* B301 5 I2 1 00 00000000 ;2nd arg may be far
LDBSE *,[*]+ BE 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
LDBSE *,[*] BE 3 I1 1 00 0000FFFe ;1st arg must be even
LDBSE *,*[*] BF 5 I6 1 00 00FeFFFe ;1st,3rd must be even
LDBSE *,#* BD 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
LDBSE *,* BF01 5 I2 1 00 00000000 ;2nd arg may be far
LDBZE *,[*]+ AE 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
LDBZE *,[*] AE 3 I1 1 00 0000FFFe ;1st arg must be even
LDBZE *,*[*] AF 5 I6 1 00 00FeFFFe ;1st,3rd must be even
LDBZE *,#* AD 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
LDBZE *,* AF01 5 I2 1 00 00000000 ;2nd arg may be far
MULU *,*,[*]+ 4E 4 I1 1 01 00000000 ;no validation yet
MULU *,*,[*] 4E 4 I1 1 00 00000000 ;no validation yet
MULU *,*,*[*] 4F 6 I6 1 00 00000000 ;no validation yet
MULU *,*,#* 4D 5 I1 1 00 00000000 ;no validation yet
MULU *,[*]+ 6E 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
MULU *,[*] 6E 3 I1 1 00 0000FFFe ;1st arg must be even
MULU *,*[*] 6F 5 I6 1 00 00FeFFFe ;1st,3rd must be even
MULU *,*,* 4F01 6 I3 1 00 00000000 ;3rd arg may be far
MULU *,#* 6D 4 I1 1 00 00FeFFFF ;1st arg must be even
MULU *,* 6F01 5 I2 1 00 00000000 ;2nd arg may be far
MULUB *,*,[*]+ 5E 4 I1 1 01 00000000 ;no validation yet
MULUB *,*,[*] 5E 4 I1 1 00 00000000 ;no validation yet
MULUB *,*,*[*] 5F 6 I6 1 00 00000000 ;no validation yet
MULUB *,*,#* 5D 4 I1 1 00 00000000 ;no validation yet
MULUB *,[*]+ 7E 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
MULUB *,[*] 7E 3 I1 1 00 0000FFFe ;1st arg must be even
MULUB *,*[*] 7F 5 I6 1 00 00FFFFFF ;
MULUB *,*,* 5F01 6 I3 1 00 00000000 ;3rd arg may be far
MULUB *,#* 7D 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
MULUB *,* 7F01 5 I2 1 00 00000000 ;2nd arg may be far
MUL *,*,[*]+ FE4E 5 I1 1 01 00000000 ;no validation yet
MUL *,*,[*] FE4E 5 I1 1 00 00000000 ;no validation yet
MUL *,*,*[*] FE4F 7 I6 1 00 00000000 ;no validation yet
MUL *,*,#* FE4D 6 I1 1 00 00000000 ;no validation yet
MUL *,[*]+ FE6E 4 I1 1 01 0000FFFe ;1st arg must be even, make odd
MUL *,[*] FE6E 4 I1 1 00 0000FFFe ;1st arg must be even
MUL *,*[*] FE6F 6 I6 1 00 00FeFFFe ;1st,3rd must be even
MUL *,*,* FE4F01 7 I3 1 00 00000000 ;3rd arg may be far
MUL *,#* FE6D 5 I1 1 00 00FFFFFF ;odd args ok for byte operations
MUL *,* FE6F01 6 I2 1 00 00000000 ;2nd arg may be far
MULB *,*,[*]+ FE5E 5 I1 1 01 00000000 ;no validation yet
MULB *,*,[*] FE5E 5 I1 1 00 00000000 ;no validation yet
MULB *,*,*[*] FE5F 7 I6 1 00 00000000 ;no validation yet
MULB *,*,#* FE5D 5 I1 1 00 00000000 ;no validation yet
MULB *,[*]+ FE7E 4 I1 1 01 0000FFFe ;1st arg must be even, make odd
MULB *,[*] FE7E 4 I1 1 00 0000FFFe ;1st arg must be even
MULB *,*[*] FE7F 6 I6 1 00 00FFFFFF ;
MULB *,*,* FE5F01 7 I3 1 00 00000000 ;3rd arg may be far
MULB *,#* FE7D 4 I1 1 00 00FFFFFF ;odd args ok for byte operations
MULB *,* FE7F01 6 I2 1 00 00000000 ;2nd arg may be far
NEG * 03 2 I1 1 00 000000FE ;arg must be even
NEGB * 13 2 I1 1 00 000000FF ;
NOP "" FD 1 NOP 1 00 00000000 ;
NORML *,* 0F 3 I1 1 00 0000FFFF ;long align
NOT * 02 2 NOP 1 00 00000000 ;
NOTB * 12 2 NOP 1 00 00000000 ;
OR *,[*]+ 82 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
OR *,[*] 82 3 I1 1 00 0000FFFe ;1st arg must be even
OR *,*[*] 83 5 I6 1 00 00FeFFFe ;1st,3rd must be even
OR *,#* 81 4 I1 1 00 00FeFFFF ;1st arg must be even
OR *,* 8301 5 I2 1 00 00000000 ;2nd arg may be far
ORB *,[*]+ 92 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
ORB *,[*] 92 3 I1 1 00 0000FFFe ;1st arg must be even
ORB *,*[*] 93 5 I6 1 00 00FFFFFF ;
ORB *,#* 91 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
ORB *,* 9301 5 I2 1 00 00000000 ;2nd arg may be far
PUSH #* C9 3 I1 1 00 00000000 ;
PUSH [*]+ CA 2 I1 1 01 000000Fe ;arg must be even
PUSH [*] CA 2 I1 1 00 000000Fe ;arg must be even
PUSH *[*] CB 4 I6 1 00 00FFFFFe ;arg must be even
PUSH * CB01 4 I7 1 00 0000FFFe ;arg must be even
PUSHF "" F2 1 NOP 1 00 00000000 ;
PUSHA "" F4 1 NOP 1 00 00000000 ;
POP [*]+ CE 2 I1 1 01 000000Fe ;arg must be even
POP [*] CE 2 I1 1 00 000000Fe ;arg must be even
POP *[*] CF 4 I6 1 00 00FFFFFE ;
POP * CF01 4 I7 1 00 0000FFFe ;arg must be even
POPF "" F3 1 NOP 1 00 00000000 ;
POPA "" F5 1 NOP 1 00 00000000 ;
RET "" F0 1 NOP 1 00 00000000 ;
RST "" FF 1 NOP 1 00 00000000 ;
SJMP * 2000 2 I5 1 00 00000000
SCALL * 2800 2 I5 1 00 00000000
SUB *,*,[*]+ 4A 4 I1 1 01 00000000 ;no validation yet
SUB *,*,[*] 4A 4 I1 1 00 00000000 ;no validation yet
SUB *,*,*[*] 4B 6 I6 1 00 00000000 ;no validation yet
SUB *,*,#* 49 5 I1 1 00 00000000 ;no validation yet
SUB *,[*]+ 6A 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
SUB *,[*] 6A 3 I1 1 00 0000FFFe ;1st arg must be even
SUB *,*[*] 6B 5 I6 1 00 00FeFFFe ;1st,3rd must be even
SUB *,*,* 4B01 6 I3 1 00 00000000 ;3rd arg may be far
SUB *,#* 69 4 I1 1 00 00FeFFFF ;1st arg must be even
SUB *,* 6B01 5 I2 1 00 00000000 ;2nd arg may be far
SUBB *,*,[*]+ 5A 4 I1 1 01 00000000 ;no validation yet
SUBB *,*,[*] 5A 4 I1 1 00 00000000 ;no validation yet
SUBB *,*,*[*] 5B 6 I6 1 00 00000000 ;no validation yet
SUBB *,*,#* 59 4 I1 1 00 00000000 ;no validation yet
SUBB *,[*]+ 7A 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
SUBB *,[*] 7A 3 I1 1 00 0000FFFe ;1st arg must be even
SUBB *,*[*] 7B 5 I6 1 00 00FeFFFe ;1st,3rd must be even
SUBB *,*,* 5B01 6 I3 1 00 00000000 ;3rd arg may be far
SUBB *,#* 79 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
SUBB *,* 7B01 5 I2 1 00 00000000 ;2nd arg may be far
SUBC *,[*]+ AA 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
SUBC *,[*] AA 3 I1 1 00 0000FFFe ;1st arg must be even
SUBC *,*[*] AB 5 I6 1 00 00FeFFFe ;1st,3rd must be even
SUBC *,#* A9 4 I1 1 00 00FeFFFF ;1st arg must be even
SUBC *,* AB01 5 I2 1 00 00000000 ;2nd arg may be far
SUBCB *,[*]+ BA 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
SUBCB *,[*] BA 3 I1 1 00 0000FFFe ;1st arg must be even
SUBCB *,*[*] BB 5 I6 1 00 00FeFFFe ;1st,3rd must be even
SUBCB *,#* B9 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
SUBCB *,* BB01 5 I2 1 00 00000000 ;2nd arg may be far
SHL *,#* 09 3 I1 1 00 0000FE0F ; F
SHL *,* 09 3 I1 1 00 0000FEFF ;
SHLB *,#* 19 3 I1 1 00 0000FF0F ;
SHLB *,* 19 3 I1 1 00 0000FFFF ;
SHLL *,#* 0D 3 I1 1 00 0000FF0F ;
SHLL *,* 0D 3 I1 1 00 0000FFFF ;
SHR *,#* 08 3 I1 1 00 0000FF0F ;word align
SHR *,* 08 3 I1 1 00 0000FFFF ;word align
SHRB *,#* 18 3 I1 1 00 0000FF0F ;byte align
SHRB *,* 18 3 I1 1 00 0000FFFF ;byte align
SHRL *,#* 0C 3 I1 1 00 0000FF0F ;long align
SHRL *,* 0C 3 I1 1 00 0000FFFF ;long align
SHRA *,#* 0A 3 I1 1 00 0000FF0F ;word align
SHRA *,* 0A 3 I1 1 00 0000FFFF ;word align
SHRAB *,#* 1A 3 I1 1 00 0000FF0F ;byte align
SHRAB *,* 1A 3 I1 1 00 0000FFFF ;byte align
SHRAL *,#* 0E 3 I1 1 00 0000FF0F ;long align
SHRAL *,* 0E 3 I1 1 00 0000FFFF ;long align
SETC "" F9 1 NOP 1 00 00000000 ;
SKIP "" 0000 2 NOP 1 00 00000000 ;
SKIP * 00 2 I1 1 00 00000000 ;
ST *,[*]+ C2 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
ST *,[*] C2 3 I1 1 00 0000FFFe ;1st arg must be even
ST *,*[*] C3 5 I6 1 00 FFFFFFFe ;1st,3rd must be even
ST *,* C301 5 I2 1 00 00000000 ;2nd arg may be far
STB *,[*]+ C6 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
STB *,[*] C6 3 I1 1 00 0000FFFe ;1st arg must be even
STB *,*[*] C7 5 I6 1 00 FFFFFFFe ;1st,3rd must be even
STB *,* C701 5 I2 1 00 00000000 ;2nd arg may be far
TRAP "" F7 1 NOP 1 00 00000000 ;
TIJMP *,[*],#* E2 4 I8 2 00 00FEFEFF ;
XCH *,*[*] 0B 5 I6 2 00 00FeFFFe ;1st,3rd must be even
XCH *,* 0B01 5 I2 2 0C 00000000 ;2nd arg may be far
XCHB *,*[*] 1B 5 I6 2 00 00FFFFFF ;
XCHB *,* 1B01 5 I2 2 0C 00000000 ;2nd arg may be far
XOR *,[*]+ 86 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
XOR *,[*] 86 3 I1 1 00 0000FFFe ;1st arg must be even
XOR *,*[*] 87 5 I6 1 00 00FeFFFe ;1st,3rd must be even
XOR *,#* 85 4 I1 1 00 00FeFFFF ;1st arg must be even
XOR *,* 8701 5 I2 1 00 00000000 ;2nd arg may be far
XORB *,[*]+ 96 3 I1 1 01 0000FFFe ;1st arg must be even, make odd
XORB *,[*] 96 3 I1 1 00 0000FFFe ;1st arg must be even
XORB *,*[*] 97 5 I6 1 00 00FFFFFF ;
XORB *,#* 95 3 I1 1 00 00FFFFFF ;odd args ok for byte operations
XORB *,* 9701 5 I2 1 00 00000000 ;2nd arg may be far

594
branches/dwg/LSource/bin/tasm180.tab

@ -0,0 +1,594 @@
"TASM Z180 Assembler. "
/****************************************************************************
/* $Id: tasm80.tab 1.2 1998/02/28 14:31:22 toma Exp $
/****************************************************************************
/* This is the instruction set definition table
/* for the Z80 version of TASM.
/* Thomas N. Anderson, Speech Technology Incorporated
/* This table authored and submitted by Carl A. Wall, VE3APY.
/*
/* Class bits assigned as follows:
/* Bit-0 = Z80 (base instruction set)
/* Bit-1 = HD64180 (extended instructions)
/* See TASM manual for info on table structure.
/*
/*INSTR ARGS OP BYTES RULE CLASS SHIFT OR */
/*-------------------------------------------*/
ADC A,(HL) 8E 1 NOP 1
ADC A,(IX*) 8EDD 3 ZIX 1
ADC A,(IY*) 8EFD 3 ZIX 1
ADC A,A 8F 1 NOP 1
ADC A,B 88 1 NOP 1
ADC A,C 89 1 NOP 1
ADC A,D 8A 1 NOP 1
ADC A,E 8B 1 NOP 1
ADC A,H 8C 1 NOP 1
ADC A,L 8D 1 NOP 1
ADC A,* CE 2 NOP 1
ADC HL,BC 4AED 2 NOP 1
ADC HL,DE 5AED 2 NOP 1
ADC HL,HL 6AED 2 NOP 1
ADC HL,SP 7AED 2 NOP 1
ADD A,(HL) 86 1 NOP 1
ADD A,(IX*) 86DD 3 ZIX 1
ADD A,(IY*) 86FD 3 ZIX 1
ADD A,A 87 1 NOP 1
ADD A,B 80 1 NOP 1
ADD A,C 81 1 NOP 1
ADD A,D 82 1 NOP 1
ADD A,E 83 1 NOP 1
ADD A,H 84 1 NOP 1
ADD A,L 85 1 NOP 1
ADD A,* C6 2 NOP 1
ADD HL,BC 09 1 NOP 1
ADD HL,DE 19 1 NOP 1
ADD HL,HL 29 1 NOP 1
ADD HL,SP 39 1 NOP 1
ADD IX,BC 09DD 2 NOP 1
ADD IX,DE 19DD 2 NOP 1
ADD IX,IX 29DD 2 NOP 1
ADD IX,SP 39DD 2 NOP 1
ADD IY,BC 09FD 2 NOP 1
ADD IY,DE 19FD 2 NOP 1
ADD IY,IY 29FD 2 NOP 1
ADD IY,SP 39FD 2 NOP 1
AND (HL) A6 1 NOP 1
AND (IX*) A6DD 3 ZIX 1
AND (IY*) A6FD 3 ZIX 1
AND A A7 1 NOP 1
AND B A0 1 NOP 1
AND C A1 1 NOP 1
AND D A2 1 NOP 1
AND E A3 1 NOP 1
AND H A4 1 NOP 1
AND L A5 1 NOP 1
AND * E6 2 NOP 1
BIT *,(HL) 46CB 2 ZBIT 1
BIT *,(IX*) CBDD 4 ZBIT 1 0 4600
BIT *,(IY*) CBFD 4 ZBIT 1 0 4600
BIT *,A 47CB 2 ZBIT 1
BIT *,B 40CB 2 ZBIT 1
BIT *,C 41CB 2 ZBIT 1
BIT *,D 42CB 2 ZBIT 1
BIT *,E 43CB 2 ZBIT 1
BIT *,H 44CB 2 ZBIT 1
BIT *,L 45CB 2 ZBIT 1
CALL C,* DC 3 NOP 1
CALL M,* FC 3 NOP 1
CALL NC,* D4 3 NOP 1
CALL NZ,* C4 3 NOP 1
CALL P,* F4 3 NOP 1
CALL PE,* EC 3 NOP 1
CALL PO,* E4 3 NOP 1
CALL Z,* CC 3 NOP 1
CALL * CD 3 NOP 1
CCF "" 3F 1 NOP 1
CP (HL) BE 1 NOP 1
CP (IX*) BEDD 3 ZIX 1
CP (IY*) BEFD 3 ZIX 1
CP A BF 1 NOP 1
CP B B8 1 NOP 1
CP C B9 1 NOP 1
CP D BA 1 NOP 1
CP E BB 1 NOP 1
CP H BC 1 NOP 1
CP L BD 1 NOP 1
CP * FE 2 NOP 1
CPD "" A9ED 2 NOP 1
CPDR "" B9ED 2 NOP 1
CPIR "" B1ED 2 NOP 1
CPI "" A1ED 2 NOP 1
CPL "" 2F 1 NOP 1
DAA "" 27 1 NOP 1
DEC (HL) 35 1 NOP 1
DEC (IX*) 35DD 3 ZIX 1
DEC (IY*) 35FD 3 ZIX 1
DEC A 3D 1 NOP 1
DEC B 05 1 NOP 1
DEC BC 0B 1 NOP 1
DEC C 0D 1 NOP 1
DEC D 15 1 NOP 1
DEC DE 1B 1 NOP 1
DEC E 1D 1 NOP 1
DEC H 25 1 NOP 1
DEC HL 2B 1 NOP 1
DEC IX 2BDD 2 NOP 1
DEC IY 2BFD 2 NOP 1
DEC L 2D 1 NOP 1
DEC SP 3B 1 NOP 1
DI "" F3 1 NOP 1
DJNZ * 10 2 R1 1
EI "" FB 1 NOP 1
EX (SP),HL E3 1 NOP 1
EX (SP),IX E3DD 2 NOP 1
EX (SP),IY E3FD 2 NOP 1
EX AF,AF' 08 1 NOP 1
EX DE,HL EB 1 NOP 1
EXX "" D9 1 NOP 1
HALT "" 76 1 NOP 1
IM 0 46ED 2 NOP 1
IM 1 56ED 2 NOP 1
IM 2 5EED 2 NOP 1
/* Alternate form of above
IM0 46ED 2 NOP 1
IM1 56ED 2 NOP 1
IM2 5EED 2 NOP 1
IN A,(C) 78ED 2 NOP 1
IN B,(C) 40ED 2 NOP 1
IN C,(C) 48ED 2 NOP 1
IN D,(C) 50ED 2 NOP 1
IN E,(C) 58ED 2 NOP 1
IN H,(C) 60ED 2 NOP 1
IN L,(C) 68ED 2 NOP 1
IN A,(*) DB 2 NOP 1
IN0 A,(*) 38ED 3 NOP 1
IN0 B,(*) 00ED 3 NOP 1
IN0 C,(*) 08ED 3 NOP 1
IN0 D,(*) 10ED 3 NOP 1
IN0 E,(*) 18ED 3 NOP 1
IN0 H,(*) 20ED 3 NOP 1
IN0 L,(*) 28ED 3 NOP 1
INC (HL) 34 1 NOP 1
INC (IX*) 34DD 3 ZIX 1
INC (IY*) 34FD 3 ZIX 1
INC A 3C 1 NOP 1
INC B 04 1 NOP 1
INC BC 03 1 NOP 1
INC C 0C 1 NOP 1
INC D 14 1 NOP 1
INC DE 13 1 NOP 1
INC E 1C 1 NOP 1
INC H 24 1 NOP 1
INC HL 23 1 NOP 1
INC IX 23DD 2 NOP 1
INC IY 23FD 2 NOP 1
INC L 2C 1 NOP 1
INC SP 33 1 NOP 1
IND "" AAED 2 NOP 1
INDR "" BAED 2 NOP 1
INI "" A2ED 2 NOP 1
INIR "" B2ED 2 NOP 1
JP (HL) E9 1 NOP 1
JP (IX) E9DD 2 NOP 1
JP (IY) E9FD 2 NOP 1
JP C,* DA 3 NOP 1
JP M,* FA 3 NOP 1
JP NC,* D2 3 NOP 1
JP NZ,* C2 3 NOP 1
JP P,* F2 3 NOP 1
JP PE,* EA 3 NOP 1
JP PO,* E2 3 NOP 1
JP Z,* CA 3 NOP 1
JP * C3 3 NOP 1
JR C,* 38 2 R1 1
JR NC,* 30 2 R1 1
JR NZ,* 20 2 R1 1
JR Z,* 28 2 R1 1
JR * 18 2 R1 1
LD (BC),A 02 1 NOP 1
LD (DE),A 12 1 NOP 1
LD (HL),A 77 1 NOP 1
LD (HL),B 70 1 NOP 1
LD (HL),C 71 1 NOP 1
LD (HL),D 72 1 NOP 1
LD (HL),E 73 1 NOP 1
LD (HL),H 74 1 NOP 1
LD (HL),L 75 1 NOP 1
LD (HL),* 36 2 NOP 1
LD (IX*),A 77DD 3 ZIX 1
LD (IX*),B 70DD 3 ZIX 1
LD (IX*),C 71DD 3 ZIX 1
LD (IX*),D 72DD 3 ZIX 1
LD (IX*),E 73DD 3 ZIX 1
LD (IX*),H 74DD 3 ZIX 1
LD (IX*),L 75DD 3 ZIX 1
LD (IX*),* 36DD 4 ZIX 1
LD (IY*),A 77FD 3 ZIX 1
LD (IY*),B 70FD 3 ZIX 1
LD (IY*),C 71FD 3 ZIX 1
LD (IY*),D 72FD 3 ZIX 1
LD (IY*),E 73FD 3 ZIX 1
LD (IY*),H 74FD 3 ZIX 1
LD (IY*),L 75FD 3 ZIX 1
LD (IY*),* 36FD 4 ZIX 1
LD (*),A 32 3 NOP 1
LD (*),BC 43ED 4 NOP 1
LD (*),DE 53ED 4 NOP 1
LD (*),HL 22 3 NOP 1
LD (*),IX 22DD 4 NOP 1
LD (*),IY 22FD 4 NOP 1
LD (*),SP 73ED 4 NOP 1
LD A,(BC) 0A 1 NOP 1
LD A,(DE) 1A 1 NOP 1
LD A,(HL) 7E 1 NOP 1
LD A,(IX*) 7EDD 3 ZIX 1
LD A,(IY*) 7EFD 3 ZIX 1
LD A,A 7F 1 NOP 1
LD A,B 78 1 NOP 1
LD A,C 79 1 NOP 1
LD A,D 7A 1 NOP 1
LD A,E 7B 1 NOP 1
LD A,H 7C 1 NOP 1
LD A,I 57ED 2 NOP 1
LD A,L 7D 1 NOP 1
LD A,R 5FED 2 NOP 1
LD A,(*) 3A 3 NOP 1
LD A,* 3E 2 NOP 1
LD B,(HL) 46 1 NOP 1
LD B,(IX*) 46DD 3 ZIX 1
LD B,(IY*) 46FD 3 ZIX 1
LD B,A 47 1 NOP 1
LD B,B 40 1 NOP 1
LD B,C 41 1 NOP 1
LD B,D 42 1 NOP 1
LD B,E 43 1 NOP 1
LD B,H 44 1 NOP 1
LD B,L 45 1 NOP 1
LD B,* 06 2 NOP 1
LD BC,(*) 4BED 4 NOP 1
LD BC,* 01 3 NOP 1
LD C,(HL) 4E 1 NOP 1
LD C,(IX*) 4EDD 3 ZIX 1
LD C,(IY*) 4EFD 3 ZIX 1
LD C,A 4F 1 NOP 1
LD C,B 48 1 NOP 1
LD C,C 49 1 NOP 1
LD C,D 4A 1 NOP 1
LD C,E 4B 1 NOP 1
LD C,H 4C 1 NOP 1
LD C,L 4D 1 NOP 1
LD C,* 0E 2 NOP 1
LD D,(HL) 56 1 NOP 1
LD D,(IX*) 56DD 3 ZIX 1
LD D,(IY*) 56FD 3 ZIX 1
LD D,A 57 1 NOP 1
LD D,B 50 1 NOP 1
LD D,C 51 1 NOP 1
LD D,D 52 1 NOP 1
LD D,E 53 1 NOP 1
LD D,H 54 1 NOP 1
LD D,L 55 1 NOP 1
LD D,* 16 2 NOP 1
LD DE,(*) 5BED 4 NOP 1
LD DE,* 11 3 NOP 1
LD E,(HL) 5E 1 NOP 1
LD E,(IX*) 5EDD 3 ZIX 1
LD E,(IY*) 5EFD 3 ZIX 1
LD E,A 5F 1 NOP 1
LD E,B 58 1 NOP 1
LD E,C 59 1 NOP 1
LD E,D 5A 1 NOP 1
LD E,E 5B 1 NOP 1
LD E,H 5C 1 NOP 1
LD E,L 5D 1 NOP 1
LD E,* 1E 2 NOP 1
LD H,(HL) 66 1 NOP 1
LD H,(IX*) 66DD 3 ZIX 1
LD H,(IY*) 66FD 3 ZIX 1
LD H,A 67 1 NOP 1
LD H,B 60 1 NOP 1
LD H,C 61 1 NOP 1
LD H,D 62 1 NOP 1
LD H,E 63 1 NOP 1
LD H,H 64 1 NOP 1
LD H,L 65 1 NOP 1
LD H,* 26 2 NOP 1
LD HL,(*) 2A 3 NOP 1
LD HL,* 21 3 NOP 1
LD I,A 47ED 2 NOP 1
LD IX,(*) 2ADD 4 NOP 1
LD IX,* 21DD 4 NOP 1
LD IY,(*) 2AFD 4 NOP 1
LD IY,* 21FD 4 NOP 1
LD L,(HL) 6E 1 NOP 1
LD L,(IX*) 6EDD 3 ZIX 1
LD L,(IY*) 6EFD 3 ZIX 1
LD L,A 6F 1 NOP 1
LD L,B 68 1 NOP 1
LD L,C 69 1 NOP 1
LD L,D 6A 1 NOP 1
LD L,E 6B 1 NOP 1
LD L,H 6C 1 NOP 1
LD L,L 6D 1 NOP 1
LD L,* 2E 2 NOP 1
LD R,A 4FED 2 NOP 1
LD SP,(*) 7BED 4 NOP 1
LD SP,HL F9 1 NOP 1
LD SP,IX F9DD 2 NOP 1
LD SP,IY F9FD 2 NOP 1
LD SP,* 31 3 NOP 1
LDD "" A8ED 2 NOP 1
LDDR "" B8ED 2 NOP 1
LDI "" A0ED 2 NOP 1
LDIR "" B0ED 2 NOP 1
NEG "" 44ED 2 NOP 1
NOP "" 00 1 NOP 1
MLT BC 4CED 2 NOP 1
MLT DE 5CED 2 NOP 1
MLT HL 6CED 2 NOP 1
MLT SP 7CED 2 NOP 1
OR (HL) B6 1 NOP 1
OR (IX*) B6DD 3 ZIX 1
OR (IY*) B6FD 3 ZIX 1
OR A B7 1 NOP 1
OR B B0 1 NOP 1
OR C B1 1 NOP 1
OR D B2 1 NOP 1
OR E B3 1 NOP 1
OR H B4 1 NOP 1
OR L B5 1 NOP 1
OR * F6 2 NOP 1
OTDM "" 8BED 2 NOP 1
OTDMR "" 9BED 2 NOP 1
OTDR "" BBED 2 NOP 1
OTIM "" 83ED 2 NOP 1
OTIMR "" 93ED 2 NOP 1
OTIR "" B3ED 2 NOP 1
OUT (C),A 79ED 2 NOP 1
OUT (C),B 41ED 2 NOP 1
OUT (C),C 49ED 2 NOP 1
OUT (C),D 51ED 2 NOP 1
OUT (C),E 59ED 2 NOP 1
OUT (C),H 61ED 2 NOP 1
OUT (C),L 69ED 2 NOP 1
OUT (*),A D3 2 NOP 1
OUT0 (*),A 39ED 3 NOP 1
OUT0 (*),B 01ED 3 NOP 1
OUT0 (*),C 09ED 3 NOP 1
OUT0 (*),D 11ED 3 NOP 1
OUT0 (*),E 19ED 3 NOP 1
OUT0 (*),H 21ED 3 NOP 1
OUT0 (*),L 29ED 3 NOP 1
OUTD "" ABED 2 NOP 1
OUTI "" A3ED 2 NOP 1
POP AF F1 1 NOP 1
POP BC C1 1 NOP 1
POP DE D1 1 NOP 1
POP HL E1 1 NOP 1
POP IX E1DD 2 NOP 1
POP IY E1FD 2 NOP 1
PUSH AF F5 1 NOP 1
PUSH BC C5 1 NOP 1
PUSH DE D5 1 NOP 1
PUSH HL E5 1 NOP 1
PUSH IX E5DD 2 NOP 1
PUSH IY E5FD 2 NOP 1
RES *,(HL) 86CB 2 ZBIT 1
RES *,(IX*) CBDD 4 ZBIT 1 0 8600
RES *,(IY*) CBFD 4 ZBIT 1 0 8600
RES *,A 87CB 2 ZBIT 1
RES *,B 80CB 2 ZBIT 1
RES *,C 81CB 2 ZBIT 1
RES *,D 82CB 2 ZBIT 1
RES *,E 83CB 2 ZBIT 1
RES *,H 84CB 2 ZBIT 1
RES *,L 85CB 2 ZBIT 1
RET "" C9 1 NOP 1
RET C D8 1 NOP 1
RET M F8 1 NOP 1
RET NC D0 1 NOP 1
RET NZ C0 1 NOP 1
RET P F0 1 NOP 1
RET PE E8 1 NOP 1
RET PO E0 1 NOP 1
RET Z C8 1 NOP 1
RETI "" 4DED 2 NOP 1
RETN "" 45ED 2 NOP 1
RL (HL) 16CB 2 NOP 1
RL (IX*) CBDD 4 ZIX 1 0 1600
RL (IY*) CBFD 4 ZIX 1 0 1600
RL A 17CB 2 NOP 1
RL B 10CB 2 NOP 1
RL C 11CB 2 NOP 1
RL D 12CB 2 NOP 1
RL E 13CB 2 NOP 1
RL H 14CB 2 NOP 1
RL L 15CB 2 NOP 1
RLA "" 17 1 NOP 1
RLC (HL) 06CB 2 NOP 1
RLC (IX*) CBDD 4 ZIX 1 0 0600
RLC (IY*) CBFD 4 ZIX 1 0 0600
RLC A 07CB 2 NOP 1
RLC B 00CB 2 NOP 1
RLC C 01CB 2 NOP 1
RLC D 02CB 2 NOP 1
RLC E 03CB 2 NOP 1
RLC H 04CB 2 NOP 1
RLC L 05CB 2 NOP 1
RLCA "" 07 1 NOP 1
RLD "" 6FED 2 NOP 1
RR (HL) 1ECB 2 NOP 1
RR (IX*) CBDD 4 ZIX 1 0 1E00
RR (IY*) CBFD 4 ZIX 1 0 1E00
RR A 1FCB 2 NOP 1
RR B 18CB 2 NOP 1
RR C 19CB 2 NOP 1
RR D 1ACB 2 NOP 1
RR E 1BCB 2 NOP 1
RR H 1CCB 2 NOP 1
RR L 1DCB 2 NOP 1
RRA "" 1F 1 NOP 1
RRC (HL) 0ECB 2 NOP 1
RRC (IX*) CBDD 4 ZIX 1 0 0E00
RRC (IY*) CBFD 4 ZIX 1 0 0E00
RRC A 0FCB 2 NOP 1
RRC B 08CB 2 NOP 1
RRC C 09CB 2 NOP 1
RRC D 0ACB 2 NOP 1
RRC E 0BCB 2 NOP 1
RRC H 0CCB 2 NOP 1
RRC L 0DCB 2 NOP 1
RRCA "" 0F 1 NOP 1
RRD "" 67ED 2 NOP 1
RST 00H C7 1 NOP 1
RST 08H CF 1 NOP 1
RST 10H D7 1 NOP 1
RST 18H DF 1 NOP 1
RST 20H E7 1 NOP 1
RST 28H EF 1 NOP 1
RST 30H F7 1 NOP 1
RST 38H FF 1 NOP 1
/* Alternate form of above
RST 00 C7 1 NOP 1
RST 08 CF 1 NOP 1
RST 10 D7 1 NOP 1
RST 18 DF 1 NOP 1
RST 20 E7 1 NOP 1
RST 28 EF 1 NOP 1
RST 30 F7 1 NOP 1
RST 38 FF 1 NOP 1
SBC A,(HL) 9E 1 NOP 1
SBC A,(IX*) 9EDD 3 ZIX 1
SBC A,(IY*) 9EFD 3 ZIX 1
SBC A,A 9F 1 NOP 1
SBC A,B 98 1 NOP 1
SBC A,C 99 1 NOP 1
SBC A,D 9A 1 NOP 1
SBC A,E 9B 1 NOP 1
SBC A,H 9C 1 NOP 1
SBC A,L 9D 1 NOP 1
SBC HL,BC 42ED 2 NOP 1
SBC HL,DE 52ED 2 NOP 1
SBC HL,HL 62ED 2 NOP 1
SBC HL,SP 72ED 2 NOP 1
SBC A,* DE 2 NOP 1
SCF "" 37 1 NOP 1
SET *,(HL) C6CB 2 ZBIT 1
SET *,(IX*) CBDD 4 ZBIT 1 0 C600
SET *,(IY*) CBFD 4 ZBIT 1 0 C600
SET *,A C7CB 2 ZBIT 1
SET *,B C0CB 2 ZBIT 1
SET *,C C1CB 2 ZBIT 1
SET *,D C2CB 2 ZBIT 1
SET *,E C3CB 2 ZBIT 1
SET *,H C4CB 2 ZBIT 1
SET *,L C5CB 2 ZBIT 1
SLA (HL) 26CB 2 NOP 1
SLA (IX*) CBDD 4 ZIX 1 0 2600
SLA (IY*) CBFD 4 ZIX 1 0 2600
SLA A 27CB 2 NOP 1
SLA B 20CB 2 NOP 1
SLA C 21CB 2 NOP 1
SLA D 22CB 2 NOP 1
SLA E 23CB 2 NOP 1
SLA H 24CB 2 NOP 1
SLA L 25CB 2 NOP 1
SLP "" 76ED 2 NOP 1
SRA (HL) 2ECB 2 NOP 1
SRA (IX*) CBDD 4 ZIX 1 0 2E00
SRA (IY*) CBFD 4 ZIX 1 0 2E00
SRA A 2FCB 2 NOP 1
SRA B 28CB 2 NOP 1
SRA C 29CB 2 NOP 1
SRA D 2ACB 2 NOP 1
SRA E 2BCB 2 NOP 1
SRA H 2CCB 2 NOP 1
SRA L 2DCB 2 NOP 1
SRL (HL) 3ECB 2 NOP 1
SRL (IX*) CBDD 4 ZIX 1 0 3E00
SRL (IY*) CBFD 4 ZIX 1 0 3E00
SRL A 3FCB 2 NOP 1
SRL B 38CB 2 NOP 1
SRL C 39CB 2 NOP 1
SRL D 3ACB 2 NOP 1
SRL E 3BCB 2 NOP 1
SRL H 3CCB 2 NOP 1
SRL L 3DCB 2 NOP 1
SUB (HL) 96 1 NOP 1
SUB (IX*) 96DD 3 ZIX 1
SUB (IY*) 96FD 3 ZIX 1
SUB A 97 1 NOP 1
SUB B 90 1 NOP 1
SUB C 91 1 NOP 1
SUB D 92 1 NOP 1
SUB E 93 1 NOP 1
SUB H 94 1 NOP 1
SUB L 95 1 NOP 1
SUB * D6 2 NOP 1
TST A 3CED 2 NOP 1
TST B 04ED 2 NOP 1
TST C 0CED 2 NOP 1
TST D 14ED 2 NOP 1
TST E 1CED 2 NOP 1
TST H 24ED 2 NOP 1
TST L 2CED 2 NOP 1
TST (HL) 34ED 2 NOP 1
TST * 64ED 3 NOP 1
TSTIO * 74ED 3 NOP 1
XOR (HL) AE 1 NOP 1
XOR (IX*) AEDD 3 ZIX 1
XOR (IY*) AEFD 3 ZIX 1
XOR A AF 1 NOP 1
XOR B A8 1 NOP 1
XOR C A9 1 NOP 1
XOR D AA 1 NOP 1
XOR E AB 1 NOP 1
XOR H AC 1 NOP 1
XOR L AD 1 NOP 1
XOR * EE 2 NOP 1

BIN
branches/dwg/LSource/src/cpmtools-2.13.tar

Binary file not shown.

14
branches/dwg/LSource/src/cpmtools-2.13/.depend

@ -0,0 +1,14 @@
cpmchattr.o: cpmchattr.c config.h getopt_.h cpmfs.h device.h
cpmchmod.o: cpmchmod.c config.h getopt_.h cpmfs.h device.h
cpmcp.o: cpmcp.c config.h getopt_.h cpmfs.h device.h
cpmfs.o: cpmfs.c config.h cpmdir.h cpmfs.h device.h
cpmls.o: cpmls.c config.h getopt_.h cpmfs.h device.h
cpmrm.o: cpmrm.c config.h getopt_.h cpmfs.h device.h
device_libdsk.o: device_libdsk.c config.h device.h
device_posix.o: device_posix.c config.h device.h
device_win32.o: device_win32.c config.h cpmdir.h cpmfs.h device.h
fsck.cpm.o: fsck.cpm.c config.h getopt_.h cpmdir.h cpmfs.h device.h
fsed.cpm.o: fsed.cpm.c config.h cpmfs.h device.h
getopt.o: getopt.c config.h getopt_.h getopt_int.h
getopt1.o: getopt1.c config.h getopt_.h getopt_int.h
mkfs.cpm.o: mkfs.cpm.c config.h getopt_.h cpmfs.h device.h

676
branches/dwg/LSource/src/cpmtools-2.13/COPYING

@ -0,0 +1,676 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

212
branches/dwg/LSource/src/cpmtools-2.13/INSTALL

@ -0,0 +1,212 @@
Options for "./configure" include:
--with-defformat=<default-format>
Set the standard format the cpmtools will use.
Default is ibm-3740
--with-libdsk=path
Use LibDsk to access raw files, .DSK files, MYZ80
files and Unix/Windows floppy drives. This library
is available at:
http://www.seasip.demon.co.uk/Unix/LibDsk/
--with-dmalloc
Use the dmalloc library
--disable-floppy
Disable the direct floppy access in LibDsk, so that it only
contains drivers for raw files, .DSK files and MYZ80 files.
All the cpmtools that use LibDsk have an extra option: -T <type>. This
sets the drive type used by LibDsk, and is one of:
"floppy" - The computer's floppy drive (only supported on Linux and Win32)
"raw" - Raw file (or the floppy drive on other Unix systems)
"dsk" - .DSK file
"myz80" - MYZ80 hard drive file
It will normally only be necessary to include "-T" when you are
accessing a MYZ80 file, because LibDsk can detect the other file types
automatically. "-T" options are ignored if LibDsk is not being used.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

114
branches/dwg/LSource/src/cpmtools-2.13/Makefile

@ -0,0 +1,114 @@
srcdir= .
libdir= ${exec_prefix}/lib
BINDIR= ${exec_prefix}/bin
MANDIR= ${datarootdir}/man
includedir= ${prefix}/include
exec_prefix= ${prefix}
prefix= /usr/local
datarootdir= ${prefix}/share
INSTALL= /usr/bin/install -c
INSTALL_DATA= ${INSTALL} -m 644
CC= gcc
CFLAGS= -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common
LDFLAGS= -g
DEFFORMAT= ibm-3740
DISKDEFS= ${datarootdir}/diskdefs
DEVICE= posix
FSED_CPM= fsed.cpm
EXEEXT =
OBJEXT = .o
LIBS= -lcurses
LDDEPS=
CPPFLAGS= -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\"
#
# I'm only a novice and I haven't worked out how to autoconf this one
#
#MAKEDEPEND= mkdep -d
MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
DEVICEOBJ= device_$(DEVICE)$(OBJEXT)
ALL= cpmls$(EXEEXT) cpmrm$(EXEEXT) cpmcp$(EXEEXT) \
cpmchmod$(EXEEXT) cpmchattr$(EXEEXT) mkfs.cpm$(EXEEXT) \
fsck.cpm$(EXEEXT) $(FSED_CPM)
all: $(ALL)
LibDsk/libdsk.a:
cd LibDsk && make
cpmls$(EXEEXT): cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmrm$(EXEEXT): cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmcp$(EXEEXT): cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchmod$(EXEEXT): cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchattr$(EXEEXT): cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
mkfs.cpm$(EXEEXT): mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.cpm$(EXEEXT): fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsed.cpm$(EXEEXT): fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.test: fsck.cpm
-./fsck.cpm -f ibm-3740 -n badfs/status
-./fsck.cpm -f ibm-3740 -n badfs/extno
-./fsck.cpm -f ibm-3740 -n badfs/lcr
-./fsck.cpm -f ibm-3740 -n badfs/name
-./fsck.cpm -f ibm-3740 -n badfs/extension
-./fsck.cpm -f ibm-3740 -n badfs/blocknumber
-./fsck.cpm -f ibm-3740 -n badfs/recordcount
-./fsck.cpm -f ibm-3740 -n badfs/hugecom
-./fsck.cpm -f ibm-3740 -n badfs/timestamps
-./fsck.cpm -f ibm-3740 -n badfs/multipleblocks
-./fsck.cpm -f ibm-3740 -n badfs/doubleext
-./fsck.cpm -f pcw -n badfs/label
install: all
$(INSTALL) -s -m 755 cpmls $(BINDIR)/cpmls
$(INSTALL) -s -m 755 cpmcp $(BINDIR)/cpmcp
$(INSTALL) -s -m 755 cpmrm $(BINDIR)/cpmrm
$(INSTALL) -s -m 755 cpmchmod $(BINDIR)/cpmchmod
$(INSTALL) -s -m 755 cpmchattr $(BINDIR)/cpmchattr
$(INSTALL) -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
$(INSTALL) -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
[ $(FSED_CPM) != '' ] && $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
$(INSTALL_DATA) diskdefs ${prefix}/share/diskdefs
$(INSTALL_DATA) cpmls.1 $(MANDIR)/man1/cpmls.1
$(INSTALL_DATA) cpmcp.1 $(MANDIR)/man1/cpmcp.1
$(INSTALL_DATA) cpmrm.1 $(MANDIR)/man1/cpmrm.1
$(INSTALL_DATA) cpmchmod.1 $(MANDIR)/man1/cpmchmod.1
$(INSTALL_DATA) cpmchattr.1 $(MANDIR)/man1/cpmchattr.1
$(INSTALL_DATA) mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
$(INSTALL_DATA) fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
$(INSTALL_DATA) fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
$(INSTALL_DATA) cpm.5 $(MANDIR)/man5/cpm.5
clean:
rm -f *$(OBJEXT)
distclean: clean
rm -rf $(ALL) autom4te.cache config.log config.cache config.h config.status Makefile *.out
tar: distclean
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

114
branches/dwg/LSource/src/cpmtools-2.13/Makefile.in

@ -0,0 +1,114 @@
srcdir= @srcdir@
VPATH= @srcdir@
libdir= @libdir@
BINDIR= @bindir@
MANDIR= @mandir@
includedir= @includedir@
exec_prefix= @exec_prefix@
prefix= @prefix@
datarootdir= @datarootdir@
INSTALL= @INSTALL@
INSTALL_DATA= @INSTALL_DATA@
CC= @CC@
CFLAGS= @CFLAGS@
LDFLAGS= @LDFLAGS@
DEFFORMAT= @DEFFORMAT@
DISKDEFS= @DISKDEFS@
DEVICE= @DEVICE@
FSED_CPM= @FSED_CPM@
EXEEXT = @EXEEXT@
OBJEXT = .@OBJEXT@
LIBS= @LIBS@ @LDLIBS@
LDDEPS= @LDDEPS@
CPPFLAGS= @CPPFLAGS@ -DDISKDEFS=\"$(DISKDEFS)\" -DFORMAT=\"$(DEFFORMAT)\"
#
# I'm only a novice and I haven't worked out how to autoconf this one
#
#MAKEDEPEND= mkdep -d
MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
DEVICEOBJ= device_$(DEVICE)$(OBJEXT)
ALL= cpmls$(EXEEXT) cpmrm$(EXEEXT) cpmcp$(EXEEXT) \
cpmchmod$(EXEEXT) cpmchattr$(EXEEXT) mkfs.cpm$(EXEEXT) \
fsck.cpm$(EXEEXT) $(FSED_CPM)
all: $(ALL)
LibDsk/libdsk.a:
cd LibDsk && make
cpmls$(EXEEXT): cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmls$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmrm$(EXEEXT): cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmrm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmcp$(EXEEXT): cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmcp$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchmod$(EXEEXT): cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchmod$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
cpmchattr$(EXEEXT): cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ cpmchattr$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
mkfs.cpm$(EXEEXT): mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ mkfs.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.cpm$(EXEEXT): fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsck.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsed.cpm$(EXEEXT): fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LDDEPS)
$(CC) $(LDFLAGS) -o $@ fsed.cpm$(OBJEXT) cpmfs$(OBJEXT) getopt$(OBJEXT) getopt1$(OBJEXT) $(DEVICEOBJ) $(LIBS)
fsck.test: fsck.cpm
-./fsck.cpm -f ibm-3740 -n badfs/status
-./fsck.cpm -f ibm-3740 -n badfs/extno
-./fsck.cpm -f ibm-3740 -n badfs/lcr
-./fsck.cpm -f ibm-3740 -n badfs/name
-./fsck.cpm -f ibm-3740 -n badfs/extension
-./fsck.cpm -f ibm-3740 -n badfs/blocknumber
-./fsck.cpm -f ibm-3740 -n badfs/recordcount
-./fsck.cpm -f ibm-3740 -n badfs/hugecom
-./fsck.cpm -f ibm-3740 -n badfs/timestamps
-./fsck.cpm -f ibm-3740 -n badfs/multipleblocks
-./fsck.cpm -f ibm-3740 -n badfs/doubleext
-./fsck.cpm -f pcw -n badfs/label
install: all
$(INSTALL) -s -m 755 cpmls $(BINDIR)/cpmls
$(INSTALL) -s -m 755 cpmcp $(BINDIR)/cpmcp
$(INSTALL) -s -m 755 cpmrm $(BINDIR)/cpmrm
$(INSTALL) -s -m 755 cpmchmod $(BINDIR)/cpmchmod
$(INSTALL) -s -m 755 cpmchattr $(BINDIR)/cpmchattr
$(INSTALL) -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
$(INSTALL) -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
[ $(FSED_CPM) != '' ] && $(INSTALL) -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
$(INSTALL_DATA) diskdefs @datarootdir@/diskdefs
$(INSTALL_DATA) cpmls.1 $(MANDIR)/man1/cpmls.1
$(INSTALL_DATA) cpmcp.1 $(MANDIR)/man1/cpmcp.1
$(INSTALL_DATA) cpmrm.1 $(MANDIR)/man1/cpmrm.1
$(INSTALL_DATA) cpmchmod.1 $(MANDIR)/man1/cpmchmod.1
$(INSTALL_DATA) cpmchattr.1 $(MANDIR)/man1/cpmchattr.1
$(INSTALL_DATA) mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
$(INSTALL_DATA) fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
$(INSTALL_DATA) fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
$(INSTALL_DATA) cpm.5 $(MANDIR)/man5/cpm.5
clean:
rm -f *$(OBJEXT)
distclean: clean
rm -rf $(ALL) autom4te.cache config.log config.cache config.h config.status Makefile *.out
tar: distclean
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

3
branches/dwg/LSource/src/cpmtools-2.13/NEWS

@ -0,0 +1,3 @@
Changes since 2.13:
o Avoid unneccessary directory writes

43
branches/dwg/LSource/src/cpmtools-2.13/README

@ -0,0 +1,43 @@
This package allows to access CP/M file systems similar to the well-known
mtools package, which accesses MSDOS file systems. I use it for file
exchange with a Z80-PC simulator, but it works on floppy devices as well.
Currently it contains:
o cpmls - list sorted directory with output similar to ls, DIR, P2DOS
DIR and CP/M3 DIR[FULL]
o cpmcp - copy files from and to CP/M file systems
o cpmrm - erase files from CP/M file systems
o cpmchmod - change file permissions
o cpmchattr - change file attributes
o mkfs.cpm - make a CP/M file system
o fsck.cpm - check and repair a CP/M file system (only simple errors
can be repaired so far). Some images of broken file systems are provided
for testing.
o fsed.cpm - view CP/M file system
o manual pages for everything including the CP/M file system format
All CP/M file system features are supported. Password protection
is ignored, because passwords are easy to decrypt, but a pseudo file
[passwd] contains them, if you are curious what your old password has
been. The disk label is read as special file [label]. User numbers
are specified as user:file.
Cpmtools should compile and work out of the box on each POSIX compliant
system. It can be additionally compiled for Win32 systems. The source
is available as a GNU zipped tape archive from:
http://www.moria.de/~michael/cpmtools/
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3 of the License, or (at your
option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

9
branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk

@ -0,0 +1,9 @@
Under Windows 95/98, if a program name has more than one dot, you have to
add the ".exe" extension to the command. So you should use "fsck.cpm.exe"
rather than just "fsck.cpm".
If you have appropriate rights, the CPMTOOLS should be able to access
the floppy drive by using "A:" or "B:" as the name of the disc image.
"mkfs.cpm" and "fsed.cpm" don't have this capability.
John Elliott, 18 June 2000

518
branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt

@ -0,0 +1,518 @@
README.win32.cygwin.txt
-----------------------
Building cpmtools-2.9 in Windows XP using:
- cpmtools http://www.moria.de/~michael/cpmtools/
- cygwin and the ncurses library - http://www.cygwin.com/
"The experts will always complain about shorter documents that do do not
provide enough details to confuse the rest of us, and longer documents that
do not omit enough details to confuse the rest of us. No documentation is
needed for people of that calibre."
- Bill Buckels, November 2008
This document is provided in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. In particular, Bill Buckels has no warranty obligations
or liability resulting from its use in any way whatsoever. If you don't agree
then don't read it.
Introduction
------------
This document is intended as a general guideline. An annotated summary is
provided directly below especially for expert users followed by annotated
details.
Please review the other documentation and source code that comes with
cpmtools for more information about cpmtools. Please review the cygwin
documentation for more information about cygwin.
At time of this writing, I have used the latest versions of the packages
listed above to build the latest version of cpmtools in its entirety. I have
documented the steps I followed below.
Although there are probably other environments and compilers that can build
cpmtools for Windows I have not been successful in using the other several I
tried. Using a complete cygwin installation I had no problems and I had
cpmtools built in moments after I had cygwin installed and the cpmtools
source in place as documented below.
Intended Audience
-----------------
This document takes two tracks for installing cpmtools binary executables
after they have been built in cygwin:
1. End users who will run cpmtools from within the cygwin shell. This
includes unix users who do not want to use the native Windows command line.
2. End users who will run cpmtools from the native Windows command line. The
average Windows user does not have cygwin, and probably won't want to install
cygwin or learn a unix-like shell to use cpmtools.
The consideration here is where cpmtools looks for its CP/M disk format
definitions file (diskdefs) when not in a unix-like environment like cygwin
and this consideration will affect the way you build cpmtools since this path
is hardcoded into the binary executables.
My hope is that this document will help address the needs of both types of
Windows end users and those who wish to provide cpmtools to them.
Summary
-------
- Install cygwin with ncurses.
- Download cpmtools-2.9.tar.tar to your cygwin home directory.
- Start cygwin from the shortcut on the Windows desktop.
- Enter the following commands:
tar -xvf cpmtools.tar.tar
cd cpmtools-2.9
./configure --with-diskdefs=/usr/local/share/diskdefs
make
mkdir /usr/local/share
mkdir /usr/local/share/man
mkdir /usr/local/share/man/man1
mkdir /usr/local/share/man/man5
make install
Assumptions
-----------
The above builds cpmtools under cygwin for end users who will use cpmtools in
the cygwin shell and who will use the default installation.
I am assuming in this summary that all has gone well and that anyone who
deviates from what I have done or who has customized their cygwin
installation will be able to troubleshoot their own problems,
I therefore make the following related assumptions in this summary:
- That compiler related programs and libraries required to build cpmtools
under cygwin (including ncurses) are installed.
- That you wish to download into and work under your home directory. You may
also consider whether a better place to download is in /usr/local/src and
whether you should install in the binaries in /opt/cpmtools/ and things of
that nature.
Default Format
--------------
You can change the default format to accomodate the special needs of your
users so they don't need to type their favorite format. The following line
can be entered to configure for an apple-do default format:
./configure --with-defformat="apple-do" --with-diskdefs=/usr/local/share/diskdefs
Native Windows Installation
---------------------------
If you wish to distribute your binaries to Windows end users who will not
have the cygwin shell and who will use the Windows command line, you have 2
options:
1. Require your users to always work in the same directory as diskdefs.
- or -
2. Hardcode the default diskdefs path into your binary executables and
require your users to always use the expected directory for diskdefs.
The following line shows how to configure for an apple-do default format and
to set the default diskdefs path in a mannner that is acceptable to Windows
to a relative path from the root of the current drive:
./configure --with-defformat="apple-do" --with-diskdefs=/cpmtools/diskdefs
Cross-Cygwin Binary Installation
--------------------------------
You can still use the binaries built as above and installed using "make
install" in cygwin if you add the following line to /etc/fstab (assuming your
cygdrive is the Windows C:drive):
c:\cygwin\usr\local\share /cpmtools
Making a Zip Installation for Native Windows Users
--------------------------------------------------
If your target is the Windows user who does not have cygwin you can do the
following in cygwin in your build directory to create a zip file that will
contain the cpmtools binary executables:
- mkdir cpmtools
- cp *.exe cpmtools/.
- cp diskdefs cpmtools/.
- cp /bin/cygwin1.dll cpmtools/.
- cp /bin/cygncurses-8.dll cpmtools/.
- zip -R cpmtools/*.*
Making Documentation for Native Windows Users
---------------------------------------------
If you wish to provide the cpmtools manual pages in html format you can use
man2html to generate your html in ugly format and redirect to a file and edit
by hand. Here's an example:
man2html -r cpm.5 > cpm.html
If you wish to avoid html and provide the cpmtools manual pages in text
format you can use troff to generate your text in ugly format and redirect to
a file and edit by hand. Here's an example:
troff -a cpm.5 > cpm.txt
This concludes the summary.
Details, Alternatives, and Other Fluff
--------------------------------------
1.cygwin
--------
Cygwin gave me a complete and free environment to both configure and build
cpmtools in its entirety.
I installed cygwin from http://www.cygwin.com/ in its entirety which included
the ncurses library and when prompted to select a download site I chose
ftp://mirrors.kernel.org/sourceware/cygwin/
The site you pick will depend on your own preference and how much of cygwin
you decide to install will be up to you. I have a good Internet connection
and a large hard disk so installing ALL of cygwin was no problem for me.
Those who don't may wish to attempt an incremental installation which I
personally found to be annoying and tedious.
It is not necessary to install ALL cygwin options. Another alternative is to
take the minimalistic approach and just install the compiler related
programs and libraries required to build cpmtools (including ncurses). If you
have missed something you will still be able to select additional components
via Cygwin Setup.
By default cygwin installs into c:\cygwin and puts a shortcut on the Windows
desktop. By default the cygwin shell starts in your cygwin home directory
under c:\cygwin\home\. I used the cygwin default paths for my installation of
cygwin.
2. cpmtoools
------------
I then downloaded Download cpmtools-2.9 from
http://www.moria.de/~michael/cpmtools/
and used WinRAR to extract cpmtools-2.9 to
C:\cygwin\home\bbuckels\cpmtools-2.9\
I have noted in the summary that tar can be used. Use whatever you are
comfortable with to handle things from unix of a tarball nature.
3. Building
-----------
3.1. I started cygwin by clicking on the cygwin shortcut on my desktop which
placed me into my cygwin home directory in the cygwin shell.
3.2 Now in the cygwin shell, I changed to the cpmtools directory by typing
the following and pressing the [Enter] key:
cd cpmtools-2.9
3.3 Running the configure script
--------------------------------
Before making cpmtools, the configure script must be run to create the
cpmtools makefile and the config.h header file required by cpmtools.
I ran the configure script with two options; to set the default format for
cpmtools to Apple II DOS 3.3 disk images and to tell cpmtools where to find
the diskdefs format definitions file (which is required to run cpmtools. See
far below.)
3.3.2 Building for use in the cygwin shell
------------------------------------------
If I was building for use in the cygwin shell and I was using the default
paths used by "make install" noted far below, to be certain that my diskdefs
file would be found and to set my default format to "apple-do" I would type
the following and press the [Enter] key:
./configure --with-defformat="apple-do" --with-diskdefs=/usr/local/share/diskdefs
3.3.1 Building for the Native Windows command line
---------------------------------------------------
To set the default format to "apple-do" and to provide a relative path for
native Windows to my diskefs file which I would later copy to C:\cpmtools\ ,
I typed the following and pressed the [Enter] key:
./configure --with-defformat="apple-do" --with-diskdefs=/cpmtools/diskdefs
Note: Windows paths are typed into the Windows native command line with
backslashes in the MS- DOS tradition. Historically the forward slash used by
unix as a path separator was used as a switch character in MS-DOS utilities
and this has carried forward with the commands that come with Windows. But in
a program, local Windows paths can be used with forward slashes instead and
they still work. Backslashes will cause problems for configure so use forward
slashes.
3.4. The configure script created my cpmtools makefile and config.h with the
options I chose. I then ran make by typing the following and pressing the
[Enter] Key.
make
This concludes the first part of the details section of this document and I
have covered the basic steps that I followed to build cpmtools. What you do
will likely be a close variation.
4. Installing
-------------
4.1 Some of this is also noted in the summary. Also keep in mind that if
cpmtools is used outside of cygwin access to the documentation which is in
the form of unix-style man pages will not be available unless reformatted to
a media type that Windows users are familiar with.
4.1.1 Installing for the cygwin shell
-----------------------------------
You can review the summary and the cpmtools INSTALL document for more
information on unix-like installations. Installation of cpmtools for use in
the cygwin shell follows those conventions.
If installing cpmtools to be used in cygwin using the cpmtools defaults and
assuming the directories below don't already exist, you will need to manually
create the following directories using the mkdir command as follows:
mkdir /usr/local/share
mkdir /usr/local/share/man
mkdir /usr/local/share/man/man1
mkdir /usr/local/share/man/man5
This is because the manual pages (man pages) will not be installed if you
don't. If you install the man pages, then when you need help on cpmtools in
cygwin, you can just enter "man cpmls" or "man cpmchmod", etc.
After you make the directories above enter the following command:
make install
Assuming all has gone well, cpmtools is now part of your cygwin installation
and can be used wherever you work in cygwin.
4.1.2 Installing for Use Outside Cygwin
---------------------------------------
Please also read the summary.
The requirements of my installation were to create a directory structure for
a binary executable version of cpmtools targetted at Apple II disk image
users that would run at the native Windows cmd prompt. I offer the following
for general reference. The cygwin paths are based on my installation of
cygwin and are presented using conventional windows pathname notation.
4.1.2.1 Dll's
-------------
Two dll's from the c:\cygwin\bin\ directory were required:
cygwin1.dll
cygncurses-8.dll
Regardless of installation, for this cygwin and this ncurses version access
to these dll's will be required by this version of the cpmtools excecutables.
4.2 Manually Placing Files for Use Outside Cygwin
-------------------------------------------------
I did my installation by hand.
My executables were created in c:\cygwin\home\bbuckels\cpmtools-2.9\ (my
cygwin home directory) which is also where the diskdefs file was.
I used Windows Explorer to manually do the following:
4.2.1 create c:\cpmtools\ directory.
4.2.2 copy all 8 exes into c:\cpmtools\
4.2.3 copy both dll's listed above into c:\cpmtools\
4.2.4 copy diskdefs into c:\cpmtools\
This gave me my directory structure and files for testing and distribution.
I also placed an Apple II CP/M disk image called EXMPLCPM.dsk in c:\cpmtools\
as a test target.
5. Additional Notes
-------------------
5.1 diskdefs - CP/M disk format definitions
--------------------------------------------
The diskdefs file is a plain ascii text file that serves as a database of
disk and disk image format definitions. It can be reviewed for available CP/M
formats and their names. For Apple II CP/M 80 users the disk image formats
apple-do and apple-po are available.
The possible locations where cpmtools first looks for the diskdefs file:
- Can vary depending on the preferences of the person who builds the cpmtools
binaries (executables) from the source code.
- The location is also installation dependent and the diskdefs file may also
have been renamed (but we hope not).
If it's not found the current (work) directory is then searched for a file
called diskdefs.
On a unix-like system, a ${prefix}/share/ style path like /usr/local/share/
is a possible place that cpmtools could be made to first look for diskdefs.
In a Win32 system sometimes unix-like shells like cygwin are used to run
cpmtools instead of Windows cmd. For those installations unix-like
conventions probably should apply.
For cpmtools installations targetted at the average Windows user who does not
have a unix-like shell and uses the Windows cmd prompt to run cpmtools there
is no standard shared place that cpmtools can be made to first look for
diskdefs. Pathed File names like \cpm\diskdefs or even c:\cpmtools\diskdefs
are possible.
5.2 Difficulties in using the Windows File System
---------------------------------------------------
This is not a troubleshooting guide. Unless you wish to find-out for yourself
as I did just how many problems you can face with all of this, or you are
really an expert, please do yourself a favour and try to stay within what I
am suggesting as standard or alternative ways of building cpmtools.
Missing libaries and compiler tools can be solved by trial and error and
reading the cygwin and cpmtools documentation.
There are however some things about path names and file names that you need
to be aware of, some of which I have mentioned throughout this document and
some which I deliberately did not mention yet, like avoiding absolute paths
and drive letters.
If you use a drive letter like C: when hardcoding a path to diskdefs you are
making several assumptions:
First off, you are assuming that your build of cpmtools will only be run from
within Windows cmd shell on the local drive C:, (not from a bash-like shell
like cygwin which doesn't support drive letters the same way Windows cmd and
Windows itself does), and that diskdefs will not be on another drive, and
that drive C: exists in the first place, and that diskdefs is not on a
Windows network either unless drive C:,X:,Y:,Z:,etc is a mapped network
drive. It is questionable whether cpmtools build process for diskdefs pathing
supports UNC pathing anyway. I couldn't get \\ to work since the first slash
disappears in the configure script and the second slash becomes an escape
sequence for the next letter.
Relative pathing will work and if you want to use conventions like
/cpmtools-2.9/diskedefs this will work. Environments like ${USERPROFILE}
aren't a good idea even if I could have got them to work since they are not
portable for several reasons and I will say no more on this except I
recommend that any path that you decide to use for diskdefs will only be
almost portable between shells if off the root directory and contains forward
slashes and no drive letters or colons.
I hope what I have said proved less confusing to read than to write if you
have bothered to read it. If you are not confused yet read further.
- Since cpmtools has special meanings for A: and B: as command line targets
it probably isn't a good idea to use these drives especially.
- Some programmers and users have no difficulty in shifts between unix-like
and Windows pathing. Some will be familiar with how colons are used on
systems like Mac OSX. I think the only point to be made here is to consider
your target audience and all the things you can anticipate going wrong with
interoperability of all of this, (cpmtools being a set of command line
tools), and build cpmtools accordingly for the needs of you or your users,
then test what you have built with all this in mind.
5.3 Testing your build of cpmtools
----------------------------------
To test what you have built I suggest you start with cpmls and cpmcp and an
apple disk image or equivalent.
John Elliot said "If you have appropriate rights, the CPMTOOLS should be able
to access the floppy drive by using "A:" or "B:" as the name of the disc
image.". I say don't bother mucking with your physical disk drive unless you
have a physical CP/M disk of a format supported by cpmtools safely in the
drive.
Get an apple CP/M disk image and use it for testing is what I suggest. The
following examples assume you have an Apple II DOS 3.3 order disk image
called EXMPLCPM.dsk for testing.
To list the files:
cpmls -f apple-do EXMPLCPM.dsk
The following example shows how to copy a file from an Apple II DOS 3.3 order
cpm disk image to the current directory:
cpmcp -f apple-do EXMPLCPM.dsk bhead.c 0:bhead.c
The following example shows how to copy a file to an Apple II DOS 3.3 order
cpm disk image from the current directory:
cpmcp -f apple-do EXMPLCPM.dsk 0:bhead.c bhead.c
To test the other utilities in cpmtools like cpmrm, cpmchattr, cpmchmod,
fsck.cpm and fsed.cpm, review the appropriate manpages for usage.
Those are simple tests as well using an apple-do format disk image. For
mkfs.cpm I will leave it to those more capable than I to decide what to do
there. Compared to them I am merely dangerous.
Acknowledgements and Stuff
--------------------------
Michael Haardt - for cpmtools in the first place and for his tireless and
ongoing efforts in supporting cpmtools in the second.
John Elliot - for bringing cpmtools to Windows.
My focus is on Windows XP (and other Windows) users and making this available
to them. At this point in time my focus is also on Apple II Z80 Softcard
users. Thankfully Michael Haardt has considered Apple II disk images in
cpmtools. My focus is also on the Aztec C Z80 MS-DOS cross-compiler which
creates Apple II CP/M programs in Windows XP.
Between Michael and John, with cpmtools I can now easily get these onto an
Apple disk image and transfer the disk image over to my real Apple II which
has a Z80 softcard clone using my Microdrive with a CF card and make a real
CP/M disk from the image with DISKMAKER.8 or DSK2FILE then run my Aztec C
CP/M programs using the real thing. I can also use the emulator that came
with Apple II Oasis to run the disk image.
Apparently nothing is missing from cpmtools for Windows XP that is available
on cpmtools for unix-like systems and I am thankful for that. Hopefully you
will be too.
I would also like to acknowledge the following individuals from the
comp.os.cpm and apple2.sys usenet newsgroups who gave their experience,
thoughts and encouragement during my adventure with all of this and in no
particular order:
David Schmidt - for cygwin feedback.
Udo Munk - for cygwin feedback.
Peter Dassow - for cygwin feedback.
Stevo Tarkin - for msys feedback.
Volker Pohlers - for msys and pdcurses feedback.
Rolf Harmann - for linux feedback.
Richard Brady - who may or may not know watfor:)
If I missed anyone, I thank them too. I am somewhat new to some of this and
needed all the help I received. cygwin is now my friend.
Bill Buckels
bbuckels@mts.net
November 2008

7
branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile

@ -0,0 +1,7 @@
#
# Dummy makefile
#
all:
clean:
distclean:

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/extension

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/extno

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/label

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/name

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/status

Binary file not shown.

BIN
branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps

Binary file not shown.

1498
branches/dwg/LSource/src/cpmtools-2.13/config.guess

File diff suppressed because it is too large

55
branches/dwg/LSource/src/cpmtools-2.13/config.h

@ -0,0 +1,55 @@
/* config.h. Generated from config.h.in by configure. */
#define HAVE_FCNTL_H 1
#define HAVE_LIMITS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_WINDOWS_H 0
#define HAVE_WINIOCTL_H 0
#define HAVE_LIBDSK_H 0
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_MODE_T 0
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#if HAVE_WINIOCTL_H
#include <winioctl.h>
#endif
#if HAVE_LIBDSK_H
#include <libdsk.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifndef _POSIX_PATH_MAX
#define _POSIX_PATH_MAX _MAX_PATH
#endif
#include <time.h>
/* Define either for large file support, if your OS needs them. */
/* #undef _FILE_OFFSET_BITS */
/* #undef _LARGE_FILES */
/* Define if using dmalloc */
/* #undef USE_DMALLOC */

54
branches/dwg/LSource/src/cpmtools-2.13/config.h.in

@ -0,0 +1,54 @@
#define HAVE_FCNTL_H 0
#define HAVE_LIMITS_H 0
#define HAVE_UNISTD_H 0
#define HAVE_WINDOWS_H 0
#define HAVE_WINIOCTL_H 0
#define HAVE_LIBDSK_H 0
#define HAVE_SYS_TYPES_H 0
#define HAVE_SYS_STAT_H 0
#define HAVE_MODE_T 0
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#if HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#if HAVE_LIMITS_H
#include <limits.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#if HAVE_WINDOWS_H
#include <windows.h>
#endif
#if HAVE_WINIOCTL_H
#include <winioctl.h>
#endif
#if HAVE_LIBDSK_H
#include <libdsk.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifndef _POSIX_PATH_MAX
#define _POSIX_PATH_MAX _MAX_PATH
#endif
#include <time.h>
/* Define either for large file support, if your OS needs them. */
#undef _FILE_OFFSET_BITS
#undef _LARGE_FILES
/* Define if using dmalloc */
#undef USE_DMALLOC

687
branches/dwg/LSource/src/cpmtools-2.13/config.log

@ -0,0 +1,687 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.65. Invocation command line was
$ ./configure
## --------- ##
## Platform. ##
## --------- ##
hostname = goodall
uname -m = x86_64
uname -r = 2.6.32-279.11.1.el6.x86_64
uname -s = Linux
uname -v = #1 SMP Tue Oct 16 11:16:02 CDT 2012
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = x86_64
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /usr/lib64/qt-3.3/bin
PATH: /usr/local/bin
PATH: /bin
PATH: /usr/bin
PATH: /usr/local/sbin
PATH: /usr/sbin
PATH: /sbin
PATH: /home/doug/depot_tools
PATH: /home/doug/bin
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2174: checking build system type
configure:2188: result: x86_64-unknown-linux-gnu
configure:2208: checking host system type
configure:2221: result: x86_64-unknown-linux-gnu
configure:2305: checking for gcc
configure:2321: found /usr/bin/gcc
configure:2332: result: gcc
configure:2561: checking for C compiler version
configure:2570: gcc --version >&5
gcc (GCC) 4.4.6 20120305 (Red Hat 4.4.6-4)
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
configure:2581: $? = 0
configure:2570: gcc -v >&5
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-ppl --with-cloog --with-tune=generic --with-arch_32=i686 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
configure:2581: $? = 0
configure:2570: gcc -V >&5
gcc: '-V' option must have argument
configure:2581: $? = 1
configure:2570: gcc -qversion >&5
gcc: unrecognized option '-qversion'
gcc: no input files
configure:2581: $? = 1
configure:2601: checking whether the C compiler works
configure:2623: gcc conftest.c >&5
configure:2627: $? = 0
configure:2676: result: yes
configure:2679: checking for C compiler default output file name
configure:2681: result: a.out
configure:2687: checking for suffix of executables
configure:2694: gcc -o conftest conftest.c >&5
configure:2698: $? = 0
configure:2720: result:
configure:2742: checking whether we are cross compiling
configure:2750: gcc -o conftest conftest.c >&5
configure:2754: $? = 0
configure:2761: ./conftest
configure:2765: $? = 0
configure:2780: result: no
configure:2785: checking for suffix of object files
configure:2807: gcc -c conftest.c >&5
configure:2811: $? = 0
configure:2832: result: o
configure:2836: checking whether we are using the GNU C compiler
configure:2855: gcc -c conftest.c >&5
configure:2855: $? = 0
configure:2864: result: yes
configure:2873: checking whether gcc accepts -g
configure:2893: gcc -c -g conftest.c >&5
configure:2893: $? = 0
configure:2934: result: yes
configure:2951: checking for gcc option to accept ISO C89
configure:3015: gcc -c -g -O2 conftest.c >&5
configure:3015: $? = 0
configure:3028: result: none needed
configure:3062: checking for a BSD-compatible install
configure:3130: result: /usr/bin/install -c
configure:3146: checking how to run the C preprocessor
configure:3177: gcc -E conftest.c
configure:3177: $? = 0
configure:3191: gcc -E conftest.c
conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
configure:3191: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3216: result: gcc -E
configure:3236: gcc -E conftest.c
configure:3236: $? = 0
configure:3250: gcc -E conftest.c
conftest.c:9:28: error: ac_nonexistent.h: No such file or directory
configure:3250: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
| #include <ac_nonexistent.h>
configure:3351: checking for printw in -lcurses
configure:3376: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:16: warning: function declaration isn't a prototype
conftest.c:19: warning: function declaration isn't a prototype
configure:3376: $? = 0
configure:3385: result: yes
configure:3800: checking for ANSI C header files
configure:3820: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:16: warning: function declaration isn't a prototype
configure:3820: $? = 0
configure:3904: result: no
configure:3915: checking fcntl.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking fcntl.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for fcntl.h
configure:3915: result: yes
configure:3915: checking sys/types.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking sys/types.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for sys/types.h
configure:3915: result: yes
configure:3915: checking sys/stat.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking sys/stat.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for sys/stat.h
configure:3915: result: yes
configure:3915: checking limits.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking limits.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for limits.h
configure:3915: result: yes
configure:3915: checking unistd.h usability
configure:3915: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking unistd.h presence
configure:3915: gcc -E conftest.c
configure:3915: $? = 0
configure:3915: result: yes
configure:3915: checking for unistd.h
configure:3915: result: yes
configure:3927: checking for an ANSI C-conforming const
configure:3992: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:17: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:37: warning: cast discards qualifiers from pointer target type
conftest.c:43: warning: 't' is used uninitialized in this function
conftest.c:59: warning: 'b' is used uninitialized in this function
conftest.c:22: warning: 'cs[0]' is used uninitialized in this function
configure:3992: $? = 0
configure:3999: result: yes
configure:4007: checking for mode_t
configure:4007: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4007: $? = 0
configure:4007: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4007: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((mode_t)))
| return 0;
| ;
| return 0;
| }
configure:4007: result: yes
configure:4018: checking for off_t
configure:4018: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4018: $? = 0
configure:4018: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4018: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((off_t)))
| return 0;
| ;
| return 0;
| }
configure:4018: result: yes
configure:4029: checking for pid_t
configure:4029: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4029: $? = 0
configure:4029: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4029: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((pid_t)))
| return 0;
| ;
| return 0;
| }
configure:4029: result: yes
configure:4040: checking for size_t
configure:4040: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
configure:4040: $? = 0
configure:4040: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:50: error: expected expression before ')' token
configure:4040: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_FCNTL_H 1
| #define HAVE_SYS_TYPES_H 1
| #define HAVE_SYS_STAT_H 1
| #define HAVE_LIMITS_H 1
| #define HAVE_UNISTD_H 1
| /* end confdefs.h. */
| #include <stdio.h>
| #ifdef HAVE_SYS_TYPES_H
| # include <sys/types.h>
| #endif
| #ifdef HAVE_SYS_STAT_H
| # include <sys/stat.h>
| #endif
| #ifdef STDC_HEADERS
| # include <stdlib.h>
| # include <stddef.h>
| #else
| # ifdef HAVE_STDLIB_H
| # include <stdlib.h>
| # endif
| #endif
| #ifdef HAVE_STRING_H
| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H
| # include <memory.h>
| # endif
| # include <string.h>
| #endif
| #ifdef HAVE_STRINGS_H
| # include <strings.h>
| #endif
| #ifdef HAVE_INTTYPES_H
| # include <inttypes.h>
| #endif
| #ifdef HAVE_STDINT_H
| # include <stdint.h>
| #endif
| #ifdef HAVE_UNISTD_H
| # include <unistd.h>
| #endif
| int
| main ()
| {
| if (sizeof ((size_t)))
| return 0;
| ;
| return 0;
| }
configure:4040: result: yes
configure:4051: checking whether struct tm is in sys/time.h or time.h
configure:4071: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:19: warning: function declaration isn't a prototype
configure:4071: $? = 0
configure:4078: result: time.h
configure:4095: checking for special C compiler options needed for large files
configure:4140: result: no
configure:4146: checking for _FILE_OFFSET_BITS value needed for large files
configure:4171: gcc -c -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common conftest.c >&5
conftest.c:25: warning: function declaration isn't a prototype
configure:4171: $? = 0
configure:4203: result: no
configure:4291: checking for working memcmp
configure:4334: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:49: warning: function declaration isn't a prototype
conftest.c: In function 'main':
conftest.c:53: warning: implicit declaration of function 'memcmp'
conftest.c:67: warning: implicit declaration of function 'strcpy'
conftest.c:67: warning: incompatible implicit declaration of built-in function 'strcpy'
configure:4334: $? = 0
configure:4334: ./conftest
configure:4334: $? = 0
configure:4344: result: yes
configure:4355: checking for strftime
configure:4355: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:37: warning: function declaration isn't a prototype
conftest.c:37: warning: conflicting types for built-in function 'strftime'
conftest.c:47: warning: function declaration isn't a prototype
configure:4355: $? = 0
configure:4355: result: yes
configure:4411: checking for mktime
configure:4411: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:38: warning: function declaration isn't a prototype
conftest.c:48: warning: function declaration isn't a prototype
configure:4411: $? = 0
configure:4411: result: yes
configure:4411: checking for strerror
configure:4411: gcc -o conftest -g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common -g conftest.c -lcurses >&5
conftest.c:39: warning: function declaration isn't a prototype
conftest.c:49: warning: function declaration isn't a prototype
configure:4411: $? = 0
configure:4411: result: yes
configure:4535: creating ./config.status
## ---------------------- ##
## Running config.status. ##
## ---------------------- ##
This file was extended by config.status, which was
generated by GNU Autoconf 2.65. Invocation command line was
CONFIG_FILES =
CONFIG_HEADERS =
CONFIG_LINKS =
CONFIG_COMMANDS =
$ ./config.status
on goodall
config.status:828: creating Makefile
config.status:828: creating cpm.5
config.status:828: creating cpmchattr.1
config.status:828: creating cpmchmod.1
config.status:828: creating cpmcp.1
config.status:828: creating cpmls.1
config.status:828: creating cpmrm.1
config.status:828: creating fsck.cpm.1
config.status:828: creating fsed.cpm.1
config.status:828: creating mkfs.cpm.1
config.status:828: creating config.h
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_c_const=yes
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_func_memcmp_working=yes
ac_cv_func_mktime=yes
ac_cv_func_strerror=yes
ac_cv_func_strftime=yes
ac_cv_header_fcntl_h=yes
ac_cv_header_limits_h=yes
ac_cv_header_stdc=no
ac_cv_header_sys_stat_h=yes
ac_cv_header_sys_types_h=yes
ac_cv_header_unistd_h=yes
ac_cv_host=x86_64-unknown-linux-gnu
ac_cv_lib_curses_printw=yes
ac_cv_objext=o
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_CPP='gcc -E'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_cc_c89=
ac_cv_prog_cc_g=yes
ac_cv_struct_tm=time.h
ac_cv_sys_file_offset_bits=no
ac_cv_sys_largefile_CC=no
ac_cv_type_mode_t=yes
ac_cv_type_off_t=yes
ac_cv_type_pid_t=yes
ac_cv_type_size_t=yes
## ----------------- ##
## Output variables. ##
## ----------------- ##
CC='gcc'
CFLAGS='-g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common'
CPP='gcc -E'
CPPFLAGS=''
DATADIR='${prefix}/share'
DEFFORMAT='ibm-3740'
DEFS='-DHAVE_CONFIG_H'
DEVICE='posix'
DISKDEFS='${datarootdir}/diskdefs'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
FSED_CPM='fsed.cpm'
GREP=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LDDEPS=''
LDFLAGS=' -g'
LDLIBS=''
LIBOBJS=''
LIBS='-lcurses '
LTLIBOBJS=''
OBJEXT='o'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
SHELL='/bin/sh'
UPDATED='March 30, 2010'
ac_ct_CC='gcc'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
host='x86_64-unknown-linux-gnu'
host_alias=''
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/usr/local'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_FCNTL_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_SYS_STAT_H 1
#define HAVE_LIMITS_H 1
#define HAVE_UNISTD_H 1
#define HAVE_STRFTIME 1
#define HAVE_MKTIME 1
#define HAVE_STRERROR 1
configure: exit 0

1014
branches/dwg/LSource/src/cpmtools-2.13/config.status

File diff suppressed because it is too large

1702
branches/dwg/LSource/src/cpmtools-2.13/config.sub

File diff suppressed because it is too large

5701
branches/dwg/LSource/src/cpmtools-2.13/configure

File diff suppressed because it is too large

124
branches/dwg/LSource/src/cpmtools-2.13/configure.in

@ -0,0 +1,124 @@
AC_INIT(cpmfs.c)
AC_CONFIG_HEADER(config.h)
AC_CANONICAL_HOST
VERSION=2.13
UPDATED='March 30, 2010'
DEVICE="posix"
if test "$prefix" = NONE
then
case $host in
*-linux-*)
;;
*-pc-mingw32)
CFLAGS_LIBDSK=-DNOTWINDLL
;;
esac
fi
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CPP
if test "$GCC" = yes
then
CFLAGS="${CFLAGS} ${EXTRA_GCFLAGS}-pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrite-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common"
LDFLAGS="${LDFLAGS} ${EXTRA_GLDFLAGS}-g"
else
CFLAGS="${CFLAGS} ${EXTRA_CFLAGS}"
LDFLAGS="${LDFLAGS} ${EXTRA_LDFLAGS}"
fi
AC_CYGWIN
AC_MINGW32
dnl Choose between posix and win32 drivers...
DEVICE="posix"
DISKDEFS='${datarootdir}/diskdefs'
if test "$CYGWIN" = "yes"
then
DEVICE="win32"
# DISKDEFS='%USERPROFILE%/diskdefs'
fi
if test "$MINGW32" = "yes"
then
DEVICE="win32"
# DISKDEFS='%USERPROFILE%\\diskdefs'
fi
AC_ARG_WITH(diskdefs,[ --with-diskdefs Specify diskdefs location],
[DISKDEFS="$withval"], [DISKDEFS="$DISKDEFS"])
AC_ARG_WITH(defformat,[ --with-defformat Specify default format (ibm-3740)],
[DEFFORMAT="$withval"], [DEFFORMAT="ibm-3740"])
AC_ARG_WITH(libdsk, [ --with-libdsk Specify path to libdsk library],
[LIBDSK="$withval"], [LIBDSK=""])
AC_ARG_WITH(dmalloc, [ --with-dmalloc Specify path to dmalloc library],
[CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include"
LDFLAGS="$LDFLAGS -L$with_dmalloc/lib"
LIBS="$LIBS -ldmalloc"
AC_DEFINE(USE_DMALLOC)])
dnl Check for curses. If not found, don't build fsed.cpm
dnl Try both curses and ncurses
AC_CHECK_LIB(curses, printw, FSED_CPM=fsed.cpm LIBS="-lcurses $LIBS", FSED_CPM=)
if test x"$FSED_CPM" = x""; then
AC_CHECK_LIB(ncurses, printw, FSED_CPM=fsed.cpm LIBS="-lncurses $LIBS", FSED_CPM=)
fi
dnl If using libdsk, check it's available.
if test "$LIBDSK" != ""; then
DEVICE="libdsk"
CPPFLAGS="$CPPFLAGS -I$LIBDSK/include"
CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK"
LDFLAGS="$LDFLAGS -L$LIBDSK/lib"
AC_CHECK_LIB(dsk, dsk_open)
AC_CHECK_HEADERS(libdsk.h, ,[echo "No libdsk.h - aborting"; exit 1])
fi
dnl If using win32, check it's available.
if test x"$DEVICE" = x"win32"; then
AC_CHECK_HEADERS(windows.h, ,[echo "Device win32, but <windows.h> not found - aborting"; exit 1] )
AC_CHECK_HEADERS(winioctl.h, ,[echo "Device win32, but <winioctl.h> not found - aborting"; exit 1],
[#ifdef HAVE_WINDOWS_H
#include <windows.h>
#endif
])
fi
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/types.h sys/stat.h limits.h unistd.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_STRUCT_TM
AC_EXEEXT
AC_OBJEXT
AC_SYS_LARGEFILE
dnl add EXE extension to fsed.cpm
if test x"$FSED_CPM" != x""; then
FSED_CPM="$FSED_CPM$EXEEXT"
fi
dnl Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STRFTIME
AC_CHECK_FUNCS(mktime strerror)
AC_SUBST(LDLIBS)
AC_SUBST(LDDEPS)
AC_SUBST(DEVICE)
eval DATADIR=$datadir
AC_SUBST(DATADIR)
AC_SUBST(DISKDEFS)
AC_SUBST(DEFFORMAT)
AC_SUBST(FSED_CPM)
AC_SUBST(UPDATED)
AC_OUTPUT(Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1 )

240
branches/dwg/LSource/src/cpmtools-2.13/cpm.5

@ -0,0 +1,240 @@
.\" Believe it or not, reportedly there are nroffs which do not know \(en
.if n .ds en -
.if t .ds en \(en
.TH CPM 5 "March 30, 2010" "CP/M tools" "File formats"
.SH NAME \"{{{roff}}}\"{{{
cpm \- CP/M disk and file system format
.\"}}}
.SH DESCRIPTION \"{{{
.SS "Characteristic sizes" \"{{{
Each CP/M disk format is described by the following specific sizes:
.RS
.sp
Sector size in bytes
.br
Number of tracks
.br
Number of sectors
.br
Block size
.br
Number of directory entries
.br
Logical sector skew
.br
Number of reserved system tracks
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
sizes of 1024, 2048, 4096, 8192 and 16384 bytes. Unfortunately, this
format specification is not stored on the disk and there are lots of
formats. Accessing a block is performed by accessing its sectors, which
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
A CP/M disk contains three areas:
.RS
.sp
System tracks (optional)
.br
Directory
.br
Data
.sp
.RE
The system tracks store the boot loader and CP/M itself. In order to save
disk space, there are non-bootable formats which omit those system tracks.
The term \fIdisk capacity\fP always excludes the space for system tracks.
Note that there is no bitmap or list for free blocks. When accessing a
drive for the first time, CP/M builds this bitmap in core from the directory.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
which contain 32 bytes of the following structure:
.RS
.sp
.ta 3n 6n 9n 12n 15n 18n 21n 24n 27n 30n 33n 36n 39n 42n 45n
St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc
.br
Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al
.sp
.RE
.\"{{{ St = status
\fBSt\fP is the status; possible values are:
.RS
.sp
0\*(en15: used for file, status is the user number
.br
16\*(en31: used for file, status is the user number (P2DOS)
or used for password extent (CP/M 3 or higher)
.br
32: disc label
.br
33: time stamp (P2DOS)
.br
0xE5: unused
.sp
.RE
.\"}}}
.LP
.\"{{{ F0-E2 = file name and extension
\fBF0\*(enE2\fP are the file name and its extension. They may consist of
any printable 7 bit ASCII character but: \fB< > . , ; : = ? * [ ]\fP.
The file name must not be empty, the extension may be empty. Both are
padded with blanks. The highest bit of each character of the file name
and extension is used as attribute. The attributes have the following
meaning:
.RS
.sp
F0: requires set wheel byte (Backgrounder II)
.br
F1: public file (P2DOS, ZSDOS), forground-only command (Backgrounder II)
.br
F2: date stamp (ZSDOS), background-only commands (Backgrounder II)
.br
F7: wheel protect (ZSDOS)
.br
E0: read-only
.br
E1: system file
.br
E2: archived
.sp
.RE
Public files (visible under each user number) are not supported by CP/M
2.2, but there is a patch and some free CP/M clones support them without
any patches.
.LP
The wheel byte is (by default) the memory location at 0x4b. If it is
zero, only non-privileged commands may be executed.
.\"}}}
.LP
.\"{{{ Xl, Xh = extent number
\fBXl\fP and \fBXh\fP store the extent number. A file may use more than
one directory entry, if it contains more blocks than an extent can hold.
In this case, more extents are allocated and each of them is numbered
sequentially with an extent number. If a physical extent stores more than
16k, it is considered to contain multiple logical extents, each pointing
to 16k data, and the extent number of the last used logical extent
is stored. Note: Some formats decided to always store only one logical
extent in a physical extent, thus wasting extent space. CP/M 2.2 allows
512 extents per file, CP/M 3 and higher allow up to 2048. Bit 5\*(en7 of
Xl are 0, bit 0\*(en4 store the lower bits of the extent number. Bit 6
and 7 of Xh are 0, bit 0\*(en5 store the higher bits of the extent number.
.\"}}}
.LP
.\"{{{ Rc, Bc = record count, byte count
\fBRc\fP and \fBBc\fP determine the length of the data used by this extent. The
physical extent is divided into logical extents, each of them being 16k
in size (a physical extent must hold at least one logical extent, e.g. a
blocksize of 1024 byte with two-byte block pointers is not allowed).
Rc stores the number of 128 byte records of the last used logical extent.
Bc stores the number of bytes in the last used record. The value 0 means
128 for backward compatibility with CP/M 2.2, which did not support Bc.
.\"}}}
.LP
.\"{{{ Al = allocated blocks
\fBAl\fP stores block pointers. If the disk capacity is less than 256 blocks,
Al is interpreted as 16 byte-values, otherwise as 8 double-byte-values.
A block pointer of 0 marks a hole in the file. If a hole
covers the range of a full extent, the extent will not be allocated. In particular,
the first extent of a file does not neccessarily have extent number 0.
A file may not share blocks with other files, as its blocks would be freed
if the other files is erased without a following disk system reset. CP/M returns
EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes
holes invisible.
.\"}}}
.\"}}}
.SS "Time stamps" \"{{{
P2DOS and CP/M Plus support time stamps, which are stored in each fourth
directory entry. This entry contains the time stamps for
the extents using the previous three directory entries. Note that you
really have time stamps for each extent, no matter if it is the first
extent of a file or not. The structure of time stamp entries is:
.RS
.sp
1 byte status 0x21
.br
8 bytes time stamp for third-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for second-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for last directory entry
.sp
.RE
A time stamp consists of two dates: Creation and modification date (the
latter being recorded when the file is closed). CP/M Plus further
allows optionally to record the access instead of creation date as first
time stamp.
.RS
.sp
2 bytes (little-endian) days starting with 1 at 01-01-1978
.br
1 byte hour in BCD format
.br
1 byte minute in BCD format
.sp
.RE
.\"}}}
.SS "Disc labels" \"{{{
CP/M Plus support disc labels, which are stored in an arbitrary directory
entry.
The structure of disc labels is:
.RS
.sp
1 byte status 0x20
.br
\fBF0\*(enE2\fP are the disc label
.br
1 byte mode: bit 7 activates password protection, bit 6 causes time stamps on
access, but 5 causes time stamps on modifications, bit 4 causes time stamps on
creation and bit 0 is set when a label exists. Bit 4 and 6 are exclusively set.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.br
4 bytes label creation time stamp
.br
4 bytes label modification time stamp
.sp
.RE
.\"}}}
.SS "Passwords" \"{{{
CP/M Plus supports passwords, which are stored in an arbitrary directory
entry.
The structure of these entries is:
.RS
.sp
1 byte status (user number plus 16)
.br
\fBF0\*(enE2\fP are the file name and its extension.
.br
1 byte password mode: bit 7 means password required for reading, bit 6 for writing
and bit 5 for deleting.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.sp
.RE
.\"}}}
.\"}}}
.SH "SEE ALSO" \"{{{
.IR mkfs.cpm (1),
.IR fsck.cpm (1),
.IR fsed.cpm (1),
.IR cpmls (1)
.\"}}}

240
branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in

@ -0,0 +1,240 @@
.\" Believe it or not, reportedly there are nroffs which do not know \(en
.if n .ds en -
.if t .ds en \(en
.TH CPM 5 "@UPDATED@" "CP/M tools" "File formats"
.SH NAME \"{{{roff}}}\"{{{
cpm \- CP/M disk and file system format
.\"}}}
.SH DESCRIPTION \"{{{
.SS "Characteristic sizes" \"{{{
Each CP/M disk format is described by the following specific sizes:
.RS
.sp
Sector size in bytes
.br
Number of tracks
.br
Number of sectors
.br
Block size
.br
Number of directory entries
.br
Logical sector skew
.br
Number of reserved system tracks
.sp
.RE
A block is the smallest allocatable storage unit. CP/M supports block
sizes of 1024, 2048, 4096, 8192 and 16384 bytes. Unfortunately, this
format specification is not stored on the disk and there are lots of
formats. Accessing a block is performed by accessing its sectors, which
are stored with the given software skew.
.\"}}}
.SS "Device areas" \"{{{
A CP/M disk contains three areas:
.RS
.sp
System tracks (optional)
.br
Directory
.br
Data
.sp
.RE
The system tracks store the boot loader and CP/M itself. In order to save
disk space, there are non-bootable formats which omit those system tracks.
The term \fIdisk capacity\fP always excludes the space for system tracks.
Note that there is no bitmap or list for free blocks. When accessing a
drive for the first time, CP/M builds this bitmap in core from the directory.
.\"}}}
.SS "Directory entries" \"{{{
The directory is a sequence of directory entries (also called extents),
which contain 32 bytes of the following structure:
.RS
.sp
.ta 3n 6n 9n 12n 15n 18n 21n 24n 27n 30n 33n 36n 39n 42n 45n
St F0 F1 F2 F3 F4 F5 F6 F7 E0 E1 E2 Xl Bc Xh Rc
.br
Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al Al
.sp
.RE
.\"{{{ St = status
\fBSt\fP is the status; possible values are:
.RS
.sp
0\*(en15: used for file, status is the user number
.br
16\*(en31: used for file, status is the user number (P2DOS)
or used for password extent (CP/M 3 or higher)
.br
32: disc label
.br
33: time stamp (P2DOS)
.br
0xE5: unused
.sp
.RE
.\"}}}
.LP
.\"{{{ F0-E2 = file name and extension
\fBF0\*(enE2\fP are the file name and its extension. They may consist of
any printable 7 bit ASCII character but: \fB< > . , ; : = ? * [ ]\fP.
The file name must not be empty, the extension may be empty. Both are
padded with blanks. The highest bit of each character of the file name
and extension is used as attribute. The attributes have the following
meaning:
.RS
.sp
F0: requires set wheel byte (Backgrounder II)
.br
F1: public file (P2DOS, ZSDOS), forground-only command (Backgrounder II)
.br
F2: date stamp (ZSDOS), background-only commands (Backgrounder II)
.br
F7: wheel protect (ZSDOS)
.br
E0: read-only
.br
E1: system file
.br
E2: archived
.sp
.RE
Public files (visible under each user number) are not supported by CP/M
2.2, but there is a patch and some free CP/M clones support them without
any patches.
.LP
The wheel byte is (by default) the memory location at 0x4b. If it is
zero, only non-privileged commands may be executed.
.\"}}}
.LP
.\"{{{ Xl, Xh = extent number
\fBXl\fP and \fBXh\fP store the extent number. A file may use more than
one directory entry, if it contains more blocks than an extent can hold.
In this case, more extents are allocated and each of them is numbered
sequentially with an extent number. If a physical extent stores more than
16k, it is considered to contain multiple logical extents, each pointing
to 16k data, and the extent number of the last used logical extent
is stored. Note: Some formats decided to always store only one logical
extent in a physical extent, thus wasting extent space. CP/M 2.2 allows
512 extents per file, CP/M 3 and higher allow up to 2048. Bit 5\*(en7 of
Xl are 0, bit 0\*(en4 store the lower bits of the extent number. Bit 6
and 7 of Xh are 0, bit 0\*(en5 store the higher bits of the extent number.
.\"}}}
.LP
.\"{{{ Rc, Bc = record count, byte count
\fBRc\fP and \fBBc\fP determine the length of the data used by this extent. The
physical extent is divided into logical extents, each of them being 16k
in size (a physical extent must hold at least one logical extent, e.g. a
blocksize of 1024 byte with two-byte block pointers is not allowed).
Rc stores the number of 128 byte records of the last used logical extent.
Bc stores the number of bytes in the last used record. The value 0 means
128 for backward compatibility with CP/M 2.2, which did not support Bc.
.\"}}}
.LP
.\"{{{ Al = allocated blocks
\fBAl\fP stores block pointers. If the disk capacity is less than 256 blocks,
Al is interpreted as 16 byte-values, otherwise as 8 double-byte-values.
A block pointer of 0 marks a hole in the file. If a hole
covers the range of a full extent, the extent will not be allocated. In particular,
the first extent of a file does not neccessarily have extent number 0.
A file may not share blocks with other files, as its blocks would be freed
if the other files is erased without a following disk system reset. CP/M returns
EOF when it reaches a hole, whereas UNIX returns zero-value bytes, which makes
holes invisible.
.\"}}}
.\"}}}
.SS "Time stamps" \"{{{
P2DOS and CP/M Plus support time stamps, which are stored in each fourth
directory entry. This entry contains the time stamps for
the extents using the previous three directory entries. Note that you
really have time stamps for each extent, no matter if it is the first
extent of a file or not. The structure of time stamp entries is:
.RS
.sp
1 byte status 0x21
.br
8 bytes time stamp for third-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for second-last directory entry
.br
2 bytes unused
.br
8 bytes time stamp for last directory entry
.sp
.RE
A time stamp consists of two dates: Creation and modification date (the
latter being recorded when the file is closed). CP/M Plus further
allows optionally to record the access instead of creation date as first
time stamp.
.RS
.sp
2 bytes (little-endian) days starting with 1 at 01-01-1978
.br
1 byte hour in BCD format
.br
1 byte minute in BCD format
.sp
.RE
.\"}}}
.SS "Disc labels" \"{{{
CP/M Plus support disc labels, which are stored in an arbitrary directory
entry.
The structure of disc labels is:
.RS
.sp
1 byte status 0x20
.br
\fBF0\*(enE2\fP are the disc label
.br
1 byte mode: bit 7 activates password protection, bit 6 causes time stamps on
access, but 5 causes time stamps on modifications, bit 4 causes time stamps on
creation and bit 0 is set when a label exists. Bit 4 and 6 are exclusively set.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.br
4 bytes label creation time stamp
.br
4 bytes label modification time stamp
.sp
.RE
.\"}}}
.SS "Passwords" \"{{{
CP/M Plus supports passwords, which are stored in an arbitrary directory
entry.
The structure of these entries is:
.RS
.sp
1 byte status (user number plus 16)
.br
\fBF0\*(enE2\fP are the file name and its extension.
.br
1 byte password mode: bit 7 means password required for reading, bit 6 for writing
and bit 5 for deleting.
.br
1 byte password decode byte: To decode the password, xor this byte with the password
bytes in reverse order. To encode a password, add its characters to get the
decode byte.
.br
2 reserved bytes
.br
8 password bytes
.sp
.RE
.\"}}}
.\"}}}
.SH "SEE ALSO" \"{{{
.IR mkfs.cpm (1),
.IR fsck.cpm (1),
.IR fsed.cpm (1),
.IR cpmls (1)
.\"}}}

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr

Binary file not shown.

86
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1

@ -0,0 +1,86 @@
.TH CPMCHATTR 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchattr \- change file attributes on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchattr
.RB [ \-f
.IR format ]
.I image
.I attrib
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchattr\fP changes the file attributes for files on CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
.SH "FILE ATTRIBUTES" \"{{{
The file attribute string can contain the characters
1,2,3,4,r,s,a,n and m.
The meanings of these are:
.TP
.B 1-4
The CP/M "user attributes" F1-F4. CP/M does not assign any
meaning to these attributes, though MP/M does.
.TP
.B r
The file is read-only. This is the same as using
.I cpmchmod(1)
to revoke write permissions.
.TP
.B s
The file is a system file. This attribute can also be set by
.I cpmchmod(1).
.TP
.B a
The file has been backed up.
.TP
.B n
Reset all attributes to zero. So the string "n1r" resets all attributes and
then sets F1 and Read-Only.
.TP
.B m
Attributes after an m are unset rather than set. The string "12m34" sets
atttributes F1 and F2, and unsets F3 and F4.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpmchmod (1),
.IR cpm (5)
.\"}}}

86
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in

@ -0,0 +1,86 @@
.TH CPMCHATTR 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchattr \- change file attributes on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchattr
.RB [ \-f
.IR format ]
.I image
.I attrib
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchattr\fP changes the file attributes for files on CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fIattrib\fP"
Set the file attributes as given.
.\"}}}
.SH "FILE ATTRIBUTES" \"{{{
The file attribute string can contain the characters
1,2,3,4,r,s,a,n and m.
The meanings of these are:
.TP
.B 1-4
The CP/M "user attributes" F1-F4. CP/M does not assign any
meaning to these attributes, though MP/M does.
.TP
.B r
The file is read-only. This is the same as using
.I cpmchmod(1)
to revoke write permissions.
.TP
.B s
The file is a system file. This attribute can also be set by
.I cpmchmod(1).
.TP
.B a
The file has been backed up.
.TP
.B n
Reset all attributes to zero. So the string "n1r" resets all attributes and
then sets F1 and Read-Only.
.TP
.B m
Attributes after an m are unset rather than set. The string "12m34" sets
atttributes F1 and F2, and unsets F3 and F4.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpmchmod (1),
.IR cpm (5)
.\"}}}

112
branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c

@ -0,0 +1,112 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmchattr";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
const char *attrs;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-2)) usage=1;
else
{
image=argv[optind++];
attrs = argv[optind++];
}
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image [NMrsa1234] pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
int rc;
cpm_attr_t attrib;
rc = cpmNamei(&root,gargv[i], &ino)==-1;
if (!rc) rc = cpmAttrGet(&ino, &attrib);
if (!rc)
{
int n, m;
m = 0;
for (n = 0; n < strlen(attrs); n++)
{
int mask = 0;
switch (attrs[n])
{
case 'n':
case 'N': mask = 0; attrib = 0; break;
case 'm':
case 'M': mask = 0; m = !m; break;
case '1': mask = CPM_ATTR_F1; break;
case '2': mask = CPM_ATTR_F2; break;
case '3': mask = CPM_ATTR_F3; break;
case '4': mask = CPM_ATTR_F4; break;
case 'r':
case 'R': mask = CPM_ATTR_RO; break;
case 's':
case 'S': mask = CPM_ATTR_SYS; break;
case 'a':
case 'A': mask = CPM_ATTR_ARCV; break;
default: fprintf(stderr, "%s: Unknown attribute %c\n", cmd, attrs[n]);
exit(1);
}
if (m) attrib &= ~mask; else attrib |= mask;
}
rc = cpmAttrSet(&ino, attrib);
}
if (rc)
{
fprintf(stderr,"%s: can not set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod

Binary file not shown.

57
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1

@ -0,0 +1,57 @@
.TH CPMCHMOD 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchmod \- change file mode on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchmod
.RB [ \-f
.IR format ]
.I image
.I mode
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchmod\fP changes the file mode for files on CP/M files.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR chmod (1),
.IR cpm (5)
.\"}}}

57
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in

@ -0,0 +1,57 @@
.TH CPMCHMOD 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmchmod \- change file mode on CP/M files
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmchmod
.RB [ \-f
.IR format ]
.I image
.I mode
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmchmod\fP changes the file mode for files on CP/M files.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fImode\fP"
Octal file mode, as used in \fIchmod\fP(1).
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de> and copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR chmod (1),
.IR cpm (5)
.\"}}}

84
branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c

@ -0,0 +1,84 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmchmod";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
unsigned int mode;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-2)) usage=1;
else
{
image=argv[optind++];
if (!sscanf(argv[optind++], "%o", &mode)) usage=1;
}
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] image mode pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
struct cpmInode ino;
if (cpmNamei(&root,gargv[i], &ino)==-1)
{
fprintf(stderr,"%s: can not find %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
else if (cpmChmod(&ino, mode) == -1)
{
fprintf(stderr,"%s: Failed to set attributes for %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmcp

Binary file not shown.

92
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1

@ -0,0 +1,92 @@
.TH CPMCP 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmcp \- copy files from and to CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP \fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP ... \fIdirectory\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP \fIuser\fP\fB:\fP\fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP ... \fIuser\fP\fB:\fP
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmcp\fP copies one or more files to or from a CP/M disk. When copying
multiple files, the last argument must be a drive or directory. The drive
letter does not matter because the device is specified by the image, it is
only used to specify which direction you want to copy. The user number is
specified after the drive letter, if omitted user 0 is used.
.PP
You can use \fB*\fP and \fB?\fP in CP/M file names, which have the same
meaning in
.IR sh (1)
file name patterns.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
.IP \fB\-t\fP
Convert text files between CP/M and UNIX conventions.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

92
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in

@ -0,0 +1,92 @@
.TH CPMCP 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmcp \- copy files from and to CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP \fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIuser\fP\fB:\fP\fIfile\fP ... \fIdirectory\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP \fIuser\fP\fB:\fP\fIfile\fP
.br
.B cpmcp
.RB [ \-f
.IR format ]
.RB [ \-p ]
.RB [ \-t ]
.I image
\fIfile\fP ... \fIuser\fP\fB:\fP
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmcp\fP copies one or more files to or from a CP/M disk. When copying
multiple files, the last argument must be a drive or directory. The drive
letter does not matter because the device is specified by the image, it is
only used to specify which direction you want to copy. The user number is
specified after the drive letter, if omitted user 0 is used.
.PP
You can use \fB*\fP and \fB?\fP in CP/M file names, which have the same
meaning in
.IR sh (1)
file name patterns.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-p\fP
Preserve time stamps when copying files from CP/M to UNIX (not
implemented for copying the other way so far).
.IP \fB\-t\fP
Convert text files between CP/M and UNIX conventions.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

284
branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c

@ -0,0 +1,284 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <sys/stat.h>
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <fcntl.h>
#include <limits.h>
#include <stdlib.h>
#include <utime.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmcp";
static int text=0;
static int preserve=0;
/**
* Return the user number.
* @param s CP/M filename in 0[0]:aaaaaaaa.bbb format.
* @returns The user number or -1 for no match.
*/
static int userNumber(const char *s) /*{{{*/
{
if (isdigit(*s) && *(s+1)==':') return (*s-'0');
if (isdigit(*s) && isdigit(*(s+1)) && *(s+2)==':') return (10*(*s-'0')+(*(s+1)));
return -1;
}
/*}}}*/
/**
* Copy one file from CP/M to UNIX.
* @param root The inode for the root directory.
* @param src The CP/M filename in 00aaaaaaaabbb format.
* @param dest The UNIX filename.
* @returns 0 for success, 1 for error.
*/
static int cpmToUnix(const struct cpmInode *root, const char *src, const char *dest) /*{{{*/
{
struct cpmInode ino;
int exitcode=0;
if (cpmNamei(root,src,&ino)==-1) { fprintf(stderr,"%s: can not open `%s': %s\n",cmd,src,boo); exitcode=1; }
else
{
struct cpmFile file;
FILE *ufp;
cpmOpen(&ino,&file,O_RDONLY);
if ((ufp=fopen(dest,text ? "w" : "wb"))==(FILE*)0) { fprintf(stderr,"%s: can not create %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; }
else
{
int crpending=0;
int ohno=0;
int res;
char buf[4096];
while ((res=cpmRead(&file,buf,sizeof(buf)))!=0)
{
int j;
for (j=0; j<res; ++j)
{
if (text)
{
if (buf[j]=='\032') goto endwhile;
if (crpending)
{
if (buf[j]=='\n')
{
if (putc('\n',ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
crpending=0;
}
else if (putc('\r',ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
crpending=(buf[j]=='\r');
}
else
{
if (buf[j]=='\r') crpending=1;
else if (putc(buf[j],ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
}
}
else if (putc(buf[j],ufp)==EOF) { fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; goto endwhile; }
}
}
endwhile:
if (fclose(ufp)==EOF && !ohno) { fprintf(stderr,"%s: can not close %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; }
if (preserve && !ohno && (ino.atime || ino.mtime))
{
struct utimbuf ut;
if (ino.atime) ut.actime=ino.atime; else time(&ut.actime);
if (ino.mtime) ut.modtime=ino.mtime; else time(&ut.modtime);
if (utime(dest,&ut)==-1) { fprintf(stderr,"%s: can change timestamps of %s: %s\n",cmd,dest,strerror(errno)); exitcode=1; ohno=1; }
}
}
cpmClose(&file);
}
return exitcode;
}
/*}}}*/
static void usage(void) /*{{{*/
{
fprintf(stderr,"Usage: %s [-f format] [-p] [-t] image user:file file\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image user:file ... directory\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image file user:file\n",cmd);
fprintf(stderr," %s [-f format] [-p] [-t] image file ... user:\n",cmd);
exit(1);
}
/*}}}*/
int main(int argc, char *argv[])
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,readcpm=-1,todir=-1;
struct cpmInode root;
struct cpmSuperBlock super;
int exitcode=0;
int gargc;
char **gargv;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?pt"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage(); break;
case 'p': preserve=1; break;
case 't': text=1; break;
}
/*}}}*/
/* parse arguments */ /*{{{*/
if ((optind+2)>=argc) usage();
image=argv[optind++];
if (userNumber(argv[optind])>=0) /* cpm -> unix? */ /*{{{*/
{
int i;
struct stat statbuf;
for (i=optind; i<(argc-1); ++i) if (userNumber(argv[i])==-1) usage();
todir=((argc-optind)>2);
if (stat(argv[argc-1],&statbuf)==-1) { if (todir) usage(); }
else if (S_ISDIR(statbuf.st_mode)) todir=1; else if (todir) usage();
readcpm=1;
}
/*}}}*/
else if (userNumber(argv[argc-1])>=0) /* unix -> cpm */ /*{{{*/
{
int i;
todir=0;
for (i=optind; i<(argc-1); ++i) if (userNumber(argv[i])>=0) usage();
if ((argc-optind)>2 && *(strchr(argv[argc-1],':')+1)!='\0') usage();
if (*(strchr(argv[argc-1],':')+1)=='\0') todir=1;
readcpm=0;
}
/*}}}*/
else usage();
/*}}}*/
/* open image file */ /*{{{*/
if ((err=Device_open(&super.dev,image,readcpm ? O_RDONLY : O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&super,&root,format);
/*}}}*/
if (readcpm) /* copy from CP/M to UNIX */ /*{{{*/
{
int i;
char *last=argv[argc-1];
cpmglob(optind,argc-1,argv,&root,&gargc,&gargv);
/* trying to copy multiple files to a file? */
if (gargc>1 && !todir) usage();
for (i=0; i<gargc; ++i)
{
char dest[_POSIX_PATH_MAX];
if (todir)
{
strcpy(dest,last);
strcat(dest,"/");
strcat(dest,gargv[i]+2);
}
else strcpy(dest,last);
if (cpmToUnix(&root,gargv[i],dest)) exitcode=1;
}
}
/*}}}*/
else /* copy from UNIX to CP/M */ /*{{{*/
{
int i;
for (i=optind; i<(argc-1); ++i)
{
/* variables */ /*{{{*/
char *dest=(char*)0;
FILE *ufp;
/*}}}*/
if ((ufp=fopen(argv[i],"rb"))==(FILE*)0) /* cry a little */ /*{{{*/
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,argv[i],strerror(errno));
exitcode=1;
}
/*}}}*/
else
{
struct cpmInode ino;
char cpmname[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
if (todir)
{
if ((dest=strrchr(argv[i],'/'))!=(char*)0) ++dest; else dest=argv[i];
sprintf(cpmname,"%02d%s",userNumber(argv[argc-1]),dest);
}
else
{
sprintf(cpmname,"%02d%s",userNumber(argv[argc-1]),strchr(argv[argc-1],':')+1);
}
if (cpmCreat(&root,cpmname,&ino,0666)==-1) /* just cry */ /*{{{*/
{
fprintf(stderr,"%s: can not create %s: %s\n",cmd,cpmname,boo);
exitcode=1;
}
/*}}}*/
else
{
struct cpmFile file;
int ohno=0;
char buf[4096+1];
cpmOpen(&ino,&file,O_WRONLY);
do
{
int j;
for (j=0; j<(sizeof(buf)/2) && (c=getc(ufp))!=EOF; ++j)
{
if (text && c=='\n') buf[j++]='\r';
buf[j]=c;
}
if (text && c==EOF) buf[j++]='\032';
if (cpmWrite(&file,buf,j)!=j)
{
fprintf(stderr,"%s: can not write %s: %s\n",cmd,dest,boo);
ohno=1;
exitcode=1;
break;
}
} while (c!=EOF);
if (cpmClose(&file)==EOF && !ohno) /* I just can't hold back the tears */ /*{{{*/
{
fprintf(stderr,"%s: can not close %s: %s\n",cmd,dest,boo);
exitcode=1;
}
/*}}}*/
}
fclose(ufp);
}
}
}
/*}}}*/
cpmUmount(&super);
exit(exitcode);
}

21
branches/dwg/LSource/src/cpmtools-2.13/cpmdir.h

@ -0,0 +1,21 @@
#ifndef CPMDIR_H
#define CPMDIR_H
struct PhysDirectoryEntry
{
char status;
char name[8];
char ext[3];
char extnol;
char lrc;
char extnoh;
char blkcnt;
char pointers[16];
};
#define ISFILECHAR(notFirst,c) (((notFirst) || (c)!=' ') && (c)>=' ' && !((c)&~0x7f) && (c)!='<' && (c)!='>' && (c)!='.' && (c)!=',' && (c)!=';' && (c)!=':' && (c)!='=' && (c)!='?' && (c)!='*' && (c)!= '[' && (c)!=']')
#define EXTENT(low,high) (((low)&0x1f)|(((high)&0x3f)<<5))
#define EXTENTL(extent) ((extent)&0x1f)
#define EXTENTH(extent) (((extent>>5))&0x3f)
#endif

1561
branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c

File diff suppressed because it is too large

174
branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h

@ -0,0 +1,174 @@
#ifndef CPMFS_H
#define CPMFS_H
#include <sys/stat.h>
#include <sys/types.h>
#ifdef _WIN32
#include <windows.h>
#include <winioctl.h>
/* To make it compile on NT: extracts from Linux 2.0 *
* <statbuf.h> and <sys/stat.h> */
#define __S_IFMT 0170000 /* These bits determine file type. */
#define __S_IFDIR 0040000 /* Directory. */
#define __S_IFREG 0100000 /* Regular file. */
#define __S_IWUSR 0000200 /* Writable for user. */
#define __S_IWGRP 0000200 /* Writable for group. */
#define __S_IWOTH 0000200 /* Writable for others. */
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
#define __S_ISTYPE(mode, mask) (((mode) & __S_IFMT) == (mask))
/* These bits are defined in Borland C++ 5 but not in MS Visual C++ */
#ifndef S_ISDIR
# define S_ISDIR(mode) __S_ISTYPE((mode), __S_IFDIR)
#endif
#ifndef S_ISREG
# define S_ISREG(mode) __S_ISTYPE((mode), __S_IFREG)
#endif
#ifndef S_IWUSR
#define S_IWUSR __S_IWUSR
#endif
#ifndef S_IWGRP
#define S_IWGRP __S_IWGRP
#endif
#ifndef S_IWOTH
#define S_IWOTH __S_IWOTH
#endif
#include <io.h> /* For open(), lseek() etc. */
#ifndef HAVE_MODE_T
typedef int mode_t;
#endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
#include "device.h"
/* CP/M file attributes */
#define CPM_ATTR_F1 1
#define CPM_ATTR_F2 2
#define CPM_ATTR_F3 4
#define CPM_ATTR_F4 8
/* F5-F8 are banned in CP/M 2 & 3, F7 is used by ZSDOS */
#define CPM_ATTR_RO 256 /* Read-only */
#define CPM_ATTR_SYS 512 /* System */
#define CPM_ATTR_ARCV 1024 /* Archive */
#define CPM_ATTR_PWDEL 2048 /* Password required to delete */
#define CPM_ATTR_PWWRITE 4096 /* Password required to write */
#define CPM_ATTR_PWREAD 8192 /* Password required to read */
typedef int cpm_attr_t;
struct cpmInode
{
ino_t ino;
mode_t mode;
off_t size;
cpm_attr_t attr;
time_t atime;
time_t mtime;
time_t ctime;
struct cpmSuperBlock *sb;
};
struct cpmFile
{
mode_t mode;
off_t pos;
struct cpmInode *ino;
};
struct cpmDirent
{
ino_t ino;
off_t off;
size_t reclen;
char name[2+8+1+3+1]; /* 00foobarxy.zzy\0 */
};
struct cpmStat
{
ino_t ino;
mode_t mode;
off_t size;
time_t atime;
time_t mtime;
time_t ctime;
};
#define CPMFS_DR22 0
#define CPMFS_P2DOS 1
#define CPMFS_DR3 2
struct cpmSuperBlock
{
struct Device dev;
int secLength;
int tracks;
int sectrk;
int blksiz;
int maxdir;
int skew;
int boottrk;
int type;
int size;
int extents; /* logical extents per physical extent */
struct PhysDirectoryEntry *dir;
int alvSize;
int *alv;
int *skewtab;
int cnotatime;
char *label;
size_t labelLength;
char *passwd;
size_t passwdLength;
struct cpmInode *root;
int dirtyDirectory;
};
struct cpmStatFS
{
long f_bsize;
long f_blocks;
long f_bfree;
long f_bused;
long f_bavail;
long f_files;
long f_ffree;
long f_namelen;
};
extern const char cmd[];
extern const char *boo;
int match(const char *a, const char *pattern);
void cpmglob(int opti, int argc, char * const argv[], struct cpmInode *root, int *gargc, char ***gargv);
int cpmReadSuper(struct cpmSuperBlock *drive, struct cpmInode *root, const char *format);
int cpmNamei(const struct cpmInode *dir, const char *filename, struct cpmInode *i);
void cpmStatFS(const struct cpmInode *ino, struct cpmStatFS *buf);
int cpmUnlink(const struct cpmInode *dir, const char *fname);
int cpmRename(const struct cpmInode *dir, const char *old, const char *newname);
int cpmOpendir(struct cpmInode *dir, struct cpmFile *dirp);
int cpmReaddir(struct cpmFile *dir, struct cpmDirent *ent);
void cpmStat(const struct cpmInode *ino, struct cpmStat *buf);
int cpmAttrGet(struct cpmInode *ino, cpm_attr_t *attrib);
int cpmAttrSet(struct cpmInode *ino, cpm_attr_t attrib);
int cpmChmod(struct cpmInode *ino, mode_t mode);
int cpmOpen(struct cpmInode *ino, struct cpmFile *file, mode_t mode);
int cpmRead(struct cpmFile *file, char *buf, int count);
int cpmWrite(struct cpmFile *file, const char *buf, int count);
int cpmClose(struct cpmFile *file);
int cpmCreat(struct cpmInode *dir, const char *fname, struct cpmInode *ino, mode_t mode);
int cpmSync(struct cpmSuperBlock *sb);
void cpmUmount(struct cpmSuperBlock *sb);
#ifdef __cplusplus
}
#endif
#endif

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmls

Binary file not shown.

67
branches/dwg/LSource/src/cpmtools-2.13/cpmls.1

@ -0,0 +1,67 @@
.TH CPMLS 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmls \- list sorted contents of directory
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
.I image
.RI [ file-pattern "...]"
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmls\fP lists the sorted contents of the directory.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
P2DOS 2.3 ddir-like output.
.IP \fB\-F\fp
CP/M 3.x dir output.
.IP \fB\-A\fp
E2fs lsattr-like output.
.IP \fB\-l\fP
Long UNIX-style directory listing including size, time stamp and user number.
.IP \fB\-c\fP
Output the creation time, not the modification time.
.IP \fB\-i\fP
Print index number of each file.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmcp (1),
.IR cpm (5)
.\"}}}

67
branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in

@ -0,0 +1,67 @@
.TH CPMLS 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmls \- list sorted contents of directory
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmls
.RB [ \-d | \-D | \-F | \-A | \-l [ \-c ][ \-i ]]
.RB [ \-f
.IR format ]
.I image
.RI [ file-pattern "...]"
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBCpmls\fP lists the sorted contents of the directory.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP \fB\-d\fP
Old CP/M 2.2 dir output.
.IP \fB\-D\fP
P2DOS 2.3 ddir-like output.
.IP \fB\-F\fp
CP/M 3.x dir output.
.IP \fB\-A\fp
E2fs lsattr-like output.
.IP \fB\-l\fP
Long UNIX-style directory listing including size, time stamp and user number.
.IP \fB\-c\fP
Output the creation time, not the modification time.
.IP \fB\-i\fP
Print index number of each file.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmcp (1),
.IR cpm (5)
.\"}}}

383
branches/dwg/LSource/src/cpmtools-2.13/cpmls.c

@ -0,0 +1,383 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* variables */ /*{{{*/
static const char * const month[12]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec" };
/*}}}*/
/* namecmp -- compare two entries */ /*{{{*/
static int namecmp(const void *a, const void *b)
{
if (**((const char * const *)a)=='[') return -1;
return strcmp(*((const char * const *)a),*((const char * const *)b));
}
/*}}}*/
/* olddir -- old style output */ /*{{{*/
static void olddir(char **dirent, int entries)
{
int i,j,k,l,user,announce;
announce=0;
for (user=0; user<32; ++user)
{
for (i=l=0; i<entries; ++i)
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==1)
{
printf("User %d\n",user);
}
announce=2;
if (l%4) printf(" : ");
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<11) { putchar(' '); ++k; }
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
++l;
}
if (l && (l%4)==0) {
l = 0;
putchar('\n');
}
}
if (l%4) {
putchar('\n');
}
if (announce==2) announce=1;
}
if (entries==0) printf("No files\n");
}
/*}}}*/
/* oldddir -- old style long output */ /*{{{*/
static void oldddir(char **dirent, int entries, struct cpmInode *ino)
{
struct cpmStatFS buf;
struct cpmStat statbuf;
struct cpmInode file;
if (entries)
{
int i,j,k,l,announce,user;
qsort(dirent,entries,sizeof(char*),namecmp);
cpmStatFS(ino,&buf);
printf(" Name Bytes Recs Attr update create\n");
printf("------------ ------ ------ ---- ----------------- -----------------\n");
announce=0;
for (l=user=0; user<32; ++user)
{
for (i=0; i<entries; ++i)
{
struct tm *tmp;
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==1)
{
printf("\nUser %d:\n\n",user);
printf(" Name Bytes Recs Attr update create\n");
printf("------------ ------ ------ ---- ----------------- -----------------\n");
}
announce=2;
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<10) { putchar(' '); ++k; }
putchar('.');
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
printf(" %5.1ldK",(long) (statbuf.size+buf.f_bsize-1) /
buf.f_bsize*(buf.f_bsize/1024));
printf(" %6.1ld ",(long)(statbuf.size/128));
putchar(statbuf.mode&0200 ? ' ' : 'R');
putchar(statbuf.mode&01000 ? 'S' : ' ');
putchar(' ');
if (statbuf.mtime)
{
tmp=localtime(&statbuf.mtime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
tmp=localtime(&statbuf.ctime);
printf(" %02d-%s-%04d %02d:%02d",tmp->tm_mday,month[tmp->tm_mon],tmp->tm_year+1900,tmp->tm_hour,tmp->tm_min);
}
putchar('\n');
++l;
}
}
if (announce==2) announce=1;
}
printf("%5.1d Files occupying %6.1ldK",l,(buf.f_bused*buf.f_bsize)/1024);
printf(", %7.1ldK Free.\n",(buf.f_bfree*buf.f_bsize)/1024);
}
else printf("No files found\n");
}
/*}}}*/
/* old3dir -- old CP/M Plus style long output */ /*{{{*/
static void old3dir(char **dirent, int entries, struct cpmInode *ino)
{
struct cpmStatFS buf;
struct cpmStat statbuf;
struct cpmInode file;
if (entries)
{
int i,j,k,l,announce,user, attrib;
int totalBytes=0,totalRecs=0;
qsort(dirent,entries,sizeof(char*),namecmp);
cpmStatFS(ino,&buf);
announce=1;
for (l=0,user=0; user<32; ++user)
{
for (i=0; i<entries; ++i)
{
struct tm *tmp;
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
cpmAttrGet(&file, &attrib);
if (announce==1)
{
if (user) putchar('\n');
printf("Directory For Drive A: User %2.1d\n\n",user);
printf(" Name Bytes Recs Attributes Prot Update Create\n");
printf("------------ ------ ------ ------------ ------ -------------- --------------\n\n");
}
announce=2;
for (j=2; dirent[i][j] && dirent[i][j]!='.'; ++j) putchar(toupper(dirent[i][j]));
k=j; while (k<10) { putchar(' '); ++k; }
putchar(' ');
if (dirent[i][j]=='.') ++j;
for (k=0; dirent[i][j]; ++j,++k) putchar(toupper(dirent[i][j]));
for (; k<3; ++k) putchar(' ');
totalBytes+=statbuf.size;
totalRecs+=(statbuf.size+127)/128;
printf(" %5.1ldk",(long) (statbuf.size+buf.f_bsize-1) /
buf.f_bsize*(buf.f_bsize/1024));
printf(" %6.1ld ",(long)(statbuf.size/128));
putchar((attrib & CPM_ATTR_F1) ? '1' : ' ');
putchar((attrib & CPM_ATTR_F2) ? '2' : ' ');
putchar((attrib & CPM_ATTR_F3) ? '3' : ' ');
putchar((attrib & CPM_ATTR_F4) ? '4' : ' ');
putchar((statbuf.mode&(S_IWUSR|S_IWGRP|S_IWOTH)) ? ' ' : 'R');
putchar((attrib & CPM_ATTR_SYS) ? 'S' : ' ');
putchar((attrib & CPM_ATTR_ARCV) ? 'A' : ' ');
printf(" ");
if (attrib & CPM_ATTR_PWREAD) printf("Read ");
else if (attrib & CPM_ATTR_PWWRITE) printf("Write ");
else if (attrib & CPM_ATTR_PWDEL) printf("Delete ");
else printf("None ");
tmp=localtime(&statbuf.mtime);
printf("%02d/%02d/%02d %02d:%02d ",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
tmp=localtime(&statbuf.ctime);
printf("%02d/%02d/%02d %02d:%02d",tmp->tm_mon+1,tmp->tm_mday,tmp->tm_year%100,tmp->tm_hour,tmp->tm_min);
putchar('\n');
++l;
}
}
if (announce==2) announce=1;
}
printf("\nTotal Bytes = %6.1dk ",(totalBytes+1023)/1024);
printf("Total Records = %7.1d ",totalRecs);
printf("Files Found = %4.1d\n",l);
printf("Total 1k Blocks = %6.1ld ",(buf.f_bused*buf.f_bsize)/1024);
printf("Used/Max Dir Entries For Drive A: %4.1ld/%4.1ld\n",buf.f_files-buf.f_ffree,buf.f_files);
}
else printf("No files found\n");
}
/*}}}*/
/* ls -- UNIX style output */ /*{{{*/
static void ls(char **dirent, int entries, struct cpmInode *ino, int l, int c, int iflag)
{
int i,user,announce,any;
time_t now;
struct cpmStat statbuf;
struct cpmInode file;
time(&now);
qsort(dirent,entries,sizeof(char*),namecmp);
announce=0;
any=0;
for (user=0; user<32; ++user)
{
announce=0;
for (i=0; i<entries; ++i) if (dirent[i][0]!='.')
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==0)
{
if (any) putchar('\n');
printf("%d:\n",user);
announce=1;
}
any=1;
if (iflag || l)
{
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
}
if (iflag) printf("%4ld ",(long) statbuf.ino);
if (l)
{
struct tm *tmp;
putchar(S_ISDIR(statbuf.mode) ? 'd' : '-');
putchar(statbuf.mode&0400 ? 'r' : '-');
putchar(statbuf.mode&0200 ? 'w' : '-');
putchar(statbuf.mode&0100 ? 'x' : '-');
putchar(statbuf.mode&0040 ? 'r' : '-');
putchar(statbuf.mode&0020 ? 'w' : '-');
putchar(statbuf.mode&0010 ? 'x' : '-');
putchar(statbuf.mode&0004 ? 'r' : '-');
putchar(statbuf.mode&0002 ? 'w' : '-');
putchar(statbuf.mode&0001 ? 'x' : '-');
#if 0
putchar(statbuf.flags&FLAG_PUBLIC ? 'p' : '-');
putchar(dir[i].flags&FLAG_SYSTEM ? 's' : '-');
printf(" %-2d ",dir[i].user);
#endif
printf("%8.1ld ",(long)statbuf.size);
tmp=localtime(c ? &statbuf.ctime : &statbuf.mtime);
printf("%s %02d ",month[tmp->tm_mon],tmp->tm_mday);
if ((c ? statbuf.ctime : statbuf.mtime)<(now-182*24*3600)) printf("%04d ",tmp->tm_year+1900);
else printf("%02d:%02d ",tmp->tm_hour,tmp->tm_min);
}
printf("%s\n",dirent[i]+2);
}
}
}
}
/*}}}*/
/* lsattr -- output something like e2fs lsattr */ /*{{{*/
static void lsattr(char **dirent, int entries, struct cpmInode *ino)
{
int i,user,announce,any;
struct cpmStat statbuf;
struct cpmInode file;
cpm_attr_t attrib;
qsort(dirent,entries,sizeof(char*),namecmp);
announce=0;
any=0;
for (user=0; user<32; ++user)
{
announce=0;
for (i=0; i<entries; ++i) if (dirent[i][0]!='.')
{
if (dirent[i][0]=='0'+user/10 && dirent[i][1]=='0'+user%10)
{
if (announce==0)
{
if (any) putchar('\n');
printf("%d:\n",user);
announce=1;
}
any=1;
cpmNamei(ino,dirent[i],&file);
cpmStat(&file,&statbuf);
cpmAttrGet(&file, &attrib);
putchar ((attrib & CPM_ATTR_F1) ? '1' : '-');
putchar ((attrib & CPM_ATTR_F2) ? '2' : '-');
putchar ((attrib & CPM_ATTR_F3) ? '3' : '-');
putchar ((attrib & CPM_ATTR_F4) ? '4' : '-');
putchar ((attrib & CPM_ATTR_SYS) ? 's' : '-');
putchar ((attrib & CPM_ATTR_ARCV) ? 'a' : '-');
putchar ((attrib & CPM_ATTR_PWREAD) ? 'r' : '-');
putchar ((attrib & CPM_ATTR_PWWRITE) ? 'w' : '-');
putchar ((attrib & CPM_ATTR_PWDEL) ? 'e' : '-');
printf(" %s\n",dirent[i]+2);
}
}
}
}
/*}}}*/
const char cmd[]="cpmls";
int main(int argc, char *argv[])
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,usage=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int style=0;
int changetime=0;
int inode=0;
char **gargv;
int gargc;
static char starlit[2]="*";
static char * const star[]={starlit};
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"cT:f:ih?dDFlA"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'h':
case '?': usage=1; break;
case 'd': style=1; break;
case 'D': style=2; break;
case 'F': style=3; break;
case 'l': style=4; break;
case 'A': style=5; break;
case 'c': changetime=1; break;
case 'i': inode=1; break;
}
if (optind==argc) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T libdsk-type] [-d|-D|-F|-A|[-l][-c][-i]] image [file ...]\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
if (optind<argc) cpmglob(optind,argc,argv,&root,&gargc,&gargv);
else cpmglob(0,1,star,&root,&gargc,&gargv);
if (style==1) olddir(gargv,gargc);
else if (style==2) oldddir(gargv,gargc,&root);
else if (style==3) old3dir(gargv,gargc,&root);
else if (style==5) lsattr(gargv, gargc, &root);
else ls(gargv,gargc,&root,style==4,changetime,inode);
exit(0);
}

BIN
branches/dwg/LSource/src/cpmtools-2.13/cpmrm

Binary file not shown.

53
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1

@ -0,0 +1,53 @@
.TH CPMRM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmrm \- remove files on CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmrm
.RB [ \-f
.IR format ]
.I image
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmrm\fP removes files from CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

53
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in

@ -0,0 +1,53 @@
.TH CPMRM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
cpmrm \- remove files on CP/M disks
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B cpmrm
.RB [ \-f
.IR format ]
.I image
.I file-pattern
\&...
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBcpmrm\fP removes files from CP/M disks.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR cpmls (1),
.IR cpm (5)
.\"}}}

72
branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c

@ -0,0 +1,72 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
const char cmd[]="cpmrm";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,i,usage=0,exitcode=0;
struct cpmSuperBlock drive;
struct cpmInode root;
int gargc;
char **gargv;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'T': devopts=optarg; break;
case 'f': format=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind>=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-T dsktype] image pattern ...\n",cmd);
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev, image, O_RDWR, devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
cpmglob(optind,argc,argv,&root,&gargc,&gargv);
for (i=0; i<gargc; ++i)
{
if (cpmUnlink(&root,gargv[i])==-1)
{
fprintf(stderr,"%s: can not erase %s: %s\n",cmd,gargv[i],boo);
exitcode=1;
}
}
cpmUmount(&drive);
exit(exitcode);
}
/*}}}*/

35
branches/dwg/LSource/src/cpmtools-2.13/device.h

@ -0,0 +1,35 @@
#ifndef DEVICE_H
#define DEVICE_H
#ifdef _WIN32
/* The type of device the file system is on: */
#define CPMDRV_FILE 0 /* Regular file or Unix block device */
#define CPMDRV_WIN95 1 /* Windows 95 floppy drive accessed via VWIN32 */
#define CPMDRV_WINNT 2 /* Windows NT floppy drive accessed via CreateFile */
#endif
struct Device
{
int opened;
int secLength;
int tracks;
int sectrk;
#if HAVE_LIBDSK_H
DSK_PDRIVER dev;
DSK_GEOMETRY geom;
#endif
#if HAVE_WINDOWS_H
int drvtype;
HANDLE hdisk;
#endif
int fd;
};
const char *Device_open(struct Device *self, const char *filename, int mode, const char *deviceOpts);
void Device_setGeometry(struct Device *self, int secLength, int sectrk, int tracks);
const char *Device_close(struct Device *self);
const char *Device_readSector(const struct Device *self, int track, int sector, char *buf);
const char *Device_writeSector(const struct Device *self, int track, int sector, const char *buf);
#endif

76
branches/dwg/LSource/src/cpmtools-2.13/device_libdsk.c

@ -0,0 +1,76 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "device.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *this, const char *filename, int mode, const char *deviceOpts)
{
dsk_err_t e = dsk_open(&this->dev, filename, deviceOpts, NULL);
this->opened = 0;
if (e) return dsk_strerror(e);
this->opened = 1;
dsk_getgeom(this->dev, &this->geom);
return NULL;
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
this->geom.dg_secsize = secLength;
this->geom.dg_sectors = sectrk;
/* Did the autoprobe guess right about the number of sectors & cylinders? */
if (this->geom.dg_cylinders * this->geom.dg_heads == tracks) return;
/* Otherwise we guess: <= 43 tracks: single-sided. Else double. This
* fails for 80-track single-sided if there are any such beasts */
if (tracks <= 43)
{
this->geom.dg_cylinders = tracks;
this->geom.dg_heads = 1;
}
else
{
this->geom.dg_cylinders = tracks/2;
this->geom.dg_heads = 2;
}
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *this)
{
dsk_err_t e;
this->opened=0;
e = dsk_close(&this->dev);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *this, int track, int sector, char *buf)
{
dsk_err_t e;
e = dsk_lread(this->dev, &this->geom, buf, (track * this->sectrk) + sector);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *this, int track, int sector, const char *buf)
{
dsk_err_t e;
e = dsk_lwrite(this->dev, &this->geom, buf, (track * this->sectrk) + sector);
return (e?dsk_strerror(e):(const char*)0);
}
/*}}}*/

77
branches/dwg/LSource/src/cpmtools-2.13/device_posix.c

@ -0,0 +1,77 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "device.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *this, const char *filename, int mode, const char *deviceOpts)
{
this->fd=open(filename,mode);
this->opened=(this->fd==-1?0:1);
return ((this->fd==-1)?strerror(errno):(const char*)0);
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *this)
{
this->opened=0;
return ((close(this->fd)==-1)?strerror(errno):(const char*)0);
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *this, int track, int sector, char *buf)
{
int res;
assert(sector>=0);
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength,SEEK_SET)==-1)
{
return strerror(errno);
}
if ((res=read(this->fd, buf, this->secLength)) != this->secLength)
{
if (res==-1)
{
return strerror(errno);
}
else memset(buf+res,0,this->secLength-res); /* hit end of disk image */
}
return (const char*)0;
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *this, int track, int sector, const char *buf)
{
assert(sector>=0);
assert(sector<this->sectrk);
assert(track>=0);
assert(track<this->tracks);
if (lseek(this->fd,(off_t)(sector+track*this->sectrk)*this->secLength, SEEK_SET)==-1)
{
return strerror(errno);
}
if (write(this->fd, buf, this->secLength) == this->secLength) return (const char*)0;
return strerror(errno);
}
/*}}}*/

658
branches/dwg/LSource/src/cpmtools-2.13/device_win32.c

@ -0,0 +1,658 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <errno.h>
#include <ctype.h>
#include <stdio.h>
#include "cpmdir.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* types */ /*{{{*/
#define PHYSICAL_SECTOR_1 1 /* First physical sector */
/* Use the INT13 interface rather than INT25/INT26. This appears to
* improve performance, but is less well tested. */
#define USE_INT13
/* Windows 95 disk I/O functions - based on Stan Mitchell's DISKDUMP.C */
#define VWIN32_DIOC_DOS_IOCTL 1 /* DOS ioctl calls 4400h-4411h */
#define VWIN32_DIOC_DOS_INT25 2 /* absolute disk read, DOS int 25h */
#define VWIN32_DIOC_DOS_INT26 3 /* absolute disk write, DOS int 26h */
#define VWIN32_DIOC_DOS_INT13 4 /* BIOS INT13 functions */
typedef struct _DIOC_REGISTERS {
DWORD reg_EBX;
DWORD reg_EDX;
DWORD reg_ECX;
DWORD reg_EAX;
DWORD reg_EDI;
DWORD reg_ESI;
DWORD reg_Flags;
}
DIOC_REGISTERS, *PDIOC_REGISTERS;
#define LEVEL0_LOCK 0
#define LEVEL1_LOCK 1
#define LEVEL2_LOCK 2
#define LEVEL3_LOCK 3
#define LEVEL1_LOCK_MAX_PERMISSION 0x0001
#define DRIVE_IS_REMOTE 0x1000
#define DRIVE_IS_SUBST 0x8000
/*********************************************************
**** Note: all MS-DOS data structures must be packed ****
**** on a one-byte boundary. ****
*********************************************************/
#pragma pack(1)
typedef struct _DISKIO {
DWORD diStartSector; /* sector number to start at */
WORD diSectors; /* number of sectors */
DWORD diBuffer; /* address of buffer */
}
DISKIO, *PDISKIO;
typedef struct MID {
WORD midInfoLevel; /* information level, must be 0 */
DWORD midSerialNum; /* serial number for the medium */
char midVolLabel[11]; /* volume label for the medium */
char midFileSysType[8]; /* type of file system as 8-byte ASCII */
}
MID, *PMID;
typedef struct driveparams { /* Disk geometry */
BYTE special;
BYTE devicetype;
WORD deviceattrs;
WORD cylinders;
BYTE mediatype;
/* BPB starts here */
WORD bytespersector;
BYTE sectorspercluster;
WORD reservedsectors;
BYTE numberofFATs;
WORD rootdirsize;
WORD totalsectors;
BYTE mediaid;
WORD sectorsperfat;
WORD sectorspertrack;
WORD heads;
DWORD hiddensectors;
DWORD bigtotalsectors;
BYTE reserved[6];
/* BPB ends here */
WORD sectorcount;
WORD sectortable[80];
} DRIVEPARAMS, *PDRIVEPARAMS;
/*}}}*/
static char *strwin32error(void) /*{{{*/
{
static char buffer[1024];
FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), /* Default language */
(LPTSTR)buffer,
1023, NULL);
return buffer;
}
/*}}}*/
static BOOL LockVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_LOCK_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static BOOL UnlockVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_UNLOCK_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static BOOL DismountVolume( HANDLE hDisk ) /*{{{*/
{
DWORD ReturnedByteCount;
return DeviceIoControl( hDisk, FSCTL_DISMOUNT_VOLUME, NULL, 0, NULL,
0, &ReturnedByteCount, NULL );
}
/*}}}*/
static int GetDriveParams( HANDLE hVWin32Device, int volume, DRIVEPARAMS* pParam ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0860; /* Get Device params */
reg.reg_EDX = (DWORD)pParam;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int SetDriveParams( HANDLE hVWin32Device, int volume, DRIVEPARAMS* pParam ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0840; /* Set Device params */
reg.reg_EDX = (DWORD)pParam;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int GetMediaID( HANDLE hVWin32Device, int volume, MID* pMid ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* IOCTL for block device */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_ECX = 0x0866; /* Get Media ID */
reg.reg_EDX = (DWORD)pMid;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int VolumeCheck(HANDLE hVWin32Device, int volume, WORD* flags ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x4409; /* Is Drive Remote */
reg.reg_EBX = volume; /* one-based drive number */
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
*flags = (WORD)(reg.reg_EDX & 0xffff);
return 0;
}
/*}}}*/
static int LockLogicalVolume(HANDLE hVWin32Device, int volume, int lock_level, int permissions) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d; /* generic IOCTL */
reg.reg_ECX = 0x084a; /* lock logical volume */
reg.reg_EBX = volume | (lock_level << 8);
reg.reg_EDX = permissions;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) )
return (reg.reg_EAX & 0xffff);
return 0;
}
/*}}}*/
static int UnlockLogicalVolume( HANDLE hVWin32Device, int volume ) /*{{{*/
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
reg.reg_EAX = 0x440d;
reg.reg_ECX = 0x086a; /* lock logical volume */
reg.reg_EBX = volume;
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( hVWin32Device, VWIN32_DIOC_DOS_IOCTL,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
if ( !bResult || (reg.reg_Flags & 1) ) return -1;
return 0;
}
/*}}}*/
static int w32mode(int mode) /*{{{*/
{
switch(mode)
{
case O_RDONLY: return GENERIC_READ;
case O_WRONLY: return GENERIC_WRITE;
}
return GENERIC_READ | GENERIC_WRITE;
}
/*}}}*/
/* Device_open -- Open an image file */ /*{{{*/
const char *Device_open(struct Device *sb, const char *filename, int mode, const char *deviceOpts)
{
/* Windows 95/NT: floppy drives using handles */
if (strlen(filename) == 2 && filename[1] == ':') /* Drive name */
{
char vname[20];
DWORD dwVers;
sb->fd = -1;
dwVers = GetVersion();
if (dwVers & 0x80000000L) /* Win32s (3.1) or Win32c (Win95) */
{
int lock, driveno, res, permissions;
unsigned short drive_flags;
MID media;
vname[0] = toupper(filename[0]);
driveno = vname[0] - 'A' + 1; /* 1=A: 2=B: */
sb->drvtype = CPMDRV_WIN95;
sb->hdisk = CreateFile( "\\\\.\\vwin32",
0,
0,
NULL,
0,
FILE_FLAG_DELETE_ON_CLOSE,
NULL );
if (!sb->hdisk)
{
return "Failed to open VWIN32 driver.";
}
if (VolumeCheck(sb->hdisk, driveno, &drive_flags))
{
CloseHandle(sb->hdisk);
return "Invalid drive";
}
res = GetMediaID( sb->hdisk, driveno, &media );
if ( res )
{
const char *lboo = NULL;
if ( res == ERROR_INVALID_FUNCTION &&
(drive_flags & DRIVE_IS_REMOTE ))
lboo = "Network drive";
else if (res == ERROR_ACCESS_DENIED) lboo = "Access denied";
/* nb: It's perfectly legitimate for GetMediaID() to fail; most CP/M */
/* CP/M disks won't have a media ID. */
if (lboo != NULL)
{
CloseHandle(sb->hdisk);
return lboo;
}
}
if (!res &&
(!memcmp( media.midFileSysType, "CDROM", 5 ) ||
!memcmp( media.midFileSysType, "CD001", 5 ) ||
!memcmp( media.midFileSysType, "CDAUDIO", 5 )))
{
CloseHandle(sb->hdisk);
return "CD-ROM drive";
}
if (w32mode(mode) & GENERIC_WRITE)
{
lock = LEVEL0_LOCK; /* Exclusive access */
permissions = 0;
}
else
{
lock = LEVEL1_LOCK; /* Allow other processes access */
permissions = LEVEL1_LOCK_MAX_PERMISSION;
}
if (LockLogicalVolume( sb->hdisk, driveno, lock, permissions))
{
CloseHandle(sb->hdisk);
return "Could not acquire a lock on the drive.";
}
sb->fd = driveno; /* 1=A: 2=B: etc - we will need this later */
}
else
{
sprintf(vname, "\\\\.\\%s", filename);
sb->drvtype = CPMDRV_WINNT;
sb->hdisk = CreateFile(vname, /* Name */
w32mode(mode), /* Access mode */
FILE_SHARE_READ|FILE_SHARE_WRITE, /*Sharing*/
NULL, /* Security attributes */
OPEN_EXISTING, /* See MSDN */
0, /* Flags & attributes */
NULL); /* Template file */
if (sb->hdisk != INVALID_HANDLE_VALUE)
{
sb->fd = 1; /* Arbitrary value >0 */
if (LockVolume(sb->hdisk) == FALSE) /* Lock drive */
{
char *lboo = strwin32error();
CloseHandle(sb->hdisk);
sb->fd = -1;
return lboo;
}
}
else return strwin32error();
}
sb->opened = 1;
return NULL;
}
/* Not a floppy. Treat it as a normal file */
mode |= O_BINARY;
sb->fd = open(filename, mode);
if (sb->fd == -1) return strerror(errno);
sb->drvtype = CPMDRV_FILE;
sb->opened = 1;
return NULL;
}
/*}}}*/
/* Device_setGeometry -- Set disk geometry */ /*{{{*/
void Device_setGeometry(struct Device *this, int secLength, int sectrk, int tracks)
{
int n;
this->secLength=secLength;
this->sectrk=sectrk;
this->tracks=tracks;
if (this->drvtype == CPMDRV_WIN95)
{
DRIVEPARAMS drvp;
memset(&drvp, 0, sizeof(drvp));
if (GetDriveParams( this->hdisk, this->fd, &drvp )) return;
drvp.bytespersector = secLength;
drvp.sectorspertrack = sectrk;
drvp.totalsectors = sectrk * tracks;
/* Guess the cylinder/head configuration from the track count. This will
* get single-sided 80-track discs wrong, but it's that or double-sided
* 40-track (or add cylinder/head counts to diskdefs)
*/
if (tracks < 44)
{
drvp.cylinders = tracks;
drvp.heads = 1;
}
else
{
drvp.cylinders = tracks / 2;
drvp.heads = 2;
}
/* Set up "reasonable" values for the other members */
drvp.sectorspercluster = 1024 / secLength;
drvp.reservedsectors = 1;
drvp.numberofFATs = 2;
drvp.sectorcount = sectrk;
drvp.rootdirsize = 64;
drvp.mediaid = 0xF0;
drvp.hiddensectors = 0;
drvp.sectorsperfat = 3;
for (n = 0; n < sectrk; n++)
{
drvp.sectortable[n*2] = n + PHYSICAL_SECTOR_1; /* Physical sector numbers */
drvp.sectortable[n*2+1] = secLength;
}
drvp.special = 6;
/* We have not set:
drvp.mediatype
drvp.devicetype
drvp.deviceattrs
which should have been read correctly by GetDriveParams().
*/
SetDriveParams( this->hdisk, this->fd, &drvp );
}
}
/*}}}*/
/* Device_close -- Close an image file */ /*{{{*/
const char *Device_close(struct Device *sb)
{
sb->opened = 0;
switch(sb->drvtype)
{
case CPMDRV_WIN95:
UnlockLogicalVolume(sb->hdisk, sb->fd );
if (!CloseHandle( sb->hdisk )) return strwin32error();
return NULL;
case CPMDRV_WINNT:
DismountVolume(sb->hdisk);
UnlockVolume(sb->hdisk);
if (!CloseHandle(sb->hdisk)) return strwin32error();
return NULL;
}
if (close(sb->fd)) return strerror(errno);
return NULL;
}
/*}}}*/
/* Device_readSector -- read a physical sector */ /*{{{*/
const char *Device_readSector(const struct Device *drive, int track, int sector, char *buf)
{
int res;
off_t offset;
assert(sector>=0);
assert(sector<drive->sectrk);
assert(track>=0);
assert(track<drive->tracks);
offset = ((sector+track*drive->sectrk)*drive->secLength);
if (drive->drvtype == CPMDRV_WINNT)
{
LPVOID iobuffer;
DWORD bytesread;
if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
iobuffer = VirtualAlloc(NULL, drive->secLength, MEM_COMMIT, PAGE_READWRITE);
if (!iobuffer)
{
return strwin32error();
}
res = ReadFile(drive->hdisk, iobuffer, drive->secLength, &bytesread, NULL);
if (!res)
{
char *lboo = strwin32error();
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return lboo;
}
memcpy(buf, iobuffer, drive->secLength);
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
if (bytesread < (unsigned)drive->secLength)
{
memset(buf + bytesread, 0, drive->secLength - bytesread);
}
return NULL;
}
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
#ifdef USE_INT13
int cyl, head;
if (drive->tracks < 44) { cyl = track; head = 0; }
else { cyl = track/2; head = track & 1; }
reg.reg_EAX = 0x0201; /* Read 1 sector */
reg.reg_EBX = (DWORD)buf;
reg.reg_ECX = (cyl << 8) | (sector + PHYSICAL_SECTOR_1);
reg.reg_EDX = (head << 8) | (drive->fd - 1);
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT13,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#else
DISKIO di;
reg.reg_EAX = drive->fd - 1; /* zero-based volume number */
reg.reg_EBX = (DWORD)&di;
reg.reg_ECX = 0xffff; /* use DISKIO structure */
reg.reg_Flags = 1; /* preset the carry flag */
di.diStartSector = sector+track*drive->sectrk;
di.diSectors = 1;
di.diBuffer = (DWORD)buf;
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT25,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#endif
if ( !bResult || (reg.reg_Flags & 1) )
{
if (GetLastError()) return strwin32error();
return "Unknown read error.";
}
return 0;
}
if (lseek(drive->fd,offset,SEEK_SET)==-1)
{
return strerror(errno);
}
if ((res=read(drive->fd, buf, drive->secLength)) != drive->secLength)
{
if (res==-1)
{
return strerror(errno);
}
else memset(buf+res,0,drive->secLength-res); /* hit end of disk image */
}
return NULL;
}
/*}}}*/
/* Device_writeSector -- write physical sector */ /*{{{*/
const char *Device_writeSector(const struct Device *drive, int track, int sector, const char *buf)
{
off_t offset;
int res;
assert(sector>=0);
assert(sector<drive->sectrk);
assert(track>=0);
assert(track<drive->tracks);
offset = ((sector+track*drive->sectrk)*drive->secLength);
if (drive->drvtype == CPMDRV_WINNT)
{
LPVOID iobuffer;
DWORD byteswritten;
if (SetFilePointer(drive->hdisk, offset, NULL, FILE_BEGIN) == INVALID_FILE_SIZE)
{
return strwin32error();
}
iobuffer = VirtualAlloc(NULL, drive->secLength, MEM_COMMIT, PAGE_READWRITE);
if (!iobuffer)
{
return strwin32error();
}
memcpy(iobuffer, buf, drive->secLength);
res = WriteFile(drive->hdisk, iobuffer, drive->secLength, &byteswritten, NULL);
if (!res || (byteswritten < (unsigned)drive->secLength))
{
char *lboo = strwin32error();
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return lboo;
}
VirtualFree(iobuffer, drive->secLength, MEM_RELEASE);
return NULL;
}
if (drive->drvtype == CPMDRV_WIN95)
{
DIOC_REGISTERS reg;
BOOL bResult;
DWORD cb;
#ifdef USE_INT13
int cyl, head;
if (drive->tracks < 44) { cyl = track; head = 0; }
else { cyl = track/2; head = track & 1; }
reg.reg_EAX = 0x0301; /* Write 1 sector */
reg.reg_EBX = (DWORD)buf;
reg.reg_ECX = (cyl << 8) | (sector + PHYSICAL_SECTOR_1);
reg.reg_EDX = (head << 8) | (drive->fd - 1);
reg.reg_Flags = 1; /* preset the carry flag */
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT13,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#else
DISKIO di;
reg.reg_EAX = drive->fd - 1; /* zero-based volume number */
reg.reg_EBX = (DWORD)&di;
reg.reg_ECX = 0xffff; /* use DISKIO structure */
reg.reg_Flags = 1; /* preset the carry flag */
di.diStartSector = sector+track*drive->sectrk;
di.diSectors = 1;
di.diBuffer = (DWORD)buf;
bResult = DeviceIoControl( drive->hdisk, VWIN32_DIOC_DOS_INT26,
&reg, sizeof( reg ), &reg, sizeof( reg ), &cb, 0 );
#endif
if ( !bResult || (reg.reg_Flags & 1) )
{
if (GetLastError()) return strwin32error();
return "Unknown write error.";
}
return NULL;
}
if (lseek(drive->fd,offset, SEEK_SET)==-1)
{
return strerror(errno);
}
if (write(drive->fd, buf, drive->secLength) == drive->secLength) return NULL;
return strerror(errno);
}
/*}}}*/

376
branches/dwg/LSource/src/cpmtools-2.13/diskdefs

@ -0,0 +1,376 @@
diskdef ibm-3740
seclen 128
tracks 77
sectrk 26
blocksize 1024
maxdir 64
skew 6
boottrk 2
os p2dos
end
diskdef 4mb-hd
seclen 128
tracks 1024
sectrk 32
blocksize 2048
maxdir 256
skew 1
boottrk 0
os p2dos
end
diskdef pcw
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 1
os 3
end
diskdef pc1.2m
seclen 512
tracks 80
# this format uses 15 sectors per track, but 30 per cylinder
sectrk 30
blocksize 4096
maxdir 256
skew 1
boottrk 0
os 3
end
# CP/M 86 on 1.44MB floppies
diskdef cpm86-144feat
seclen 512
tracks 160
sectrk 18
blocksize 4096
maxdir 256
skew 1
boottrk 2
os 3
end
diskdef cf2dd
seclen 512
tracks 160
sectrk 9
blocksize 2048
maxdir 256
skew 1
boottrk 1
os 3
end
#amstrad: values are read from super block (special name hardcoded)
# Royal alphatronic
# setfdprm /dev/fd1 dd ssize=256 cyl=40 sect=16 head=2
diskdef alpha
seclen 256
tracks 40
sectrk 32
blocksize 2048
maxdir 128
skew 1
boottrk 2
os 2.2
end
# Apple II CP/M skew o Apple II DOS 3.3 skew
diskdef apple-do
seclen 256
tracks 35
sectrk 16
blocksize 1024
maxdir 64
skewtab 0,6,12,3,9,15,14,5,11,2,8,7,13,4,10,1
boottrk 3
os 2.2
end
# Apple II CP/M skew o Apple II PRODOS skew
diskdef apple-po
seclen 256
tracks 35
sectrk 16
blocksize 1024
maxdir 64
skewtab 0,9,3,12,6,15,1,10,4,13,7,8,2,11,5,14
boottrk 3
os 2.2
end
# MYZ80 hard drive (only works with libdsk, because it has a 256-byte header)
diskdef myz80
seclen 1024
tracks 64
sectrk 128
blocksize 4096
maxdir 1024
skew 1
boottrk 0
os 3
end
# Despite being Amstrad formats, CPC System and CPC Data don't have an Amstrad
# superblock. You'll need to use libdsk to access them because the Linux
# and Windows kernel drivers won't touch them.
diskdef cpcsys
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 2
os 3
end
diskdef cpcdata
seclen 512
tracks 40
sectrk 9
blocksize 1024
maxdir 64
skew 1
boottrk 0
os 3
end
# after being read in with no sector skew.
diskdef nigdos
seclen 512
# NigDos double sided disk format, 42 tracks * 2 sides
tracks 84
sectrk 10
blocksize 2048
maxdir 128
skew 1
boottrk 0
# this format wastes half of the directory entry
logicalextents 1
os 3
end
diskdef epsqx10
seclen 512
tracks 40
sectrk 20
blocksize 2048
maxdir 128
skew 0
boottrk 2
os 2.2
end
diskdef ibm-8ss
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 0
boottrk 1
os 2.2
end
diskdef ibm-8ds
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 0
boottrk 1
os 2.2
end
diskdef electroglas
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 256
skew 0
boottrk 1
os 3
end
# IBM CP/M-86
# setfdprm /dev/fd1 sect=8 dtr=1 hd ssize=512 tpi=48 head=1
diskdef ibmpc-514ss
seclen 512
tracks 40
sectrk 8
blocksize 1024
maxdir 64
skew 1
boottrk 1
os 2.2
end
# IBM CP/M-86
# setfdprm /dev/fd1 sect=8 dtr=1 hd ssize=512 tpi=48
diskdef ibmpc-514ds
seclen 512
tracks 80
sectrk 8
blocksize 2048
maxdir 64
skew 0
boottrk 2
os 2.2
end
diskdef p112
seclen 512
tracks 160
sectrk 18
blocksize 2048
maxdir 256
skew 1
boottrk 2
os 3
end
diskdef p112-old
seclen 512
tracks 160
sectrk 18
blocksize 2048
maxdir 128
skew 1
boottrk 1
os 3
end
diskdef kpii
seclen 512
tracks 40
sectrk 10
blocksize 1024
maxdir 32
skew 0
boottrk 1
os 2.2
end
# setfdprm /dev/fd0 dd sect=10
diskdef interak
seclen 512
tracks 80
sectrk 20
blocksize 4096
maxdir 256
skew 1
boottrk 2
os 2.2
end
# Timex FDD3000 3"
diskdef fdd3000
seclen 256
tracks 40
sectrk 16
blocksize 1024
maxdir 128
boottrk 4
os 2.2
skew 7
end
# Timex FDD3000 3"
diskdef fdd3000_2
seclen 256
tracks 40
sectrk 16
blocksize 1024
maxdir 128
boottrk 2
os 2.2
skew 5
end
# Robotron 1715
diskdef 1715
seclen 1024
tracks 40
sectrk 5
blocksize 1024
maxdir 64
skew 0
boottrk 3
os 2.2
end
# Robotron 1715 with SCP3
diskdef 17153
seclen 1024
tracks 160
sectrk 5
blocksize 2048
maxdir 128
skew 0
boottrk 4
os 3
end
# Visual Technology Visual 1050 computer
diskdef v1050
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skew 0
boottrk 2
os 3
end
# Microbee 40 track 5.25" disks
diskdef microbee40
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef dreamdisk40
seclen 512
tracks 80
sectrk 10
blocksize 2048
maxdir 128
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef dreamdisk80
seclen 512
tracks 160
sectrk 10
blocksize 2048
maxdir 256
skewtab 1,4,7,0,3,6,9,2,5,8
boottrk 2
os 2.2
end
diskdef rc759
seclen 1024
tracks 160
sectrk 8
blocksize 2048
maxdir 512
boottrk 4
os 3
end

BIN
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm

Binary file not shown.

74
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1

@ -0,0 +1,74 @@
.TH FSCK.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsck.cpm \- check a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsck.cpm
.RB [ \-f
.IR format ]
.RB [ \-n ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsck.cpm\fP is used to check and repair a CP/M file system. After
reading the directory, it makes two passes. The first pass checks extent
fields for range and format violations (bad status, extent number, last
record byte count, file name, extension, block number, record count,
size of \&.COM files, time stamp format, invalid password characters,
invalid time stamp mode). The second pass checks extent connectivity
(multiple allocated blocks and duplicate directory entries).
.P
\fBfsck.cpm\fP can not yet repair all errors.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH DIAGNOSTICS .\"{{{
.IP "\fIimage\fP: \fIused\fP/\fItotal\fP files (\fIn\fP.\fIn\fP% non-contiguos), \fIused\fP/\fItotal\fP blocks"
No inconsistencies could be found. The number of used files actually
is the number of used extents. Since a file may use more than
one extent, this may be greather than the actual number of files, but a
correct measure would not reflect how many files could still be created
at most. A file is considered fragmented, if sequential data blocks
pointed to by the same extent do not have sequential block numbers.
The number of used blocks includes the blocks used for system tracks
and the directory.
.\"}}}
.SH AUTHORS .\"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck (8),
.IR mkfs.cpm (1),
.IR cpm (5)
.\"}}}

74
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in

@ -0,0 +1,74 @@
.TH FSCK.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsck.cpm \- check a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsck.cpm
.RB [ \-f
.IR format ]
.RB [ \-n ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsck.cpm\fP is used to check and repair a CP/M file system. After
reading the directory, it makes two passes. The first pass checks extent
fields for range and format violations (bad status, extent number, last
record byte count, file name, extension, block number, record count,
size of \&.COM files, time stamp format, invalid password characters,
invalid time stamp mode). The second pass checks extent connectivity
(multiple allocated blocks and duplicate directory entries).
.P
\fBfsck.cpm\fP can not yet repair all errors.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-n\fP"
Open the file system read-only and do not repair any errors.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH DIAGNOSTICS .\"{{{
.IP "\fIimage\fP: \fIused\fP/\fItotal\fP files (\fIn\fP.\fIn\fP% non-contiguos), \fIused\fP/\fItotal\fP blocks"
No inconsistencies could be found. The number of used files actually
is the number of used extents. Since a file may use more than
one extent, this may be greather than the actual number of files, but a
correct measure would not reflect how many files could still be created
at most. A file is considered fragmented, if sequential data blocks
pointed to by the same extent do not have sequential block numbers.
The number of used blocks includes the blocks used for system tracks
and the directory.
.\"}}}
.SH AUTHORS .\"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck (8),
.IR mkfs.cpm (1),
.IR cpm (5)
.\"}}}

627
branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c

@ -0,0 +1,627 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "getopt_.h"
#include "cpmdir.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* #defines */ /*{{{*/
/* your favourite password *:-) */
#define T0 'G'
#define T1 'E'
#define T2 'H'
#define T3 'E'
#define T4 'I'
#define T5 'M'
#define T6 ' '
#define T7 ' '
#define PB ((char)(T0+T1+T2+T3+T4+T5+T6+T7))
#define P0 ((char)(T7^PB))
#define P1 ((char)(T6^PB))
#define P2 ((char)(T5^PB))
#define P3 ((char)(T4^PB))
#define P4 ((char)(T3^PB))
#define P5 ((char)(T2^PB))
#define P6 ((char)(T1^PB))
#define P7 ((char)(T0^PB))
/*}}}*/
/* types */ /*{{{*/
enum Result { OK=0, MODIFIED=1, BROKEN=2 };
/*}}}*/
/* variables */ /*{{{*/
static int norepair=0;
/*}}}*/
/* bcdCheck -- check format and range of BCD digit */ /*{{{*/
static int bcdCheck(int n, int max, const char *msg, const char *unit, int extent1, int extent2)
{
if (((n>>4)&0xf)>10 || (n&0xf)>10 || (((n>>4)&0xf)*10+(n&0xf))>=max)
{
printf("Error: Bad %s %s (extent=%d/%d, %s=%02x)\n",msg,unit,extent1,extent2,unit,n&0xff);
return -1;
}
else return 0;
}
/*}}}*/
/* pwdCheck -- check password */ /*{{{*/
static int pwdCheck(int extent, const char *pwd, char decode)
{
char c;
int i;
for (i=0; i<8; ++i) if ((c=((char)(pwd[7-i]^decode)))<' ' || c&0x80)
{
printf("Error: non-printable character in password (extent=%d, password=",extent);
for (i=0; i<8; ++i)
{
c=pwd[7-i]^decode;
if (c<' ' || c&0x80)
{
putchar('\\'); putchar('0'+((c>>6)&0x01));
putchar('0'+((c>>3)&0x03));
putchar('0'+(c&0x03));
}
else putchar(c);
}
printf(")\n");
return -1;
}
return 0;
}
/*}}}*/
/* ask -- ask user and return answer */ /*{{{*/
static int ask(const char *msg)
{
while (1)
{
char buf[80];
if (norepair) return 0;
printf("%s [Y]? ",msg); fflush(stdout);
if (fgets(buf,sizeof(buf),stdin)==(char*)0) exit(1);
switch (toupper(buf[0]))
{
case '\n':
case 'Y': return 1;
case 'N': return 0;
}
}
}
/*}}}*/
/* prfile -- print file name */ /*{{{*/
static char *prfile(struct cpmSuperBlock *sb, int extent)
{
struct PhysDirectoryEntry *dir;
static char name[80];
char *s=name;
int i;
char c;
dir=sb->dir+extent;
for (i=0; i<8; ++i)
{
c=dir->name[i];
if ((c&0x7f)<' ')
{
*s++='\\'; *s++=('0'+((c>>6)&0x01));
*s++=('0'+((c>>3)&0x03));
*s++=('0'+(c&0x03));
}
else *s++=(c&0x7f);
}
*s++='.';
for (i=0; i<3; ++i)
{
c=dir->ext[i];
if ((c&0x7f)<' ')
{
*s++='\\'; *s++=('0'+((c>>6)&0x01));
*s++=('0'+((c>>3)&0x03));
*s++=('0'+(c&0x03));
}
else *s++=(c&0x7f);
}
*s='\0';
return name;
}
/*}}}*/
/* fsck -- file system check */ /*{{{*/
static int fsck(struct cpmInode *root, const char *image)
{
/* variables */ /*{{{*/
enum Result ret=OK;
int extent,extent2;
struct PhysDirectoryEntry *dir,*dir2;
struct cpmSuperBlock *sb=root->sb;
/*}}}*/
/* Phase 1: check extent fields */ /*{{{*/
printf("Phase 1: check extent fields\n");
for (extent=0; extent<sb->maxdir; ++extent)
{
char *status;
int usedBlocks=0;
dir=sb->dir+extent;
status=&dir->status;
if (*status>=0 && *status<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* directory entry */ /*{{{*/
{
/* check name and extension */ /*{{{*/
{
int i;
char *c;
for (i=0; i<8; ++i)
{
c=&(dir->name[i]);
if (!ISFILECHAR(i,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
for (i=0; i<3; ++i)
{
c=&(dir->ext[i]);
if (!ISFILECHAR(1,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check extent number */ /*{{{*/
if ((dir->extnol&0xff)>0x1f)
{
printf("Error: Bad lower bits of extent number (extent=%d, name=\"%s\", low bits=%d)\n",extent,prfile(sb,extent),dir->extnol&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
if ((dir->extnoh&0xff)>0x3f)
{
printf("Error: Bad higher bits of extent number (extent=%d, name=\"%s\", high bits=%d)\n",extent,prfile(sb,extent),dir->extnoh&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
/*}}}*/
/* check last record byte count */ /*{{{*/
if ((dir->lrc&0xff)>128)
{
printf("Error: Bad last record byte count (extent=%d, name=\"%s\", lrc=%d)\n",extent,prfile(sb,extent),dir->lrc&0xff);
if (ask("Clear last record byte count"))
{
dir->lrc=(char)0;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
/*}}}*/
/* check block number range */ /*{{{*/
{
int block,min,max,i;
min=(sb->maxdir*32+sb->blksiz-1)/sb->blksiz;
max=sb->size;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
if (block>0)
{
++usedBlocks;
if (block<min || block>max)
{
printf("Error: Bad block number (extent=%d, name=\"%s\", block=%d)\n",extent,prfile(sb,extent),block);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check number of used blocks ? */ /*{{{*/
/*}}}*/
/* check record count */ /*{{{*/
{
int i,min,max,recordsInBlocks,used=0;
min=(dir->extnol%sb->extents)*16/sb->extents;
max=((dir->extnol%sb->extents)+1)*16/sb->extents;
assert(min<max);
for (i=min; i<max; ++i)
{
/* [JCE] Rewritten because the previous implementation didn't work
* properly with Visual C++ */
if (dir->pointers[i] || (sb->size>=256 && dir->pointers[i+1])) ++used;
if (sb->size >= 256) ++i;
}
recordsInBlocks=(((unsigned char)dir->blkcnt)*128+sb->blksiz-1)/sb->blksiz;
if (recordsInBlocks!=used)
{
printf("Error: Bad record count (extent=%d, name=\"%s\", record count=%d)\n",extent,prfile(sb,extent),dir->blkcnt&0xff);
if (ask("Remove file"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check for too large .com files */ /*{{{*/
if (((EXTENT(dir->extnol,dir->extnoh)==3 && dir->blkcnt>=126) || EXTENT(dir->extnol,dir->extnoh)>=4) && (dir->ext[0]&0x7f)=='C' && (dir->ext[1]&0x7f)=='O' && (dir->ext[2]&0x7f)=='M')
{
printf("Warning: Oversized .COM file (extent=%d, name=\"%s\")\n",extent,prfile(sb,extent));
}
/*}}}*/
}
/*}}}*/
else if ((sb->type==CPMFS_P2DOS || sb->type==CPMFS_DR3) && *status==33) /* check time stamps ? */ /*{{{*/
{
unsigned long created,modified;
char s;
if ((s=sb->dir[extent2=(extent&~3)].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for first of the three extents */ /*{{{*/
{
bcdCheck(dir->name[2],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->name[3],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->name[6],24,"modification date","hour",extent,extent2);
bcdCheck(dir->name[7],60,"modification date","minute",extent,extent2);
created=(dir->name[4]+(dir->name[1]<<8))*(0x60*0x60)+dir->name[2]*0x60+dir->name[3];
modified=(dir->name[0]+(dir->name[5]<<8))*(0x60*0x60)+dir->name[6]*0x60+dir->name[7];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
if ((s=sb->dir[extent2=(extent&~3)+1].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for second */ /*{{{*/
{
bcdCheck(dir->lrc,24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->extnoh,60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->pointers[1],24,"modification date","hour",extent,extent2);
bcdCheck(dir->pointers[2],60,"modification date","minute",extent,extent2);
created=(dir->ext[2]+(dir->extnol<<8))*(0x60*0x60)+dir->lrc*0x60+dir->extnoh;
modified=(dir->blkcnt+(dir->pointers[0]<<8))*(0x60*0x60)+dir->pointers[1]*0x60+dir->pointers[2];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
if ((s=sb->dir[extent2=(extent&~3)+2].status)>=0 && s<=(sb->type==CPMFS_P2DOS ? 31 : 15)) /* time stamps for third */ /*{{{*/
{
bcdCheck(dir->pointers[7],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent2);
bcdCheck(dir->pointers[8],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent2);
bcdCheck(dir->pointers[11],24,"modification date","hour",extent,extent2);
bcdCheck(dir->pointers[12],60,"modification date","minute",extent,extent2);
created=(dir->pointers[5]+(dir->pointers[6]<<8))*(0x60*0x60)+dir->pointers[7]*0x60+dir->pointers[8];
modified=(dir->pointers[9]+(dir->pointers[10]<<8))*(0x60*0x60)+dir->pointers[11]*0x60+dir->pointers[12];
if (sb->cnotatime && modified<created)
{
printf("Warning: Modification date earlier than creation date (extent=%d/%d)\n",extent,extent2);
}
}
/*}}}*/
}
/*}}}*/
else if (sb->type==CPMFS_DR3 && *status==32) /* disc label */ /*{{{*/
{
unsigned long created,modified;
bcdCheck(dir->pointers[10],24,sb->cnotatime ? "creation date" : "access date","hour",extent,extent);
bcdCheck(dir->pointers[11],60,sb->cnotatime ? "creation date" : "access date","minute",extent,extent);
bcdCheck(dir->pointers[14],24,"modification date","hour",extent,extent);
bcdCheck(dir->pointers[15],60,"modification date","minute",extent,extent);
created=(dir->pointers[8]+(dir->pointers[9]<<8))*(0x60*0x60)+dir->pointers[10]*0x60+dir->pointers[11];
modified=(dir->pointers[12]+(dir->pointers[13]<<8))*(0x60*0x60)+dir->pointers[14]*0x60+dir->pointers[15];
if (sb->cnotatime && modified<created)
{
printf("Warning: Label modification date earlier than creation date (extent=%d)\n",extent);
}
if (dir->extnol&0x40 && dir->extnol&0x10)
{
printf("Error: Bit 4 and 6 can only be exclusively be set (extent=%d, label byte=0x%02x)\n",extent,(unsigned char)dir->extnol);
if (ask("Time stamp on creation"))
{
dir->extnol&=~0x40;
ret|=MODIFIED;
}
else if (ask("Time stamp on access"))
{
dir->extnol&=~0x10;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
if (dir->extnol&0x80 && pwdCheck(extent,dir->pointers,dir->lrc))
{
char msg[80];
sprintf(msg,"Set password to %c%c%c%c%c%c%c%c",T0,T1,T2,T3,T4,T5,T6,T7);
if (ask(msg))
{
dir->pointers[0]=P0;
dir->pointers[1]=P1;
dir->pointers[2]=P2;
dir->pointers[3]=P3;
dir->pointers[4]=P4;
dir->pointers[5]=P5;
dir->pointers[6]=P6;
dir->pointers[7]=P7;
dir->lrc=PB;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
}
/*}}}*/
else if (sb->type==CPMFS_DR3 && *status>=16 && *status<=31) /* password */ /*{{{*/
{
/* check name and extension */ /*{{{*/
{
int i;
char *c;
for (i=0; i<8; ++i)
{
c=&(dir->name[i]);
if (!ISFILECHAR(i,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Clear password entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
for (i=0; i<3; ++i)
{
c=&(dir->ext[i]);
if (!ISFILECHAR(1,*c&0x7f) || islower(*c&0x7f))
{
printf("Error: Bad name (extent=%d, name=\"%s\", position=%d)\n",extent,prfile(sb,extent),i);
if (ask("Clear password entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
break;
}
else ret|=BROKEN;
}
}
if (*status==(char)0xe5) continue;
}
/*}}}*/
/* check password */ /*{{{*/
if (dir->extnol&(0x80|0x40|0x20) && pwdCheck(extent,dir->pointers,dir->lrc))
{
char msg[80];
sprintf(msg,"Set password to %c%c%c%c%c%c%c%c",T0,T1,T2,T3,T4,T5,T6,T7);
if (ask(msg))
{
dir->pointers[0]=P0;
dir->pointers[1]=P1;
dir->pointers[2]=P2;
dir->pointers[3]=P3;
dir->pointers[4]=P4;
dir->pointers[5]=P5;
dir->pointers[6]=P6;
dir->pointers[7]=P7;
dir->lrc=PB;
ret|=MODIFIED;
}
else ret|=BROKEN;
}
/*}}}*/
}
/*}}}*/
else if (*status!=(char)0xe5) /* bad status */ /*{{{*/
{
printf("Error: Bad status (extent=%d, name=\"%s\", status=0x%02x)\n",extent,prfile(sb,extent),*status&0xff);
if (ask("Clear entry"))
{
*status=(char)0xE5;
ret|=MODIFIED;
}
else ret|=BROKEN;
continue;
}
/*}}}*/
}
/*}}}*/
/* Phase 2: check extent connectivity */ /*{{{*/
printf("Phase 2: check extent connectivity\n");
/* check multiple allocated blocks */ /*{{{*/
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
int i,j,block,block2;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
for (extent2=0; extent2<sb->maxdir; ++extent2) if ((dir2=sb->dir+extent2)->status>=0 && dir2->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (j=0; j<16; ++j)
{
block2=dir2->pointers[j]&0xff;
if (sb->size>=256) block2+=(dir2->pointers[++j]&0xff)<<8;
if (block!=0 && block2!=0 && block==block2 && !(extent==extent2 && i==j))
{
printf("Error: Multiple allocated block (extent=%d,%d, name=\"%s\"",extent,extent2,prfile(sb,extent));
printf(",\"%s\" block=%d)\n",prfile(sb,extent2),block);
ret|=BROKEN;
}
}
}
}
}
/*}}}*/
/* check multiple extents */ /*{{{*/
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (extent2=0; extent2<sb->maxdir; ++extent2) if ((dir2=sb->dir+extent2)->status>=0 && dir2->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
if (extent!=extent2 && EXTENT(dir->extnol,dir->extnoh)==EXTENT(dir2->extnol,dir2->extnoh) && dir->status==dir2->status)
{
int i;
for (i=0; i<8 && (dir->name[i]&0x7f)==(dir2->name[i]&0x7f); ++i);
if (i==8)
{
for (i=0; i<3 && (dir->ext[i]&0x7f)==(dir2->ext[i]&0x7f); ++i);
if (i==3)
{
printf("Error: Duplicate extent (extent=%d,%d)\n",extent,extent2);
ret|=BROKEN;
}
}
}
}
}
/*}}}*/
/*}}}*/
if (ret==0) /* print statistics */ /*{{{*/
{
struct cpmStatFS statfsbuf;
int fragmented=0,borders=0;
cpmStatFS(root,&statfsbuf);
for (extent=0; extent<sb->maxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
int i,block,previous=-1;
for (i=0; i<16; ++i)
{
block=dir->pointers[i]&0xff;
if (sb->size>=256) block+=(dir->pointers[++i]&0xff)<<8;
if (previous!=-1)
{
if (block!=0 && block!=(previous+1)) ++fragmented;
++borders;
}
previous=block;
}
}
fragmented=(borders ? (1000*fragmented)/borders : 0);
printf("%s: %ld/%ld files (%d.%d%% non-contigous), %ld/%ld blocks\n",image,statfsbuf.f_files-statfsbuf.f_ffree,statfsbuf.f_files,fragmented/10,fragmented%10,statfsbuf.f_blocks-statfsbuf.f_bfree,statfsbuf.f_blocks);
}
/*}}}*/
return ret;
}
/*}}}*/
const char cmd[]="fsck.cpm";
/* main */ /*{{{*/
int main(int argc, char *argv[])
{
const char *err;
const char *image;
const char *format=FORMAT;
const char *devopts=NULL;
int c,usage=0;
struct cpmSuperBlock sb;
struct cpmInode root;
enum Result ret;
while ((c=getopt(argc,argv,"T:f:nh?"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'n': norepair=1; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-n] image\n",cmd);
exit(1);
}
if ((err=Device_open(&sb.dev, image, (norepair ? O_RDONLY : O_RDWR), devopts)))
{
if ((err=Device_open(&sb.dev, image,O_RDONLY, devopts)))
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,image,err);
exit(1);
}
else
{
fprintf(stderr,"%s: can not open %s for writing, no repair possible\n",cmd,image);
}
}
cpmReadSuper(&sb,&root,format);
ret=fsck(&root,image);
if (ret&MODIFIED)
{
if (cpmSync(&sb)==-1)
{
fprintf(stderr,"%s: write error on %s: %s\n",cmd,image,strerror(errno));
ret|=BROKEN;
}
fprintf(stderr,"%s: FILE SYSTEM ON %s MODIFIED",cmd,image);
if (ret&BROKEN) fprintf(stderr,", PLEASE CHECK AGAIN");
fprintf(stderr,"\n");
}
cpmUmount(&sb);
if (ret&BROKEN) return 2;
else return 0;
}
/*}}}*/

BIN
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm

Binary file not shown.

56
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1

@ -0,0 +1,56 @@
.TH FSED.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsed.cpm \- edit a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsed.cpm
.RB [ \-f
.IR format ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsed.cpm\fP edits a CP/M file system on an image file or device.
It knows about the system, directory and data area, using sector skew on
the last two. Directory entries are decoded. The interactive usage is
self-explanatory.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck.cpm (1),
.IR mkfs.cpm (1),
.IR cpmls (1),
.IR cpm (5)
.\"}}}

56
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in

@ -0,0 +1,56 @@
.TH FSED.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME ..\"{{{roff}}}\"{{{
fsed.cpm \- edit a CP/M file system
.\"}}}
.SH SYNOPSIS .\"{{{
.ad l
.B fsed.cpm
.RB [ \-f
.IR format ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION .\"{{{
\fBfsed.cpm\fP edits a CP/M file system on an image file or device.
It knows about the system, directory and data area, using sector skew on
the last two. Directory entries are decoded. The interactive usage is
self-explanatory.
.\"}}}
.SH OPTIONS .\"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.\"}}}
.SH "RETURN VALUE" .\"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS .\"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES .\"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" .\"{{{
.IR fsck.cpm (1),
.IR mkfs.cpm (1),
.IR cpmls (1),
.IR cpm (5)
.\"}}}

732
branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c

@ -0,0 +1,732 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <assert.h>
#include <ctype.h>
#include <curses.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
extern char **environ;
static char *mapbuf;
static struct tm *cpmtime(char lday, char hday, char hour, char min) /*{{{*/
{
static struct tm tm;
unsigned long days=(lday&0xff)|((hday&0xff)<<8);
int d;
int md[12]={31,0,31,30,31,30,31,31,30,31,30,31};
tm.tm_sec=0;
tm.tm_min=((min>>4)&0xf)*10+(min&0xf);
tm.tm_hour=((hour>>4)&0xf)*10+(hour&0xf);
tm.tm_mon=0;
tm.tm_year=1978;
tm.tm_isdst=-1;
if (days) --days;
while (days>=(d=(((tm.tm_year%400)==0 || ((tm.tm_year%4)==0 && (tm.tm_year%100))) ? 366 : 365)))
{
days-=d;
++tm.tm_year;
}
md[1]=((tm.tm_year%400)==0 || ((tm.tm_year%4)==0 && (tm.tm_year%100))) ? 29 : 28;
while (days>=md[tm.tm_mon])
{
days-=md[tm.tm_mon];
++tm.tm_mon;
}
tm.tm_mday=days+1;
tm.tm_year-=1900;
return &tm;
}
/*}}}*/
static void info(struct cpmSuperBlock *sb, const char *format, const char *image) /*{{{*/
{
const char *msg;
clear();
msg="File system characteristics";
move(0,(COLS-strlen(msg))/2); printw(msg);
move(2,0); printw(" Image: %s",image);
move(3,0); printw(" Format: %s",format);
move(4,0); printw(" File system: ");
switch (sb->type)
{
case CPMFS_DR22: printw("CP/M 2.2"); break;
case CPMFS_P2DOS: printw("P2DOS 2.3"); break;
case CPMFS_DR3: printw("CP/M Plus"); break;
}
move(6,0); printw(" Sector length: %d",sb->secLength);
move(7,0); printw(" Number of tracks: %d",sb->tracks);
move(8,0); printw(" Sectors per track: %d",sb->sectrk);
move(10,0);printw(" Block size: %d",sb->blksiz);
move(11,0);printw("Number of directory entries: %d",sb->maxdir);
move(12,0);printw(" Logical sector skew: %d",sb->skew);
move(13,0);printw(" Number of system tracks: %d",sb->boottrk);
move(14,0);printw(" Logical extents per extent: %d",sb->extents);
move(15,0);printw(" Allocatable data blocks: %d",sb->size-(sb->maxdir*32+sb->blksiz-1)/sb->blksiz);
msg="Any key to continue";
move(23,(COLS-strlen(msg))/2); printw(msg);
getch();
}
/*}}}*/
static void map(struct cpmSuperBlock *sb) /*{{{*/
{
const char *msg;
char bmap[18*80];
int secmap,pos,sys,directory;
clear();
msg="Data map";
move(0,(COLS-strlen(msg))/2); printw(msg);
secmap=(sb->tracks*sb->sectrk+80*18-1)/(80*18);
memset(bmap,' ',sizeof(bmap));
sys=sb->boottrk*sb->sectrk;
memset(bmap,'S',sys/secmap);
directory=(sb->maxdir*32+sb->secLength-1)/sb->secLength;
memset(bmap+sys/secmap,'D',directory/secmap);
memset(bmap+(sys+directory)/secmap,'.',sb->sectrk*sb->tracks/secmap);
for (pos=0; pos<(sb->maxdir*32+sb->secLength-1)/sb->secLength; ++pos)
{
int entry;
Device_readSector(&sb->dev,sb->boottrk+pos/(sb->sectrk*sb->secLength),pos/sb->secLength,mapbuf);
for (entry=0; entry<sb->secLength/32 && (pos*sb->secLength/32)+entry<sb->maxdir; ++entry)
{
int i;
if (mapbuf[entry*32]>=0 && mapbuf[entry*32]<=(sb->type==CPMFS_P2DOS ? 31 : 15))
{
for (i=0; i<16; ++i)
{
unsigned int sector;
sector=mapbuf[entry*32+16+i]&0xff;
if (sb->size>=256) sector|=(((mapbuf[entry*32+16+ ++i]&0xff)<<8));
if (sector>0 && sector<=sb->size)
{
/* not entirely correct without the last extent record count */
sector=sector*(sb->blksiz/sb->secLength)+sb->sectrk*sb->boottrk;
memset(bmap+sector/secmap,'#',sb->blksiz/(sb->secLength*secmap));
}
}
}
}
}
for (pos=0; pos<sizeof(bmap); ++pos)
{
move(2+pos%18,pos/18);
addch(bmap[pos]);
}
move(21,0); printw("S=System area D=Directory area #=File data .=Free");
msg="Any key to continue";
move(23,(COLS-strlen(msg))/2); printw(msg);
getch();
}
/*}}}*/
static void data(struct cpmSuperBlock *sb, const char *buf, unsigned long int pos) /*{{{*/
{
int offset=(pos%sb->secLength)&~0x7f;
int i;
for (i=0; i<128; ++i)
{
move(4+(i>>4),(i&0x0f)*3+!!(i&0x8)); printw("%02x",buf[i+offset]&0xff);
if (pos%sb->secLength==i+offset) attron(A_REVERSE);
move(4+(i>>4),50+(i&0x0f)); printw("%c",isprint(buf[i+offset]) ? buf[i+offset] : '.');
attroff(A_REVERSE);
}
move(4+((pos&0x7f)>>4),((pos&0x7f)&0x0f)*3+!!((pos&0x7f)&0x8)+1);
}
/*}}}*/
const char cmd[]="fsed.cpm";
int main(int argc, char *argv[]) /*{{{*/
{
/* variables */ /*{{{*/
const char *devopts=(const char*)0;
char *image;
const char *err;
struct cpmSuperBlock drive;
struct cpmInode root;
const char *format=FORMAT;
int c,usage=0;
unsigned long pos;
chtype ch;
int reload;
char *buf;
/*}}}*/
/* parse options */ /*{{{*/
while ((c=getopt(argc,argv,"T:f:h?"))!=EOF) switch(c)
{
case 'f': format=optarg; break;
case 'T': devopts=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: fsed.cpm [-f format] image\n");
exit(1);
}
/*}}}*/
/* open image */ /*{{{*/
if ((err=Device_open(&drive.dev,image,O_RDONLY,devopts)))
{
fprintf(stderr,"%s: can not open %s (%s)\n",cmd,image,err);
exit(1);
}
cpmReadSuper(&drive,&root,format);
/*}}}*/
/* alloc sector buffers */ /*{{{*/
if ((buf=malloc(drive.secLength))==(char*)0 || (mapbuf=malloc(drive.secLength))==(char*)0)
{
fprintf(stderr,"fsed.cpm: can not allocate sector buffer (%s).\n",strerror(errno));
exit(1);
}
/*}}}*/
/* init curses */ /*{{{*/
initscr();
noecho();
raw();
nonl();
idlok(stdscr,TRUE);
idcok(stdscr,TRUE);
keypad(stdscr,TRUE);
clear();
/*}}}*/
pos=0;
reload=1;
do
{
/* display position and load data */ /*{{{*/
clear();
move(2,0); printw("Byte %8lu (0x%08lx) ",pos,pos);
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
printw("Physical sector %3lu ",((pos/drive.secLength)%drive.sectrk)+1);
}
else
{
printw("Sector %3lu ",((pos/drive.secLength)%drive.sectrk)+1);
printw("(physical %3d) ",drive.skewtab[(pos/drive.secLength)%drive.sectrk]+1);
}
printw("Offset %5lu ",pos%drive.secLength);
printw("Track %5lu",pos/(drive.secLength*drive.sectrk));
move(LINES-3,0); printw("N)ext track P)revious track");
move(LINES-2,0); printw("n)ext record p)revious record f)orward byte b)ackward byte");
move(LINES-1,0); printw("i)nfo q)uit");
if (reload)
{
if (pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),(pos/drive.secLength)%drive.sectrk,buf);
}
else
{
err=Device_readSector(&drive.dev,pos/(drive.secLength*drive.sectrk),drive.skewtab[(pos/drive.secLength)%drive.sectrk],buf);
}
if (err)
{
move(4,0); printw("Data can not be read: %s",err);
}
else reload=0;
}
/*}}}*/
if /* position before end of system area */ /*{{{*/
(pos<(drive.boottrk*drive.sectrk*drive.secLength))
{
const char *msg;
msg="System area"; move(0,(COLS-strlen(msg))/2); printw(msg);
move(LINES-3,36); printw("F)orward 16 byte B)ackward 16 byte");
if (!reload) data(&drive,buf,pos);
switch (ch=getch())
{
case 'F': /* next 16 byte */ /*{{{*/
{
if (pos+16<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+16)/drive.secLength) reload=1;
pos+=16;
}
break;
}
/*}}}*/
case 'B': /* previous 16 byte */ /*{{{*/
{
if (pos>=16)
{
if (pos/drive.secLength!=(pos-16)/drive.secLength) reload=1;
pos-=16;
}
break;
}
/*}}}*/
}
}
/*}}}*/
else if /* position before end of directory area */ /*{{{*/
(pos<(drive.boottrk*drive.sectrk*drive.secLength+drive.maxdir*32))
{
const char *msg;
unsigned long entrystart=(pos&~0x1f)%drive.secLength;
int entry=(pos-(drive.boottrk*drive.sectrk*drive.secLength))>>5;
int offset=pos&0x1f;
msg="Directory area"; move(0,(COLS-strlen(msg))/2); printw(msg);
move(LINES-3,36); printw("F)orward entry B)ackward entry");
move(13,0); printw("Entry %3d: ",entry);
if /* free or used directory entry */ /*{{{*/
((buf[entrystart]>=0 && buf[entrystart]<=(drive.type==CPMFS_P2DOS ? 31 : 15)) || buf[entrystart]==(char)0xe5)
{
int i;
if (buf[entrystart]==(char)0xe5)
{
if (offset==0) attron(A_REVERSE);
printw("Free");
attroff(A_REVERSE);
}
else printw("Directory entry");
move(15,0);
if (buf[entrystart]!=(char)0xe5)
{
printw("User: ");
if (offset==0) attron(A_REVERSE);
printw("%2d",buf[entrystart]);
attroff(A_REVERSE);
printw(" ");
}
printw("Name: ");
for (i=0; i<8; ++i)
{
if (offset==1+i) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
printw(" Extension: ");
for (i=0; i<3; ++i)
{
if (offset==9+i) attron(A_REVERSE);
printw("%c",buf[entrystart+9+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0); printw("Extent: %3d",((buf[entrystart+12]&0xff)+((buf[entrystart+14]&0xff)<<5))/drive.extents);
printw(" (low: ");
if (offset==12) attron(A_REVERSE);
printw("%2d",buf[entrystart+12]&0xff);
attroff(A_REVERSE);
printw(", high: ");
if (offset==14) attron(A_REVERSE);
printw("%2d",buf[entrystart+14]&0xff);
attroff(A_REVERSE);
printw(")");
move(17,0); printw("Last extent record count: ");
if (offset==15) attron(A_REVERSE);
printw("%3d",buf[entrystart+15]&0xff);
attroff(A_REVERSE);
move(18,0); printw("Last record byte count: ");
if (offset==13) attron(A_REVERSE);
printw("%3d",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
move(19,0); printw("Data blocks:");
for (i=0; i<16; ++i)
{
unsigned int block=buf[entrystart+16+i]&0xff;
if (drive.size>=256)
{
printw(" ");
if (offset==16+i || offset==16+i+1) attron(A_REVERSE);
printw("%5d",block|(((buf[entrystart+16+ ++i]&0xff)<<8)));
attroff(A_REVERSE);
}
else
{
printw(" ");
if (offset==16+i) attron(A_REVERSE);
printw("%3d",block);
attroff(A_REVERSE);
}
}
}
/*}}}*/
else if /* disc label */ /*{{{*/
(buf[entrystart]==0x20 && drive.type==CPMFS_DR3)
{
int i;
const struct tm *tm;
char s[30];
if (offset==0) attron(A_REVERSE);
printw("Disc label");
attroff(A_REVERSE);
move(15,0);
printw("Label: ");
for (i=0; i<11; ++i)
{
if (i+1==offset) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0);
printw("Bit 0,7: ");
if (offset==12) attron(A_REVERSE);
printw("Label %s",buf[entrystart+12]&1 ? "set" : "not set");
printw(", password protection %s",buf[entrystart+12]&0x80 ? "set" : "not set");
attroff(A_REVERSE);
move(17,0);
printw("Bit 4,5,6: ");
if (offset==12) attron(A_REVERSE);
printw("Time stamp ");
if (buf[entrystart+12]&0x10) printw("on create, ");
else printw("not on create, ");
if (buf[entrystart+12]&0x20) printw("on modification, ");
else printw("not on modifiction, ");
if (buf[entrystart+12]&0x40) printw("on access");
else printw("not on access");
attroff(A_REVERSE);
move(18,0);
printw("Password: ");
for (i=0; i<8; ++i)
{
char printable;
if (offset==16+(7-i)) attron(A_REVERSE);
printable=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
printw("%c",isprint(printable) ? printable : ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
if (offset==13) attron(A_REVERSE);
printw("0x%02x",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
move(19,0);
printw("Created: ");
tm=cpmtime(buf[entrystart+24],buf[entrystart+25],buf[entrystart+26],buf[entrystart+27]);
if (offset==24 || offset==25) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==26) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==27) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Updated: ");
tm=cpmtime(buf[entrystart+28],buf[entrystart+29],buf[entrystart+30],buf[entrystart+31]);
if (offset==28 || offset==29) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==30) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==31) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
}
/*}}}*/
else if /* time stamp */ /*{{{*/
(buf[entrystart]==0x21 && (drive.type==CPMFS_P2DOS || drive.type==CPMFS_DR3))
{
const struct tm *tm;
char s[30];
if (offset==0) attron(A_REVERSE);
printw("Time stamps");
attroff(A_REVERSE);
move(15,0);
printw("3rd last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+1],buf[entrystart+2],buf[entrystart+3],buf[entrystart+4]);
if (offset==1 || offset==2) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==3) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==4) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+5],buf[entrystart+6],buf[entrystart+7],buf[entrystart+8]);
if (offset==5 || offset==6) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==7) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==8) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
move(16,0);
printw("2nd last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+11],buf[entrystart+12],buf[entrystart+13],buf[entrystart+14]);
if (offset==11 || offset==12) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==13) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==14) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+15],buf[entrystart+16],buf[entrystart+17],buf[entrystart+18]);
if (offset==15 || offset==16) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==17) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==18) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
move(17,0);
printw(" Last extent: Created/Accessed ");
tm=cpmtime(buf[entrystart+21],buf[entrystart+22],buf[entrystart+23],buf[entrystart+24]);
if (offset==21 || offset==22) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==23) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==24) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
printw(" Modified ");
tm=cpmtime(buf[entrystart+25],buf[entrystart+26],buf[entrystart+27],buf[entrystart+28]);
if (offset==25 || offset==26) attron(A_REVERSE);
strftime(s,sizeof(s),"%x",tm);
printw("%s",s);
attroff(A_REVERSE);
printw(" ");
if (offset==27) attron(A_REVERSE);
printw("%2d",tm->tm_hour);
attroff(A_REVERSE);
printw(":");
if (offset==28) attron(A_REVERSE);
printw("%02d",tm->tm_min);
attroff(A_REVERSE);
}
/*}}}*/
else if /* password */ /*{{{*/
(buf[entrystart]>=16 && buf[entrystart]<=31 && drive.type==CPMFS_DR3)
{
int i;
if (offset==0) attron(A_REVERSE);
printw("Password");
attroff(A_REVERSE);
move(15,0);
printw("Name: ");
for (i=0; i<8; ++i)
{
if (offset==1+i) attron(A_REVERSE);
printw("%c",buf[entrystart+1+i]&0x7f);
attroff(A_REVERSE);
}
printw(" Extension: ");
for (i=0; i<3; ++i)
{
if (offset==9+i) attron(A_REVERSE);
printw("%c",buf[entrystart+9+i]&0x7f);
attroff(A_REVERSE);
}
move(16,0);
printw("Password required for: ");
if (offset==12) attron(A_REVERSE);
if (buf[entrystart+12]&0x80) printw("Reading ");
if (buf[entrystart+12]&0x40) printw("Writing ");
if (buf[entrystart+12]&0x20) printw("Deleting ");
attroff(A_REVERSE);
move(17,0);
printw("Password: ");
for (i=0; i<8; ++i)
{
char printable;
if (offset==16+(7-i)) attron(A_REVERSE);
printable=(buf[entrystart+16+(7-i)]^buf[entrystart+13])&0x7f;
printw("%c",isprint(printable) ? printable : ' ');
attroff(A_REVERSE);
}
printw(" XOR value: ");
if (offset==13) attron(A_REVERSE);
printw("0x%02x",buf[entrystart+13]&0xff);
attroff(A_REVERSE);
}
/*}}}*/
else /* bad status */ /*{{{*/
{
printw("Bad status ");
if (offset==0) attron(A_REVERSE);
printw("0x%02x",buf[entrystart]);
attroff(A_REVERSE);
}
/*}}}*/
if (!reload) data(&drive,buf,pos);
switch (ch=getch())
{
case 'F': /* next entry */ /*{{{*/
{
if (pos+32<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+32)/drive.secLength) reload=1;
pos+=32;
}
break;
}
/*}}}*/
case 'B': /* previous entry */ /*{{{*/
{
if (pos>=32)
{
if (pos/drive.secLength!=(pos-32)/drive.secLength) reload=1;
pos-=32;
}
break;
}
/*}}}*/
}
}
/*}}}*/
else /* data area */ /*{{{*/
{
const char *msg;
msg="Data area"; move(0,(COLS-strlen(msg))/2); printw(msg);
if (!reload) data(&drive,buf,pos);
ch=getch();
}
/*}}}*/
/* process common commands */ /*{{{*/
switch (ch)
{
case 'n': /* next record */ /*{{{*/
{
if (pos+128<(drive.sectrk*drive.tracks*(unsigned long)drive.secLength))
{
if (pos/drive.secLength!=(pos+128)/drive.secLength) reload=1;
pos+=128;
}
break;
}
/*}}}*/
case 'p': /* previous record */ /*{{{*/
{
if (pos>=128)
{
if (pos/drive.secLength!=(pos-128)/drive.secLength) reload=1;
pos-=128;
}
break;
}
/*}}}*/
case 'N': /* next track */ /*{{{*/
{
if ((pos+drive.sectrk*drive.secLength)<(drive.sectrk*drive.tracks*drive.secLength))
{
pos+=drive.sectrk*drive.secLength;
reload=1;
}
break;
}
/*}}}*/
case 'P': /* previous track */ /*{{{*/
{
if (pos>=drive.sectrk*drive.secLength)
{
pos-=drive.sectrk*drive.secLength;
reload=1;
}
break;
}
/*}}}*/
case 'b': /* byte back */ /*{{{*/
{
if (pos)
{
if (pos/drive.secLength!=(pos-1)/drive.secLength) reload=1;
--pos;
}
break;
}
/*}}}*/
case 'f': /* byte forward */ /*{{{*/
{
if (pos+1<drive.tracks*drive.sectrk*drive.secLength)
{
if (pos/drive.secLength!=(pos+1)/drive.secLength) reload=1;
++pos;
}
break;
}
/*}}}*/
case 'i': info(&drive,format,image); break;
case 'm': map(&drive); break;
}
/*}}}*/
} while (ch!='q');
/* exit curses */ /*{{{*/
move(LINES-1,0);
refresh();
echo();
noraw();
endwin();
/*}}}*/
exit(0);
}
/*}}}*/

1195
branches/dwg/LSource/src/cpmtools-2.13/getopt.c

File diff suppressed because it is too large

171
branches/dwg/LSource/src/cpmtools-2.13/getopt1.c

@ -0,0 +1,171 @@
/* getopt_long and getopt_long_only entry points for GNU getopt.
Copyright (C) 1987,88,89,90,91,92,93,94,96,97,98,2004,2006
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef _LIBC
# include <getopt.h>
#else
# include "config.h"
# include "getopt_.h"
#endif
#include "getopt_int.h"
#include <stdio.h>
/* This needs to come after some library #include
to get __GNU_LIBRARY__ defined. */
#ifdef __GNU_LIBRARY__
#include <stdlib.h>
#endif
#ifndef NULL
#define NULL 0
#endif
int
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 0, 0);
}
int
_getopt_long_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
0, 0, d);
}
/* Like getopt_long, but '-' as well as '--' can indicate a long option.
If an option that starts with '-' (not '--') doesn't match a long option,
but does match a short option, it is parsed as a short option
instead. */
int
getopt_long_only (int argc, char *__getopt_argv_const *argv,
const char *options,
const struct option *long_options, int *opt_index)
{
return _getopt_internal (argc, (char **) argv, options, long_options,
opt_index, 1, 0);
}
int
_getopt_long_only_r (int argc, char **argv, const char *options,
const struct option *long_options, int *opt_index,
struct _getopt_data *d)
{
return _getopt_internal_r (argc, argv, options, long_options, opt_index,
1, 0, d);
}
#ifdef TEST
#include <stdio.h>
int
main (int argc, char **argv)
{
int c;
int digit_optind = 0;
while (1)
{
int this_option_optind = optind ? optind : 1;
int option_index = 0;
static struct option long_options[] =
{
{"add", 1, 0, 0},
{"append", 0, 0, 0},
{"delete", 1, 0, 0},
{"verbose", 0, 0, 0},
{"create", 0, 0, 0},
{"file", 1, 0, 0},
{0, 0, 0, 0}
};
c = getopt_long (argc, argv, "abc:d:0123456789",
long_options, &option_index);
if (c == -1)
break;
switch (c)
{
case 0:
printf ("option %s", long_options[option_index].name);
if (optarg)
printf (" with arg %s", optarg);
printf ("\n");
break;
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
if (digit_optind != 0 && digit_optind != this_option_optind)
printf ("digits occur in two different argv-elements.\n");
digit_optind = this_option_optind;
printf ("option %c\n", c);
break;
case 'a':
printf ("option a\n");
break;
case 'b':
printf ("option b\n");
break;
case 'c':
printf ("option c with value `%s'\n", optarg);
break;
case 'd':
printf ("option d with value `%s'\n", optarg);
break;
case '?':
break;
default:
printf ("?? getopt returned character code 0%o ??\n", c);
}
}
if (optind < argc)
{
printf ("non-option ARGV-elements: ");
while (optind < argc)
printf ("%s ", argv[optind++]);
printf ("\n");
}
exit (0);
}
#endif /* TEST */

226
branches/dwg/LSource/src/cpmtools-2.13/getopt_.h

@ -0,0 +1,226 @@
/* Declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2005,2006,2007
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_H
#ifndef __need_getopt
# define _GETOPT_H 1
#endif
/* Standalone applications should #define __GETOPT_PREFIX to an
identifier that prefixes the external functions and variables
defined in this header. When this happens, include the
headers that might declare getopt so that they will not cause
confusion if included after this file. Then systematically rename
identifiers so that they do not collide with the system functions
and variables. Renaming avoids problems with some compilers and
linkers. */
#if defined __GETOPT_PREFIX && !defined __need_getopt
# include <stdlib.h>
# include <stdio.h>
# include <unistd.h>
# undef __need_getopt
# undef getopt
# undef getopt_long
# undef getopt_long_only
# undef optarg
# undef opterr
# undef optind
# undef optopt
# define __GETOPT_CONCAT(x, y) x ## y
# define __GETOPT_XCONCAT(x, y) __GETOPT_CONCAT (x, y)
# define __GETOPT_ID(y) __GETOPT_XCONCAT (__GETOPT_PREFIX, y)
# define getopt __GETOPT_ID (getopt)
# define getopt_long __GETOPT_ID (getopt_long)
# define getopt_long_only __GETOPT_ID (getopt_long_only)
# define optarg __GETOPT_ID (optarg)
# define opterr __GETOPT_ID (opterr)
# define optind __GETOPT_ID (optind)
# define optopt __GETOPT_ID (optopt)
#endif
/* Standalone applications get correct prototypes for getopt_long and
getopt_long_only; they declare "char **argv". libc uses prototypes
with "char *const *argv" that are incorrect because getopt_long and
getopt_long_only can permute argv; this is required for backward
compatibility (e.g., for LSB 2.0.1).
This used to be `#if defined __GETOPT_PREFIX && !defined __need_getopt',
but it caused redefinition warnings if both unistd.h and getopt.h were
included, since unistd.h includes getopt.h having previously defined
__need_getopt.
The only place where __getopt_argv_const is used is in definitions
of getopt_long and getopt_long_only below, but these are visible
only if __need_getopt is not defined, so it is quite safe to rewrite
the conditional as follows:
*/
#if !defined __need_getopt
# if defined __GETOPT_PREFIX
# define __getopt_argv_const /* empty */
# else
# define __getopt_argv_const const
# endif
#endif
/* If __GNU_LIBRARY__ is not already defined, either we are being used
standalone, or this is the first header included in the source file.
If we are being used with glibc, we need to include <features.h>, but
that does not exist if we are standalone. So: if __GNU_LIBRARY__ is
not defined, include <ctype.h>, which will pull in <features.h> for us
if it's from glibc. (Why ctype.h? It's guaranteed to exist and it
doesn't flood the namespace with stuff the way some other headers do.) */
#if !defined __GNU_LIBRARY__
# include <ctype.h>
#endif
#ifndef __THROW
# ifndef __GNUC_PREREQ
# define __GNUC_PREREQ(maj, min) (0)
# endif
# if defined __cplusplus && __GNUC_PREREQ (2,8)
# define __THROW throw ()
# else
# define __THROW
# endif
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* For communication from `getopt' to the caller.
When `getopt' finds an option that takes an argument,
the argument value is returned here.
Also, when `ordering' is RETURN_IN_ORDER,
each non-option ARGV-element is returned here. */
extern char *optarg;
/* Index in ARGV of the next element to be scanned.
This is used for communication to and from the caller
and for communication between successive calls to `getopt'.
On entry to `getopt', zero means this is the first call; initialize.
When `getopt' returns -1, this is the index of the first of the
non-option elements that the caller should itself scan.
Otherwise, `optind' communicates from one call to the next
how much of ARGV has been scanned so far. */
extern int optind;
/* Callers store zero here to inhibit the error message `getopt' prints
for unrecognized options. */
extern int opterr;
/* Set to an option character which was unrecognized. */
extern int optopt;
#ifndef __need_getopt
/* Describe the long-named options requested by the application.
The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector
of `struct option' terminated by an element containing a name which is
zero.
The field `has_arg' is:
no_argument (or 0) if the option does not take an argument,
required_argument (or 1) if the option requires an argument,
optional_argument (or 2) if the option takes an optional argument.
If the field `flag' is not NULL, it points to a variable that is set
to the value given in the field `val' when the option is found, but
left unchanged if the option is not found.
To have a long-named option do something other than set an `int' to
a compiled-in constant, such as set a value from `optarg', set the
option's `flag' field to zero and its `val' field to a nonzero
value (the equivalent single-letter option character, if there is
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
struct option
{
const char *name;
/* has_arg can't be an enum because some compilers complain about
type mismatches in all the code that assumes it is an int. */
int has_arg;
int *flag;
int val;
};
/* Names for the values of the `has_arg' field of `struct option'. */
# define no_argument 0
# define required_argument 1
# define optional_argument 2
#endif /* need getopt */
/* Get definitions and prototypes for functions to process the
arguments in ARGV (ARGC of them, minus the program name) for
options given in OPTS.
Return the option character from OPTS just read. Return -1 when
there are no more options. For unrecognized options, or options
missing arguments, `optopt' is set to the option letter, and '?' is
returned.
The OPTS string is a list of characters which are recognized option
letters, optionally followed by colons, specifying that that letter
takes an argument, to be placed in `optarg'.
If a letter in OPTS is followed by two colons, its argument is
optional. This behavior is specific to the GNU `getopt'.
The argument `--' causes premature termination of argument
scanning, explicitly telling `getopt' that there are no more
options.
If OPTS begins with `-', then non-option arguments are treated as
arguments to the option '\1'. This behavior is specific to the GNU
`getopt'. If OPTS begins with `+', or POSIXLY_CORRECT is set in
the environment, then do not permute arguments. */
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__THROW;
#ifndef __need_getopt
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
extern int getopt_long_only (int ___argc, char *__getopt_argv_const *___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind)
__THROW;
#endif
#ifdef __cplusplus
}
#endif
/* Make sure we later can get all the definitions and declarations. */
#undef __need_getopt
#endif /* getopt.h */

131
branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h

@ -0,0 +1,131 @@
/* Internal declarations for getopt.
Copyright (C) 1989-1994,1996-1999,2001,2003,2004
Free Software Foundation, Inc.
This file is part of the GNU C Library.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifndef _GETOPT_INT_H
#define _GETOPT_INT_H 1
extern int _getopt_internal (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct);
/* Reentrant versions which can handle parsing multiple argument
vectors at the same time. */
/* Data type for reentrant functions. */
struct _getopt_data
{
/* These have exactly the same meaning as the corresponding global
variables, except that they are used for the reentrant
versions of getopt. */
int optind;
int opterr;
int optopt;
char *optarg;
/* Internal members. */
/* True if the internal members have been initialized. */
int __initialized;
/* The next char to be scanned in the option-element
in which the last option character we returned was found.
This allows us to pick up the scan where we left off.
If this is zero, or a null string, it means resume the scan
by advancing to the next ARGV-element. */
char *__nextchar;
/* Describe how to deal with options that follow non-option ARGV-elements.
If the caller did not specify anything,
the default is REQUIRE_ORDER if the environment variable
POSIXLY_CORRECT is defined, PERMUTE otherwise.
REQUIRE_ORDER means don't recognize them as options;
stop option processing when the first non-option is seen.
This is what Unix does.
This mode of operation is selected by either setting the environment
variable POSIXLY_CORRECT, or using `+' as the first character
of the list of option characters, or by calling getopt.
PERMUTE is the default. We permute the contents of ARGV as we
scan, so that eventually all the non-options are at the end.
This allows options to be given in any order, even with programs
that were not written to expect this.
RETURN_IN_ORDER is an option available to programs that were
written to expect options and other ARGV-elements in any order
and that care about the ordering of the two. We describe each
non-option ARGV-element as if it were the argument of an option
with character code 1. Using `-' as the first character of the
list of option characters selects this mode of operation.
The special argument `--' forces an end of option-scanning regardless
of the value of `ordering'. In the case of RETURN_IN_ORDER, only
`--' can cause `getopt' to return -1 with `optind' != ARGC. */
enum
{
REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER
} __ordering;
/* If the POSIXLY_CORRECT environment variable is set
or getopt was called. */
int __posixly_correct;
/* Handle permutation of arguments. */
/* Describe the part of ARGV that contains non-options that have
been skipped. `first_nonopt' is the index in ARGV of the first
of them; `last_nonopt' is the index after the last of them. */
int __first_nonopt;
int __last_nonopt;
#if defined _LIBC && defined USE_NONOPTION_FLAGS
int __nonoption_flags_max_len;
int __nonoption_flags_len;
# endif
};
/* The initializer is necessary to set OPTIND and OPTERR to their
default values and to clear the initialization flag. */
#define _GETOPT_DATA_INITIALIZER { 1, 1 }
extern int _getopt_internal_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
int __long_only, int __posixly_correct,
struct _getopt_data *__data);
extern int _getopt_long_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts, int *__longind,
struct _getopt_data *__data);
extern int _getopt_long_only_r (int ___argc, char **___argv,
const char *__shortopts,
const struct option *__longopts,
int *__longind,
struct _getopt_data *__data);
#endif /* getopt_int.h */

520
branches/dwg/LSource/src/cpmtools-2.13/install-sh

@ -0,0 +1,520 @@
#!/bin/sh
# install - install a program, script, or datafile
scriptversion=2009-04-28.21; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch.
nl='
'
IFS=" "" $nl"
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
if test -z "$doit"; then
doit_exec=exec
else
doit_exec=$doit
fi
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
chgrpprog=${CHGRPPROG-chgrp}
chmodprog=${CHMODPROG-chmod}
chownprog=${CHOWNPROG-chown}
cmpprog=${CMPPROG-cmp}
cpprog=${CPPROG-cp}
mkdirprog=${MKDIRPROG-mkdir}
mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
posix_glob='?'
initialize_posix_glob='
test "$posix_glob" != "?" || {
if (set -f) 2>/dev/null; then
posix_glob=
else
posix_glob=:
fi
}
'
posix_mkdir=
# Desired mode of installed file.
mode=0755
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
mvcmd=$mvprog
rmcmd="$rmprog -f"
stripcmd=
src=
dst=
dir_arg=
dst_arg=
copy_on_change=false
no_target_directory=
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
or: $0 [OPTION]... SRCFILES... DIRECTORY
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
or: $0 [OPTION]... -d DIRECTORIES...
In the 1st form, copy SRCFILE to DSTFILE.
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
In the 4th, create DIRECTORIES.
Options:
--help display this help and exit.
--version display version info and exit.
-c (ignored)
-C install only if different (preserve the last data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
-s $stripprog installed files.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
"
while test $# -ne 0; do
case $1 in
-c) ;;
-C) copy_on_change=true;;
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
case $mode in
*' '* | *' '* | *'
'* | *'*'* | *'?'* | *'['*)
echo "$0: invalid mode: $mode" >&2
exit 1;;
esac
shift;;
-o) chowncmd="$chownprog $2"
shift;;
-s) stripcmd=$stripprog;;
-t) dst_arg=$2
shift;;
-T) no_target_directory=true;;
--version) echo "$0 $scriptversion"; exit $?;;
--) shift
break;;
-*) echo "$0: invalid option: $1" >&2
exit 1;;
*) break;;
esac
shift
done
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
# Otherwise, the last argument is the destination. Remove it from $@.
for arg
do
if test -n "$dst_arg"; then
# $@ is not empty: it contains at least $arg.
set fnord "$@" "$dst_arg"
shift # fnord
fi
shift # arg
dst_arg=$arg
done
fi
if test $# -eq 0; then
if test -z "$dir_arg"; then
echo "$0: no input file specified." >&2
exit 1
fi
# It's OK to call `install-sh -d' without argument.
# This can happen when creating conditional directories.
exit 0
fi
if test -z "$dir_arg"; then
trap '(exit $?); exit' 1 2 13 15
# Set umask so as not to create temps with too-generous modes.
# However, 'strip' requires both read and write access to temps.
case $mode in
# Optimize common cases.
*644) cp_umask=133;;
*755) cp_umask=22;;
*[0-7])
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
u_plus_rw=
else
u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
fi
for src
do
# Protect names starting with `-'.
case $src in
-*) src=./$src;;
esac
if test -n "$dir_arg"; then
dst=$src
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if test ! -f "$src" && test ! -d "$src"; then
echo "$0: $src does not exist." >&2
exit 1
fi
if test -z "$dst_arg"; then
echo "$0: no destination specified." >&2
exit 1
fi
dst=$dst_arg
# Protect names starting with `-'.
case $dst in
-*) dst=./$dst;;
esac
# If destination is a directory, append the input filename; won't work
# if double slashes aren't ignored.
if test -d "$dst"; then
if test -n "$no_target_directory"; then
echo "$0: $dst_arg: Is a directory" >&2
exit 1
fi
dstdir=$dst
dst=$dstdir/`basename "$src"`
dstdir_status=0
else
# Prefer dirname, but fall back on a substitute if dirname fails.
dstdir=`
(dirname "$dst") 2>/dev/null ||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$dst" : 'X\(//\)[^/]' \| \
X"$dst" : 'X\(//\)$' \| \
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
echo X"$dst" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'
`
test -d "$dstdir"
dstdir_status=$?
fi
fi
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
# Create intermediate dirs using mode 755 as modified by the umask.
# This is like FreeBSD 'install' as of 1997-10-28.
umask=`umask`
case $stripcmd.$umask in
# Optimize common cases.
*[2367][2367]) mkdir_umask=$umask;;
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
*[0-7])
mkdir_umask=`expr $umask + 22 \
- $umask % 100 % 40 + $umask % 20 \
- $umask % 10 % 4 + $umask % 2
`;;
*) mkdir_umask=$umask,go-w;;
esac
# With -d, create the new directory with the user-specified mode.
# Otherwise, rely on $mkdir_umask.
if test -n "$dir_arg"; then
mkdir_mode=-m$mode
else
mkdir_mode=
fi
posix_mkdir=false
case $umask in
*[123567][0-7][0-7])
# POSIX mkdir -p sets u+wx bits regardless of umask, which
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
if (umask $mkdir_umask &&
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writeable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
ls_ld_tmpdir=`ls -ld "$tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
rmdir "$tmpdir/d" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
fi
trap '' 0;;
esac;;
esac
if
$posix_mkdir && (
umask $mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
# The umask is ridiculous, or mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
/*) prefix='/';;
-*) prefix='./';;
*) prefix='';;
esac
eval "$initialize_posix_glob"
oIFS=$IFS
IFS=/
$posix_glob set -f
set fnord $dstdir
shift
$posix_glob set +f
IFS=$oIFS
prefixes=
for d
do
test -z "$d" && continue
prefix=$prefix$d
if test -d "$prefix"; then
prefixes=
else
if $posix_mkdir; then
(umask=$mkdir_umask &&
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
# Don't fail if two instances are running concurrently.
test -d "$prefix" || exit 1
else
case $prefix in
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
*) qprefix=$prefix;;
esac
prefixes="$prefixes '$qprefix'"
fi
fi
prefix=$prefix/
done
if test -n "$prefixes"; then
# Don't fail if two instances are running concurrently.
(umask $mkdir_umask &&
eval "\$doit_exec \$mkdirprog $prefixes") ||
test -d "$dstdir" || exit 1
obsolete_mkdir_used=true
fi
fi
fi
if test -n "$dir_arg"; then
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
else
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $cpprog $src $dsttmp" command.
#
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
eval "$initialize_posix_glob" &&
$posix_glob set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
$posix_glob set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
# The rename failed, perhaps because mv can't rename something else
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
# Now remove or move aside any old file at destination location.
# We try this two ways since rm can't unlink itself on some
# systems and the destination file might be busy for other
# reasons. In this case, the final cleanup might fail but the new
# file should still install successfully.
{
test ! -f "$dst" ||
$doit $rmcmd -f "$dst" 2>/dev/null ||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
} ||
{ echo "$0: cannot unlink or rename $dst" >&2
(exit 1); exit 1
}
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
trap '' 0
fi
done
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:

89
branches/dwg/LSource/src/cpmtools-2.13/makefile.nt

@ -0,0 +1,89 @@
#
# Makefile for cpmtools, using MS Visual C++ 6.x command-line tools
#
CC= cl
DISKDEFS= c:/cpm/etc/diskdefs
CPPFLAGS= /DDISKDEFS=\"$(DISKDEFS)\" /DFORMAT=\"ibm-3740\"
#
# Note: The "/Zp1" (pack structures on 1-byte boundaries) is important.
#
CFLAGS= /Zp1 /WX /W3 $(CPPFLAGS)
LDFLAGS=
#LDFLAGS= -g -L/usr/dmalloc/lib
LIBCURSES= -lcurses
LIBS= getopt.obj
#LIBS= -ldmalloc
MAKEDEPEND= mkdep -d
#MAKEDEPEND= gcc -MM
#MAKEDEPEND= makedepend -f-
BINDIR= /usr/cpm/bin
MANDIR= /usr/cpm/man/en
OSDEPEND= os_win32.obj
#OSDEPEND= os_unix.obj # Can be used if you don't want direct
# floppy support
ALL= cpmls.exe cpmrm.exe cpmcp.exe mkfs.cpm.exe fsck.cpm.exe \
# fsed.cpm.exe
all: $(ALL)
cpmls.exe: cpmls.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmls.obj cpmfs.obj $(OSDEPEND) $(LIBS)
cpmrm.exe: cpmrm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmrm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
cpmcp.exe: cpmcp.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ cpmcp.obj cpmfs.obj $(OSDEPEND) $(LIBS)
mkfs.cpm.exe: mkfs.cpm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ mkfs.cpm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
fsck.cpm.exe: fsck.cpm.obj cpmfs.obj $(OSDEPEND) getopt.obj
$(CC) $(LDFLAGS) -o $@ fsck.cpm.obj cpmfs.obj $(OSDEPEND) $(LIBS)
fsed.cpm.exe: fsed.cpm.obj getopt.obj
$(CC) $(LDFLAGS) -o $@ fsed.cpm.obj $(LIBCURSES) $(LIBS)
fsck.test: fsck.cpm.exe
-.\\fsck.cpm.exe -n badfs/status
-.\\fsck.cpm.exe -n badfs/extno
-.\\fsck.cpm.exe -n badfs/lcr
-.\\fsck.cpm.exe -n badfs/name
-.\\fsck.cpm.exe -n badfs/extension
-.\\fsck.cpm.exe -n badfs/blocknumber
-.\\fsck.cpm.exe -n badfs/recordcount
-.\\fsck.cpm.exe -n badfs/hugecom
-.\\fsck.cpm.exe -n badfs/timestamps
-.\\fsck.cpm.exe -n badfs/multipleblocks
-.\\fsck.cpm.exe -n badfs/doubleext
-.\\fsck.cpm.exe -f pcw -n badfs/label
install: all
install -c -s -m 755 cpmls $(BINDIR)/cpmls
install -c -s -m 755 cpmcp $(BINDIR)/cpmcp
install -c -s -m 755 cpmrm $(BINDIR)/cpmrm
install -c -s -m 755 mkfs.cpm $(BINDIR)/mkfs.cpm
install -c -s -m 755 fsck.cpm $(BINDIR)/fsck.cpm
install -c -s -m 755 fsed.cpm $(BINDIR)/fsed.cpm
install -c -m 644 diskdefs $(DISKDEFS)
install -c -m 644 cpmls.1 $(MANDIR)/man1/cpmls.1
install -c -m 644 cpmcp.1 $(MANDIR)/man1/cpmcp.1
install -c -m 644 cpmrm.1 $(MANDIR)/man1/cpmrm.1
install -c -m 644 mkfs.cpm.1 $(MANDIR)/man1/mkfs.cpm.1
install -c -m 644 fsck.cpm.1 $(MANDIR)/man1/fsck.cpm.1
install -c -m 644 fsed.cpm.1 $(MANDIR)/man1/fsed.cpm.1
clean:
rm -f *.obj
clobber: clean
rm -f $(ALL) *.out
tar: clobber
(b=`pwd`; b=`basename $$b`; cd ..; tar zcvf $$b.tar.gz $$b)
depend:
$(MAKEDEPEND) $(CPPFLAGS) *.c >.depend
include .depend

BIN
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm

Binary file not shown.

64
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1

@ -0,0 +1,64 @@
.TH MKFS.CPM 1 "March 30, 2010" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
mkfs.cpm \- make a CP/M file system
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B mkfs.cpm
.RB [ \-f
.IR format ]
.RB [ \-b
.IR boot ]
.RB [ \-L
.IR label ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBmkfs.cpm\fP makes a CP/M file system on an image file or device.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-b\fP \fIbootblock\fP"
Write the contents of the file \fIbootblock\fP to the system tracks
instead of filling them with 0xe5. This option can be used up to four
times. The file contents (typically boot block, CCP, BDOS and BIOS)
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
${prefix}/share/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR fsck.cpm (1),
.IR cpmls (1),
.IR mkfs (1),
.IR cpm (5)
.\"}}}

64
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in

@ -0,0 +1,64 @@
.TH MKFS.CPM 1 "@UPDATED@" "CP/M tools" "User commands"
.SH NAME \"{{{roff}}}\"{{{
mkfs.cpm \- make a CP/M file system
.\"}}}
.SH SYNOPSIS \"{{{
.ad l
.B mkfs.cpm
.RB [ \-f
.IR format ]
.RB [ \-b
.IR boot ]
.RB [ \-L
.IR label ]
.I image
.ad b
.\"}}}
.SH DESCRIPTION \"{{{
\fBmkfs.cpm\fP makes a CP/M file system on an image file or device.
.\"}}}
.SH OPTIONS \"{{{
.IP "\fB\-f\fP \fIformat\fP"
Use the given CP/M disk \fIformat\fP instead of the default format.
.IP "\fB\-b\fP \fIbootblock\fP"
Write the contents of the file \fIbootblock\fP to the system tracks
instead of filling them with 0xe5. This option can be used up to four
times. The file contents (typically boot block, CCP, BDOS and BIOS)
are written to sequential sectors, padding with 0xe5 if needed.
.IP "\fB\-L\fP \fIlabel\fP"
Label the file system. This is only supported by CP/M Plus.
.\"}}}
.SH "RETURN VALUE" \"{{{
Upon successful completion, exit code 0 is returned.
.\"}}}
.SH ERRORS \"{{{
Any errors are indicated by exit code 1.
.\"}}}
.SH FILES \"{{{
@DATADIR@/diskdefs CP/M disk format definitions
.\"}}}
.SH AUTHORS \"{{{
This program is copyright 1997\(en2010 Michael Haardt
<michael@moria.de>. The Windows port is copyright 2000, 2001 John Elliott
<jce@seasip.demon.co.uk>.
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License along
with this program. If not, write to the Free Software Foundation, Inc.,
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
.\"}}}
.SH "SEE ALSO" \"{{{
.IR fsck.cpm (1),
.IR cpmls (1),
.IR mkfs (1),
.IR cpm (5)
.\"}}}

175
branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c

@ -0,0 +1,175 @@
/* #includes */ /*{{{C}}}*//*{{{*/
#include "config.h"
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "getopt_.h"
#include "cpmfs.h"
#ifdef USE_DMALLOC
#include <dmalloc.h>
#endif
/*}}}*/
/* #defines */ /*{{{*/
#ifndef O_BINARY
#define O_BINARY 0
#endif
/*}}}*/
/* mkfs -- make file system */ /*{{{*/
static int mkfs(struct cpmSuperBlock *drive, const char *name, const char *label, char *bootTracks)
{
/* variables */ /*{{{*/
int i;
char buf[128];
char firstbuf[128];
int fd;
int bytes;
int trkbytes;
/*}}}*/
/* open image file */ /*{{{*/
if ((fd = open(name, O_BINARY|O_CREAT|O_WRONLY, 0666)) < 0)
{
boo=strerror(errno);
return -1;
}
/*}}}*/
/* write system tracks */ /*{{{*/
/* this initialises only whole tracks, so it skew is not an issue */
trkbytes=drive->secLength*drive->sectrk;
for (i=0; i<trkbytes*drive->boottrk; i+=drive->secLength) if (write(fd, bootTracks+i, drive->secLength)!=drive->secLength)
{
boo=strerror(errno);
close(fd);
return -1;
}
/*}}}*/
/* write directory */ /*{{{*/
memset(buf,0xe5,128);
bytes=drive->maxdir*32;
if (bytes%trkbytes) bytes=((bytes+trkbytes)/trkbytes)*trkbytes;
if (drive->type==CPMFS_P2DOS || drive->type==CPMFS_DR3) buf[3*32]=0x21;
memcpy(firstbuf,buf,128);
if (drive->type==CPMFS_DR3)
{
time_t now;
struct tm *t;
int min,hour,days;
firstbuf[0]=0x20;
for (i=0; i<11 && *label; ++i,++label) firstbuf[1+i]=toupper(*label&0x7f);
while (i<11) firstbuf[1+i++]=' ';
firstbuf[12]=0x11; /* label set and first time stamp is creation date */
memset(&firstbuf[13],0,1+2+8);
time(&now);
t=localtime(&now);
min=((t->tm_min/10)<<4)|(t->tm_min%10);
hour=((t->tm_hour/10)<<4)|(t->tm_hour%10);
for (i=1978,days=0; i < 1900 + t->tm_year; ++i)
{
days+=365;
if (i%4==0 && (i%100!=0 || i%400==0)) ++days;
}
days += t->tm_yday + 1;
firstbuf[24]=firstbuf[28]=days&0xff; firstbuf[25]=firstbuf[29]=days>>8;
firstbuf[26]=firstbuf[30]=hour;
firstbuf[27]=firstbuf[31]=min;
}
for (i=0; i < bytes; i += 128) if (write(fd, i==0 ? firstbuf : buf, 128)!=128)
{
boo=strerror(errno);
close(fd);
return -1;
}
/*}}}*/
/* close image file */ /*{{{*/
if (close(fd)==-1)
{
boo=strerror(errno);
return -1;
}
/*}}}*/
return 0;
}
/*}}}*/
const char cmd[]="mkfs.cpm";
int main(int argc, char *argv[]) /*{{{*/
{
char *image;
const char *format=FORMAT;
int c,usage=0;
struct cpmSuperBlock drive;
struct cpmInode root;
const char *label="unlabeled";
size_t bootTrackSize,used;
char *bootTracks;
const char *boot[4]={(const char*)0,(const char*)0,(const char*)0,(const char*)0};
while ((c=getopt(argc,argv,"b:f:L:h?"))!=EOF) switch(c)
{
case 'b':
{
if (boot[0]==(const char*)0) boot[0]=optarg;
else if (boot[1]==(const char*)0) boot[1]=optarg;
else if (boot[2]==(const char*)0) boot[2]=optarg;
else if (boot[3]==(const char*)0) boot[3]=optarg;
else usage=1;
break;
}
case 'f': format=optarg; break;
case 'L': label=optarg; break;
case 'h':
case '?': usage=1; break;
}
if (optind!=(argc-1)) usage=1;
else image=argv[optind++];
if (usage)
{
fprintf(stderr,"Usage: %s [-f format] [-b boot] [-L label] image\n",cmd);
exit(1);
}
drive.dev.opened=0;
cpmReadSuper(&drive,&root,format);
bootTrackSize=drive.boottrk*drive.secLength*drive.sectrk;
if ((bootTracks=malloc(bootTrackSize))==(void*)0)
{
fprintf(stderr,"%s: can not allocate boot track buffer: %s\n",cmd,strerror(errno));
exit(1);
}
memset(bootTracks,0xe5,bootTrackSize);
used=0;
for (c=0; c<4 && boot[c]; ++c)
{
int fd;
size_t size;
if ((fd=open(boot[c],O_BINARY|O_RDONLY))==-1)
{
fprintf(stderr,"%s: can not open %s: %s\n",cmd,boot[c],strerror(errno));
exit(1);
}
size=read(fd,bootTracks+used,bootTrackSize-used);
#if 0
fprintf(stderr,"%d %04x %s\n",c,used+0x800,boot[c]);
#endif
if (size%drive.secLength) size=(size|(drive.secLength-1))+1;
used+=size;
close(fd);
}
if (mkfs(&drive,image,label,bootTracks)==-1)
{
fprintf(stderr,"%s: can not make new file system: %s\n",cmd,boo);
exit(1);
}
else exit(0);
}
/*}}}*/

62
branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt

@ -0,0 +1,62 @@
The Telemark Assembler Copyright Notification
The files on this disk are:
Copyright 1985-1993 by Speech Technology Incorporated, all rights reserved.
Copyright 1998,1999,2001 by Thomas N. Anderson , all rights reserved.
The following files on this disk may be freely copied and shared with others:
TASM.EXE - TASM Assembler, executable
TASM48.TAB - 8048 Instruction definition table
TASM51.TAB - 8051 Instruction definition table
TASM65.TAB - 6502 Instruction definition table
TASM85.TAB - 8085 Instruction definition table
TASM80.TAB - Z80 Instruction definition table
TASM05.TAB - 6805 Instruction definition table
TASM68.TAB - 6800/6801/68HC11 Instruction definition table
TASM3210.TAB - TMS32010 Instruction definition table
TASM3225.TAB - TMS32025 Instruction definition table
TASM70.TAB - TMS7000 Instruction definition table
TASMMAN.HTM - TASM Documentation (HTML)
TASMTABS.HTM - TASM Documentation on individual tables (HTML)
TEST*.ASM - TASM test cases (one for each table)
TESTTABS.BAT - Batch script to execute the test cases
8051.H - Useful register definitions for the 8051
MOTO.H - Useful directive definitions for Motorola compatibility
README.TXT - Brief Explanation of Disk contents
COPYRIGH.TXT - Copyright notice
ORDERFRM.TXT - Registration Form
ORDERFRM.HTM - Registration Form (HTML)
RELNOTES.TXT - Release notes.
Although you may freely copy the above files, TASM is not 'free' or
'public domain'. It is copyrighted material which can be copied and
evaluated by people without registration, but those that use it on a
regular basis must register (see the ORDERFRM.TXT or ORDERFRM.HTM files).
The following files are to be copied only with the following
restrictions: The owner of this software may make as many copies of
the following as is deemed necessary as long as no possibility exists
for the software (or derivitive products) to be in use on more than
one machine at a time. Or, if a site license has been purchased, the
software can only be used on machines at that site.
TASM.C
TASMMAIN.C
MACRO.C
PARSE.C
STR.C
LOOKUP.C
WRTOBJ.C
FNAME.C
WRTOBJ.C
ERRLOG.C
TASM.H
Thomas N. Anderson
Squak Valley Software
837 Front Street South
Issaquah, WA 98027
email: andersontn@acm.org

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

Loading…
Cancel
Save