diff --git a/branches/dwg/LSource/Makefile b/branches/dwg/LSource/Makefile new file mode 100644 index 00000000..dfdfb5a9 --- /dev/null +++ b/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: +# .rom, .sys, and .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= ROMSIZE= CPU= SYS= 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= ROMSIZE=[512|1024] CPU=[80|180] SYS=[CPM|ZSYS] 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)/*.* diff --git a/branches/dwg/LSource/bin/CPMCHATTR b/branches/dwg/LSource/bin/CPMCHATTR new file mode 100755 index 00000000..adf84bb4 Binary files /dev/null and b/branches/dwg/LSource/bin/CPMCHATTR differ diff --git a/branches/dwg/LSource/bin/CPMCHMOD b/branches/dwg/LSource/bin/CPMCHMOD new file mode 100755 index 00000000..2f89a4b0 Binary files /dev/null and b/branches/dwg/LSource/bin/CPMCHMOD differ diff --git a/branches/dwg/LSource/bin/CPMCP b/branches/dwg/LSource/bin/CPMCP new file mode 100755 index 00000000..b74af05a Binary files /dev/null and b/branches/dwg/LSource/bin/CPMCP differ diff --git a/branches/dwg/LSource/bin/CPMLS b/branches/dwg/LSource/bin/CPMLS new file mode 100755 index 00000000..ff570616 Binary files /dev/null and b/branches/dwg/LSource/bin/CPMLS differ diff --git a/branches/dwg/LSource/bin/CPMRM b/branches/dwg/LSource/bin/CPMRM new file mode 100755 index 00000000..589392e4 Binary files /dev/null and b/branches/dwg/LSource/bin/CPMRM differ diff --git a/branches/dwg/LSource/bin/CVT2LINUX b/branches/dwg/LSource/bin/CVT2LINUX new file mode 100755 index 00000000..f5592e6a Binary files /dev/null and b/branches/dwg/LSource/bin/CVT2LINUX differ diff --git a/branches/dwg/LSource/bin/TASM b/branches/dwg/LSource/bin/TASM new file mode 100755 index 00000000..2f7ef33e Binary files /dev/null and b/branches/dwg/LSource/bin/TASM differ diff --git a/branches/dwg/LSource/bin/TASM05.TAB b/branches/dwg/LSource/bin/TASM05.TAB new file mode 100644 index 00000000..1072d3dc --- /dev/null +++ b/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 */ + diff --git a/branches/dwg/LSource/bin/TASM3210.TAB b/branches/dwg/LSource/bin/TASM3210.TAB new file mode 100644 index 00000000..d5aed946 --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM3225.TAB b/branches/dwg/LSource/bin/TASM3225.TAB new file mode 100644 index 00000000..30dcd4c8 --- /dev/null +++ b/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 ;, + +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 + diff --git a/branches/dwg/LSource/bin/TASM48.TAB b/branches/dwg/LSource/bin/TASM48.TAB new file mode 100644 index 00000000..a76454ae --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM51.TAB b/branches/dwg/LSource/bin/TASM51.TAB new file mode 100644 index 00000000..24c2a142 --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM65.TAB b/branches/dwg/LSource/bin/TASM65.TAB new file mode 100644 index 00000000..c6b95ce7 --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM68.TAB b/branches/dwg/LSource/bin/TASM68.TAB new file mode 100644 index 00000000..7b9f5190 --- /dev/null +++ b/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 */ + diff --git a/branches/dwg/LSource/bin/TASM70.TAB b/branches/dwg/LSource/bin/TASM70.TAB new file mode 100644 index 00000000..b1cc5e04 --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM80.TAB b/branches/dwg/LSource/bin/TASM80.TAB new file mode 100644 index 00000000..f644ccd4 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/bin/TASM85.TAB b/branches/dwg/LSource/bin/TASM85.TAB new file mode 100644 index 00000000..83c866bb --- /dev/null +++ b/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 + diff --git a/branches/dwg/LSource/bin/TASM96.TAB b/branches/dwg/LSource/bin/TASM96.TAB new file mode 100644 index 00000000..ca6669b6 --- /dev/null +++ b/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 + + diff --git a/branches/dwg/LSource/bin/tasm180.tab b/branches/dwg/LSource/bin/tasm180.tab new file mode 100644 index 00000000..a3dd5839 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13.tar b/branches/dwg/LSource/src/cpmtools-2.13.tar new file mode 100644 index 00000000..c6773dd9 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13.tar differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/.depend b/branches/dwg/LSource/src/cpmtools-2.13/.depend new file mode 100644 index 00000000..a6039372 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/COPYING b/branches/dwg/LSource/src/cpmtools-2.13/COPYING new file mode 100644 index 00000000..44325404 --- /dev/null +++ b/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. + 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. + + + Copyright (C) + + 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 . + +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: + + Copyright (C) + 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 +. + + 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 +. + diff --git a/branches/dwg/LSource/src/cpmtools-2.13/INSTALL b/branches/dwg/LSource/src/cpmtools-2.13/INSTALL new file mode 100644 index 00000000..6c565395 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/INSTALL @@ -0,0 +1,212 @@ +Options for "./configure" include: + + --with-defformat= + 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 . 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. + diff --git a/branches/dwg/LSource/src/cpmtools-2.13/Makefile b/branches/dwg/LSource/src/cpmtools-2.13/Makefile new file mode 100644 index 00000000..3555ab36 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/Makefile.in b/branches/dwg/LSource/src/cpmtools-2.13/Makefile.in new file mode 100644 index 00000000..53059a07 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/NEWS b/branches/dwg/LSource/src/cpmtools-2.13/NEWS new file mode 100644 index 00000000..fa404572 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/NEWS @@ -0,0 +1,3 @@ +Changes since 2.13: + +o Avoid unneccessary directory writes diff --git a/branches/dwg/LSource/src/cpmtools-2.13/README b/branches/dwg/LSource/src/cpmtools-2.13/README new file mode 100644 index 00000000..5268daab --- /dev/null +++ b/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. diff --git a/branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk b/branches/dwg/LSource/src/cpmtools-2.13/README.win32-libdsk new file mode 100644 index 00000000..ff9eb457 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt b/branches/dwg/LSource/src/cpmtools-2.13/README.win32.cygwin.txt new file mode 100644 index 00000000..868e1e8c --- /dev/null +++ b/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 \ No newline at end of file diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile b/branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile new file mode 100644 index 00000000..75c4ee00 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/badfs/Makefile @@ -0,0 +1,7 @@ +# +# Dummy makefile +# +all: +clean: +distclean: + diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber b/branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber new file mode 100644 index 00000000..9259cacb Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/blocknumber differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext b/branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext new file mode 100644 index 00000000..8ee7d65b Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/doubleext differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/extension b/branches/dwg/LSource/src/cpmtools-2.13/badfs/extension new file mode 100644 index 00000000..cc02845f Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/extension differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/extno b/branches/dwg/LSource/src/cpmtools-2.13/badfs/extno new file mode 100644 index 00000000..5948b0ee Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/extno differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom b/branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom new file mode 100644 index 00000000..3d8fea49 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/hugecom differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/label b/branches/dwg/LSource/src/cpmtools-2.13/badfs/label new file mode 100644 index 00000000..982928d1 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/label differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr b/branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr new file mode 100644 index 00000000..da20f4b5 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/lcr differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks b/branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks new file mode 100644 index 00000000..52c1d922 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/multipleblocks differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/name b/branches/dwg/LSource/src/cpmtools-2.13/badfs/name new file mode 100644 index 00000000..67265aca Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/name differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount b/branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount new file mode 100644 index 00000000..e8633a56 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/recordcount differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/status b/branches/dwg/LSource/src/cpmtools-2.13/badfs/status new file mode 100644 index 00000000..33da2481 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/status differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps b/branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps new file mode 100644 index 00000000..a434cc96 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/badfs/timestamps differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.guess b/branches/dwg/LSource/src/cpmtools-2.13/config.guess new file mode 100755 index 00000000..d53e309f --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/config.guess @@ -0,0 +1,1498 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-19' + +# This file 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 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ELF__ + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep -q __LP64__ + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + authenticamd | genuineintel | EM64T) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:* | mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=${UNAME_MACHINE}el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=${UNAME_MACHINE} + #else + CPU= + #endif + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.h b/branches/dwg/LSource/src/cpmtools-2.13/config.h new file mode 100644 index 00000000..03128855 --- /dev/null +++ b/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 +#endif + +#if HAVE_SYS_TYPES_H +#include +#endif + +#if HAVE_LIMITS_H +#include +#endif + +#if HAVE_UNISTD_H +#include +#endif + +#if HAVE_WINDOWS_H +#include +#endif + +#if HAVE_WINIOCTL_H +#include +#endif + +#if HAVE_LIBDSK_H +#include +#endif + +#if HAVE_FCNTL_H +#include +#endif + +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX _MAX_PATH +#endif + +#include + +/* 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 */ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.h.in b/branches/dwg/LSource/src/cpmtools-2.13/config.h.in new file mode 100644 index 00000000..0e057156 --- /dev/null +++ b/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 +#endif + +#if HAVE_SYS_TYPES_H +#include +#endif + +#if HAVE_LIMITS_H +#include +#endif + +#if HAVE_UNISTD_H +#include +#endif + +#if HAVE_WINDOWS_H +#include +#endif + +#if HAVE_WINIOCTL_H +#include +#endif + +#if HAVE_LIBDSK_H +#include +#endif + +#if HAVE_FCNTL_H +#include +#endif + +#ifndef _POSIX_PATH_MAX +#define _POSIX_PATH_MAX _MAX_PATH +#endif + +#include + +/* 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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.log b/branches/dwg/LSource/src/cpmtools-2.13/config.log new file mode 100644 index 00000000..615f8ae3 --- /dev/null +++ b/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 +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 +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 +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #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 +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #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 +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #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 +| #ifdef HAVE_SYS_TYPES_H +| # include +| #endif +| #ifdef HAVE_SYS_STAT_H +| # include +| #endif +| #ifdef STDC_HEADERS +| # include +| # include +| #else +| # ifdef HAVE_STDLIB_H +| # include +| # endif +| #endif +| #ifdef HAVE_STRING_H +| # if !defined STDC_HEADERS && defined HAVE_MEMORY_H +| # include +| # endif +| # include +| #endif +| #ifdef HAVE_STRINGS_H +| # include +| #endif +| #ifdef HAVE_INTTYPES_H +| # include +| #endif +| #ifdef HAVE_STDINT_H +| # include +| #endif +| #ifdef HAVE_UNISTD_H +| # include +| #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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.status b/branches/dwg/LSource/src/cpmtools-2.13/config.status new file mode 100755 index 00000000..abe1670e --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/config.status @@ -0,0 +1,1014 @@ +#! /bin/sh +# Generated by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +# Files that config.status was made for. +config_files=" Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1" +config_headers=" config.h" + +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +ac_cs_config="" +ac_cs_version="\ +config.status +configured by ./configure, generated by GNU Autoconf 2.65, + with options \"$ac_cs_config\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='/home/doug/RomWBW/branches/dwg/LSource/src/cpmtools-2.13' +srcdir='.' +INSTALL='/usr/bin/install -c' +test -n "$AWK" || AWK=awk +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +if $ac_cs_recheck; then + set X '/bin/sh' './configure' $ac_configure_extra_args --no-create --no-recursion + shift + $as_echo "running CONFIG_SHELL=/bin/sh $*" >&6 + CONFIG_SHELL='/bin/sh' + export CONFIG_SHELL + exec "$@" +fi + +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "cpm.5") CONFIG_FILES="$CONFIG_FILES cpm.5" ;; + "cpmchattr.1") CONFIG_FILES="$CONFIG_FILES cpmchattr.1" ;; + "cpmchmod.1") CONFIG_FILES="$CONFIG_FILES cpmchmod.1" ;; + "cpmcp.1") CONFIG_FILES="$CONFIG_FILES cpmcp.1" ;; + "cpmls.1") CONFIG_FILES="$CONFIG_FILES cpmls.1" ;; + "cpmrm.1") CONFIG_FILES="$CONFIG_FILES cpmrm.1" ;; + "fsck.cpm.1") CONFIG_FILES="$CONFIG_FILES fsck.cpm.1" ;; + "fsed.cpm.1") CONFIG_FILES="$CONFIG_FILES fsed.cpm.1" ;; + "mkfs.cpm.1") CONFIG_FILES="$CONFIG_FILES mkfs.cpm.1" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +cat >>"$tmp/subs1.awk" <<\_ACAWK && +S["LTLIBOBJS"]="" +S["UPDATED"]="March 30, 2010" +S["FSED_CPM"]="fsed.cpm" +S["DEFFORMAT"]="ibm-3740" +S["DISKDEFS"]="${datarootdir}/diskdefs" +S["DATADIR"]="${prefix}/share" +S["DEVICE"]="posix" +S["LDDEPS"]="" +S["LDLIBS"]="" +S["LIBOBJS"]="" +S["EGREP"]="" +S["GREP"]="" +S["CPP"]="gcc -E" +S["INSTALL_DATA"]="${INSTALL} -m 644" +S["INSTALL_SCRIPT"]="${INSTALL}" +S["INSTALL_PROGRAM"]="${INSTALL}" +S["OBJEXT"]="o" +S["EXEEXT"]="" +S["ac_ct_CC"]="gcc" +S["CPPFLAGS"]="" +S["LDFLAGS"]=" -g" +S["CFLAGS"]="-g -O2 -pipe -Wall -Wno-unused -Wshadow -Wbad-function-cast -Wmissing-prototypes -Wstrict-prototypes -Wcast-align -Wcast-qual -Wpointer-arith -Wwrit"\ +"e-strings -Wmissing-declarations -Wnested-externs -Wundef -pedantic -fno-common" +S["CC"]="gcc" +S["host_os"]="linux-gnu" +S["host_vendor"]="unknown" +S["host_cpu"]="x86_64" +S["host"]="x86_64-unknown-linux-gnu" +S["build_os"]="linux-gnu" +S["build_vendor"]="unknown" +S["build_cpu"]="x86_64" +S["build"]="x86_64-unknown-linux-gnu" +S["target_alias"]="" +S["host_alias"]="" +S["build_alias"]="" +S["LIBS"]="-lcurses " +S["ECHO_T"]="" +S["ECHO_N"]="-n" +S["ECHO_C"]="" +S["DEFS"]="-DHAVE_CONFIG_H" +S["mandir"]="${datarootdir}/man" +S["localedir"]="${datarootdir}/locale" +S["libdir"]="${exec_prefix}/lib" +S["psdir"]="${docdir}" +S["pdfdir"]="${docdir}" +S["dvidir"]="${docdir}" +S["htmldir"]="${docdir}" +S["infodir"]="${datarootdir}/info" +S["docdir"]="${datarootdir}/doc/${PACKAGE}" +S["oldincludedir"]="/usr/include" +S["includedir"]="${prefix}/include" +S["localstatedir"]="${prefix}/var" +S["sharedstatedir"]="${prefix}/com" +S["sysconfdir"]="${prefix}/etc" +S["datadir"]="${datarootdir}" +S["datarootdir"]="${prefix}/share" +S["libexecdir"]="${exec_prefix}/libexec" +S["sbindir"]="${exec_prefix}/sbin" +S["bindir"]="${exec_prefix}/bin" +S["program_transform_name"]="s,x,x," +S["prefix"]="/usr/local" +S["exec_prefix"]="${prefix}" +S["PACKAGE_URL"]="" +S["PACKAGE_BUGREPORT"]="" +S["PACKAGE_STRING"]="" +S["PACKAGE_VERSION"]="" +S["PACKAGE_TARNAME"]="" +S["PACKAGE_NAME"]="" +S["PATH_SEPARATOR"]=":" +S["SHELL"]="/bin/sh" +_ACAWK +cat >>"$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +D["PACKAGE_NAME"]=" \"\"" +D["PACKAGE_TARNAME"]=" \"\"" +D["PACKAGE_VERSION"]=" \"\"" +D["PACKAGE_STRING"]=" \"\"" +D["PACKAGE_BUGREPORT"]=" \"\"" +D["PACKAGE_URL"]=" \"\"" +D["HAVE_FCNTL_H"]=" 1" +D["HAVE_SYS_TYPES_H"]=" 1" +D["HAVE_SYS_STAT_H"]=" 1" +D["HAVE_LIMITS_H"]=" 1" +D["HAVE_UNISTD_H"]=" 1" +D["HAVE_STRFTIME"]=" 1" +D["HAVE_MKTIME"]=" 1" +D["HAVE_STRERROR"]=" 1" + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+[_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][_abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789]*([\t (]|$)/ { + line = $ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + ac_datarootdir_hack=' + s&@datadir@&${datarootdir}&g + s&@docdir@&${datarootdir}/doc/${PACKAGE}&g + s&@infodir@&${datarootdir}/info&g + s&@localedir@&${datarootdir}/locale&g + s&@mandir@&${datarootdir}/man&g + s&\${datarootdir}&${prefix}/share&g' ;; +esac +ac_sed_extra="/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +} + +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/config.sub b/branches/dwg/LSource/src/cpmtools-2.13/config.sub new file mode 100755 index 00000000..17c91458 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/config.sub @@ -0,0 +1,1702 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 +# Free Software Foundation, Inc. + +timestamp='2009-11-07' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file 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 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., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted GNU ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 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." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray | -microblaze) + os= + basic_machine=$1 + ;; + -bluegene*) + os=-cnk + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | lm32 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep | metag \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | rx \ + | score \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | ubicom32 \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k | z80) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | lm32-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64octeon-* | mips64octeonel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tron-* \ + | ubicom32-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-* | z80-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aros) + basic_machine=i386-pc + os=-aros + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + microblaze) + basic_machine=microblaze-xilinx + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* | -aros* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* | -cegcc* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -dicos*) + os=-dicos + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -cnk*|-aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/branches/dwg/LSource/src/cpmtools-2.13/configure b/branches/dwg/LSource/src/cpmtools-2.13/configure new file mode 100755 index 00000000..d8149b07 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/configure @@ -0,0 +1,5701 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.65. +# +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, +# Inc. +# +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +if test "x$CONFIG_SHELL" = x; then + as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which + # is contrary to our usage. Disable this feature. + alias -g '\${1+\"\$@\"}'='\"\$@\"' + setopt NO_GLOB_SUBST +else + case \`(set -o) 2>/dev/null\` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi +" + as_required="as_fn_return () { (exit \$1); } +as_fn_success () { as_fn_return 0; } +as_fn_failure () { as_fn_return 1; } +as_fn_ret_success () { return 0; } +as_fn_ret_failure () { return 1; } + +exitcode=0 +as_fn_success || { exitcode=1; echo as_fn_success failed.; } +as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } +as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } +as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } +if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : + +else + exitcode=1; echo positional parameters were not saved. +fi +test x\$exitcode = x0 || exit 1" + as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO + as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO + eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && + test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 +test \$(( 1 + 1 )) = 2 || exit 1" + if (eval "$as_required") 2>/dev/null; then : + as_have_required=yes +else + as_have_required=no +fi + if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : + +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +as_found=false +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + as_found=: + case $as_dir in #( + /*) + for as_base in sh bash ksh sh5; do + # Try only shells that exist, to save several forks. + as_shell=$as_dir/$as_base + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : + CONFIG_SHELL=$as_shell as_have_required=yes + if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : + break 2 +fi +fi + done;; + esac + as_found=false +done +$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && + { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : + CONFIG_SHELL=$SHELL as_have_required=yes +fi; } +IFS=$as_save_IFS + + + if test "x$CONFIG_SHELL" != x; then : + # We cannot yet assume a decent shell, so we have to provide a + # neutralization value for shells without unset; and this also + # works around shells that cannot unset nonexistent variables. + BASH_ENV=/dev/null + ENV=/dev/null + (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + if test x$as_have_required = xno; then : + $as_echo "$0: This script requires a shell more modern than all" + $as_echo "$0: the shells that I found on your system." + if test x${ZSH_VERSION+set} = xset ; then + $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" + $as_echo "$0: be upgraded to zsh 4.3.4 or later." + else + $as_echo "$0: Please tell bug-autoconf@gnu.org about your system, +$0: including any error possibly output before this +$0: message. Then install a modern shell, or manually run +$0: the script under such a shell if you do have one." + fi + exit 1 +fi +fi +fi +SHELL=${CONFIG_SHELL-/bin/sh} +export SHELL +# Unset more variables known to interfere with behavior of common tools. +CLICOLOR_FORCE= GREP_OPTIONS= +unset CLICOLOR_FORCE GREP_OPTIONS + +## --------------------- ## +## M4sh Shell Functions. ## +## --------------------- ## +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + + + as_lineno_1=$LINENO as_lineno_1a=$LINENO + as_lineno_2=$LINENO as_lineno_2a=$LINENO + eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && + test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { + # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +test -n "$DJDIR" || exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= +PACKAGE_URL= + +ac_unique_file="cpmfs.c" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_subst_vars='LTLIBOBJS +UPDATED +FSED_CPM +DEFFORMAT +DISKDEFS +DATADIR +DEVICE +LDDEPS +LDLIBS +LIBOBJS +EGREP +GREP +CPP +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_URL +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_diskdefs +with_defformat +with_libdsk +with_dmalloc +enable_largefile +' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid feature name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; + + -without-* | --without-*) + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + as_fn_error "invalid package name: $ac_useropt" + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) as_fn_error "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information." + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + case $ac_envvar in #( + '' | [0-9]* | *[!_$as_cr_alnum]* ) + as_fn_error "invalid variable name: \`$ac_envvar'" ;; + esac + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + as_fn_error "missing argument to $ac_option" +fi + +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + as_fn_error "working directory cannot be determined" +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + as_fn_error "pwd does not report name of working directory" + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-largefile omit support for large files + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-diskdefs Specify diskdefs location + --with-defformat Specify default format (ibm-3740) + --with-libdsk Specify path to libdsk library + --with-dmalloc Specify path to dmalloc library + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to the package provider. +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +configure +generated by GNU Autoconf 2.65 + +Copyright (C) 2009 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit +fi + +## ------------------------ ## +## Autoconf initialization. ## +## ------------------------ ## + +# ac_fn_c_try_compile LINENO +# -------------------------- +# Try to compile conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext + if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_compile + +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_try_link LINENO +# ----------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_link () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + rm -f conftest.$ac_objext conftest$ac_exeext + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information + # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would + # interfere with the next link command; also delete a directory that is + # left behind by Apple's compiler. We do this before executing the actions. + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_link + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_header_compile + +# ac_fn_c_check_type LINENO TYPE VAR INCLUDES +# ------------------------------------------- +# Tests whether TYPE exists after having included INCLUDES, setting cache +# variable VAR accordingly. +ac_fn_c_check_type () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=no" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof ($2)) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +if (sizeof (($2))) + return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + eval "$3=yes" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_type + +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$2 || defined __stub___$2 +choke me +#endif + +int +main () +{ +return $2 (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_func +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.65. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + $as_echo "PATH: $as_dir" + done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; + 2) + as_fn_append ac_configure_args1 " '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + as_fn_append ac_configure_args " '$ac_arg'" + ;; + esac + done +done +{ ac_configure_args0=; unset ac_configure_args0;} +{ ac_configure_args1=; unset ac_configure_args1;} + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + $as_echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +$as_echo "/* confdefs.h */" > confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_URL "$PACKAGE_URL" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE +if test -n "$CONFIG_SITE"; then + ac_site_file1=$CONFIG_SITE +elif test "x$prefix" != xNONE; then + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site +else + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site +fi +for ac_site_file in "$ac_site_file1" "$ac_site_file2" +do + test "x$ac_site_file" = xNONE && continue + if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special files + # actually), so we avoid doing that. DJGPP emulates it as a regular file. + if test /dev/null != "$cache_file" && test -f "$cache_file"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) as_fn_append ac_configure_args " '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 +fi +## -------------------- ## +## Main body of script. ## +## -------------------- ## + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +ac_config_headers="$ac_config_headers config.h" + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + for ac_t in install-sh install.sh shtool; do + if test -f "$ac_dir/$ac_t"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/$ac_t -c" + break 2 + fi + done +done +if test -z "$ac_aux_dir"; then + as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } +if test "${ac_cv_build+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } +if test "${ac_cv_host+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +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_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 +$as_echo "$CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "no acceptable C compiler found in \$PATH +See \`config.log' for more details." "$LINENO" 5; } + +# Provide some information about the compiler. +$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 +for ac_option in --version -v -V -qversion; do + { { ac_try="$ac_compiler $ac_option >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compiler $ac_option >&5") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + sed '10a\ +... rest of stderr output deleted ... + 10q' conftest.err >conftest.er1 + cat conftest.er1 >&5 + fi + rm -f conftest.er1 conftest.err + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } +done + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { { ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi +if test -z "$ac_file"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +$as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ as_fn_set_status 77 +as_fn_error "C compiler cannot create executables +See \`config.log' for more details." "$LINENO" 5; }; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } +ac_exeext=$ac_cv_exeext + +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } +if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest conftest$ac_cv_exeext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +int +main () +{ +FILE *f = fopen ("conftest.out", "w"); + return ferror (f) || fclose (f) != 0; + + ; + return 0; +} +_ACEOF +ac_clean_files="$ac_clean_files conftest.out" +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +if test "$cross_compiling" != yes; then + { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } + if { ac_try='./conftest$ac_cv_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." "$LINENO" 5; } + fi + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } + +rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out +ac_clean_files=$ac_clean_files_save +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } +if test "${ac_cv_objext+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { { ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then : + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "cannot compute suffix of object files: cannot compile +See \`config.log' for more details." "$LINENO" 5; } +fi +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_compiler_gnu=yes +else + ac_compiler_gnu=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +else + CFLAGS="" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +else + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_g=yes +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c89=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c89" != xno; then : + +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in #(( + ./ | .// | /[cC]/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + fi + done + done + ;; +esac + + done +IFS=$as_save_IFS + +rm -rf conftest.one conftest.two conftest.dir + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +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 + + +case $host_os in + *cygwin* ) CYGWIN=yes;; + * ) CYGWIN=no;; +esac + + +case $host_os in + *mingw32* ) MINGW32=yes;; + * ) MINGW32=no;; +esac + +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 + + +# Check whether --with-diskdefs was given. +if test "${with_diskdefs+set}" = set; then : + withval=$with_diskdefs; DISKDEFS="$withval" +else + DISKDEFS="$DISKDEFS" +fi + + +# Check whether --with-defformat was given. +if test "${with_defformat+set}" = set; then : + withval=$with_defformat; DEFFORMAT="$withval" +else + DEFFORMAT="ibm-3740" +fi + + +# Check whether --with-libdsk was given. +if test "${with_libdsk+set}" = set; then : + withval=$with_libdsk; LIBDSK="$withval" +else + LIBDSK="" +fi + + +# Check whether --with-dmalloc was given. +if test "${with_dmalloc+set}" = set; then : + withval=$with_dmalloc; CPPFLAGS="$CPPFLAGS -I$with_dmalloc/include" + LDFLAGS="$LDFLAGS -L$with_dmalloc/lib" + LIBS="$LIBS -ldmalloc" + $as_echo "#define USE_DMALLOC 1" >>confdefs.h + +fi + + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for printw in -lcurses" >&5 +$as_echo_n "checking for printw in -lcurses... " >&6; } +if test "${ac_cv_lib_curses_printw+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char printw (); +int +main () +{ +return printw (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_curses_printw=yes +else + ac_cv_lib_curses_printw=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_curses_printw" >&5 +$as_echo "$ac_cv_lib_curses_printw" >&6; } +if test "x$ac_cv_lib_curses_printw" = x""yes; then : + FSED_CPM=fsed.cpm LIBS="-lcurses $LIBS" +else + FSED_CPM= +fi + +if test x"$FSED_CPM" = x""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for printw in -lncurses" >&5 +$as_echo_n "checking for printw in -lncurses... " >&6; } +if test "${ac_cv_lib_ncurses_printw+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lncurses $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char printw (); +int +main () +{ +return printw (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_ncurses_printw=yes +else + ac_cv_lib_ncurses_printw=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_printw" >&5 +$as_echo "$ac_cv_lib_ncurses_printw" >&6; } +if test "x$ac_cv_lib_ncurses_printw" = x""yes; then : + FSED_CPM=fsed.cpm LIBS="-lncurses $LIBS" +else + FSED_CPM= +fi + +fi + +if test "$LIBDSK" != ""; then + DEVICE="libdsk" + CPPFLAGS="$CPPFLAGS -I$LIBDSK/include" + CFLAGS="$CFLAGS -I$LIBDSK/include $CFLAGS_LIBDSK" + LDFLAGS="$LDFLAGS -L$LIBDSK/lib" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dsk_open in -ldsk" >&5 +$as_echo_n "checking for dsk_open in -ldsk... " >&6; } +if test "${ac_cv_lib_dsk_dsk_open+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldsk $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dsk_open (); +int +main () +{ +return dsk_open (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_dsk_dsk_open=yes +else + ac_cv_lib_dsk_dsk_open=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dsk_dsk_open" >&5 +$as_echo "$ac_cv_lib_dsk_dsk_open" >&6; } +if test "x$ac_cv_lib_dsk_dsk_open" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDSK 1 +_ACEOF + + LIBS="-ldsk $LIBS" + +fi + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if test "${ac_cv_path_GREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in libdsk.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "libdsk.h" "ac_cv_header_libdsk_h" "$ac_includes_default" +if test "x$ac_cv_header_libdsk_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBDSK_H 1 +_ACEOF + +else + echo "No libdsk.h - aborting"; exit 1 +fi + +done + +fi + +if test x"$DEVICE" = x"win32"; then + for ac_header in windows.h +do : + ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" +if test "x$ac_cv_header_windows_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINDOWS_H 1 +_ACEOF + +else + echo "Device win32, but not found - aborting"; exit 1 +fi + +done + + for ac_header in winioctl.h +do : + ac_fn_c_check_header_compile "$LINENO" "winioctl.h" "ac_cv_header_winioctl_h" "#ifdef HAVE_WINDOWS_H +#include +#endif + +" +if test "x$ac_cv_header_winioctl_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_WINIOCTL_H 1 +_ACEOF + +else + echo "Device win32, but not found - aborting"; exit 1 +fi + +done + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if test "${ac_cv_header_stdc+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +for ac_header in fcntl.h sys/types.h sys/stat.h limits.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" +eval as_val=\$$as_ac_Header + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for an ANSI C-conforming const" >&5 +$as_echo_n "checking for an ANSI C-conforming const... " >&6; } +if test "${ac_cv_c_const+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_c_const=yes +else + ac_cv_c_const=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_const" >&5 +$as_echo "$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +$as_echo "#define const /**/" >>confdefs.h + +fi + +ac_fn_c_check_type "$LINENO" "mode_t" "ac_cv_type_mode_t" "$ac_includes_default" +if test "x$ac_cv_type_mode_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "off_t" "ac_cv_type_off_t" "$ac_includes_default" +if test "x$ac_cv_type_off_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define off_t long int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" +if test "x$ac_cv_type_pid_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define pid_t int +_ACEOF + +fi + +ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" +if test "x$ac_cv_type_size_t" = x""yes; then : + +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 +$as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } +if test "${ac_cv_struct_tm+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include + +int +main () +{ +struct tm tm; + int *p = &tm.tm_sec; + return !p; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_struct_tm=time.h +else + ac_cv_struct_tm=sys/time.h +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_struct_tm" >&5 +$as_echo "$ac_cv_struct_tm" >&6; } +if test $ac_cv_struct_tm = sys/time.h; then + +$as_echo "#define TM_IN_SYS_TIME 1" >>confdefs.h + +fi + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then : + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + if ac_fn_c_try_compile "$LINENO"; then : + break +fi +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_largefile_CC=' -n32'; break +fi +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_file_offset_bits=64; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + while :; do + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=no; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_sys_large_files=1; break +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + +if test x"$FSED_CPM" != x""; then + FSED_CPM="$FSED_CPM$EXEEXT" +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working memcmp" >&5 +$as_echo_n "checking for working memcmp... " >&6; } +if test "${ac_cv_func_memcmp_working+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + if test "$cross_compiling" = yes; then : + ac_cv_func_memcmp_working=no +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = '\100', c1 = '\200', c2 = '\201'; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + return 1; + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + return 1; + } + return 0; + } + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + ac_cv_func_memcmp_working=yes +else + ac_cv_func_memcmp_working=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_memcmp_working" >&5 +$as_echo "$ac_cv_func_memcmp_working" >&6; } +test $ac_cv_func_memcmp_working = no && case " $LIBOBJS " in + *" memcmp.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS memcmp.$ac_objext" + ;; +esac + + +for ac_func in strftime +do : + ac_fn_c_check_func "$LINENO" "strftime" "ac_cv_func_strftime" +if test "x$ac_cv_func_strftime" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_STRFTIME 1 +_ACEOF + +else + # strftime is in -lintl on SCO UNIX. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for strftime in -lintl" >&5 +$as_echo_n "checking for strftime in -lintl... " >&6; } +if test "${ac_cv_lib_intl_strftime+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char strftime (); +int +main () +{ +return strftime (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_intl_strftime=yes +else + ac_cv_lib_intl_strftime=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_intl_strftime" >&5 +$as_echo "$ac_cv_lib_intl_strftime" >&6; } +if test "x$ac_cv_lib_intl_strftime" = x""yes; then : + $as_echo "#define HAVE_STRFTIME 1" >>confdefs.h + +LIBS="-lintl $LIBS" +fi + +fi +done + +for ac_func in mktime strerror +do : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +eval DATADIR=$datadir + + + + + +ac_config_files="$ac_config_files Makefile cpm.5 cpmchattr.1 cpmchmod.1 cpmcp.1 cpmls.1 cpmrm.1 fsck.cpm.1 fsed.cpm.1 mkfs.cpm.1" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( + *) { eval $ac_var=; unset $ac_var;} ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes: double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \. + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" + as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + + +: ${CONFIG_STATUS=./config.status} +ac_write_fail=0 +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +as_write_fail=0 +cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false + +SHELL=\${CONFIG_SHELL-$SHELL} +export SHELL +_ASEOF +cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 +## -------------------- ## +## M4sh Initialization. ## +## -------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : + emulate sh + NULLCMD=: + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in #( + *posix*) : + set -o posix ;; #( + *) : + ;; +esac +fi + + +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +# Prefer a ksh shell builtin over an external printf program on Solaris, +# but without wasting forks for bash or zsh. +if test -z "$BASH_VERSION$ZSH_VERSION" \ + && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='print -r --' + as_echo_n='print -rn --' +elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in #( + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in #(( + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break + done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + exit 1 +fi + +# Unset variables that we do not need and which cause bugs (e.g. in +# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" +# suppresses any "Segmentation fault" message there. '((' could +# trigger a bug in pdksh 5.2.14. +for as_var in BASH_ENV ENV MAIL MAILPATH +do eval test x\${$as_var+set} = xset \ + && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE + +# CDPATH. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + + +# as_fn_error ERROR [LINENO LOG_FD] +# --------------------------------- +# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are +# provided, also output the error to LOG_FD, referencing LINENO. Then exit the +# script with status $?, using 1 if that was 0. +as_fn_error () +{ + as_status=$?; test $as_status -eq 0 && as_status=1 + if test "$3"; then + as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + fi + $as_echo "$as_me: error: $1" >&2 + as_fn_exit $as_status +} # as_fn_error + + +# as_fn_set_status STATUS +# ----------------------- +# Set $? to STATUS, without forking. +as_fn_set_status () +{ + return $1 +} # as_fn_set_status + +# as_fn_exit STATUS +# ----------------- +# Exit the shell with STATUS, even in a "trap 0" or "set -e" context. +as_fn_exit () +{ + set +e + as_fn_set_status $1 + exit $1 +} # as_fn_exit + +# as_fn_unset VAR +# --------------- +# Portably unset VAR. +as_fn_unset () +{ + { eval $1=; unset $1;} +} +as_unset=as_fn_unset +# as_fn_append VAR VALUE +# ---------------------- +# Append the text in VALUE to the end of the definition contained in VAR. Take +# advantage of any shell optimizations that allow amortized linear growth over +# repeated appends, instead of the typical quadratic growth present in naive +# implementations. +if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : + eval 'as_fn_append () + { + eval $1+=\$2 + }' +else + as_fn_append () + { + eval $1=\$$1\$2 + } +fi # as_fn_append + +# as_fn_arith ARG... +# ------------------ +# Perform arithmetic evaluation on the ARGs, and store the result in the +# global $as_val. Take advantage of shells that can avoid forks. The arguments +# must be portable across $(()) and expr. +if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : + eval 'as_fn_arith () + { + as_val=$(( $* )) + }' +else + as_fn_arith () + { + as_val=`expr "$@" || test $? -eq 1` + } +fi # as_fn_arith + + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in #((((( +-n*) + case `echo 'xy\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + xy) ECHO_C='\c';; + *) echo `echo ksh88 bug on AIX 6.1` > /dev/null + ECHO_T=' ';; + esac;; +*) + ECHO_N='-n';; +esac + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir 2>/dev/null +fi +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else + as_ln_s='cp -p' + fi +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + + +# as_fn_mkdir_p +# ------------- +# Create "$as_dir" as a directory, including parents if necessary. +as_fn_mkdir_p () +{ + + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || eval $as_mkdir_p || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + + +} # as_fn_mkdir_p +if mkdir -p . 2>/dev/null; then + as_mkdir_p='mkdir -p "$as_dir"' +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in #( + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 +## ----------------------------------- ## +## Main body of $CONFIG_STATUS script. ## +## ----------------------------------- ## +_ASEOF +test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# Save the log message, to keep $0 and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by $as_me, which was +generated by GNU Autoconf 2.65. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +ac_cs_usage="\ +\`$as_me' instantiates files and other configuration actions +from templates according to the current configuration. Unless the files +and actions are specified as TAGs, all are instantiated by default. + +Usage: $0 [OPTION]... [TAG]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + --config print configuration, then exit + -q, --quiet, --silent + do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Report bugs to the package provider." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.65, + with options \\"\$ac_cs_config\\" + +Copyright (C) 2009 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +test -n "\$AWK" || AWK=awk +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + $as_echo "$ac_cs_version"; exit ;; + --config | --confi | --conf | --con | --co | --c ) + $as_echo "$ac_cs_config"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_FILES " '$ac_optarg'" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + as_fn_append CONFIG_HEADERS " '$ac_optarg'" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + as_fn_error "ambiguous option: \`$1' +Try \`$0 --help' for more information.";; + --help | --hel | -h ) + $as_echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) as_fn_error "unrecognized option: \`$1' +Try \`$0 --help' for more information." ;; + + *) as_fn_append ac_config_targets " $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +if \$ac_cs_recheck; then + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' + export CONFIG_SHELL + exec "\$@" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + $as_echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "cpm.5") CONFIG_FILES="$CONFIG_FILES cpm.5" ;; + "cpmchattr.1") CONFIG_FILES="$CONFIG_FILES cpmchattr.1" ;; + "cpmchmod.1") CONFIG_FILES="$CONFIG_FILES cpmchmod.1" ;; + "cpmcp.1") CONFIG_FILES="$CONFIG_FILES cpmcp.1" ;; + "cpmls.1") CONFIG_FILES="$CONFIG_FILES cpmls.1" ;; + "cpmrm.1") CONFIG_FILES="$CONFIG_FILES cpmrm.1" ;; + "fsck.cpm.1") CONFIG_FILES="$CONFIG_FILES fsck.cpm.1" ;; + "fsed.cpm.1") CONFIG_FILES="$CONFIG_FILES fsed.cpm.1" ;; + "mkfs.cpm.1") CONFIG_FILES="$CONFIG_FILES mkfs.cpm.1" ;; + + *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap 'as_fn_exit 1' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 + +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. +if test -n "$CONFIG_FILES"; then + + +ac_cr=`echo X | tr X '\015'` +# On cygwin, bash can eat \r inside `` if the user requested igncr. +# But we know of no other shell where ac_cr would be empty at this +# point, so we can use a bashism as a fallback. +if test "x$ac_cr" = x; then + eval ac_cr=\$\'\\r\' +fi +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && +_ACEOF + + +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + . ./conf$$subs.sh || + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done +rm -f conf$$subs.sh + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +_ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\)..*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\)..*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" + +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || as_fn_error "could not setup config files machinery" "$LINENO" 5 +_ACEOF + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +fi # test -n "$CONFIG_FILES" + +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF + +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + as_fn_error "could not setup config headers machinery" "$LINENO" 5 +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS " +shift +for ac_tag +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + esac + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + as_fn_append ac_file_inputs " '$ac_f'" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} + fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + as_dir="$ac_dir"; as_fn_mkdir_p + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= +ac_sed_dataroot=' +/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s|@configure_input@|$ac_sed_conf_input|;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + ;; + :H) + # + # CONFIG_HEADER + # + if test x"$ac_file" != x-; then + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || as_fn_error "could not create $ac_file" "$LINENO" 5 + fi + else + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error "could not create -" "$LINENO" 5 + fi + ;; + + + esac + +done # for ac_tag + + +as_fn_exit 0 +_ACEOF +ac_clean_files=$ac_clean_files_save + +test $ac_write_fail = 0 || + as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || as_fn_exit $? +fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi + diff --git a/branches/dwg/LSource/src/cpmtools-2.13/configure.in b/branches/dwg/LSource/src/cpmtools-2.13/configure.in new file mode 100644 index 00000000..3a9b985c --- /dev/null +++ b/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 not found - aborting"; exit 1] ) + AC_CHECK_HEADERS(winioctl.h, ,[echo "Device win32, but not found - aborting"; exit 1], +[#ifdef HAVE_WINDOWS_H +#include +#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 ) diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpm.5 b/branches/dwg/LSource/src/cpmtools-2.13/cpm.5 new file mode 100644 index 00000000..8a9e1c4e --- /dev/null +++ b/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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in b/branches/dwg/LSource/src/cpmtools-2.13/cpm.5.in new file mode 100644 index 00000000..89371f6c --- /dev/null +++ b/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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr new file mode 100755 index 00000000..adf84bb4 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1 b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1 new file mode 100644 index 00000000..39a37c14 --- /dev/null +++ b/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 + and copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.1.in new file mode 100644 index 00000000..77c2b4ca --- /dev/null +++ b/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 + and copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c new file mode 100644 index 00000000..cf337e21 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmchattr.c @@ -0,0 +1,112 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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 and copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in b/branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.1.in new file mode 100644 index 00000000..05a42245 --- /dev/null +++ b/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 + and copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c new file mode 100644 index 00000000..701d3b38 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmchmod.c @@ -0,0 +1,84 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in b/branches/dwg/LSource/src/cpmtools-2.13/cpmcp.1.in new file mode 100644 index 00000000..2d7dec82 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c new file mode 100644 index 00000000..f840f598 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmcp.c @@ -0,0 +1,284 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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=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=' ' && !((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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c new file mode 100644 index 00000000..1d4524ed --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.c @@ -0,0 +1,1561 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "cpmdir.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#endif +/*}}}*/ +/* #defines */ /*{{{*/ +#undef CPMFS_DEBUG + +/* Number of _used_ bits per int */ + +#define INTBITS ((int)(sizeof(int)*8)) + +/* There are four reserved entries: ., .., [passwd] and [label] */ + +#define RESERVED_ENTRIES 4 + +/* CP/M does not support any kind of inodes, so they are simulated. +Inode 0-(maxdir-1) are used by files which lowest extent is stored in +the respective directory entry. Inode maxdir is the root directory +and inode maxdir+1 is the passwd file, if any. */ + +#define RESERVED_INODES 3 + +#define PASSWD_RECLEN 24 +/*}}}*/ + +extern char **environ; +const char *boo; +static mode_t s_ifdir=1; +static mode_t s_ifreg=1; + +/* memcpy7 -- Copy string, leaving 8th bit alone */ /*{{{*/ +static void memcpy7(char *dest, const char *src, int count) +{ + while (count--) + { + *dest = ((*dest) & 0x80) | ((*src) & 0x7F); + ++dest; + ++src; + } +} +/*}}}*/ + +/* file name conversions */ +/* splitFilename -- split file name into name and extension */ /*{{{*/ +static int splitFilename(const char *fullname, int type, char *name, char *ext, int *user) +{ + int i,j; + + assert(fullname!=(const char*)0); + assert(name!=(char*)0); + assert(ext!=(char*)0); + assert(user!=(int*)0); + memset(name,' ',8); + memset(ext,' ',3); + if (!isdigit(fullname[0]) || !isdigit(fullname[1])) + { + boo="illegal CP/M filename"; + return -1; + } + *user=10*(fullname[0]-'0')+(fullname[1]-'0'); + fullname+=2; + if ((fullname[0]=='\0') || (type==CPMFS_DR22 && *user>=16) || (type==CPMFS_P2DOS && *user>=32)) + { + boo="illegal CP/M filename"; + return -1; + } + for (i=0; i<8 && fullname[i] && fullname[i]!='.'; ++i) if (!ISFILECHAR(i,fullname[i])) + { + boo="illegal CP/M filename"; + return -1; + } + else name[i]=toupper(fullname[i]); + if (fullname[i]=='.') + { + ++i; + for (j=0; j<3 && fullname[i]; ++i,++j) if (!ISFILECHAR(1,fullname[i])) + { + boo="illegal CP/M filename"; + return -1; + } + else ext[j]=toupper(fullname[i]); + if (i==1 && j==0) + { + boo="illegal CP/M filename"; + return -1; + } + } + return 0; +} +/*}}}*/ +/* isMatching -- do two file names match? */ /*{{{*/ +static int isMatching(int user1, const char *name1, const char *ext1, int user2, const char *name2, const char *ext2) +{ + int i; + + assert(name1!=(const char*)0); + assert(ext1!=(const char*)0); + assert(name2!=(const char*)0); + assert(ext2!=(const char*)0); + if (user1!=user2) return 0; + for (i=0; i<8; ++i) if ((name1[i]&0x7f)!=(name2[i]&0x7f)) return 0; + for (i=0; i<3; ++i) if ((ext1[i]&0x7f)!=(ext2[i]&0x7f)) return 0; + return 1; +} +/*}}}*/ + +/* time conversions */ +/* cpm2unix_time -- convert CP/M time to UTC */ /*{{{*/ +static time_t cpm2unix_time(int days, int hour, int min) +{ + /* CP/M stores timestamps in local time. We don't know which */ + /* timezone was used and if DST was in effect. Assuming it was */ + /* the current offset from UTC is most sensible, but not perfect. */ + + int year,days_per_year; + static int days_per_month[]={31,0,31,30,31,30,31,31,30,31,30,31}; + char **old_environ; + static char gmt0[]="TZ=GMT0"; + static char *gmt_env[]={ gmt0, (char*)0 }; + struct tm tms; + time_t lt,t; + + time(<); + t=lt; + tms=*localtime(<); + old_environ=environ; + environ=gmt_env; + lt=mktime(&tms); + lt-=t; + tms.tm_sec=0; + tms.tm_min=((min>>4)&0xf)*10+(min&0xf); + tms.tm_hour=((hour>>4)&0xf)*10+(hour&0xf); + tms.tm_mday=1; + tms.tm_mon=0; + tms.tm_year=78; + tms.tm_isdst=-1; + for (;;) + { + year=tms.tm_year+1900; + days_per_year=((year%4)==0 && ((year%100) || (year%400)==0)) ? 366 : 365; + if (days>days_per_year) + { + days-=days_per_year; + ++tms.tm_year; + } + else break; + } + for (;;) + { + days_per_month[1]=(days_per_year==366) ? 29 : 28; + if (days>days_per_month[tms.tm_mon]) + { + days-=days_per_month[tms.tm_mon]; + ++tms.tm_mon; + } + else break; + } + t=mktime(&tms)+(days-1)*24*3600; + environ=old_environ; + t-=lt; + return t; +} +/*}}}*/ +/* unix2cpm_time -- convert UTC to CP/M time */ /*{{{*/ +static void unix2cpm_time(time_t now, int *days, int *hour, int *min) +{ + struct tm *tms; + int i; + + tms=localtime(&now); + *min=((tms->tm_min/10)<<4)|(tms->tm_min%10); + *hour=((tms->tm_hour/10)<<4)|(tms->tm_hour%10); + for (i=1978,*days=0; i<1900+tms->tm_year; ++i) + { + *days+=365; + if (i%4==0 && (i%100!=0 || i%400==0)) ++*days; + } + *days += tms->tm_yday+1; +} +/*}}}*/ + +/* allocation vector bitmap functions */ +/* alvInit -- init allocation vector */ /*{{{*/ +static void alvInit(const struct cpmSuperBlock *d) +{ + int i,j,offset,block; + + assert(d!=(const struct cpmSuperBlock*)0); + /* clean bitmap */ /*{{{*/ + memset(d->alv,0,d->alvSize*sizeof(int)); + /*}}}*/ + /* mark directory blocks as used */ /*{{{*/ + *d->alv=(1<<((d->maxdir*32+d->blksiz-1)/d->blksiz))-1; + /*}}}*/ + for (i=0; imaxdir; ++i) /* mark file blocks as used */ /*{{{*/ + { + if (d->dir[i].status>=0 && d->dir[i].status<=(d->type==CPMFS_P2DOS ? 31 : 15)) + { +#ifdef CPMFS_DEBUG + fprintf(stderr,"alvInit: allocate extent %d\n",i); +#endif + for (j=0; j<16; ++j) + { + block=(unsigned char)d->dir[i].pointers[j]; + if (d->size>=256) block+=(((unsigned char)d->dir[i].pointers[++j])<<8); + if (block && blocksize) + { +#ifdef CPMFS_DEBUG + fprintf(stderr,"alvInit: allocate block %d\n",block); +#endif + offset=block/INTBITS; + d->alv[offset]|=(1<alvSize; ++i) + { + for (j=0,bits=drive->alv[i]; j=drive->size) + { + boo="device full"; + return -1; + } + drive->alv[i] |= (1<>= 1; + } + } + boo="device full"; + return -1; +} +/*}}}*/ + +/* logical block I/O */ +/* readBlock -- read a (partial) block */ /*{{{*/ +static int readBlock(const struct cpmSuperBlock *d, int blockno, char *buffer, int start, int end) +{ + int sect, track, counter; + + assert(blockno>=0); + assert(blocknosize); + assert(buffer!=(char*)0); + if (end<0) end=d->blksiz/d->secLength-1; + sect=(blockno*(d->blksiz/d->secLength)+ d->sectrk*d->boottrk)%d->sectrk; + track=(blockno*(d->blksiz/d->secLength)+ d->sectrk*d->boottrk)/d->sectrk; + for (counter=0; counter<=end; ++counter) + { + const char *err; + + if (counter>=start && (err=Device_readSector(&d->dev,track,d->skewtab[sect],buffer+(d->secLength*counter)))) + { + boo=err; + return -1; + } + ++sect; + if (sect>=d->sectrk) + { + sect = 0; + ++track; + } + } + return 0; +} +/*}}}*/ +/* writeBlock -- write a (partial) block */ /*{{{*/ +static int writeBlock(const struct cpmSuperBlock *d, int blockno, const char *buffer, int start, int end) +{ + int sect, track, counter; + + assert(blockno>=0); + assert(blocknosize); + assert(buffer!=(const char*)0); + if (end < 0) end=d->blksiz/d->secLength-1; + sect = (blockno*(d->blksiz/d->secLength))%d->sectrk; + track = (blockno*(d->blksiz/d->secLength))/d->sectrk+d->boottrk; + for (counter = 0; counter<=end; ++counter) + { + const char *err; + + if (counter>=start && (err=Device_writeSector(&d->dev,track,d->skewtab[sect],buffer+(d->secLength*counter)))) + { + boo=err; + return -1; + } + ++sect; + if (sect>=d->sectrk) + { + sect=0; + ++track; + } + } + return 0; +} +/*}}}*/ + +/* directory management */ +/* findFileExtent -- find first/next extent for a file */ /*{{{*/ +static int findFileExtent(const struct cpmSuperBlock *sb, int user, const char *name, const char *ext, int start, int extno) +{ + boo="file already exists"; + for (; startmaxdir; ++start) + { + if + ( + ((unsigned char)sb->dir[start].status)<=(sb->type==CPMFS_P2DOS ? 31 : 15) + && (extno==-1 || (EXTENT(sb->dir[start].extnol,sb->dir[start].extnoh)/sb->extents)==(extno/sb->extents)) + && isMatching(user,name,ext,sb->dir[start].status,sb->dir[start].name,sb->dir[start].ext) + ) return start; + } + boo="file not found"; + return -1; +} +/*}}}*/ +/* findFreeExtent -- find first free extent */ /*{{{*/ +static int findFreeExtent(const struct cpmSuperBlock *drive) +{ + int i; + + for (i=0; imaxdir; ++i) if (drive->dir[i].status==(char)0xe5) return (i); + boo="directory full"; + return -1; +} +/*}}}*/ +/* updateTimeStamps -- convert time stamps to CP/M format */ /*{{{*/ +static void updateTimeStamps(const struct cpmInode *ino, int extent) +{ + struct PhysDirectoryEntry *date; + int i; + int ca_min,ca_hour,ca_days,u_min,u_hour,u_days; + + if (!S_ISREG(ino->mode)) return; +#ifdef CPMFS_DEBUG + fprintf(stderr,"CPMFS: updating time stamps for inode %d (%d)\n",extent,extent&3); +#endif + unix2cpm_time(ino->sb->cnotatime ? ino->ctime : ino->atime,&ca_days,&ca_hour,&ca_min); + unix2cpm_time(ino->mtime,&u_days,&u_hour,&u_min); + if ((ino->sb->type==CPMFS_P2DOS || ino->sb->type==CPMFS_DR3) && (date=ino->sb->dir+(extent|3))->status==0x21) + { + ino->sb->dirtyDirectory=1; + switch (extent&3) + { + case 0: /* first entry */ /*{{{*/ + { + date->name[0]=ca_days&0xff; date->name[1]=ca_days>>8; + date->name[2]=ca_hour; + date->name[3]=ca_min; + date->name[4]=u_days&0xff; date->name[5]=u_days>>8; + date->name[6]=u_hour; + date->name[7]=u_min; + break; + } + /*}}}*/ + case 1: /* second entry */ /*{{{*/ + { + date->ext[2]=ca_days&0xff; date->extnol=ca_days>>8; + date->lrc=ca_hour; + date->extnoh=ca_min; + date->blkcnt=u_days&0xff; date->pointers[0]=u_days>>8; + date->pointers[1]=u_hour; + date->pointers[2]=u_min; + break; + } + /*}}}*/ + case 2: /* third entry */ /*{{{*/ + { + date->pointers[5]=ca_days&0xff; date->pointers[6]=ca_days>>8; + date->pointers[7]=ca_hour; + date->pointers[8]=ca_min; + date->pointers[9]=u_days&0xff; date->pointers[10]=u_days>>8; + date->pointers[11]=u_hour; + date->pointers[12]=u_min; + break; + } + /*}}}*/ + } + } +} +/*}}}*/ + +/* diskdefReadSuper -- read super block from diskdefs file */ /*{{{*/ +static int diskdefReadSuper(struct cpmSuperBlock *d, const char *format) +{ + char line[256]; + FILE *fp; + int insideDef=0,found=0; + + if ((fp=fopen(DISKDEFS,"r"))==(FILE*)0 && (fp=fopen("diskdefs","r"))==(FILE*)0) + { + fprintf(stderr,"%s: Neither " DISKDEFS " nor diskdefs could be opened.\n",cmd); + exit(1); + } + while (fgets(line,sizeof(line),fp)!=(char*)0) + { + int argc; + char *argv[2]; + + for (argc=0; argc<1 && (argv[argc]=strtok(argc ? (char*)0 : line," \t\n")); ++argc); + if ((argv[argc]=strtok((char*)0,"\n"))!=(char*)0) ++argc; + if (insideDef) + { + if (argc==1 && strcmp(argv[0],"end")==0) + { + insideDef=0; + d->size=(d->secLength*d->sectrk*(d->tracks-d->boottrk))/d->blksiz; + if (d->extents==0) d->extents=((d->size>=256 ? 8 : 16)*d->blksiz)/16384; + if (d->extents==0) d->extents=1; + if (found) break; + } + else if (argc==2) + { + if (strcmp(argv[0],"seclen")==0) d->secLength=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"tracks")==0) d->tracks=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"sectrk")==0) d->sectrk=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"blocksize")==0) d->blksiz=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"maxdir")==0) d->maxdir=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"skew")==0) d->skew=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"skewtab")==0) + { + int pass,sectors; + + for (pass=0; pass<2; ++pass) + { + char *s; + + sectors=0; + for (s=argv[1]; *s; ) + { + int phys; + char *end; + + phys=strtol(s,&end,10); + if (pass==1) d->skewtab[sectors]=phys; + if (end==s) + { + fprintf(stderr,"%s: invalid skewtab `%s' at `%s'\n",cmd,argv[1],s); + exit(1); + } + s=end; + ++sectors; + if (*s==',') ++s; + } + if (pass==0) d->skewtab=malloc(sizeof(int)*sectors); + } + } + else if (strcmp(argv[0],"boottrk")==0) d->boottrk=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"logicalextents")==0) d->extents=strtol(argv[1],(char**)0,0); + else if (strcmp(argv[0],"os")==0) + { + if (strcmp(argv[1],"2.2")==0) d->type=CPMFS_DR22; + else if (strcmp(argv[1],"3")==0) d->type=CPMFS_DR3; + else if (strcmp(argv[1],"p2dos")==0) d->type=CPMFS_P2DOS; + } + } + else if (argc>0 && argv[0][0]!='#') + { + fprintf(stderr,"%s: invalid keyword `%s'\n",cmd,argv[0]); + exit(1); + } + } + else if (argc==2 && strcmp(argv[0],"diskdef")==0) + { + insideDef=1; + d->skew=1; + d->extents=0; + d->type=CPMFS_DR3; + d->skewtab=(int*)0; + if (strcmp(argv[1],format)==0) found=1; + } + } + fclose(fp); + if (!found) + { + fprintf(stderr,"%s: unknown format %s\n",cmd,format); + exit(1); + } + return 0; +} +/*}}}*/ +/* amsReadSuper -- read super block from amstrad disk */ /*{{{*/ +static int amsReadSuper(struct cpmSuperBlock *d, const char *format) +{ + unsigned char boot_sector[512], *boot_spec; + const char *err; + + Device_setGeometry(&d->dev,512,9,40); + if ((err=Device_readSector(&d->dev, 0, 0, (char *)boot_sector))) + { + fprintf(stderr,"%s: Failed to read Amstrad superblock (%s)\n",cmd,err); + exit(1); + } + boot_spec=(boot_sector[0] == 0 || boot_sector[0] == 3)?boot_sector:(unsigned char*)0; + /* Check for JCE's extension to allow Amstrad and MSDOS superblocks + * in the same sector (for the PCW16) + */ + if + ( + (boot_sector[0] == 0xE9 || boot_sector[0] == 0xEB) + && !memcmp(boot_sector + 0x2B, "CP/M", 4) + && !memcmp(boot_sector + 0x33, "DSK", 3) + && !memcmp(boot_sector + 0x7C, "CP/M", 4) + ) boot_spec = boot_sector + 128; + if (boot_spec==(unsigned char*)0) + { + fprintf(stderr,"%s: Amstrad superblock not present\n",cmd); + exit(1); + } + /* boot_spec[0] = format number: 0 for SS SD, 3 for DS DD + [1] = single/double sided and density flags + [2] = cylinders per side + [3] = sectors per cylinder + [4] = Physical sector shift, 2 => 512 + [5] = Reserved track count + [6] = Block shift + [7] = No. of directory blocks + */ + d->type = CPMFS_DR3; /* Amstrads are CP/M 3 systems */ + d->secLength = 128 << boot_spec[4]; + d->tracks = boot_spec[2]; + if (boot_spec[1] & 3) d->tracks *= 2; + d->sectrk = boot_spec[3]; + d->blksiz = 128 << boot_spec[6]; + d->maxdir = (d->blksiz / 32) * boot_spec[7]; + d->skew = 1; /* Amstrads skew at the controller level */ + d->skewtab = (int*)0; + d->boottrk = boot_spec[5]; + d->size = (d->secLength*d->sectrk*(d->tracks-d->boottrk))/d->blksiz; + d->extents = ((d->size>=256 ? 8 : 16)*d->blksiz)/16384; + + return 0; +} +/*}}}*/ + +/* match -- match filename against a pattern */ /*{{{*/ +static int recmatch(const char *a, const char *pattern) +{ + int first=1; + + while (*pattern) + { + switch (*pattern) + { + case '*': + { + if (*a=='.' && first) return 1; + ++pattern; + while (*a) if (recmatch(a,pattern)) return 1; else ++a; + break; + } + case '?': + { + if (*a) { ++a; ++pattern; } else return 0; + break; + } + default: if (tolower(*a)==tolower(*pattern)) { ++a; ++pattern; } else return 0; + } + first=0; + } + return (*pattern=='\0' && *a=='\0'); +} + +int match(const char *a, const char *pattern) +{ + int user; + char pat[255]; + + assert(strlen(pattern)<255); + if (isdigit(*pattern) && *(pattern+1)==':') { user=(*pattern-'0'); pattern+=2; } + else if (isdigit(*pattern) && isdigit(*(pattern+1)) && *(pattern+2)==':') { user=(10*(*pattern-'0')+(*(pattern+1)-'0')); pattern+=3; } + else user=-1; + if (user==-1) sprintf(pat,"??%s",pattern); + else sprintf(pat,"%02d%s",user,pattern); + return recmatch(a,pat); +} + +/*}}}*/ +/* cpmglob -- expand CP/M style wildcards */ /*{{{*/ +void cpmglob(int optin, int argc, char * const argv[], struct cpmInode *root, int *gargc, char ***gargv) +{ + struct cpmFile dir; + int entries,dirsize=0; + struct cpmDirent *dirent=(struct cpmDirent*)0; + int gargcap=0,i,j; + + *gargv=(char**)0; + *gargc=0; + cpmOpendir(root,&dir); + entries=0; + dirsize=8; + dirent=malloc(sizeof(struct cpmDirent)*dirsize); + while (cpmReaddir(&dir,&dirent[entries])) + { + ++entries; + if (entries==dirsize) dirent=realloc(dirent,sizeof(struct cpmDirent)*(dirsize*=2)); + } + for (i=optin; idev,d->secLength,d->sectrk,d->tracks); + if (d->skewtab==(int*)0) /* generate skew table */ /*{{{*/ + { + int i,j,k; + + if (( d->skewtab = malloc(d->sectrk*sizeof(int))) == (int*)0) + { + fprintf(stderr,"%s: can not allocate memory for skew sector table\n",cmd); + exit(1); + } + memset(d->skewtab,0,d->sectrk*sizeof(int)); + for (i=j=0; isectrk; ++i,j=(j+d->skew)%d->sectrk) + { + while (1) + { + for (k=0; kskewtab[k]!=j; ++k); + if (ksectrk; + else break; + } + d->skewtab[i]=j; + } + } + /*}}}*/ + /* initialise allocation vector bitmap */ /*{{{*/ + { + d->alvSize=((d->secLength*d->sectrk*(d->tracks-d->boottrk))/d->blksiz+INTBITS-1)/INTBITS; + if ((d->alv=malloc(d->alvSize*sizeof(int)))==(int*)0) + { + boo="out of memory"; + return -1; + } + } + /*}}}*/ + /* allocate directory buffer */ /*{{{*/ + if ((d->dir=malloc(d->maxdir*32))==(struct PhysDirectoryEntry*)0) + { + boo="out of memory"; + return -1; + } + /*}}}*/ + if (d->dev.opened==0) /* create empty directory in core */ /*{{{*/ + { + memset(d->dir,0xe5,d->maxdir*32); + } + /*}}}*/ + else /* read directory in core */ /*{{{*/ + { + int i,blocks,entry; + + blocks=(d->maxdir*32+d->blksiz-1)/d->blksiz; + entry=0; + for (i=0; idir+entry),0,-1)==-1) return -1; + entry+=(d->blksiz/32); + } + } + /*}}}*/ + alvInit(d); + if (d->type==CPMFS_DR3) /* read additional superblock information */ /*{{{*/ + { + int i; + + /* passwords */ /*{{{*/ + { + int passwords=0; + + for (i=0; imaxdir; ++i) if (d->dir[i].status>=16 && d->dir[i].status<=31) ++passwords; +#ifdef CPMFS_DEBUG + fprintf(stderr,"getformat: found %d passwords\n",passwords); +#endif + if ((d->passwdLength=passwords*PASSWD_RECLEN)) + { + if ((d->passwd=malloc(d->passwdLength))==(char*)0) + { + boo="out of memory"; + return -1; + } + for (i=0,passwords=0; imaxdir; ++i) if (d->dir[i].status>=16 && d->dir[i].status<=31) + { + int j,pb; + char *p=d->passwd+(passwords++*PASSWD_RECLEN); + + p[0]='0'+(d->dir[i].status-16)/10; + p[1]='0'+(d->dir[i].status-16)%10; + for (j=0; j<8; ++j) p[2+j]=d->dir[i].name[j]&0x7f; + p[10]=(d->dir[i].ext[0]&0x7f)==' ' ? ' ' : '.'; + for (j=0; j<3; ++j) p[11+j]=d->dir[i].ext[j]&0x7f; + p[14]=' '; + pb=(unsigned char)d->dir[i].lrc; + for (j=0; j<8; ++j) p[15+j]=((unsigned char)d->dir[i].pointers[7-j])^pb; +#ifdef CPMFS_DEBUG + p[23]='\0'; + fprintf(stderr,"getformat: %s\n",p); +#endif + p[23]='\n'; + } + } + } + /*}}}*/ + /* disc label */ /*{{{*/ + for (i=0; imaxdir; ++i) if (d->dir[i].status==(char)0x20) + { + int j; + + d->cnotatime=d->dir[i].extnol&0x10; + if (d->dir[i].extnol&0x1) + { + d->labelLength=12; + if ((d->label=malloc(d->labelLength))==(char*)0) + { + boo="out of memory"; + return -1; + } + for (j=0; j<8; ++j) d->label[j]=d->dir[i].name[j]&0x7f; + for (j=0; j<3; ++j) d->label[8+j]=d->dir[i].ext[j]&0x7f; + d->label[11]='\n'; + } + else + { + d->labelLength=0; + } + break; + } + if (i==d->maxdir) + { + d->cnotatime=1; + d->labelLength=0; + } + /*}}}*/ + } + /*}}}*/ + else + { + d->passwdLength=0; + d->cnotatime=1; + d->labelLength=0; + } + d->root=root; + root->ino=d->maxdir; + root->sb=d; + root->mode=(s_ifdir|0777); + root->size=0; + root->atime=root->mtime=root->ctime=0; + return 0; +} +/*}}}*/ +/* cpmNamei -- map name to inode */ /*{{{*/ +int cpmNamei(const struct cpmInode *dir, const char *filename, struct cpmInode *i) +{ + /* variables */ /*{{{*/ + int user; + char name[8],extension[3]; + struct PhysDirectoryEntry *date; + int highestExtno,highestExt=-1,lowestExtno,lowestExt=-1; + int protectMode=0; + /*}}}*/ + + if (!S_ISDIR(dir->mode)) + { + boo="No such file"; + return -1; + } + if (strcmp(filename,".")==0 || strcmp(filename,"..")==0) /* root directory */ /*{{{*/ + { + *i=*dir; + return 0; + } + /*}}}*/ + else if (strcmp(filename,"[passwd]")==0 && dir->sb->passwdLength) /* access passwords */ /*{{{*/ + { + i->attr=0; + i->ino=dir->sb->maxdir+1; + i->mode=s_ifreg|0444; + i->sb=dir->sb; + i->atime=i->mtime=i->ctime=0; + i->size=i->sb->passwdLength; + return 0; + } + /*}}}*/ + else if (strcmp(filename,"[label]")==0 && dir->sb->labelLength) /* access label */ /*{{{*/ + { + i->attr=0; + i->ino=dir->sb->maxdir+2; + i->mode=s_ifreg|0444; + i->sb=dir->sb; + i->atime=i->mtime=i->ctime=0; + i->size=i->sb->labelLength; + return 0; + } + /*}}}*/ + if (splitFilename(filename,dir->sb->type,name,extension,&user)==-1) return -1; + /* find highest and lowest extent */ /*{{{*/ + { + int extent; + + i->size=0; + extent=-1; + highestExtno=-1; + lowestExtno=2049; + while ((extent=findFileExtent(dir->sb,user,name,extension,extent+1,-1))!=-1) + { + int extno=EXTENT(dir->sb->dir[extent].extnol,dir->sb->dir[extent].extnoh); + + if (extno>highestExtno) + { + highestExtno=extno; + highestExt=extent; + } + if (extnosize=highestExtno*16384; + if (dir->sb->size<256) for (block=15; block>=0; --block) + { + if (dir->sb->dir[highestExt].pointers[block]) break; + } + else for (block=7; block>=0; --block) + { + if (dir->sb->dir[highestExt].pointers[2*block] || dir->sb->dir[highestExt].pointers[2*block+1]) break; + } + if (dir->sb->dir[highestExt].blkcnt) i->size+=((dir->sb->dir[highestExt].blkcnt&0xff)-1)*128; + i->size+=dir->sb->dir[highestExt].lrc ? (dir->sb->dir[highestExt].lrc&0xff) : 128; +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmNamei: size=%ld\n",(long)i->size); +#endif + } + /*}}}*/ + i->ino=lowestExt; + i->mode=s_ifreg; + i->sb=dir->sb; + /* set timestamps */ /*{{{*/ + if + ( + (dir->sb->type==CPMFS_P2DOS || dir->sb->type==CPMFS_DR3) + && (date=dir->sb->dir+(lowestExt|3))->status==0x21 + ) + { + /* variables */ /*{{{*/ + int u_days=0,u_hour=0,u_min=0; + int ca_days=0,ca_hour=0,ca_min=0; + /*}}}*/ + + switch (lowestExt&3) + { + case 0: /* first entry of the four */ /*{{{*/ + { + ca_days=((unsigned char)date->name[0])+(((unsigned char)date->name[1])<<8); + ca_hour=(unsigned char)date->name[2]; + ca_min=(unsigned char)date->name[3]; + u_days=((unsigned char)date->name[4])+(((unsigned char)date->name[5])<<8); + u_hour=(unsigned char)date->name[6]; + u_min=(unsigned char)date->name[7]; + protectMode=(unsigned char)date->ext[0]; + break; + } + /*}}}*/ + case 1: /* second entry */ /*{{{*/ + { + ca_days=((unsigned char)date->ext[2])+(((unsigned char)date->extnol)<<8); + ca_hour=(unsigned char)date->lrc; + ca_min=(unsigned char)date->extnoh; + u_days=((unsigned char)date->blkcnt)+(((unsigned char)date->pointers[0])<<8); + u_hour=(unsigned char)date->pointers[1]; + u_min=(unsigned char)date->pointers[2]; + protectMode=(unsigned char)date->pointers[3]; + break; + } + /*}}}*/ + case 2: /* third one */ /*{{{*/ + { + ca_days=((unsigned char)date->pointers[5])+(((unsigned char)date->pointers[6])<<8); + ca_hour=(unsigned char)date->pointers[7]; + ca_min=(unsigned char)date->pointers[8]; + u_days=((unsigned char)date->pointers[9])+(((unsigned char)date->pointers[10])<<8); + u_hour=(unsigned char)date->pointers[11]; + u_min=(unsigned char)date->pointers[12]; + protectMode=(unsigned char)date->pointers[13]; + break; + } + /*}}}*/ + } + if (i->sb->cnotatime) + { + i->ctime=cpm2unix_time(ca_days,ca_hour,ca_min); + i->atime=0; + } + else + { + i->ctime=0; + i->atime=cpm2unix_time(ca_days,ca_hour,ca_min); + } + i->mtime=cpm2unix_time(u_days,u_hour,u_min); + } + else i->atime=i->mtime=i->ctime=0; + /*}}}*/ + + /* Determine the inode attributes */ + i->attr = 0; + if (dir->sb->dir[lowestExt].name[0]&0x80) i->attr |= CPM_ATTR_F1; + if (dir->sb->dir[lowestExt].name[1]&0x80) i->attr |= CPM_ATTR_F2; + if (dir->sb->dir[lowestExt].name[2]&0x80) i->attr |= CPM_ATTR_F3; + if (dir->sb->dir[lowestExt].name[3]&0x80) i->attr |= CPM_ATTR_F4; + if (dir->sb->dir[lowestExt].ext [0]&0x80) i->attr |= CPM_ATTR_RO; + if (dir->sb->dir[lowestExt].ext [1]&0x80) i->attr |= CPM_ATTR_SYS; + if (dir->sb->dir[lowestExt].ext [2]&0x80) i->attr |= CPM_ATTR_ARCV; + if (protectMode&0x20) i->attr |= CPM_ATTR_PWDEL; + if (protectMode&0x40) i->attr |= CPM_ATTR_PWWRITE; + if (protectMode&0x80) i->attr |= CPM_ATTR_PWREAD; + + if (dir->sb->dir[lowestExt].ext[1]&0x80) i->mode|=01000; + i->mode|=0444; + if (!(dir->sb->dir[lowestExt].ext[0]&0x80)) i->mode|=0222; + if (extension[0]=='C' && extension[1]=='O' && extension[2]=='M') i->mode|=0111; + return 0; +} +/*}}}*/ +/* cpmStatFS -- statfs */ /*{{{*/ +void cpmStatFS(const struct cpmInode *ino, struct cpmStatFS *buf) +{ + int i; + struct cpmSuperBlock *d; + + d=ino->sb; + buf->f_bsize=d->blksiz; + buf->f_blocks=(d->tracks*d->sectrk*d->secLength)/d->blksiz; + buf->f_bfree=0; + buf->f_bused=-(d->maxdir*32+d->blksiz-1)/d->blksiz; + for (i=0; ialvSize; ++i) + { + int temp,j; + + temp = *(d->alv+i); + for (j=0; jsize) + { + if (1&temp) + { +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmStatFS: block %d allocated\n",(i*INTBITS+j)); +#endif + ++buf->f_bused; + } + else ++buf->f_bfree; + } + temp >>= 1; + } + } + buf->f_bavail=buf->f_bfree; + buf->f_files=d->maxdir; + buf->f_ffree=0; + for (i=0; imaxdir; ++i) + { + if (d->dir[i].status==(char)0xe5) ++buf->f_ffree; + } + buf->f_namelen=11; +} +/*}}}*/ +/* cpmUnlink -- unlink */ /*{{{*/ +int cpmUnlink(const struct cpmInode *dir, const char *fname) +{ + int user; + char name[8],extension[3]; + int extent; + struct cpmSuperBlock *drive; + + if (!S_ISDIR(dir->mode)) + { + boo="No such file"; + return -1; + } + drive=dir->sb; + if (splitFilename(fname,dir->sb->type,name,extension,&user)==-1) return -1; + if ((extent=findFileExtent(drive,user,name,extension,0,-1))==-1) return -1; + drive->dirtyDirectory=1; + drive->dir[extent].status=(char)0xe5; + do + { + drive->dir[extent].status=(char)0xe5; + } while ((extent=findFileExtent(drive,user,name,extension,extent+1,-1))>=0); + alvInit(drive); + return 0; +} +/*}}}*/ +/* cpmRename -- rename */ /*{{{*/ +int cpmRename(const struct cpmInode *dir, const char *old, const char *new) +{ + struct cpmSuperBlock *drive; + int extent; + int olduser; + char oldname[8], oldext[3]; + int newuser; + char newname[8], newext[3]; + + if (!S_ISDIR(dir->mode)) + { + boo="No such file"; + return -1; + } + drive=dir->sb; + if (splitFilename(old,dir->sb->type, oldname, oldext,&olduser)==-1) return -1; + if (splitFilename(new,dir->sb->type, newname, newext,&newuser)==-1) return -1; + if ((extent=findFileExtent(drive,olduser,oldname,oldext,0,-1))==-1) return -1; + if (findFileExtent(drive,newuser,newname, newext,0,-1)!=-1) + { + boo="file already exists"; + return -1; + } + do + { + drive->dirtyDirectory=1; + drive->dir[extent].status=newuser; + memcpy7(drive->dir[extent].name, newname, 8); + memcpy7(drive->dir[extent].ext, newext, 3); + } while ((extent=findFileExtent(drive,olduser,oldname,oldext,extent+1,-1))!=-1); + return 0; +} +/*}}}*/ +/* cpmOpendir -- opendir */ /*{{{*/ +int cpmOpendir(struct cpmInode *dir, struct cpmFile *dirp) +{ + if (!S_ISDIR(dir->mode)) + { + boo="No such file"; + return -1; + } + dirp->ino=dir; + dirp->pos=0; + dirp->mode=O_RDONLY; + return 0; +} +/*}}}*/ +/* cpmReaddir -- readdir */ /*{{{*/ +int cpmReaddir(struct cpmFile *dir, struct cpmDirent *ent) +{ + /* variables */ /*{{{*/ + struct PhysDirectoryEntry *cur=(struct PhysDirectoryEntry*)0; + char buf[2+8+1+3+1]; /* 00foobarxy.zzy\0 */ + int i; + char *bufp; + int hasext; + /*}}}*/ + + if (!(S_ISDIR(dir->ino->mode))) /* error: not a directory */ /*{{{*/ + { + boo="not a directory"; + return -1; + } + /*}}}*/ + while (1) + { + if (dir->pos==0) /* first entry is . */ /*{{{*/ + { + ent->ino=dir->ino->sb->maxdir; + ent->reclen=1; + strcpy(ent->name,"."); + ent->off=dir->pos; + ++dir->pos; + return 1; + } + /*}}}*/ + else if (dir->pos==1) /* next entry is .. */ /*{{{*/ + { + ent->ino=dir->ino->sb->maxdir; + ent->reclen=2; + strcpy(ent->name,".."); + ent->off=dir->pos; + ++dir->pos; + return 1; + } + /*}}}*/ + else if (dir->pos==2) + { + if (dir->ino->sb->passwdLength) /* next entry is [passwd] */ /*{{{*/ + { + ent->ino=dir->ino->sb->maxdir+1; + ent->reclen=8; + strcpy(ent->name,"[passwd]"); + ent->off=dir->pos; + ++dir->pos; + return 1; + } + /*}}}*/ + } + else if (dir->pos==3) + { + if (dir->ino->sb->labelLength) /* next entry is [label] */ /*{{{*/ + { + ent->ino=dir->ino->sb->maxdir+2; + ent->reclen=7; + strcpy(ent->name,"[label]"); + ent->off=dir->pos; + ++dir->pos; + return 1; + } + /*}}}*/ + } + else if (dir->pos>=RESERVED_ENTRIES && dir->posino->sb->maxdir+RESERVED_ENTRIES) + { + int first=dir->pos-RESERVED_ENTRIES; + + if ((cur=dir->ino->sb->dir+(dir->pos-RESERVED_ENTRIES))->status>=0 && cur->status<=(dir->ino->sb->type==CPMFS_P2DOS ? 31 : 15)) + { + /* determine first extent for the current file */ /*{{{*/ + for (i=0; iino->sb->maxdir; ++i) if (i!=(dir->pos-RESERVED_ENTRIES)) + { + if (isMatching(cur->status,cur->name,cur->ext,dir->ino->sb->dir[i].status,dir->ino->sb->dir[i].name,dir->ino->sb->dir[i].ext) && EXTENT(cur->extnol,cur->extnoh)>EXTENT(dir->ino->sb->dir[i].extnol,dir->ino->sb->dir[i].extnoh)) first=i; + } + /*}}}*/ + if (first==(dir->pos-RESERVED_ENTRIES)) + { + ent->ino=dir->pos-RESERVED_INODES; + /* convert file name to UNIX style */ /*{{{*/ + buf[0]='0'+cur->status/10; + buf[1]='0'+cur->status%10; + for (bufp=buf+2,i=0; i<8 && (cur->name[i]&0x7f)!=' '; ++i) *bufp++=tolower(cur->name[i]&0x7f); + for (hasext=0,i=0; i<3 && (cur->ext[i]&0x7f)!=' '; ++i) + { + if (!hasext) { *bufp++='.'; hasext=1; } + *bufp++=tolower(cur->ext[i]&0x7f); + } + *bufp='\0'; + /*}}}*/ + assert(bufp<=buf+sizeof(buf)); + ent->reclen=bufp-buf; + strcpy(ent->name,buf); + ent->off=dir->pos; + ++dir->pos; + return 1; + } + } + } + else return 0; + ++dir->pos; + } +} +/*}}}*/ +/* cpmStat -- stat */ /*{{{*/ +void cpmStat(const struct cpmInode *ino, struct cpmStat *buf) +{ + buf->ino=ino->ino; + buf->mode=ino->mode; + buf->size=ino->size; + buf->atime=ino->atime; + buf->mtime=ino->mtime; + buf->ctime=ino->ctime; +} +/*}}}*/ +/* cpmOpen -- open */ /*{{{*/ +int cpmOpen(struct cpmInode *ino, struct cpmFile *file, mode_t mode) +{ + if (S_ISREG(ino->mode)) + { + if ((mode&O_WRONLY) && (ino->mode&0222)==0) + { + boo="permission denied"; + return -1; + } + file->pos=0; + file->ino=ino; + file->mode=mode; + return 0; + } + else + { + boo="not a regular file"; + return -1; + } +} +/*}}}*/ +/* cpmRead -- read */ /*{{{*/ +int cpmRead(struct cpmFile *file, char *buf, int count) +{ + int findext=1,findblock=1,extent=-1,block=-1,extentno=-1,got=0,nextblockpos=-1,nextextpos=-1; + int blocksize=file->ino->sb->blksiz; + int extcap; + + extcap=(file->ino->sb->size<256 ? 16 : 8)*blocksize; + if (extcap>16384) extcap=16384*file->ino->sb->extents; + if (file->ino->ino==file->ino->sb->maxdir+1) /* [passwd] */ /*{{{*/ + { + if ((file->pos+count)>file->ino->size) count=file->ino->size-file->pos; + if (count) memcpy(buf,file->ino->sb->passwd+file->pos,count); + file->pos+=count; +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmRead passwd: read %d bytes, now at position %ld\n",count,(long)file->pos); +#endif + return count; + } + /*}}}*/ + else if (file->ino->ino==file->ino->sb->maxdir+2) /* [label] */ /*{{{*/ + { + if ((file->pos+count)>file->ino->size) count=file->ino->size-file->pos; + if (count) memcpy(buf,file->ino->sb->label+file->pos,count); + file->pos+=count; +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmRead label: read %d bytes, now at position %ld\n",count,(long)file->pos); +#endif + return count; + } + /*}}}*/ + else while (count>0 && file->posino->size) + { + char buffer[16384]; + + if (findext) + { + extentno=file->pos/16384; + extent=findFileExtent(file->ino->sb,file->ino->sb->dir[file->ino->ino].status,file->ino->sb->dir[file->ino->ino].name,file->ino->sb->dir[file->ino->ino].ext,0,extentno); + nextextpos=(file->pos/extcap)*extcap+extcap; + findext=0; + findblock=1; + } + if (findblock) + { + if (extent!=-1) + { + int start,end,ptr; + + ptr=(file->pos%extcap)/blocksize; + if (file->ino->sb->size>=256) ptr*=2; + block=(unsigned char)file->ino->sb->dir[extent].pointers[ptr]; + if (file->ino->sb->size>=256) block+=((unsigned char)file->ino->sb->dir[extent].pointers[ptr+1])<<8; + if (block==0) + { + memset(buffer,0,blocksize); + } + else + { + start=(file->pos%blocksize)/file->ino->sb->secLength; + end=((file->pos%blocksize+count)>blocksize ? blocksize-1 : (file->pos%blocksize+count-1))/file->ino->sb->secLength; + readBlock(file->ino->sb,block,buffer,start,end); + } + } + nextblockpos=(file->pos/blocksize)*blocksize+blocksize; + findblock=0; + } + if (file->pospos%blocksize]; + ++file->pos; + ++got; + --count; + } + else if (file->pos==nextextpos) findext=1; else findblock=1; + } +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmRead: read %d bytes, now at position %ld\n",got,(long)file->pos); +#endif + return got; +} +/*}}}*/ +/* cpmWrite -- write */ /*{{{*/ +int cpmWrite(struct cpmFile *file, const char *buf, int count) +{ + int findext=1,findblock=-1,extent=-1,extentno=-1,got=0,nextblockpos=-1,nextextpos=-1; + int blocksize=file->ino->sb->blksiz; + int extcap=(file->ino->sb->size<256 ? 16 : 8)*blocksize; + int block=-1,start=-1,end=-1,ptr=-1,last=-1; + char buffer[16384]; + + while (count>0) + { + if (findext) /*{{{*/ + { + extentno=file->pos/16384; + extent=findFileExtent(file->ino->sb,file->ino->sb->dir[file->ino->ino].status,file->ino->sb->dir[file->ino->ino].name,file->ino->sb->dir[file->ino->ino].ext,0,extentno); + nextextpos=(file->pos/extcap)*extcap+extcap; + if (extent==-1) + { + if ((extent=findFreeExtent(file->ino->sb))==-1) return (got==0 ? -1 : got); + file->ino->sb->dir[extent]=file->ino->sb->dir[file->ino->ino]; + memset(file->ino->sb->dir[extent].pointers,0,16); + file->ino->sb->dir[extent].extnol=EXTENTL(extentno); + file->ino->sb->dir[extent].extnoh=EXTENTH(extentno); + file->ino->sb->dir[extent].blkcnt=0; + file->ino->sb->dir[extent].lrc=0; + updateTimeStamps(file->ino,extent); + } + findext=0; + findblock=1; + } + /*}}}*/ + if (findblock) /*{{{*/ + { + ptr=(file->pos%extcap)/blocksize; + if (file->ino->sb->size>=256) ptr*=2; + block=(unsigned char)file->ino->sb->dir[extent].pointers[ptr]; + if (file->ino->sb->size>=256) block+=((unsigned char)file->ino->sb->dir[extent].pointers[ptr+1])<<8; + if (block==0) /* allocate new block, set start/end to cover it */ /*{{{*/ + { + if ((block=allocBlock(file->ino->sb))==-1) return (got==0 ? -1 : got); + file->ino->sb->dir[extent].pointers[ptr]=block&0xff; + if (file->ino->sb->size>=256) file->ino->sb->dir[extent].pointers[ptr+1]=(block>>8)&0xff; + start=0; + end=(blocksize-1)/file->ino->sb->secLength; + memset(buffer,0,blocksize); + } + /*}}}*/ + else /* read existing block and set start/end to cover modified parts */ /*{{{*/ + { + start=(file->pos%blocksize)/file->ino->sb->secLength; + end=((file->pos%blocksize+count)>blocksize ? blocksize-1 : (file->pos%blocksize+count-1))/file->ino->sb->secLength; + if (file->pos%file->ino->sb->secLength) readBlock(file->ino->sb,block,buffer,start,start); + if (end!=start && (file->pos+count-1)ino->sb,block,buffer+end*file->ino->sb->secLength,end,end); + } + /*}}}*/ + nextblockpos=(file->pos/blocksize)*blocksize+blocksize; + findblock=0; + } + /*}}}*/ + /* fill block and write it */ /*{{{*/ + file->ino->sb->dirtyDirectory=1; + while (file->pos!=nextblockpos && count) + { + buffer[file->pos%blocksize]=*buf++; + ++file->pos; + if (file->ino->sizepos) file->ino->size=file->pos; + ++got; + --count; + } + (void)writeBlock(file->ino->sb,block,buffer,start,end); + if (file->ino->sb->size<256) for (last=15; last>=0; --last) + { + if (file->ino->sb->dir[extent].pointers[last]) + { + break; + } + } + else for (last=14; last>0; last-=2) + { + if (file->ino->sb->dir[extent].pointers[last] || file->ino->sb->dir[extent].pointers[last+1]) + { + last/=2; + break; + } + } + if (last>0) extentno+=(last*blocksize)/extcap; + file->ino->sb->dir[extent].extnol=EXTENTL(extentno); + file->ino->sb->dir[extent].extnoh=EXTENTH(extentno); + file->ino->sb->dir[extent].blkcnt=((file->pos-1)%16384)/128+1; + file->ino->sb->dir[extent].lrc=file->pos%128; + updateTimeStamps(file->ino,extent); + /*}}}*/ + if (file->pos==nextextpos) findext=1; + else if (file->pos==nextblockpos) findblock=1; + } + return got; +} +/*}}}*/ +/* cpmClose -- close */ /*{{{*/ +int cpmClose(struct cpmFile *file) +{ + return 0; +} +/*}}}*/ +/* cpmCreat -- creat */ /*{{{*/ +int cpmCreat(struct cpmInode *dir, const char *fname, struct cpmInode *ino, mode_t mode) +{ + int user; + char name[8],extension[3]; + int extent; + struct cpmSuperBlock *drive; + struct PhysDirectoryEntry *ent; + + if (!S_ISDIR(dir->mode)) + { + boo="No such file or directory"; + return -1; + } + if (splitFilename(fname,dir->sb->type,name,extension,&user)==-1) return -1; +#ifdef CPMFS_DEBUG + fprintf(stderr,"cpmCreat: %s -> %d:%-.8s.%-.3s\n",fname,user,name,extension); +#endif + if (findFileExtent(dir->sb,user,name,extension,0,-1)!=-1) return -1; + drive=dir->sb; + if ((extent=findFreeExtent(dir->sb))==-1) return -1; + ent=dir->sb->dir+extent; + drive->dirtyDirectory=1; + memset(ent,0,32); + ent->status=user; + memcpy(ent->name,name,8); + memcpy(ent->ext,extension,3); + ino->ino=extent; + ino->mode=s_ifreg|mode; + ino->size=0; + time(&ino->atime); + time(&ino->mtime); + time(&ino->ctime); + ino->sb=dir->sb; + updateTimeStamps(ino,extent); + return 0; +} +/*}}}*/ +/* cpmAttrGet -- get CP/M attributes */ /*{{{*/ +int cpmAttrGet(struct cpmInode *ino, cpm_attr_t *attrib) +{ + *attrib = ino->attr; + return 0; +} +/*}}}*/ +/* cpmAttrSet -- set CP/M attributes */ /*{{{*/ +int cpmAttrSet(struct cpmInode *ino, cpm_attr_t attrib) +{ + struct cpmSuperBlock *drive; + int extent; + int user; + char name[8], extension[3]; + + memset(name, 0, sizeof(name)); + memset(extension, 0, sizeof(extension)); + drive = ino->sb; + extent = ino->ino; + + drive->dirtyDirectory=1; + /* Strip off existing attribute bits */ + memcpy7(name, drive->dir[extent].name, 8); + memcpy7(extension, drive->dir[extent].ext, 3); + user = drive->dir[extent].status; + + /* And set new ones */ + if (attrib & CPM_ATTR_F1) name[0] |= 0x80; + if (attrib & CPM_ATTR_F2) name[1] |= 0x80; + if (attrib & CPM_ATTR_F3) name[2] |= 0x80; + if (attrib & CPM_ATTR_F4) name[3] |= 0x80; + if (attrib & CPM_ATTR_RO) extension[0] |= 0x80; + if (attrib & CPM_ATTR_SYS) extension[1] |= 0x80; + if (attrib & CPM_ATTR_ARCV) extension[2] |= 0x80; + + do + { + memcpy(drive->dir[extent].name, name, 8); + memcpy(drive->dir[extent].ext, extension, 3); + } while ((extent=findFileExtent(drive, user,name,extension,extent+1,-1))!=-1); + + /* Update the stored (inode) copies of the file attributes and mode */ + ino->attr=attrib; + if (attrib&CPM_ATTR_RO) ino->mode&=~(S_IWUSR|S_IWGRP|S_IWOTH); + else ino->mode|=(S_IWUSR|S_IWGRP|S_IWOTH); + + return 0; +} +/*}}}*/ +/* cpmChmod -- set CP/M r/o & sys */ /*{{{*/ +int cpmChmod(struct cpmInode *ino, mode_t mode) +{ + /* Convert the chmod() into a chattr() call that affects RO */ + int newatt = ino->attr & ~CPM_ATTR_RO; + + if (!(mode & (S_IWUSR|S_IWGRP|S_IWOTH))) newatt |= CPM_ATTR_RO; + return cpmAttrSet(ino, newatt); +} +/*}}}*/ +/* cpmSync -- write directory back */ /*{{{*/ +int cpmSync(struct cpmSuperBlock *d) +{ + if (d->dirtyDirectory) + { + int i,blocks,entry; + + blocks=(d->maxdir*32+d->blksiz-1)/d->blksiz; + entry=0; + for (i=0; idir+entry),0,-1)==-1) return -1; + entry+=(d->blksiz/32); + } + d->dirtyDirectory=0; + } + return 0; +} +/*}}}*/ +/* cpmUmount -- free super block */ /*{{{*/ +void cpmUmount(struct cpmSuperBlock *sb) +{ + cpmSync(sb); + free(sb->alv); + free(sb->skewtab); + free(sb->dir); + if (sb->passwdLength) free(sb->passwd); +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h b/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h new file mode 100644 index 00000000..acf050f9 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmfs.h @@ -0,0 +1,174 @@ +#ifndef CPMFS_H +#define CPMFS_H + +#include +#include + +#ifdef _WIN32 + #include + #include + /* To make it compile on NT: extracts from Linux 2.0 * + * and */ + #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 /* 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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmls b/branches/dwg/LSource/src/cpmtools-2.13/cpmls new file mode 100755 index 00000000..ff570616 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/cpmls differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmls.1 b/branches/dwg/LSource/src/cpmtools-2.13/cpmls.1 new file mode 100644 index 00000000..8084a3c0 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in b/branches/dwg/LSource/src/cpmtools-2.13/cpmls.1.in new file mode 100644 index 00000000..f57c3bf0 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmls.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmls.c new file mode 100644 index 00000000..983817a0 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmls.c @@ -0,0 +1,383 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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; itm_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; itm_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; itm_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. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in b/branches/dwg/LSource/src/cpmtools-2.13/cpmrm.1.in new file mode 100644 index 00000000..46c0d189 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c b/branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c new file mode 100644 index 00000000..d6639532 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/cpmrm.c @@ -0,0 +1,72 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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 +#include +#include +#include + +#include "device.h" + +#ifdef USE_DMALLOC +#include +#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); +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/device_posix.c b/branches/dwg/LSource/src/cpmtools-2.13/device_posix.c new file mode 100644 index 00000000..6362a9aa --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/device_posix.c @@ -0,0 +1,77 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include + +#include "device.h" + +#ifdef USE_DMALLOC +#include +#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(sectorsectrk); + assert(track>=0); + assert(tracktracks); + 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(sectorsectrk); + assert(track>=0); + assert(tracktracks); + 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); +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/device_win32.c b/branches/dwg/LSource/src/cpmtools-2.13/device_win32.c new file mode 100644 index 00000000..b8aef9b3 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/device_win32.c @@ -0,0 +1,658 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include + +#include "cpmdir.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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, + ®, sizeof( 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, + ®, sizeof( 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, + ®, sizeof( 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, + ®, sizeof( 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, + ®, sizeof( 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, + ®, sizeof( 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(sectorsectrk); + assert(track>=0); + assert(tracktracks); + + 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, + ®, sizeof( 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, + ®, sizeof( 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(sectorsectrk); + assert(track>=0); + assert(tracktracks); + + 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, + ®, sizeof( 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, + ®, sizeof( 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); +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/diskdefs b/branches/dwg/LSource/src/cpmtools-2.13/diskdefs new file mode 100644 index 00000000..fd14a19b --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm new file mode 100755 index 00000000..f463c4e5 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1 b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1 new file mode 100644 index 00000000..ab39ead3 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.1.in new file mode 100644 index 00000000..3a1dbc03 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c new file mode 100644 index 00000000..c7e9048e --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/fsck.cpm.c @@ -0,0 +1,627 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmdir.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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; extentmaxdir; ++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 (blockmax) + { + 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(minpointers[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 && modifieddir[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 && modifieddir[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 && modifiedtype==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 && modifiedextnol&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; extentmaxdir; ++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; extent2maxdir; ++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; extentmaxdir; ++extent) if ((dir=sb->dir+extent)->status>=0 && dir->status<=(sb->type==CPMFS_P2DOS ? 31 : 15)) + { + for (extent2=0; extent2maxdir; ++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; extentmaxdir; ++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; +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm new file mode 100755 index 00000000..05f31f92 Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1 b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1 new file mode 100644 index 00000000..f2f08406 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.1.in new file mode 100644 index 00000000..aee1b1a6 --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c new file mode 100644 index 00000000..5a606cb3 --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/fsed.cpm.c @@ -0,0 +1,732 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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; entrysecLength/32 && (pos*sb->secLength/32)+entrymaxdir; ++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; possecLength)&~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 +#include +#include +#include + +#ifdef __VMS +# include +#endif + +#ifdef _LIBC +# include +#else +#if 0 +# include +# define _(msgid) gettext (msgid) +#else +# define _(msgid) (msgid) +#endif +#endif + +#if defined _LIBC && defined USE_IN_LIBIO +# include +#endif + +#ifndef attribute_hidden +# define attribute_hidden +#endif + +/* Unlike standard Unix `getopt', functions like `getopt_long' + let the user intersperse the options with the other arguments. + + As `getopt_long' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Using `getopt' or setting the environment variable POSIXLY_CORRECT + disables permutation. + Then the application's behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt_int.h" + +/* 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. */ + +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. */ + +/* 1003.2 says this must be 1 before any call. */ +int optind = 1; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Keep a global copy of all internal members of getopt_data. */ + +static struct _getopt_data getopt_data; + + +#if defined HAVE_DECL_GETENV && !HAVE_DECL_GETENV +extern char *getenv (); +#endif + +#ifdef _LIBC +/* Stored original parameters. + XXX This is no good solution. We should rather copy the args so + that we can compare them later. But we must not use malloc(3). */ +extern int __libc_argc; +extern char **__libc_argv; + +/* Bash 2.0 gives us an environment variable containing flags + indicating ARGV elements that should not be considered arguments. */ + +# ifdef USE_NONOPTION_FLAGS +/* Defined in getopt_init.c */ +extern char *__getopt_nonoption_flags; +# endif + +# ifdef USE_NONOPTION_FLAGS +# define SWAP_FLAGS(ch1, ch2) \ + if (d->__nonoption_flags_len > 0) \ + { \ + char __tmp = __getopt_nonoption_flags[ch1]; \ + __getopt_nonoption_flags[ch1] = __getopt_nonoption_flags[ch2]; \ + __getopt_nonoption_flags[ch2] = __tmp; \ + } +# else +# define SWAP_FLAGS(ch1, ch2) +# endif +#else /* !_LIBC */ +# define SWAP_FLAGS(ch1, ch2) +#endif /* _LIBC */ + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (char **argv, struct _getopt_data *d) +{ + int bottom = d->__first_nonopt; + int middle = d->__last_nonopt; + int top = d->optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + /* First make sure the handling of the `__getopt_nonoption_flags' + string can work normally. Our top argument must be in the range + of the string. */ + if (d->__nonoption_flags_len > 0 && top >= d->__nonoption_flags_max_len) + { + /* We must extend the array. The user plays games with us and + presents new arguments. */ + char *new_str = malloc (top + 1); + if (new_str == NULL) + d->__nonoption_flags_len = d->__nonoption_flags_max_len = 0; + else + { + memset (__mempcpy (new_str, __getopt_nonoption_flags, + d->__nonoption_flags_max_len), + '\0', top + 1 - d->__nonoption_flags_max_len); + d->__nonoption_flags_max_len = top + 1; + __getopt_nonoption_flags = new_str; + } + } +#endif + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + SWAP_FLAGS (bottom + i, top - (middle - bottom) + i); + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + SWAP_FLAGS (bottom + i, middle + i); + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + d->__first_nonopt += (d->optind - d->__last_nonopt); + d->__last_nonopt = d->optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (int argc, char **argv, const char *optstring, + int posixly_correct, struct _getopt_data *d) +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + d->__first_nonopt = d->__last_nonopt = d->optind; + + d->__nextchar = NULL; + + d->__posixly_correct = posixly_correct || !!getenv ("POSIXLY_CORRECT"); + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + d->__ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + d->__ordering = REQUIRE_ORDER; + ++optstring; + } + else if (d->__posixly_correct) + d->__ordering = REQUIRE_ORDER; + else + d->__ordering = PERMUTE; + +#if defined _LIBC && defined USE_NONOPTION_FLAGS + if (!d->__posixly_correct + && argc == __libc_argc && argv == __libc_argv) + { + if (d->__nonoption_flags_max_len == 0) + { + if (__getopt_nonoption_flags == NULL + || __getopt_nonoption_flags[0] == '\0') + d->__nonoption_flags_max_len = -1; + else + { + const char *orig_str = __getopt_nonoption_flags; + int len = d->__nonoption_flags_max_len = strlen (orig_str); + if (d->__nonoption_flags_max_len < argc) + d->__nonoption_flags_max_len = argc; + __getopt_nonoption_flags = + (char *) malloc (d->__nonoption_flags_max_len); + if (__getopt_nonoption_flags == NULL) + d->__nonoption_flags_max_len = -1; + else + memset (__mempcpy (__getopt_nonoption_flags, orig_str, len), + '\0', d->__nonoption_flags_max_len - len); + } + } + d->__nonoption_flags_len = d->__nonoption_flags_max_len; + } + else + d->__nonoption_flags_len = 0; +#endif + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns -1. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. + + If POSIXLY_CORRECT is nonzero, behave as if the POSIXLY_CORRECT + environment variable were set. */ + +int +_getopt_internal_r (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct, struct _getopt_data *d) +{ + int print_errors = d->opterr; + if (optstring[0] == ':') + print_errors = 0; + + if (argc < 1) + return -1; + + d->optarg = NULL; + + if (d->optind == 0 || !d->__initialized) + { + if (d->optind == 0) + d->optind = 1; /* Don't scan ARGV[0], the program name. */ + optstring = _getopt_initialize (argc, argv, optstring, + posixly_correct, d); + d->__initialized = 1; + } + + /* Test whether ARGV[optind] points to a non-option argument. + Either it does not have option syntax, or there is an environment flag + from the shell indicating it is not an option. The later information + is only used when the used in the GNU libc. */ +#if defined _LIBC && defined USE_NONOPTION_FLAGS +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0' \ + || (d->optind < d->__nonoption_flags_len \ + && __getopt_nonoption_flags[d->optind] == '1')) +#else +# define NONOPTION_P (argv[d->optind][0] != '-' || argv[d->optind][1] == '\0') +#endif + + if (d->__nextchar == NULL || *d->__nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + /* Give FIRST_NONOPT & LAST_NONOPT rational values if OPTIND has been + moved back by the user (who may also have changed the arguments). */ + if (d->__last_nonopt > d->optind) + d->__last_nonopt = d->optind; + if (d->__first_nonopt > d->optind) + d->__first_nonopt = d->optind; + + if (d->__ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__last_nonopt != d->optind) + d->__first_nonopt = d->optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (d->optind < argc && NONOPTION_P) + d->optind++; + d->__last_nonopt = d->optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (d->optind != argc && !strcmp (argv[d->optind], "--")) + { + d->optind++; + + if (d->__first_nonopt != d->__last_nonopt + && d->__last_nonopt != d->optind) + exchange ((char **) argv, d); + else if (d->__first_nonopt == d->__last_nonopt) + d->__first_nonopt = d->optind; + d->__last_nonopt = argc; + + d->optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (d->optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (d->__first_nonopt != d->__last_nonopt) + d->optind = d->__first_nonopt; + return -1; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if (NONOPTION_P) + { + if (d->__ordering == REQUIRE_ORDER) + return -1; + d->optarg = argv[d->optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + d->__nextchar = (argv[d->optind] + 1 + + (longopts != NULL && argv[d->optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[d->optind][1] == '-' + || (long_only && (argv[d->optind][2] + || !strchr (optstring, argv[d->optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = -1; + int option_index; + + for (nameend = d->__nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) + == (unsigned int) strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else if (long_only + || pfound->has_arg != p->has_arg + || pfound->flag != p->flag + || pfound->val != p->val) + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `%s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + d->optopt = 0; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + d->optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind - 1][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#else + fprintf (stderr, _("\ +%s: option `--%s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#else + fprintf (stderr, _("\ +%s: option `%c%s' doesn't allow an argument\n"), + argv[0], argv[d->optind - 1][0], + pfound->name); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + + d->__nextchar += strlen (d->__nextchar); + + d->optopt = pfound->val; + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optopt = pfound->val; + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[d->optind][1] == '-' + || strchr (optstring, *d->__nextchar) == NULL) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (argv[d->optind][1] == '-') + { + /* --option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `--%s'\n"), + argv[0], d->__nextchar); +#endif + } + else + { + /* +option or -option */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#else + fprintf (stderr, _("%s: unrecognized option `%c%s'\n"), + argv[0], argv[d->optind][0], d->__nextchar); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->__nextchar = (char *) ""; + d->optind++; + d->optopt = 0; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *d->__nextchar++; + char *temp = strchr (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*d->__nextchar == '\0') + ++d->optind; + + if (temp == NULL || c == ':') + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + int n; +#endif + + if (d->__posixly_correct) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: illegal option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: illegal option -- %c\n"), argv[0], c); +#endif + } + else + { +#if defined _LIBC && defined USE_IN_LIBIO + n = __asprintf (&buf, _("%s: invalid option -- %c\n"), + argv[0], c); +#else + fprintf (stderr, _("%s: invalid option -- %c\n"), argv[0], c); +#endif + } + +#if defined _LIBC && defined USE_IN_LIBIO + if (n >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#endif + } + d->optopt = c; + return '?'; + } + /* Convenience. Treat POSIX -W foo same as long option --foo */ + if (temp[0] == 'W' && temp[1] == ';') + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound = 0; + int option_index; + + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, + _("%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + return c; + } + else + /* We already incremented `d->optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + + /* optarg is now the argument, see if it's in the + table of longopts. */ + + for (d->__nextchar = nameend = d->optarg; *nameend && *nameend != '='; + nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, d->__nextchar, nameend - d->__nextchar)) + { + if ((unsigned int) (nameend - d->__nextchar) == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + if (ambig && !exact) + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"), + argv[0], argv[d->optind]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + d->optind++; + return '?'; + } + if (pfound != NULL) + { + option_index = indfound; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + d->optarg = nameend + 1; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, _("\ +%s: option `-W %s' doesn't allow an argument\n"), + argv[0], pfound->name); +#endif + } + + d->__nextchar += strlen (d->__nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (d->optind < argc) + d->optarg = argv[d->optind++]; + else + { + if (print_errors) + { +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 + |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option `%s' requires an argument\n"), + argv[0], argv[d->optind - 1]); +#endif + } + d->__nextchar += strlen (d->__nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + d->__nextchar += strlen (d->__nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + d->__nextchar = NULL; + return 'W'; /* Let the application handle it. */ + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + d->optind++; + } + else + d->optarg = NULL; + d->__nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*d->__nextchar != '\0') + { + d->optarg = d->__nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + d->optind++; + } + else if (d->optind == argc) + { + if (print_errors) + { + /* 1003.2 specifies the format of this message. */ +#if defined _LIBC && defined USE_IN_LIBIO + char *buf; + + if (__asprintf (&buf, _("\ +%s: option requires an argument -- %c\n"), + argv[0], c) >= 0) + { + _IO_flockfile (stderr); + + int old_flags2 = ((_IO_FILE *) stderr)->_flags2; + ((_IO_FILE *) stderr)->_flags2 |= _IO_FLAGS2_NOTCANCEL; + + __fxprintf (NULL, "%s", buf); + + ((_IO_FILE *) stderr)->_flags2 = old_flags2; + _IO_funlockfile (stderr); + + free (buf); + } +#else + fprintf (stderr, + _("%s: option requires an argument -- %c\n"), + argv[0], c); +#endif + } + d->optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + d->optarg = argv[d->optind++]; + d->__nextchar = NULL; + } + } + return c; + } +} + +int +_getopt_internal (int argc, char **argv, const char *optstring, + const struct option *longopts, int *longind, + int long_only, int posixly_correct) +{ + int result; + + getopt_data.optind = optind; + getopt_data.opterr = opterr; + + result = _getopt_internal_r (argc, argv, optstring, longopts, longind, + long_only, posixly_correct, &getopt_data); + + optind = getopt_data.optind; + optarg = getopt_data.optarg; + optopt = getopt_data.optopt; + + return result; +} + +/* glibc gets a LSB-compliant getopt. + Standalone applications get a POSIX-compliant getopt. */ +#if _LIBC +enum { POSIXLY_CORRECT = 0 }; +#else +enum { POSIXLY_CORRECT = 1 }; +#endif + +int +getopt (int argc, char *const *argv, const char *optstring) +{ + return _getopt_internal (argc, (char **) argv, optstring, NULL, NULL, 0, + POSIXLY_CORRECT); +} + + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (int argc, char **argv) +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == -1) + break; + + switch (c) + { + 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 '?': + 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 */ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/getopt1.c b/branches/dwg/LSource/src/cpmtools-2.13/getopt1.c new file mode 100644 index 00000000..7fa0c4e5 --- /dev/null +++ b/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 +#else +# include "config.h" +# include "getopt_.h" +#endif +#include "getopt_int.h" + +#include + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#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 + +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 */ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/getopt_.h b/branches/dwg/LSource/src/cpmtools-2.13/getopt_.h new file mode 100644 index 00000000..615ef9a3 --- /dev/null +++ b/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 +# include +# include +# 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 , but + that does not exist if we are standalone. So: if __GNU_LIBRARY__ is + not defined, include , which will pull in 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 +#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 */ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h b/branches/dwg/LSource/src/cpmtools-2.13/getopt_int.h new file mode 100644 index 00000000..401579fd --- /dev/null +++ b/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 */ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/install-sh b/branches/dwg/LSource/src/cpmtools-2.13/install-sh new file mode 100755 index 00000000..6781b987 --- /dev/null +++ b/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: diff --git a/branches/dwg/LSource/src/cpmtools-2.13/makefile.nt b/branches/dwg/LSource/src/cpmtools-2.13/makefile.nt new file mode 100644 index 00000000..816c592c --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm new file mode 100755 index 00000000..888c4a9b Binary files /dev/null and b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm differ diff --git a/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1 b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1 new file mode 100644 index 00000000..726c00af --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.1.in new file mode 100644 index 00000000..966088db --- /dev/null +++ b/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 +. The Windows port is copyright 2000, 2001 John Elliott +. +.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) +.\"}}} diff --git a/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c new file mode 100644 index 00000000..3e97a89a --- /dev/null +++ b/branches/dwg/LSource/src/cpmtools-2.13/mkfs.cpm.c @@ -0,0 +1,175 @@ +/* #includes */ /*{{{C}}}*//*{{{*/ +#include "config.h" + +#include +#include +#include +#include +#include + +#include "getopt_.h" +#include "cpmfs.h" + +#ifdef USE_DMALLOC +#include +#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; iboottrk; 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); +} +/*}}}*/ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt b/branches/dwg/LSource/src/tasm-src-3.2/Doc/CopyRight.txt new file mode 100644 index 00000000..4d0d7f17 --- /dev/null +++ b/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 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/OrderForm.htm b/branches/dwg/LSource/src/tasm-src-3.2/Doc/OrderForm.htm new file mode 100644 index 00000000..6a8e8ee0 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/OrderForm.htm @@ -0,0 +1,196 @@ + + + + + + Telemark Cross Assembler (TASM) Order Form + + + +

+TASM Order Form

+
+ +To order TASM by mail: +

Print this page, fill in the details and mail (along with a check) to SVS at:

+
Squak Valley Software +
837 Front Street South +
Issaquah, WA 98027 +
USA
+ +

+ +To order TASM by email

+ +

+Use PayPal to send the appropriate amount +(see below) to tnetherly@attbi.com.  +This is the preferred method if you are eRegistering (receipt of TASM via email +without disk or printed manual).

+ +

+TASM registration provides the user:

+ +
    +
  • +Most Recent TASM Distribution (includes tables for all supported processor +families)
  • + +
  • +TASM Source code (in ANSI C)
  • + +
  • +Bound TASM Manual (except for eRegistration)
  • + +
  • +Support by email
  • + +
  • +Knowledge that they are supporting the development of useful but inexpensive +software
  • +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Item DescriptionUnit PriceAmount Extended
TASM 3.2 eRegistration (no disk or manual)$25______________________
TASM 3.2 Registration (with disk and manual)$40______________________
TASM 3.2 Site Registration$90______________________
TASM 3.2 Update for registered users$10______________________
Subtotal______________________
Tax (Washington State residents add 8.8%)______________________
Billing Fee (for orders not accompanied by payment)$10______________________
Foreign postage and handling$10______________________
Total______________________
+ +
    +
  • +All payments must be in US funds drawn on a US bank (or payment via PayPal)
  • + +
  • +Payments via PayPal are preferred (payable to tnetherly@attbi.com, see www.paypal.com)
  • + +
  • +Orders outside North America please add the indicated foreign postage and +handling.
  • + +
  • +Purchase orders allowed from North America only (all others must be prepaid).
  • +
+ +

+Ship To:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Name____________________________________
Company___________________________________
Street Address____________________________________
City, State/Province, Postal Code____________________________________
Country____________________________________
+ +
+ + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/QuickStart.txt b/branches/dwg/LSource/src/tasm-src-3.2/Doc/QuickStart.txt new file mode 100644 index 00000000..e5feb1c8 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/QuickStart.txt @@ -0,0 +1,20 @@ +Quick Start Hints +----------------- + +To quickly give TASM a try, go to the "Examples" folder in the +TASM installation folder. Execute the TESTTABS.BAT script, either +from the command line of a "Command Prompt" window, or with a double-click +on the script from the Windows Explorer. + +The script will assemble a sample file for each of the supported +processors. You can examine the assembly source files (*.asm) +and the resulting output files (*.obj and *.lst) in that same +folder after the script executes. + +Launching your own assembly projects with a batch file similar to +TESTTABS.bat is practical, but the recommended approach is to +launch TASM from your source file editor. The more capable +source editors (like CodeWright, Brief, etc.) can make it +easy to jump to the lines with errors after each assembly, +which is a real time-saver. + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/ReleaseNotes.txt b/branches/dwg/LSource/src/tasm-src-3.2/Doc/ReleaseNotes.txt new file mode 100644 index 00000000..a0d071c9 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/ReleaseNotes.txt @@ -0,0 +1,34 @@ +TASM RELEASE NOTES [Most recent releases] + +Release Date/Version Description +-------------------- ----------------------------------------------- +09/01/01 version 3.2 Increased LINESIZ to 512 to enable use of longer macros. + Eliminated -r command line option (to set + read buffer size - Now obsolete.) + Improved list() function to put a max of + six bytes per line to avoid problems with + directives that generate large blocks of + object code (i.e. .FILL). + Built as a 32 bit version using MS C++ 6.0 + Added a Windows Installation Utility. + +11/30/97 Version 3.1 Added LINUX support. + Added Protected mode version (tasmp) with better memory + management (more labels allowed, etc.) + Added an 8096 table. + Added Logical NOT unary operator. + Added an object file format with word address. + +06/16/94 Version 3.0.1 Multiple macros on the same line. + Fixed problem with -c with >8000h bytes used goes bonkers + Corrected word addressing problem for BLOCK/DS directives. + Allow escaped quotes in TEXT strings. + +10/24/93 Version 3.0 Documentation update. TASM.DOC, TASMTABS.DOC + and Relase Notes updated, but the functionality + remains unchanged from version 2.9.4. + +... + + +10/01/85 Version 2.0 First version released to the market. diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmFAQ.htm b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmFAQ.htm new file mode 100644 index 00000000..6ce948d5 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmFAQ.htm @@ -0,0 +1,252 @@ + + + + + + The Telemark Cross Assembler (TASM) FAQ + + + + +

+TASM Frequently Asked Questions

+ +
+ +

+Q: What Processors are supported by TASM?

+The following table enumerates the processor families supported by TASM.  +Derivatives that are compatible with the base processor family are, of course, +supported too.  For those derivatives that have additional (extended) +instructions, the second column shows those that are supported.  [Note: use +the "-x" command line option to enable extended instructions.] +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Processor FamilyDerivatives with extended instructions supported
80488041A, 8022, 8021
6502R65C02, R65C00/21
Z80HD64180
68006801, 6803, 68HC11
6805M146805 CMOS, 68HC02C4
8051
8080
TMS32010
TMS320C25TMS320C26
TMS7000
8096 80C196KC
+ +

+Q: Does TASM come with an object code linker?

+No. TASM generates absolute object code, thus no linker is necessary. It +is possible to break an application into many files, however, and collect +them via a top level file to include all the components (see the #include +directive in the TASM User's Manual). +

+Q: What are the minimum system requirements to run TASM?

+ +For versions earlier than 3.2: + +
    +
  • +80286 or higher processor. [Contact us if you need a version for the 8086.]
  • + +
  • +MSDOS 2.1 or above
  • + +
  • +512 Kbytes RAM
  • + +
  • +2 Mbytes disk space
  • +
+

For version 3.2:

+
    +
  • A 32 bit Windows platform (Windows 95, Windows 98, Windows 2000, Windows + NT)
  • +
  • 2 Mbytes disk space
  • +
+

+Q: My computer has 512 Mbytes of RAM. How come TASM runs out of memory?

+Prior to version 3.2, TASM was an old-fashioned program confined +to the 640 Kbyte memory space provided by DOS. If you are running out of memory +and you are using a version early than 3.2 you should upgrade and see if it +eliminates the problem.  Even version 3.2 has some inherent limits, +however.  There are fixed limits for the maximum number of labels and +macros (see the TASM User's Manual). +

+Q: What performance can be expected from TASM?

+Many factors affect performance. Here are some observed lines/second measurements +for assemblies of 6502 source code on various platforms: +
    +
  • +15000 lines/second on a 500 MHz Pentium based PC.
  • + +
  • +40000 lines/second on a     2 GHz Pentium based PC.
  • +
+Of historical note, early versions of TASM running on a PC/AT class machine +(circa 1985) typically achieved about 20 lines/second.   +

+Q: Is there a UNIX version of TASM?

+Yes, but you need the source distribution to build it.  The source +distribution comes with a makefile and instructions for building on +LINUX.  The makefile should be usable on a variety of UNIX platforms +with little modification (assuming an appropriate compiler +tool set). An ANSI C compiler is required. +

+Q: What compiler is used to build the released version of TASM?

+Microsoft Visual C++ 6.0. +

+Q: What's new in the latest release (v3.2)?

+ +
    +
  • +Built as a 32 bit application for improved memory management and performance +improvements.
  • + +
  • +Increased maximum length of a source line to 512 bytes to better handle +expansion of long macros.
  • + +
  • +Improved formatting of list file for directives that generate more than 6 bytes +of object code (now broken into multiple lines).
  • + +
  • +Self-extracting installation utility provided.
  • +
+ +

+Q: Can I bundle TASM with my way-cool development board?

+The shareware distribution of TASM may be distributed with other commercial +products as long as it is clear that the customer is getting a shareware +product that has not yet been paid for. The customer receives the shareware +product for evaluation purposes, and if prolonged use ensues, the product +should be paid for. +

Alternately, a fully licensed TASM may be bundled with other commercial +products under an agreement with SVS. Many agreements such as this have +been employed in the past for both microcontroller development tools and +educational books. Please contact SVS if you are interested in such an +arrangement. +

+Q: Can I distribute TASM to my students for course assignments?

+The license policy is this: an educational institution may distribute TASM +to students for course work at that institution provide the institution +purchases a TASM site license. The students are not authorized to continue +use of TASM for their personal projects, however. Continued use by students +outside of course work requires an individual registration. +

+Q: Is there a Windows version of TASM?

+No. We have experimented with Windows interfaces for TASM, but have concluded +that such adds little value. What is of value, though, is integration of +TASM with a source code editor (Windows based or otherwise). Being able +to perform the edit/assemble/edit cycle all within a single environment +is useful. Many full-featured editors support such integration. Such editors +include: + + +

+Q: How do I configure the Vim editor to run TASM?

+The first step is to add the following to your "_vimrc" file (which is +normally in the directory indicated by the HOME or HOMEPATH environment +variables):  +
+
set makeprg=tasm\ -80\ -x\ %
+set errorformat=%f\ line\ %l:\ %m
+
+

Now, you can launch an assembly on the file you are editing with Vim by +invoking the ":make" command.  +Use the ":cnext" command to +skip to the next line with an error.  Use the ":copen" +command to open a window showing the full error list.  See the Vim help +documentation for more details on this feature.

+ +

The makeprg setting above depends upon the TASM executable being in a +directory in the Path environment variable.  Alternately, add the +full path to the makeprg setting (being extra careful with embedded +spaces).  Also, the example explicitly indicates the Z80 instruction table +with the "-80" option.  Set this according to your needs.

+ +

+Q: Suppose I want to write my own TASM table for a processor not currently +supported. Is it difficult?

+It is not terribly difficult, but does require thorough knowledge of the +target processor instruction set and the encoding rules supported by TASM. +The 3.2 release of TASM supports 31 different rules for the encoding of +opcodes/operands. When new processor families are added to TASM, most of +the instructions/address modes are supported by an existing encoding rule, +but usually a few new rules are necessary. Adding new encoding rules requires +source code modification. See TASMTABS.HTM  for a summary of the encoding rules. +

 

+
+ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmManual.htm b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmManual.htm new file mode 100644 index 00000000..944ec1eb --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmManual.htm @@ -0,0 +1,2865 @@ + + + + + + + The Telemark Assembler (TASM) User Manual + + + + +
+

+The Telemark Assembler (TASM) User Manual

+ +
Version 3.2
+
+ +
Thomas N. Anderson
+ +
Squak Valley Software
+ +
837 Front Street South
+ +
Issaquah, WA 98027
+ +
email: andersontn@acm.org
+ +
www.halcyon.com/squakvly/
+
+ +
Copyright (C) 1985-2000 by Thomas N. Anderson. All rights reserved.
+ +
+

+TABLE OF CONTENTS

+ + + +
+

+INTRODUCTION

+The Telemark Assembler (TASM) is a table driven cross assembler for the +MS-DOS and LINUX environments. Assembly source code, written in the appropriate +dialect (generally very close to the manufacturers assembly language), +can be assembled with TASM, and the resulting object code transferred to +the target microprocessor system via PROM or other mechanisms. + +

The microprocessor families supported by TASM are: +

    +
  • +6502
  • + +
  • +6800/6801/68HC11
  • + +
  • +6805
  • + +
  • +8048
  • + +
  • +8051
  • + +
  • +8080/8085, Z80
  • + +
  • +TMS32010, TMS320C25
  • + +
  • +TMS7000
  • + +
  • +8096/80196
  • +
+The user so inclined may build tables for other microprocessors. The descriptions +of the various existing tables and instructions on building new tables +are not in this document but can be found in the TASMTABS.HTM file on the +TASM distribution disk. + +

TASM characteristics include: +

    +
  1. +Powerful expression parsing (17 operators).
  2. + +
  3. +Supports a subset of the 'C' preprocessor commands.
  4. + +
  5. +Macro capability (through use of DEFINE directive).
  6. + +
  7. +Multiple statements per line.
  8. + +
  9. +Four object file formats: Intel hex, MOS Technology hex, Motorola hex, +binary.
  10. + +
  11. +Absolute code generation only.
  12. + +
  13. +Source code available (in C).
  14. + +
  15. +Uniform syntax across versions for different target machines.
  16. + +
  17. +Features in support of PROM programming (preset memory, contiguous block).
  18. + +
  19. +Supports extended instructions for many of the supported microprocessor +families.
  20. + +
  21. +Tables read at run time - single TASM executable for all table versions.
  22. + +
  23. +Symbol table export for inclusion in subsequent assemblies.
  24. + +
  25. +Symbol table export file for import with some simulator products.
  26. +
+ +
+

+SHAREWARE

+TASM is distributed as shareware. TASM is not in the public domain. The +TASM distribution files may be freely copied (excluding the source code +files) and freely used for the purpose of evaluating the suitability of +TASM for a given purpose. Use of TASM beyond a reasonable evaluation period +requires registration. Prolonged use without registration is unethical.  +
+

+INVOCATION

+TASM can be invoked as follows (optional fields shown in brackets, symbolic +fields in italics): +
  tasm -pn [-options ...] src_file [obj_file [lst_file [exp_file [sym_file]]]]
+Where options can be one or more of the following: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-table Specify version (table = table designation) 
-ttable Table (alternate form of above) 
-aamask Assembly control (optional error checking) 
-b Produce object in binary (.COM) format 
-c Object file written as a contiguous block 
-dmacro Define a macro (or just a macro label) 
-e Show source lines after macro expansion 
-ffillbyte Fill entire memory space with fillbyte (hex) 
-gobjtype Object file (0=Intel Hex, 1=MOS Tech, 2=Motorola, +3=binary,4=Intel Hex (Word)) 
-h Produce hex table of the assembled code (in list +file) 
-i Ignore case for labels 
-l[al] Produce a label table in the listing 
-m Produce object in MOS Technology format 
-oobytes Bytes per object record (for hex obj formats) 
-p[linesPage the listing file (lines per page. default=60) 
-q Quiet, disable the listing file 
-s Write a symbol table file 
-x[xmaskEnable extended instruction set (if any) 
-y Time the assembly 
+

The filename parameters are defined as follows: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
src_file Source file name 
obj_file Object code file name 
lst_file Listing file name 
exp_file Symbol export file (only if the EXPORT directive +is used).
sym_file Symbol table file (only if the -s option +or the SYM/AVSYM directives are used). 
+

The source file must be specified. If not, some usage information is displayed. +Default file names for all the other files are generated if they are not +explicitly provided. The filename is formed by taking the source filename +and changing the extension to one of the following: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Extension File type 
.OBJ Object file 
.LST Listing file 
.EXP Symbol export file 
.SYM Symbol table file 
+

TASM has no built-in instruction set tables. Instruction set definition +files are read at run time. TASM determines which table to use based on +the '-table' field shown above. For example, to assemble the code +in a file called source.asm, one would enter +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
tasm -48 source.asm for an 8048 assembly 
tasm -65 source.asm for a 6502 assembly 
tasm -51 source.asm for an 8051 assembly. 
tasm -85 source.asm for an 8085 assembly. 
tasm -80 source.asm for a Z80 assembly. 
tasm -05 source.asm for a 6805 assembly. 
tasm -68 source.asm for a 6800/6801/68HC11 assembly. 
tasm -70 source.asm for a TMS7000 assembly. 
tasm -3210 source.asm for a TMS32010 assembly. 
tasm -3225 source.asm for a TMS320C25 assembly. 
tasm -96 source.asm for a 8096/80196 assembly
+

+Tables are read from a file named by taking the digits specified after +the '-' and appending it to 'TASM' then appending the '.TAB' extension. +Thus, the -48 flag would cause the tables to be read from the file +'TASM48.TAB'. + +

It is possible to designate tables by non numeric part numbers if the +-t flag is used. For example, if a user built a table called TASMF8.TAB +then TASM could be invoked as follows: +

    tasm -tf8 source.asm
+Each option flag must be preceded by a dash. Options need not precede the +file names. The various options are described in the sections that follow. +

+a - Assembly Control

+TASM can provide additional error checking by specifying the -a +option at the time of execution. If the -a is provided without a +digit following, then all the available error checking is done. If a digit +follows, then it is used as a mask to determine the error checks to be +made. The bits of the mask are defined as follows: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Bit Option Default Description 
-a1 OFF Check for apparent illegal use of indirection 
-a2 ON Check for unused data in the arguments 
-a4 ON Check for duplicate labels 
-a8 OFF Check for non-unary operators at start of expression. 
+

Combinations of the above bits can also be used. For example, -a5 +would enable the checking for illegal indirection and duplicate labels. + +

Illegal indirection applies to micros that use parenthesis around an +argument to indicate indirection. Since it is always legal to put an extra +pair of parenthesis around any expression (as far as the expression parser +is concerned), the user may think that he/she is indicating indirection +for an instruction that has no indirection and TASM would not complain. +Enabling this checking will result in an error message (warning) whenever +an outer pair of parenthesis is used and the instruction set definition +table does not explicitly indicate that to be a valid form of addressing. + +

Unused data in arguments applies to cases where a single byte of data +is needed from an argument, but the argument contains more than one byte +of data. If a full sixteen bit address is used in a 'Load Immediate' type +instruction that needs only a single byte, for example, an error message +would be generated. Here is an example (6502 code): +

    0001   1234                    .org $1234
+    test.asm line 0002: Unused data in MS byte of argument.
+    0002   1234 A9 34       start  lda  #start
+To make the above checks occur whenever you do an assembly, add a line +like this to your AUTOEXEC.BAT file: +
    SET TASMOPTS=-a
+ +

+b - Binary Object Format

+This option causes the object file to be written in binary - one byte for +each byte of code/data. Note that no address information is included in +the object file in this format. The contiguous block (-c) output mode is +forced when this option is invoked. This flag is equivalent to -g3. +

+c - Contiguous Block Output

+If this option is specified, then all bytes in the range from the lowest +used byte to the highest will be defined in the object file. Normally, +with the default Intel Hex object format enabled, if the Program Counter +(PC) jumps forward because of an .ORG directive, the +bytes skipped over will not have any value assigned them in the object +file. With this option enabled, no output to the object file occurs until +the end of the assembly at which time the whole block is written. This +is useful when using TASM to generate code that will be put into a PROM +so that all locations will have a known value. This option is often used +in conjunction with the -f option to ensure all unused bytes will have +a known value. +

+d - Define a Macro

+Macros are defined on the command line generally to control the assembly +of various IFDEF's that are in the source file. This is a convenient way +to generate various versions of object code from a single source file. +

+e - Expand Source.

+Normally TASM shows lines in the listing file just as they are in the source +file. If macros are in use (via the DEFINE directive) +it is sometimes desirable to see the source lines after expansion. Use +the '-e' flag to accomplish this. +

+f - Fill Memory.

+This option causes the memory image that TASM maintains to be initialized +to the value specified by the two hex characters immediately following +the 'f'. TASM maintains a memory image that is a full 64K bytes in size +(even if the target processor cannot utilize that memory space). Invocation +of this option introduces a delay at start up time. +

+g - Object File Format.

+TASM can generate object code in the formats indicated below: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Option Description
-g0 Intel hex (default) 
-g1 MOS Technology hex (same as -m
-g2 Motorola hex 
-g3 binary (same as -b
-g4 Intel hex with word addresses
+

The -m and -b flags may also be used, as indicated above. +If both are used the right-most option on the command line will be obeyed. + +

See the section on OBJECT FILE FORMATS for descriptions of each +of the above. +

+h - Hex Object Code Table.

+This option causes a hex table of the produced object code to appear in +the listing file. Each line of the table shows sixteen bytes of code. +

+i - Ignore Case in Labels.

+TASM is normally case sensitive when dealing with labels. For those that +prefer case insensitivity, the '-i' command line option can be employed. +

+l - Label Table.

+This option causes a label table to appear in the listing file. Each label +is shown with its corresponding value. Macro labels (as established via +the DEFINE directives) do not appear. + +

Two optional suffixes may follow the -l option: +
  + + + + + + + + + + + + + + + + + + +
Suffix Description 
Use long form listing 
Show all labels (including local labels) 
+

The suffix should immediately follow the '-l'. Here are some examples: +
  + + + + + + + + + + + + + + + + + + + + + + + + +
-l to show non-local labels in the short form 
-la to show all labels in the short form 
-ll to show non-local labels in the long form 
-lal to show all labels in the long form 
+ +

+m - MOS Technology Object Format.

+This option causes the object file to be written in MOS Technology hex +format rather than the default Intel hex format. See section on OBJECT +FILE FORMATS for a description of the format. +

+o - Set Number of Bytes per Object Record.

+When generating object code in either the MOS Technology format or the +Intel hex format, a default of 24 (decimal) bytes of object are defined +on each record. This can be altered by invoking the '-o' option immediately +followed by two hex digits defining the number of bytes per record desired. +For example, if 32 bytes per record are desired, one might invoke TASM +as: +
    tasm -48 -o20 source.asm
+ +

+p - Page Listing File.

+This option causes the listing file to have top of page headers and form +feeds inserted at appropriate intervals (every sixty lines of output). +To override the default of sixty lines per page, indicate the desired number +of lines per page as a decimal number immediately following the '-p'. Here +is an example: +
    tasm -48 -p56 source.asm
+ +

+q - Disable Listing File.

+This option causes all output to the listing file to be suppressed, unless +a .LIST directive is encountered in the source file (see LIST/NOLIST +directives). +

+s - Enable Symbol File Generation.

+If this flag is set, a symbol file is generated at the end of the assembly. +The format of the file is one line per label, each label starts in the +first column and is followed by white space and then four hexadecimal digits +representing the value of the label. The following illustrates the format: +
    label1         FFFE
+    label2         FFFF
+    label3         1000
+The symbol file name can be provided as the fifth file name on the command +line, or the name will be generated from the source file name with a '.SYM' +extension. The symbol table file can also be generated by invoking the +SYM directive. The AVSYM directive also generates the symbol file but in +a different format (see section on ASSEMBLER +DIRECTIVES). +

+t - Table Name.

+As an alternative to specifying the instruction set table as two decimal +digits, the table indication may be proceeded by the '-t' option. This +is useful if the desired table name starts with a non-numeric. Thus, a +table for an F8 might be selected as: +
    tasm -tf8 source.asm
+TASM would expect to read the instruction set definition tables from a +file named TASMF8.TAB. +

+x - Enable Extended Instruction Set.

+If a processor family has instructions that are valid for only certain +members, this option can be used to enable those beyond the basic standard +instruction set. A hex digit may follow the 'x' to indicate a mask value +used in selecting the appropriate instruction set. Bit 0 of the mask selects +the basic instruction set, thus a '-x1' would have no effect. A '-x3' would +enable the basic set plus whatever instructions have bit 1 set in their +class mask. A '-x' without a digit following is equivalent to a '-xf' which +sets all four of the mask bits. The following table indicates the current +extended instruction sets available in the TASM tables: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Base Table Base Family Ext 1 (-x3) Ext 2 (-x7) Ext 3 (-x5) Ext 4 (-x9) 
48 8048 8041A 8022 8021 
65 6502 R65C02 R65C00/21 
05 6805 M146805 CMOS HC05C4 
80 Z80 HD64180 
68 6800 6801/6803 68HC11 
51 8051 
85 8080 
3210 TMS32010 
3225 TMS320C25 TMS320C26 
70 TMS7000 
+  +
  + +

The above table does not attempt to show the many microprocessor family +members that may apply under a given column. + +

See the TASMTABS.HTM on-line document for details on each specific table. +

+y - Enable Assembly Timing

+If this option is enabled TASM will generate a statement of elapsed time +and assembled lines per second at the end of the assembly. +

+ +
ENVIRONMENT VARIABLES

+The TASM environment can be customized by using the environment variables +listed below: +

+TASMTABS

+The TASMTABS variable specifies the path to be searched for TASM instruction +set definition tables. If it is not defined then the table(s) must exist +in the current working directory. The following examples illustrate possible +usage: +
  + + + + + + + + + + + + +
For MSDOS set TASMTABS=C:\TASM
For LINUX TASMTABS=/tasm
+ +

+TASMOPTS

+This variable specifies TASM command line options that are to be invoked +every time TASM is executed. For example, if TASM is being used for 8048 +assemblies with binary object file output desired, the following statement +would be appropriate in the AUTOEXEC.BAT file: +
    set TASMOPTS=-48 -b
+ +

+TASMERRFORMAT

+The TASMERRFORMAT variable provides user control of the format of error +messages.  The format string must be a valid printf format string +for ANSI C.  The default value is: +
    +
    "%s line %04d: %s %s"
    +
+Which provides error messages like this: +
    +
    Main.asm line 1234: No such label: Start
    +
+The four fields associated with an error message are: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field DescriptionAssociated Data Type (ANSI C)
File namechar *
Line number within fileint
Error descriptionchar *
Error data (optional)char *
+ + +

No user control of the order of the error message fields is provided. +
Here are sample usages: + +

For MSDOS: +

    +
    set TASMERRFORMAT=”%s(%d) %s %s”
    +
+For LINUX: +
    +
    TASMERRFORMAT=”%s(%d) %s %s”
    +
+ +
+

+EXIT CODES

+When TASM terminates, it will return to the OS the following exit codes: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Exit Code Definition
Normal completion, no assembly errors 
Normal completion, with assembly errors 
Abnormal completion, insufficient memory 
Abnormal completion, file access error 
Abnormal completion, general error 
+

Exit codes 2 and above will also be accompanied by messages to the console +concerning the error. +
+


+

+SOURCE FILE FORMAT

+Statements in the source file must conform to a format as follows (except +for assembler directive statements which are described in a subsequent +section): +
  +
    label operation operand comment
+All of the fields are optional, under appropriate circumstances. An arbitrary +amount of white space (space and tabs) can separate each field (as long +as the maximum line length of 255 characters is not exceeded). Each of +the fields are described in the following sections. +

+Label Field.

+If the first character of the line is alphabetic, it is assumed to be the +start of a label. Subsequent characters are accepted as part of that label +until a space, tab, or ':' is encountered. The assembler assigns a value +to the label corresponding to the current location counter. Labels can +be a maximum of 32 characters long. Labels can contain upper and lower +case letters, digits, underscores, and periods (the first character must +be alphabetic). Labels are case sensitive - the label 'START' is a different +label from 'start' - unless the '-i' (ignore case) option is enabled. +

+Operation Field.

+The operation field contains an instruction mnemonic which specifies the +action to be carried out by the target processor when this instruction +is executed. The interpretation of each mnemonic is dependent on the target +microprocessor (as indicated by the selected TASM table). The operation +field may begin in any column except the first. The operation field is +case insensitive. +

+Operand Field.

+The operand field specifies the data to be operated on by the instruction. +It may include expressions and/or special symbols describing the addressing +mode to be used. The actual format and interpretation is dependent on the +target processor. For a description of the format for currently supported +processors, see the TASMTABS.DOC file on the TASM distribution disk. +

+Comment Field.

+The comment field always begins with a semicolon. The rest of the line +from the semicolon to the end of the line is ignored by TASM, but passed +on to the listing file for annotation purposes. The comment field must +be the last field on a line, but it may be the only field, starting in +column one, if desired. +

+Multiple Statement Lines.

+If the backslash character is encountered on a source line, it is treated +as a newline. The remainder of the line following the backslash will be +processed as an independent line of source code. This allows one to put +multiple statements on a line. This facility is not so useful of itself, +but when coupled with the capability of the DEFINE directive, powerful +multiple statement macros can be constructed (see section on ASSEMBLER +DIRECTIVES). Note that when using the statement separator, the +character immediately following it should be considered the first character +of a new line, and thus must either be a start of a label or white space +(not an instruction). As the examples show, a space is put between the +backslash and the start of the next instruction. +

+Sample Source Listing.

+Some examples of valid source statements follow (6502 mnemonics shown): +
  lab1       lda    byte1   ;get the first byte
+             dec    byte1
+             jne    label1
+  ;            
+  lab2       sta    byte2,X
+  ;  a multiple statement line follows
+             lda    byte1\ sta byte1+4\ lda byte2\ sta byte2+4
+ +
+

+EXPRESSIONS

+Expressions are made up of various syntactic elements combined according +to a set of syntactical rules. Expressions can be comprised of the following +elements: +
    +
  • +Labels
  • + +
  • +Constants
  • + +
  • +Location Counter Symbol
  • + +
  • +Operators
  • + +
  • +Parenthesis
  • +
+ +

+Labels

+Labels are strings of characters that have a numeric value associated with +them, generally representing an address. Labels can contain upper and lower +case letters, digits, underscores, and periods. The first character must +be a letter or the local label prefix (default '_'). The value of a label +is limited to 32 bit precision. Labels can contain up to 32 characters, +all of which are significant (none are ignored when looking at a label's +value, as in some assemblers). Case is significant unless the '-i' command +line option is invoked. + +

Local labels must only be unique within the scope of the current module. +Modules are defined with the MODULE directive. Here +is an example: +

          .MODULE xxx
+          lda regx
+          jne _skip
+          dec
+   _skip  rts
+          .MODULE yyy
+          lda regy
+          jne _skip
+          dec
+   _skip  rts
+In the above example, the _skip label is reused without harm. As +a default, local labels are not shown in the label table listing (resulting +from the '-l' command line option). See also sections on MODULE +and LOCALLABELCHAR directives. +

+Numeric Constants

+Numeric constants must always begin with a decimal digit (thus hexadecimal +constants that start with a letter must be prefixed by a '0' unless the +'$' prefix is used). The radix is determined by a letter immediately following +the digit string according to the following table: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Radix Suffix Prefix 
B or b 
O or o 
10 D or d (or nothing) 
16 H or h 
+ +

Decimal is the default radix, so decimal constants need no suffix or prefix. + +

The following representations are equivalent: +

    1234H          or     $1234
+    100d           or     100
+    177400o        or     @177400
+    01011000b      or     %01011000
+The prefixes are provided for compatibility with some other source code +formats but introduce a problem of ambiguity. Both '%' and '$' have alternate +uses ('%' for modulo, '$' for location counter symbol). The ambiguity is +resolved by examining the context. The '%' character is interpreted as +the modulo operator only if it is in a position suitable for a binary operator. +Similarly, if the first character following a '$' is a valid hexadecimal +digit, it is assumed to be a radix specifier and not the location counter. +

+Character Constants

+Character constants are single characters surrounded by single quotes. +The ASCII value of the character in the quotes is returned. No escape provision +exists to represent non-printable characters within the quotes, but this +is not necessary since these can be just as easily represented as numeric +constants (or using the TEXT directive which does allow +escapes). +

+String Constants.

+String constants are one or more characters surrounded by double quotes. +Note that string constants are not allowed in expressions. They are only +allowable following the TITLE, BYTE, +DB, and TEXT assembler directives. +The quoted strings may also contain escape sequences to put in unprintable +values. The following escape sequences are supported: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Escape Sequence Description 
\n Line Feed 
\r Carriage return 
\b Backspace 
\t Tab 
\f Formfeed 
\\ Backslash 
\" Quote 
\000 Octal value of character 
+ +

+Location Counter Symbol

+The current value of the location counter (PC) can be used in expressions +by placing a '$' in the desired place. The Location Counter Symbol is allowable +anywhere a numeric constant is. (Note that if the '$' is followed by a +decimal digit then it is taken to be the hexadecimal radix indicator instead +of the Location Counter symbol, as mentioned above). The '*' may also be +used to represent the location counter, but is less preferred because of +its ambiguity with the multiplicative operator. +

+Operators

+Expressions can optionally contain operators to perform some alterations +or calculations on particular values. The operators are summarized as follows: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Operator Type Description 
Additive addition 
subtraction 
Multiplicative multiplication 
division 
modulo 
<<logical shift left 
>> logical shift right 
Unary bit inversion (one's complement) 
unary negation 
Relational equal 
== equal 
!= not equal 
<less than 
>greater than 
<= less than or equal 
>= greater than or equal 
&Binary binary 'and' 
binary 'or' 
binary 'exclusive or' 
+ +

The syntax is much the same as in ANSI C with the following notes: + +

    +
  1. +No operator precedence is in effect. Evaluation is from left to right unless +grouped by parenthesis (see example below).
  2. + +
  3. +All evaluations are done with 32 bit signed precision.
  4. + +
  5. +Both '=' and '==' are allowable equality checkers. This is allowed since +the syntax does not provide assignment capability (as '=' would normally +imply).
  6. +
+The relational operators return a value of 1 if the relation is true and +0 if it is false. Thirty-two bit signed arithmetic is used. + +

It is always a good idea to explicitly indicate the desired order of +evaluation with parenthesis, especially to maintain portability since TASM +does not evaluate expressions in the same manner as many other assemblers. +To understand how it does arrive at the values for expressions, consider +the following example: +

    1 + 2*3 + 4
+TASM would evaluate this as: +
    (((1 + 2) * 3) + 4) = 13
+Typical rules of precedence would cause the (2*3) to be evaluated first, +such as: +
    1 + (2*3) + 4      = 11
+To make sure you get the desired order of evaluation, use parenthesis liberally. +Here are some examples of valid expressions: +
    (0f800H + tab)
+    (label_2 >> 8)
+    (label_3 << 8) & $f000
+    $ + 4
+    010010000100100b + 'a'
+    (base + ((label_4 >> 5) & (mask << 2))
+ +
+

+ASSEMBLER DIRECTIVES

+Most of the assembler directives have a format similar to the machine instruction +format. However, instead of specifying operations for the processor to +carry out, the directives cause the assembler to perform some function +related to the assembly process. TASM has two types of assembler directives +- those that mimic the 'C' preprocessor functions, and those that resemble +the more traditional assembler directive functions. Each of these will +be discussed. + +

The ANSI C preprocessor style directives are invoked with a '#' as the +first character of the line followed by the appropriate directive (just +as in 'C'). Thus, these directives cannot have a label preceding them (on +the same line). Note that in the examples directives are shown in upper +case, however, either upper or lower case is acceptable. +

+ADDINSTR

+The ADDINSTR directive can be used to define additional instructions for +TASM to use in this assembly. The format is: +
    [label] .ADDINSTR inst args opcode nbytes rule class shift binor
+The fields are separated by white space just as they would appear in an +instruction definition file. See the TASMTABS.HTM file on the TASM distribution +disk for more detail. +

+AVSYM

+See SYM/AVSYM. +

+BLOCK

+The BLOCK directive causes the Instruction Pointer to advance the specified +number of bytes without assigning values to the skipped over locations. +The format is: +
    [label] .BLOCK        expr
+Some valid examples are: +
    word1   .BLOCK     2
+    byte1   .block     1
+    buffer  .block     80
+ +

+BSEG/CSEG/DSEG/NSEG/XSEG

+These directives can be invoked to indicate the appropriate address space +for symbols and labels defined in the subsequent code. The invocation of +these directives in no way affects the code generated, only provides more +information in the symbol table file if the AVSYM directive is employed. +Segment control directives such as these are generally supported by assemblers +that generate relocatable object code. TASM does not generate relocatable +object code and does not support a link phase, so these directives have +no direct effect on the resulting object code. The segments are defined +as follows: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Directive Segment Description 
BSEG Bit address 
CSEG Code address 
DSEG Data address (internal RAM) 
NSEG Number or constant (EQU) 
XSEG External data address (external RAM) 
+ +

+BYTE

+The BYTE directive allows a value assignment to the byte pointed to by +the current Instruction Pointer. The format is: +
    [label] .BYTE   expr [, expr ...]
+Only the lower eight bits of expr are used. Multiple bytes may be +assigned by separating them with commas or (for printable strings) enclosed +in double quotes. Here are some examples: +
    label1   .BYTE     10010110B
+             .byte     'a'
+             .byte     0
+             .byte     100010110b,'a',0
+             .byte     "Hello", 10, 13, "World"
+ +

+CHK

+The CHK directive causes a checksum to be computed and deposited at the +current location. The starting point of the checksum calculation is indicated +as an argument. Here is the format: +
    [label]    .CHK    starting_addr
+Here is an example: +
    start: NOP
+           LDA #1
+           .CHK start
+The checksum is calculated as the simple arithmetic sum of all bytes starting +at the starting_addr up to but not including the address of the +CHK directive. The least significant byte is all that +is used. +

+CODES/NOCODES

+The CODES/NOCODES directives can be used to alternately turn on or off +the generation of formatted listing output with line numbers, opcodes, +data, etc. With NOCODES in effect, the source lines are sent to the listing +file untouched. This is useful around blocks of comments that need a full +80 columns of width for clarity. +

+DB

+This is alternate form of the BYTE directive. +

+DW

+This is alternate form of the WORD directive. +

+DEFINE

+The DEFINE directive is one of the most powerful of the directives and +allows string substitution with optional arguments (macros). The format +is as follows: +
    #DEFINE  macro_label[(arg_list)]  [macro_definition]
+Where: +
+
+macro_label
+ +
+character string to be expanded when found in the source file
+ +
+arg_list
+ +
+optional argument list for variable substitution in macro expansion
+ +
+macro_def
+ +
+string to replace the occurrences of macro_label in the source file.
+
+The simplest form of the DEFINE directive might look like this: +
    #DEFINE         MLABEL
+Notice that no substitutionary string is specified. The purpose of a statement +like this would typically be to define a label for the purpose of controlling +some subsequent conditional assembly (IFDEF or IFNDEF). + +

A more complicated example, performing simple substitution, might look +like this: +

    #DEFINE         VAR1_LO         (VAR1 & 255)
+This statement would cause all occurrences of the string 'VAR1_LO' in the +source to be substituted with '(VAR1 & 255)'. + +

As a more complicated example, using the argument expansion capability, +consider this: +

    #DEFINE  ADD(xx,yy)    clc\ lda xx\ adc yy\ sta xx
+If the source file then contained a line like this: +
    ADD(VARX,VARY)
+It would be expanded to: +
    clc\ lda VARX\ adc VARY\ sta VARX
+The above example shows the use of the backslash ('\') character as a multiple +instruction statement delimiter. This approach allows the definition of +fairly powerful, multiple statement macros. The example shown generates +6502 instructions to add one memory location to another. + +

Some rules associated with the argument list: +

    +
  1. +Use a maximum of 10 arguments.
  2. + +
  3. +Each argument should be a maximum of 15 characters.
  4. +
+Note that macros can be defined on the TASM command line, also, with the +-d option flag. +

+DEFCONT

+The DEFCONT directive can be used to add to the last macro started with +a DEFINE directive. This provides a convenient way +to define long macros without running off the edge of the page. The ADD +macro shown above could be defined as follows: +
    #DEFINE         ADD(xx,yy)     clc
+    #DEFCONT                     \ lda xx
+    #DEFCONT                     \ adc yy
+    #DEFCONT                     \ sta xx
+ +

+ECHO

+The ECHO directive can be used to send output to the console (stderr). +It can accept either a quoted text string (with the standard escape sequences +allowed) or a valid expression. It can accept only one or the other, however. +Multiple instances of the directive may be used to create output that contains +both. Consider the following example: +
    .ECHO "The size of the table is "
+    .ECHO (table_end - table_start)
+    .ECHO " bytes long.\n"
+This would result in a single line of output something like this: +
    The size of the table is 196 bytes long.
+ +

+EJECT

+The EJECT directive can be used to force a top-of-form and the generation +of a page header on the list file. It has no effect if the paging mode +is off (see PAGE/NOPAGE). The format is: +
    [label]    .EJECT
+ +

+ELSE

+The ELSE directive can optionally be used with IFDEF, IFNDEF and IF to +delineate an alternate block of code to be assembled if the block immediately +following the IFDEF, IFNDEF or IF is not assembled. + +

Here are some examples of the use of IFDEF, IFNDEF, IF, ELSE, and ENDIF: +

    #IFDEF   label1
+        lda      byte1
+        sta      byte2
+    #ENDIF   
+
+    #ifdef   label1
+        lda      byte1
+    #else    
+        lda      byte2
+    #endif   
+
+    #ifndef  label1
+        lda      byte2
+    #else    
+        lda      byte1
+    #endif   
+
+    #if ($ >= 1000h)
+    ; generate an invalid statement to cause an error
+    ;  when we go over the 4K boundary.
+    !!! PROM bounds exceeded.
+    #endif
+ +

+END

+The END directive should follow all code/data generating statements in +the source file. It forces the last record to be written to the object +file. The format is: +
    [label]       .END [addr]
+The optional addr will appear in the last object record (Motorola +S9 record type) if the object format is Motorola hex. The addr field +is ignored for all other object formats. +

+ENDIF

+The ENDIF directive must always follow an IFDEF, IFNDEF, or IF directive +and signifies the end of the conditional block. +

+EQU

+The EQU directive can be used to assign values to labels. The labels can +then be used in expressions in place of the literal constant. The format +is: +
    label   .EQU   expr
+Here is an example: +
    MASK   .EQU  0F0H
+    ;
+           lda   IN_BYTE
+           and   MASK
+           sta   OUT_BYTE
+An alternate form of the EQU directive is '='. The previous example is +equivalent to any of the following: +
    MASK    =   0F0H
+    MASK    =0F0H
+    MASK    =$F0
+White space must exist after the label, but none is required after +the '='. +

+EXPORT

+The EXPORT directive can be used to define labels (symbols) that are to +be written to the export symbol file. The symbols are written as equates +(using the .EQU directive) so that the resulting file can be included in +a subsequent assembly. This feature can help overcome some of the deficiencies +of TASM due to its lack of a relocating linker. The format is: +
    [label]  .EXPORT      label [,label...]
+The following example illustrates the use of the EXPORT directive and the +format of the resulting export file: + +

Source file: +

    EXPORT        read_byte
+    EXPORT        write_byte, open_file
+Resulting export file: +
    read_byte      .EQU   $1243
+    write_byte     .EQU   $12AF
+    open_file      .EQU   $1301
+ +

+FILL

+The FILL directive can be used to fill a selected number of object bytes +with a fixed value. Object memory is filled from the current program counter +forward. The format is as follows: +
    [label]  .FILL      number_of_bytes [,fill_value]
+The number_of_bytes value can be provided as any valid expression. +The optional fill_value can also be any valid expression. If fill_value +is not provided, a default value of 255 ($FF) is used. +

+IFDEF

+The IFDEF directive can be used to optionally assemble a block of code. +It has the following form: +
    #IFDEF  macro_label
+When invoked, the list of macro labels (established via DEFINE +directives) is searched. If the label is found, the following lines of +code are assembled. If not found, the input file is skipped until an ENDIF +or ELSE directive is found. + +

Lines that are skipped over still appear in the listing file, but a +'~' will appear immediately after the current PC and no object code will +be generated (this is applicable to IFDEF, IFNDEF, and IF). +

+IFNDEF

+The IFNDEF directive is the opposite of the IFDEF directive. The block +of code following is assembled only if the specified macro_label +is undefined. It has the following form: +
    #IFNDEF  macro_label
+When invoked, the list of macro labels (established via DEFINE directives) +is searched. If the label is not found, the following lines of code are +assembled. If it is found, the input file is skipped until an ENDIF or +ELSE directive is found. +

+IF

+The IF directive can be used to optionally assemble a block of code dependent +on the value of a given expression. The format is as follows: +
    #IF     expr
+If the expression expr evaluates to non-zero, the following block +of code is assembled (until an ENDIF or ELSE is encountered). +

+INCLUDE

+The INCLUDE directive reads in and assembles the indicated source file. +INCLUDEs can be nested up to four levels. This allows a convenient means +to keep common definitions, declarations, or subroutines in files to be +included as needed. The format is as follows: +
#INCLUDE        filename
+The filename must be enclosed in double quotes. Here are some examples: +
    #INCLUDE       "macros.h"
+    #include       "equates"
+    #include       "subs.asm"
+ +

+LIST/NOLIST

+The LIST and NOLIST directives can be used to alternately turn the output +to the list file on (LIST) or off (NOLIST). The formats are: +
    .LIST
+    .NOLIST
+ +

+LOCALLABELCHAR

+The LOCALLABELCHAR directive can be used to override the default "_" as +the label prefix indicating a local label. For example, to change the prefix +to "?" do this: +
    [label]   .LOCALLABELCHAR "?"
+Be careful to use only characters that are not operators for expression +evaluation. To do so causes ambiguity for the expression evaluator. Some +safe characters are "?", "{", and "}".  See Labels +for an example of local label usage. +

+LSFIRST/MSFIRST

+The LSFIRST and MSFIRST directives determine the byte order rule to be +employed for the WORD directive. The default (whether +correct or not) for all TASM versions is the least significant byte first +(LSFIRST). The following illustrates its effect: +
    0000  34 12    .word $1234
+    0002           .msfirst
+    0002  12 34    .word $1234
+    0004           .lsfirst
+    0004  34 12    .word $1234
+ +

+MODULE

+The MODULE directive defines the scope of local labels. The format is: +
    [label]   .MODULE label
+Here is an example: +
          .MODULE module_x
+          lda regx
+          jne _skip
+          dec
+   _skip  rts
+          .MODULE module_y
+          lda regy
+          jne _skip
+          dec
+   _skip  rts
+In the above example, the local label _skip is reused without harm +since the two usages are in separate modules. See also section LOCALLABELCHAR +directive. +

+ORG

+The ORG directive provides the means to set the Instruction Pointer (a.k.a. +Program Counter) to the desired value. The format is: +
    [label] .ORG    expr
+The label is optional. The Instruction pointer is assigned the value +of the expr. For example, to generate code starting at address 1000H, +the following could be done: +
    start   .ORG    1000H
+The expression (expr) may contain references to the current Instruction +Pointer, thus allowing various manipulations to be done. For example, to +align the Instruction Pointer on the next 256 byte boundary, the following +could be done: +
    .ORG  (($ + 0FFH) & 0FF00H)
+ORG can also be used to reserve space without assigning values: +
    .ORG    $+8
+An alternate form of ORG is '*=' or '$='. Thus the following two examples +are exactly equivalent to the previous example: +
    *=*+8
+    $=$+8
+ +

+PAGE/NOPAGE

+The PAGE/NOPAGE directives can be used to alternately turn the paging mode +on (PAGE) or off (NOPAGE). If paging is in effect, then every sixty lines +of output will be followed by a Top of Form character and a two line header +containing page number, filename, and the title. The format is: +
    
+    .PAGE
+    .NOPAGE
+The number of lines per page can be set with the '-p' command line option. +

+SET

+The SET directive allows the value of an existing label to be changed. +The format is: +
    label   .SET    expr
+The use of the SET directive should be avoided since changing the value +of a label can sometimes cause phase errors between pass 1 and pass 2 of +the assembly. +

+SYM/AVSYM

+These directives can be used to cause a symbol table file to be generated. +The format is: +
    .SYM    ["symbol_filename"]
+    .AVSYM  ["symbol_filename"]
+For example: +
    .SYM       "symbol.map"
+    .SYM       
+    .AVSYM     "prog.sym"
+    .AVSYM
+The two directives are similar, but result in a different format of the +symbol table file. The format of the SYM file is one line per symbol, each +symbol starts in the first column and is followed by white space and then +four hexadecimal digits representing the value of the symbol. The following +illustrates the format: +
    label1         FFFE
+    label2         FFFF
+    label3         1000
+The AVSYM directive is provided to generate symbol tables compatible with +the Avocet 8051 simulator. The format is similar, but each line is prefixed +by an 'AS' and each symbol value is prefixed by a segment indicator: +
    AS     start          C:1000
+    AS     read_byte      C:1245
+    AS     write_byte     C:1280
+    AS     low_nib_mask   N:000F
+    AS     buffer         X:0080
+The segment prefixes are determined by the most recent segment directive +invoked (see BSEG/CSEG/DSEG/NSEG/XSEG directives). +

+TEXT

+This directive allows an ASCII string to be used to assign values to a +sequence of locations starting at the current Instruction Pointer. The +format is: +
    [label] .TEXT   "string"
+The ASCII value of each character in string is taken and assigned to the +next sequential location. Some escape sequences are supported as follows: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Escape Sequence Description 
\n Line Feed 
\r Carriage return 
\b Backspace 
\t Tab 
\f Formfeed 
\\ Backslash 
\" Quote 
\000 Octal value of character 
+ +

Here are some examples: + +

    message1   .TEXT   "Disk I/O error"
+    message2   .text   "Enter file name "
+               .text   "abcdefg\n\r"
+               .text   "I said \"NO\""
+ +

+TITLE

+The TITLE directive allows the user to define a title string that appears +at the top of each page of the list file (assuming the PAGE mode is on). +The format is: +
    [label]    .TITLE  "string"
+The string should not exceed 80 characters. Here are some examples: +
    .TITLE  "Controller version 1.1"
+    .title  "This is the title of the assembly"
+    .title  ""
+ +

+WORD

+The WORD directive allows a value assignment to the next two bytes pointed +to by the current Instruction Pointer. The format is: +
    [label] .WORD expr [,expr...]
+The least significant byte of expr is put at the current Instruction Pointer +with the most significant byte at the next sequential location (unless +the MSFIRST directive has been invoked). Here are some examples: +
    data_table     .WORD   (data_table + 1)
+                   .word   $1234
+                   .Word   (('x' - 'a')  << 2)
+                   .Word  12, 55, 32
+ +
+

+OBJECT FILE FORMATS

+TASM can generate object code in the formats indicated below: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Option Description
-g0 Intel hex (default) 
-g1 MOS Technology hex (same as -m
-g2 Motorola hex 
-g3 binary (same as -b
-g4 Intel hex with word addresses
+

The -m and -b flags may also be used, as indicated above. +If both are used the right-most option on the command line will be obeyed. +

+Intel Hex Object Format

+This is the default object file format. This format is line oriented and +uses only printable ASCII characters except for the carriage return/line +feed at the end of each line. The format is symbolically represented as: + +

:NN AAAA RR HH CC CRLF + +

Where: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
:Record Start Character (colon)
NNByte Count (2 hex digits)
AAAAAddress of first byte (4 hex digits)
RRRecord Type (00 except for last record +which is 01)
HHData Bytes (a pair of hex digits for each byte +of data in the record)
CCCheck Sum (2 hex digits)
CRLFLine Terminator (CR/LF for DOS, LF for LINUX)
+

The last line of the file will be a record conforming to the above format +with a byte count of zero. + +

The checksum is defined as: + +

sum = byte_count+address_hi+address_lo+record_type+(sum of all data +bytes) +
checksum = ((-sum) & ffh) + +

Here is a sample listing file followed by the resulting object file: +

0001   0000             
+0002   1000                     .org   $1000
+0003   1000 010203040506        .byte  1, 2, 3, 4, 5, 6, 7, 8
+0003   1006 0708
+0004   1008 090A0B0C0D0E        .byte  9,10,11,12,13,14,15,16
+0004   100E 0F10
+0005   1010 111213141516        .byte 17,18,19,20,21,22,23,24,25,26
+0005   1016 1718191A
+0006   101A                     .end
+ +
    :181000000102030405060708090A0B0C0D0E0F101112131415161718AC
+    :02101800191AA3
+    :00000001FF
+ +

+Intel Hex Word Address Object Format

+This format is identical to the Intel Hex Object Format except that +the address for each line of object code is divided by two thus converting +it to a word address (16 bit word). All other fields are identical. + +

Here is an example: +

:180800000102030405060708090A0B0C0D0E0F101112131415161718AC
+:02080C00191AA3
+:00000001FF
+ +

+MOS Technology Hex Object Format

+This format is line oriented and uses only printable ASCII characters except +for the carriage return/line feed at the end of each line. Each line in +the file is of the following format: + +

:NN AAAA HH CC CRLF + +

Where: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
;Record Start Character (semicolon)
NNByte Count (2 hex digits)
AAAAAddress of first byte (4 hex digits)
HHData Bytes (a pair of hex digits for each byte +of data in the record)
CCCCCheck Sum (4 hex digits)
CRLFLine Terminator (CR/LF for DOS, LF for LINUX)
+

The last line of the file will be a record conforming to the above format +with a byte count of zero. + +

The checksum is defined as: + +

sum =byte_count+address_hi+address_lo+record_type+(sum of all data +bytes) +
checksum = (sum & ffffh) + +

Here is a sample object file: +

;1810000102030405060708090A0B0C0D0E0F1011121314151617180154
+;021018191A005D
+;00
+ +

+Motorola Hex Object Format

+This format is line oriented and uses only printable ASCII characters except +for the carriage return/line feed at the end of each line. The format is +symbolically represented as: + +

S1 NN AAAA HH CCCC CRLF + +

Where: +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
S1Record Start tag 
NNByte Count (2 hex digits) (data byte count + +3)
AAAAAddress of first byte (4 hex digits)
HHData Bytes (a pair of hex digits for each byte +of data in the record)
CCCheck Sum (2 hex digits)
CRLFLine Terminator (CR/LF for DOS, LF for LINUX)
+ +

The checksum is defined as: + +

sum = byte_count+address_hi+address_lo+(sum of all data bytes) +
checksum = ((~sum) & ffh) + +

Here is a sample file: +

S11B10000102030405060708090A0B0C0D0E0F101112131415161718A8
+S1051018191A9F
+S9030000FC
+

The last line of the file will be a record with a byte count of zero and +a tag of S9. The address field will be 0000 unless and address was provided +with the END directive in which case it will appear in the address field. +

+Binary Object Format.

+This file format is essentially a memory image of the object code without +address, checksum or format description information. + +

Note that when this object format is selected (-b option), the -c option +is forced. This is done so that no ambiguity results from the lack of address +information in the file. Without the -c option, discontinuous blocks of +object code would appear contiguous. +
  + +

+


+

+LISTING FILE FORMAT

+Each line of source code generates one (or more) lines of output in the +listing file. The fields of the output line are as follows: +
    +
  1. +Current source file line number (4 decimal digits).
  2. + +
  3. +An optional '+' appears if this is an 'INCLUDE' file. (One '+' for each +level of INCLUDE invoked).
  4. + +
  5. +Current Instruction Pointer (4 hex digits). An optional '~' follows the +Instruction Pointer if the line of source code is not being assembled because +of an IFDEF, IFNDEF, or IF directive.
  6. + +
  7. +Resulting code/data generated from this source line (two hex digits per +byte, each byte separated by a space, up to six bytes per line).
  8. + +
  9. +The source line exactly as it appears in the source file.
  10. +
+If paging is enabled (by either the '-p' option flag or the .PAGE directive) +some additional fields will be inserted into the listing file every 60 +lines. These fields are: +
    +
  1. +Top of Form (form feed).
  2. + +
  3. +Assembler identifier (e.g. "TASM 6502 Assembler").
  4. + +
  5. +Initial source file name.
  6. + +
  7. +Page number.
  8. + +
  9. +Title.
  10. +
+If errors are encountered, then error messages will be interspersed in +the listing. TASM outputs error messages proceeding the offending line. +The following example illustrates the format: +
    0001   0000             label1  .equ  40h
+    0002   0000             label2  .equ  44h
+    0003   0000 
+    0004   1000             start:  .org  1000h
+    0005   1000 E6 40               inc   label1
+    0006   1002 E6 44               inc   label2
+    tt.asm line 0007: Label not found: (label3)
+    0007   1004 EE 00 00            inc   label3
+    0008   1007 4C 00 10            jmp   start
+    0009   100A                     .end  
+    0010   100A                            
+    tasm: Number of errors = 1
+ +
+

+PROM PROGRAMMING

+A wide variety of PROM programming equipment is available that can use +object code in one or more of the formats supported by TASM. Here are some +notes concerning the generation of code to be programmed into PROMs: +

+PRESET MEMORY

+It is often desirable to have all bytes in the PROM programmed even if +not explicitly assigned a value in the source code (e.g. the bytes are +skipped over with a .ORG statement). This can be accomplished by using +the -c (contiguous block) and the -f (fill) command line +option flags. The -c will ensure that every byte from the lowest +byte assigned a value to the highest byte assigned a value will be in the +object file with no gaps. The -f flag will assign the specified +value to all bytes before the assembly begins so that when the object file +is written, all bytes not assigned a value in the source code will have +a known value. As an example, the following command line will generate +object code in the default Intel Hex format with all bytes not assigned +a value in the source set to EA (hex, 6502 NOP instruction): +
    tasm -65 -c -fEA test.asm
+ +

+CONTIGUOUS BLOCKS

+To ensure that TASM generates object code to cover the full address range +of the target PROM, put a .ORG statement at the end of the source file +set to the last address desired. For example, to generate code to be put +in a 2716 EPROM (2 Kbytes) from hex address $1000 to $17ff, do something +like this in the source file: +
    ;start of the file
+        .ORG    $1000
+    ;rest of the source code follows
+    source code
+    ;end of the source code
+        .ORG    $17ff
+        .BYTE   0
+        .END
+Now, to invoke TASM to generate the code in the binary format with all +unassigned bytes set to 00 (6502 BRK instruction), do the following: +
tasm -65 -b -f00 test.asm
+Note: -b forces the -c option. +
+
+

+ERROR MESSAGES

+ +

+Error Message Format

+TASM error messages take the following general form: +
    filename line line_number: error_message
+For example: +
    main.asm line 0032: Duplicate label (start)
+Many editors and IDE’s can run assemblies from within and parse the error +messages to make it convenient to jump to each error and correct.  +If the above format is not satisfactory for your editor or IDE, use the +TASMERRFORMAT environment variable to alter +the error message format. + +

When using automatic invocation of TASM from within an editor or IDE, +it may be useful to use the TASMOPTS environment +variable to set other command line options.  For example, to cause +TASM to perform 6502 assemblies, set TASMOPTS like this: +

    +
    SET TASMOPTS=-65
    +
+ +

+ERROR MESSAGE DESCRIPTIONS

+ +
+
+Binary operator where value expected
+ +
+Two binary operators in a row indicate a missing value.
+ +
+Branch off of current 2K page
+ +
+An instruction is attempting to branch to a location not within the current +2K byte page.
+ +
+Branch off of current page
+ +
+An instruction is attempting to branch to a location not within the current +256 byte page.
+ +
+Cannot malloc for label storage
+ +
+Insufficient memory to store more labels. See LIMITATIONS.
+ +
+Duplicate label
+ +
+The label for the current line has already been assigned a value. Duplicate +label checks are optionally enabled by the -a option.
+ +
+File name too short
+ +
+A file name on the command line is fewer than 3 characters. A two character +file name may be valid, of course, but it is detected as an error to prevent +a garbled option flag from being taken as a source file, which in turn +can result in the true source file being taken as the object file. Since +the object file is truncated at startup time, the source file could be +clobbered.
+ +
+Forward reference in equate
+ +
+An EQU directive is using a label on the right hand side that has not yet +been defined.
+ +
+Heap overflow on label definition
+ +
+TASM was unable to allocate memory to store the label.
+ +
+Imbalanced conditional.
+ +
+An end-of-file was encountered at which time the level of descent in conditional +directives was different from when the file was entered. Conditional directives +include IF, IFDEF, and IFNDEF.
+ +
+Invalid Object file type.
+ +
+An object file type was requested by the -g command line option that is +not valid. See section on Option g - Object File Format.
+ +
+Invalid operand.
+ +
+No indirection for this instruction. The first character of an operand +was a left parenthesis for an instruction that does not explicitly specify +that as the format. Some micros use the parenthesis as an indicator of +indirection, but putting a layer of parenthesis around an expression is +always a valid thing to do (as far as the expression evaluator is concerned). +The test for this case is only done if the -a4 option is selected. +See section on ASSEMBLY CONTROL.
+ +
+Invalid token where value expected.
+ +
+Two binary operators in a row are not allowed.
+ +
+Label too long.
+ +
+Labels are limited to 31 characters.
+ +
+Label value misaligned
+ +
+The value of a label appears to have a different value on the second pass +then it was computed to have on the first pass. This is generally due to +Zero Page Addressing mode problems with the 6502 version of TASM. Labels +that are used in operands for statements that could utilize Zero Page addressing +mode should always be defined before used as an operand.
+ +
+Label not found
+ +
+A label used in an expression was not found in the current label table.
+ +
+Label must pre-exist for SET.
+ +
+The SET directive can only be applied to an existing label.
+ +
+Label table overflow
+ +
+To many labels have been encountered.
+ +
+List file open error
+ +
+TASM was not able to open the specified list file.
+ +
+Macro expansion too long.
+ +
+The expansion of a macro resulted in a line that exceeded the maximum length.
+ +
+Max number of nested conditionals exceeded
+ +
+Too many levels of IF, IFDEF, or IFNDEF.
+ +
+Maximum number of args exceeded
+ +
+Too many macro arguments.
+ +
+Maximum number of macros exceeded
+ +
+Too many macros (DEFINEs) have been encountered.
+ +
+No END directive before EOF
+ +
+The source file did not have an END directive in it. This is not fatal, +but may cause the last object file record to be lost.
+ +
+No files specified
+ +
+TASM was invoked with no source file specified.
+ +
+No such label
+ +
+A SET directive was encountered for a label not yet defined. The value +of labels that are modified by the SET directive must already exist.
+ +
+No terminating quote
+ +
+A double quote was used at the start of a a text string but was not used +at the end of the string.
+ +
+No indirection for this instruction.
+ +
+A parenthesis was found around the operand expression. This may indicate +an attempt to use indirection where it is inappropriate.
+ +
+Non-unary operator at start of expression
+ +
+A binary operator (such as '*') was found at the beginning of an expression. +Some micros use '*' as an indirection operator. Since it is also a legitimate +operator in an expression, some ambiguity can arise. If a particular instruction/addressing +mode does not allow indirection, and a '*' is placed in front of the associated +expression, the assembler will assume this error. See the -a8 option +of ASSEMBLY CONTROL.
+ +
+Object file open error
+ +
+TASM was not able to open the specified object file.
+ +
+Range of argument exceeded
+ +
+The value of an argument exceeds the valid range for the current instruction +and addressing mode.
+ +
+Range of relative branch exceeded
+ +
+A branch instruction exceeds the maximum range.
+ +
+Source file open error
+ +
+TASM was not able to open the specified source file.
+ +
+Unrecognized directive
+ +
+A statement starting with a '.' or '#' has a mnemonic that is not defined +as a directive.
+ +
+Unrecognized instruction
+ +
+A statement has an opcode mnemonic that is not defined.
+ +
+Unrecognized argument
+ +
+A statement has an operand format that is not defined.
+ +
+Unknown token
+ +
+Unexpected characters were encountered while parsing an expression.
+ +
+Unused data in MS byte of argument
+ +
+An instruction or directive used the least significant byte of an argument +and left the most significant byte unused, but it was non-zero.
+ +
+Unknown option Flag.
+ +
+Invalid option flag has been specified on the command line. invoke TASM +with nothing on the command line to see a list of valid options.
+
+ +
+

+LIMITATIONS

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Maximum number of labels 15000 
Maximum length of labels 32 characters 
Maximum address space 64 Kbytes (65536 bytes) 
Maximum number of nested INCLUDES
Maximum length of TITLE string 79 characters 
Maximum source line length 511 characters 
Maximum length after macro expansion 511 characters 
Maximum length of expressions 511 characters 
Maximum length of pathnames 79 characters 
Maximum length of command line 127 characters 
Maximum number of instructions (per table) 1200 
Maximum number of macros 1000 
Maximum number of macro arguments 10 
Maximum length of macro argument 16 characters 
Memory requirements 512K 
+ +

+Other Limitations

+ +
    +
  1. +The 8048 version of TASM does not check for use of memory beyond any reasonable +bounds (e.g. an 8048 has a maximum address space of 4 Kbytes but TASM will +let you pretend that you have 64 Kbytes).
  2. + +
  3. +Expression evaluation has no operator precedence in effect which can make +for unexpected results if not explicitly grouped with parenthesis.
  4. + +
  5. +First page of listing file will not show a user defined title (defined +via TITLE directive).
  6. +
+ +
+
Top + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmTableManual.htm b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmTableManual.htm new file mode 100644 index 00000000..0f8297a7 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Doc/TasmTableManual.htm @@ -0,0 +1,2989 @@ + + + +TASM Table Syntax + +

TASM TABLE SYNTAX DESCRIPTION

+

The tables that control TASM's interpretation of the source file are read +from a file at run time. The table file name is determined by taking the +numeric option field specified on the TASM command line and appending it to the +string "TASM", then a ".TAB" extension is added. Thus, +if the following command line is entered: +

+
        tasm -51  test.asm
+
+

then TASM would read the table file named "TASM51.TAB". +

+

The following rules apply to the structure of the table file: +

+
    +
  • The first line of the file should contain a string surrounded by double +quotes that should identify the version of the assembler table. This string +will appear at the top of each page in the list file. It should be limited to +24 characters.
  • +
  • Any line that starts with a '.' is considered a directive. Directives +should preceed instruction defintion lines. The following directives are +available: +
+ + + + + + + + + + + + + + + + + + +
DIRECTIVEDESCRIPTION
MSFIRSTGenerate opcodes MS byte first. Useful for tables with multibyte opcodes.
ALTWILDUse '@' instead of '*' as the wild card in the table. Useful if the +instruction syntax uses '*' to denote certain addressing modes.
NOARGSHIFTSuppress the shift/or operation that applies if the optional SHIFT and OR +fields are provided. Some RULEs use the SHIFT/OR fields for other purposes.
REGSETDefine a register mnemonic and associated bit field. See example below.
WORDADDRSSet word addressing mode (one word = 2 bytes)
+
    +
  • Any line whose first character is not a '.' and is not alphabetic is +considered to be a comment and is discarded.
  • +
  • Any line that has an alphabetic character as the first character is assumed +to be an instruction definition record and is parsed to build the internal +representation of the instruction set tables. Eight fields (separated by white +space) are expected, as follows: +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
Field Name Description
INSTRUCTION Instruction Mnemonic
ARGS Argument definition
OPCODE Opcode value
NBYTES Number of bytes
RULE Modifier operation
CLASS Instruction class
SHIFT Argument left shift count
OR Argument bitwise OR mask
+

The fields are further defined below:

+
+
INSTRUCTION
+
The INSTRUCTION field should contain the string to be used as the mnemonic +for this instruction. Upper case letters should be used (the source statements +are converted to upper case before comparison).
+
ARGS.
+
The ARGS field should contain a string describing the format of the operand +field. All characters are taken literally except the '*' which denotes the +presence of a valid TASM expression. Multiple '*'s can be used, but all but the +last one must be followed by a comma, '[', or ']'. If a single '*' appears in +the ARGS field, then the default action of TASM will be to determine the value +of the expression that matches the field and insert one or two bytes of it into +the object file depending on the NBYTES field. If multiple '*'s are used, then +special operators (RULE) must be used to take advantage of them (see the +examples below). An ARGS field of a pair of double quotes means that no +arguments are expected. +
+
OPCODE.
+
The OPCODE field should contain the opcode value (two to six hex digits) +for this instruction and address mode. Each pair of hex digits represent a +single byte of the opcode, ordered with the right most pair being placed in the +lowest memory location. +
+
NBYTES.
+
The NBYTES field should specify the number of bytes this instruction is to +occupy (a single decimal digit). This number includes both opcode bytes and +argument bytes, thus, the number of bytes of argument is computed by subtracting +the number of bytes of opcode (dictated by the length of the OPCODE field) from +NBYTES. +
+
RULE.
+
The RULE field determines if any special operations need to be performed +on the code generated for this instruction. For example, the zero-page +addressing mode of the 6502 is a special case of the absolute addressing mode, +and is handled by a special RULE code. See the Encoding Rules below. +
+
CLASS.
+
The CLASS field is used to specify whether this instruction is part of the +standard instruction set or a member of a set of extended instructions. Bit 0 of +this field should be set to denote a member of the standard instruction set. +Other bits can be used as needed to establish several classes (or sets) of +instructions that can be enabled or disabled via the '-x' command line option. + +
+
SHIFT (optional).
+
The SHIFT field is used to cause the first argument of the given +instruction to be shifted left the specified number of bits. (Except T1, TDMA, +TAR RULES as noted below). +
+
OR (optional).
+
The OR field is used to perform a bitwise OR with the first argument of the +given instruction. Specified as hex digits. (Except T1, TDMA, TAR RULES as +noted below). +
+

Note that the SHIFT/OR fields are used somewhat differently for T1, TDMA, +and TAR RULES. In those cases, the SHIFT and OR fields are used but the OR +field is really an AND mask and the result is OR'd with the opcode. +

+

Encoding Rules

+

The following encoding rules are available:

+
+
NOTOUCH or NOP
+
Do nothing to instruction or args
+
JMPPAGE
+
Put bits 8-10 of first arg into bits 5-7 of opcode (8048 JMP)
+
ZPAGE
+
If arg < 256 then use zero-page (6502)
+
R1
+
Make arg relative to PC (single byte)
+
R2
+
Make arg relative to PC (two byte)
+
CREL
+
Combine LS bytes of first two args making the second one relative to PC
+
SWAP
+
Swap bytes of first arg
+
COMBINE
+
Combine LS bytes of first two args into first arg (arg1 -> LSB, arg2 ->MSB).
+
CSWAP
+
Combine LS bytes of first two args into first arg and swap.
+
ZBIT
+
Z80 bit instructions.
+
ZIDX
+
Z80 Indexed Instructions (e.g. ADC A,(IX+x))
+
MBIT
+
Motorola (6805) bit instructions
+
MZERO
+
Motorola (6805) zero page (direct)
+
3ARG
+
Three args, one byte each.
+
3REL
+
Three args, one byte each, last one relative
+
T1
+
TMS320 instruction with one arg. Shift according to SHIFT and mask with OR +and OR into opcode. If a second arg exists assume it is an arp and OR intoLSB +of opcode.
+
TDMA
+
TMS320 instruction with first arg dma. Second arg gets shift/and/or +treatment as with T1.
+
TAR
+
TMS320 instruction with first arg ar. Second arg gets shift/and/or +treatment as with T1.
+
I1
+
I8096 Combine
+
I2
+
I8096 two far args
+
I3
+
I8096 three far args
+
I4
+
I8096 Jump with bit mask
+
I5
+
I8096 Relative
+
I6
+
I8096 Indirect
+
I7
+
I8096 One far arg
+
I8
+
I8096 Jump
+

Encoding Examples

+

Note that the reason for the combining of arguments (COMBINE and CSWAP) is +that TASM assumes that all object bytes to be inserted in the object file are +derived from a variable representing the value of the first argument (argval). +If two arguments are in the ARGS field, then one of the previously mentioned +RULE`s must be used. They have the effect of combining the low bytes of the +first two arguments into the variable (argval) from which the object code will +be generated. TASM`s argument parsing routine can handle a large number of +arguments, but the code that generates the object code is less capable. +

+

The following table shows possible instruction definition records, followed +by possible source statements that would match it, followed by the resulting +object code that would be generated (in hex): +

+
                                          EXAMPLE         EXAMPLE
+INSTRUCTION DEFINITION                    SOURCE          OBJECT
+-------------------------------------------------------------------
+XYZ  *      FF   3  NOTOUCH 1             xyz 1234h       FF 34 12
+XYZ  *      FF   2  NOTOUCH 1             xyz 1234h       FF 34
+ZYX  *      FE   3  SWAP    1             zyx 1234h       FE 12 34
+ZYX  *      FE   3  R2      1             zyx $+4         FE 01 00
+ABC  *,*    FD   3  COMBINE 1             abc 45h,67h     FD 45 67
+ABC  *,*    FD   3  CSWAP   1             abc 45h,67h     FD 67 45
+ADD  A,#*   FC   2  NOTOUCH 1             add A,#'B'      FC 42
+RET  ""     FB   1  NOTOUCH 1             ret             FB
+LD   IX,*   21DD 4  NOTOUCH 1             ld  IX,1234h    DD 21 34 12
+LD   IX,*   21DD 4  NOTOUCH 1 1 0         ld  IX,1234h    DD 21 68 24
+LD   IX,*   21DD 4  NOTOUCH 1 0 1         ld  IX,1234h    DD 21 35 12
+LD   IX,*   21DD 4  NOTOUCH 1 1 1         ld  IX,1234h    DD 21 69 24
+LD   IX,*   21DD 4  NOTOUCH 1 8 12        ld  IX,34h      DD 21 12 34
+
+

The order of the entries for various addressing modes of a given instruction +is important. Since the wild card matches anything, it is important to specify +the ARGS for the addressing modes that have the most qualifying characters +first. For example, if an instruction had two addressing modes, one that +accepted any expression, and another that required a pound sign in front of an +expression, the pound sign entry should go first otherwise all occurrences of +the instruction would match the more general ARGS expression that it +encountered first. The following entries illustrate the proper sequencing: +

+
        ADD #*  12 3 NOTOUCH 1
+        ADD *   13 3 NOTOUCH 1
+
+

Table Lookup Method

+

The current version of TASM uses a very simple hashing method based on the +first character of the nmemonic. A search is begun at the first table entry +that starts with that letter. Thus, the table should be sorted alphabetically +for optimum lookup speed. If the table is not sorted in this way it will not +break anything, but just slow it down a bit.

+

REGSET Directive

+

For instruction sets that have a well defined set of registers that map to a +bit field in the opcode it may be convenient to use the REGSET directive. The +value field following each register definition is OR'd into the opcode when a +match is found. The '!' character is used to indicate the expected occurance of +a register. Consider the following example:

+
.REGSET R0  00 1
+.REGSET R1  01 1
+.REGSET R2  02 1
+.REGSET R3  03 1
+.REGSET R4  04 1
+.REGSET R5  05 1
+.REGSET R6  06 1
+.REGSET R7  07 1
+
+...
+INC !  E0  1 NOP
+...
+
+

A source instruction INC R3 would be encoded by ORing E0 with 03 +resulting in E3.

+
+

6502 INSTRUCTIONS AND ADDRESSING MODES

+

The acceptable 6502 opcode mnemonics for TASM are as follows: +

+
 ADC  AND  ASL  BCC  BCS  BEQ  BNE  BMI  BPL  BVC  BVS  BIT
+ BRK  CLC  CLD  CLI  CLV  CMP  CPX  CPY  DEC  DEX  DEY  EOR
+ INC  INX  INY  JMP  JSR  LDA  LDX  LDY  LSR  NOP  ORA  PHA
+ PHP  PLA  PLP  ROL  ROR  RTI  RTS  SBC  SEC  SED  SEI  STA
+ STX  STY  TAX  TAY  TSX  TXA  TXS  TYA
+
+

TASM also supports the following instructions that are part of the +Rockwell R65C02 and R65C00/21 microprocessor instruction sets. Those that + are marked as set A are applicable to the R65C02 and those marked as set B +are applicable to the R65C00/21 (A+B for both): +

+
        Mnemonic        Description                Address Mode  Set
+        ---------------------------------------------------------------
+        ADC             Add with carry             (IND)         A
+        AND             And memory with A          (IND)         A
+        BIT             Test memory bits with A    ABS,X         A
+        BIT             Test memory bits with A    ZP,X          A
+        BIT             Test memory bits with A    IMM           A
+        CMP             Compare memory with A      (IND)         A
+        DEC             Decrement A                A             A
+        EOR             Exclusive OR memory with A (IND)         A
+        INC             Increment A                A             A
+        JMP             Jump                       (ABS,X)       A
+        LDA             Load A with memory         (IND)         A
+        ORA             OR A with memory           (IND)         A
+        SBC             Subtract memory form A     (IND)         A
+        STA             Store A in memory          (IND)         A
+        STZ             Store zero                 ABS           A
+        STZ             Store zero                 ABS,X         A
+        STZ             Store zero                 ZP            A
+        STZ             Store zero                 ZP,X          A
+        TRB             Test and reset memory bit  ABS           A
+        TRB             Test and reset memory bit  ZP            A
+        TSB             Test and set memory bit    ABS           A
+        TSB             Test and set memory bit    ZP            A
+
+        BRA             Branch Always              REL           A+B
+
+        BBR0            Branch on Bit 0 Reset      ZP,REL        A+B
+        BBR1            Branch on Bit 1 Reset      ZP,REL        A+B
+        BBR2            Branch on Bit 2 Reset      ZP,REL        A+B
+        BBR3            Branch on Bit 3 Reset      ZP,REL        A+B
+        BBR4            Branch on Bit 4 Reset      ZP,REL        A+B
+        BBR5            Branch on Bit 5 Reset      ZP,REL        A+B
+        BBR6            Branch on Bit 6 Reset      ZP,REL        A+B
+        BBR7            Branch on Bit 7 Reset      ZP,REL        A+B
+
+        BBS0            Branch on Bit 0 Set        ZP,REL        A+B
+        BBS1            Branch on Bit 1 Set        ZP,REL        A+B
+        BBS2            Branch on Bit 2 Set        ZP,REL        A+B
+        BBS3            Branch on Bit 3 Set        ZP,REL        A+B
+        BBS4            Branch on Bit 4 Set        ZP,REL        A+B
+        BBS5            Branch on Bit 5 Set        ZP,REL        A+B
+        BBS6            Branch on Bit 6 Set        ZP,REL        A+B
+        BBS7            Branch on Bit 7 Set        ZP,REL        A+B
+
+        MUL             Multiply                   Implied       B
+
+        PHX             Push Index X               Implied       A+B
+        PHY             Push Index Y               Implied       A+B
+        PLX             Pull Index X               Implied       A+B
+        PLY             Pull Index Y               Implied       A+B
+
+        RMB0            Reset Memory Bit 0         ZP            A+B
+        RMB1            Reset Memory Bit 1         ZP            A+B
+        RMB2            Reset Memory Bit 2         ZP            A+B
+        RMB3            Reset Memory Bit 3         ZP            A+B
+        RMB4            Reset Memory Bit 4         ZP            A+B
+        RMB5            Reset Memory Bit 5         ZP            A+B
+        RMB6            Reset Memory Bit 6         ZP            A+B
+        RMB7            Reset Memory Bit 7         ZP            A+B
+
+        SMB0            Set   Memory Bit 0         ZP            A+B
+        SMB1            Set   Memory Bit 1         ZP            A+B
+        SMB2            Set   Memory Bit 2         ZP            A+B
+        SMB3            Set   Memory Bit 3         ZP            A+B
+        SMB4            Set   Memory Bit 4         ZP            A+B
+        SMB5            Set   Memory Bit 5         ZP            A+B
+        SMB6            Set   Memory Bit 6         ZP            A+B
+        SMB7            Set   Memory Bit 7         ZP            A+B
+
+

Addressing modes are denoted as follows: +

+
ABS               Absolute
+ZP                Zero Page
+ABS,X             Absolute X
+ZP,X              Zero Page X
+ABS,Y             Absolute Y
+ZP,Y              Zero Page Y
+A                 Accumulator
+(IND,X)           Indirect X
+(IND),Y           Indirect Y
+(IND)             Indirect
+#IMM              Immediate
+REL               Relative (Branch instructions only)
+ZP,REL            Zero Page, Relative
+Implied           Implied
+
+

Note that Zero Page addressing can not be explicitly requested. It is used +if the value of the operand is representable in a single byte for the +applicable statements. +

+

The '-x' command line option can be used to enable the extended +instructions. A '-x' with no digit following will enable the standard set plus +both extended sets. The 6502 version of TASM uses three bits in the instruction +class mask to determine whether a given instruction is enabled or not. Bit 0 +enables the basic set, bit 1 enables set A (R65C02) and bit 2 enables set B +(R65C00/21). The following table shows various options: +

+
Class Mask        Enabled Instructions
+                BASIC   R65C02  R65C00/21
+--------------------------------------------
+1               yes     no      no
+2               no      yes     no
+3               yes     yes     no
+4               no      no      yes
+5               yes     no      yes
+6               no      yes     yes
+7               yes     yes     yes
+
+

Thus, to enable the basic set plus the R65C02 instructions, invoke the +'-x3' command line option. +

+

See manufacturer's data for a more complete description of the meaning of +the mnemonics and addressing modes. +

+
+

68xx INSTRUCTIONS AND ADDRESSING MODES +

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the 6800/68HC11 version of TASM. Symbolic +fields are defined as follows: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr8_             Absolute address (8 bits)
+_addr16_            Absolute address (16 bits)
+                      Values that can fit in 8 bits can
+                      result in the DIRECT addressing mode.
+_addr16_no8_        Absolute address (16 bits)
+                      DIRECT addressing not applicable.
+_bmsk_              Bit mask (8 bits)
+_rel8_              Relative address (8 bit signed)
+_immed8_            Immediate data (8 bits)
+_immed16_           Immediate data (16 bits)
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics. +

+

The lines that are marked with an 'a' or 'b' are extended instructions that +are available only if a -x option has been invoked on the command line. The +classes of instructions (and their bit assignment in the class mask) are shown +below: +

+
BIT     PROCESSOR      EXT LABEL     COMMAND LINE OPTION
+--------------------------------------------------------
+0       6800
+1       6801/6803       a            -x3
+2       68HC11          b            -x7
+
+

Thus, to enable the 68HC11 instructions, a -x7 could be used on the command +line. +

+

TASM deviates from standard Motorola syntax for the BSET, BRSET, BCLR, +and BRCLR instructions. TASM requires commas separating all arguments. +Motorola assemblers use white space to separate the last one or two +arguments for these instructions. Here are examples of each applicable +instruction: +

+
TASM                                MOTOROLA
+----------------------              --------------------
+BCLR    _addr8_,Y,_bmsk_            BCLR    _addr8_,Y _bmsk_
+BCLR    _addr8_,X,_bmsk_            BCLR    _addr8_,X _bmsk_
+BCLR    _addr8_  ,_bmsk_            BCLR    _addr8_   _bmsk_
+BSET    _addr8_,Y,_bmsk_            BSET    _addr8_,Y _bmsk_
+BSET    _addr8_,X,_bmsk_            BSET    _addr8_,X _bmsk_
+BSET    _addr8_  ,_bmsk_            BSET    _addr8_   _bmsk_
+BRCLR   _addr8_,Y,_bmsk_,_rel8_     BRCLR   _addr8_,Y _bmsk_ _rel8_
+BRCLR   _addr8_,X,_bmsk_,_rel8_     BRCLR   _addr8_,X _bmsk_ _rel8_
+BRCLR   _addr8_  ,_bmsk_,_rel8_     BRCLR   _addr8_   _bmsk_ _rel8_
+BRSET   _addr8_,Y,_bmsk_,_rel8_     BRSET   _addr8_,Y _bmsk_ _rel8_
+BRSET   _addr8_,X,_bmsk_,_rel8_     BRSET   _addr8_,X _bmsk_ _rel8_
+BRSET   _addr8_  ,_bmsk_,_rel8_     BRSET   _addr8_   _bmsk_ _rel8_
+
+
OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+ABA                          Add Accumulator B to Accumulator A
+ABX                     a    Add Accumulator B to Index Reg X
+ABY                     b    Add Accumulator B to Index reg Y
+
+ADCA    #_immed8_            Add with carry immediate  to Reg A
+ADCA    _addr8_,X            Add with carry indirect,X to Reg A
+ADCA    _addr8_,Y       b    Add with carry indirect,Y to Reg A
+ADCA    _addr16_             Add with carry extended   to Reg A
+
+ADCB    #_immed8_            Add with carry immediate  to Reg B
+ADCB    _addr8_,X            Add with carry indirect,X to Reg B
+ADCB    _addr8_,Y       b    Add with carry indirect,Y to Reg B
+ADCB    _addr16_             Add with carry extended   to Reg B
+
+ADDA    #_immed8_            Add w/o  carry immediate  to Reg A
+ADDA    _addr8_,X            Add w/o  carry indirect,X to Reg A
+ADDA    _addr8_,Y       b    Add w/o  carry indirect,Y to Reg A
+ADDA    _addr16_             Add w/o  carry extended   to Reg A
+
+ADDB    #_immed8_            Add w/o  carry immediate  to Reg B
+ADDB    _addr8_,X            Add w/o  carry indirect,X to Reg B
+ADDB    _addr8_,Y       b    Add w/o  carry indirect,Y to Reg B
+ADDB    _addr16_             Add w/o  carry extended   to Reg B
+
+ADDD    #_immed8_       a    Add double immediate  to Reg D
+ADDD    _addr8_,X       a    Add double indirect,X to Reg D
+ADDD    _addr8_,Y       b    Add double indirect,Y to Reg D
+ADDD    _addr16_        a    Add double extended   to Reg D
+
+ANDA    #_immed8_            AND immediate  to Reg A
+ANDA    _addr8_,X            AND indirect,X to Reg A
+ANDA    _addr8_,Y       b    AND indirect,Y to Reg A
+ANDA    _addr16_             AND extended   to Reg A
+
+ANDB    #_immed8_            AND immediate  to Reg B
+ANDB    _addr8_,X            AND indirect,X to Reg B
+ANDB    _addr8_,Y       b    AND indirect,Y to Reg B
+ANDB    _addr16_             AND extended   to Reg B
+
+ASL     _addr8_,X            Arithmetic shift left indirect,X
+ASL     _addr8_,Y       b    Arithmetic shift left indirect,Y
+ASL     _addr16_             Arithmetic shift left extended
+ASLA                         Arithmetic shift left Reg A
+ASLB                         Arithmetic shift left Reg B
+ASLD                    a    Arithmetic shift left double Reg D
+
+ASR     _addr8_,X            Arithmetic shift right indirect,X
+ASR     _addr8_,Y       b    Arithmetic shift right indirect,Y
+ASR     _addr16_             Arithmetic shift right extended
+ASRA                         Arithmetic shift right Reg A
+ASRB                         Arithmetic shift right Reg B
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+BCC     _rel8_               Branch if carry clear
+BCS     _rel8_               Branch if carry set
+BEQ     _rel8_               Branch if equal
+BGE     _rel8_               Branch if greater or equal
+BGT     _rel8_               Branch if greater
+BHI     _rel8_               Branch if higher
+BHS     _rel8_               Branch if higher or same
+BRA     _rel8_               Branch always
+
+BITA    #_immed8_            AND immediate  with Reg A (set condition codes)
+BITA    _addr8_,X            AND indirect,X with Reg A (set condition codes)
+BITA    _addr8_,Y       b    AND indirect,Y with Reg A (set condition codes)
+BITA    _addr16_             AND extended   with Reg A (set condition codes)
+
+BITB    #_immed8_            AND immediate  with Reg B (set condition codes)
+BITB    _addr8_,X            AND indirect,X with Reg B (set condition codes)
+BITB    _addr8_,Y       b    AND indirect,Y with Reg B (set condition codes)
+BITB    _addr16_             AND extended   with Reg B (set condition codes)
+
+BLE     _rel8_               Branch if less than or equal
+BLO     _rel8_               Branch if lower (same as BCS)
+BLS     _rel8_               Branch if lower or same
+BLT     _rel8_               Branch if less than zero
+BMI     _rel8_               Branch if minus
+BNE     _rel8_               Branch if not equal
+BPL     _rel8_               Branch if plus
+BRA     _rel8_               Branch always
+
+BRCLR _addr8_,X,_bmsk_,_rel8_  b Branch if bits clear indirect X
+BRCLR _addr8_,Y,_bmsk_,_rel8_  b Branch if bits clear indirect Y
+BRCLR _addr8_,_bmsk_,  _rel8_  b Branch if bits clear direct
+
+BRN     _rel8_               Branch never
+
+BRSET _addr8_,X,_bmsk_,_rel8_  b Branch if bits set indirect X
+BRSET _addr8_,Y,_bmsk_,_rel8_  b Branch if bits set indirect Y
+BRSET _addr8_,_bmsk_,  _rel8_  b Branch if bits set direct
+
+BSET    _addr8_,X,_bmsk_ b   Bit set indirect X
+BSET    _addr8_,Y,_bmsk_ b   Bit set indirect Y
+BSET    _addr8_,_bmsk_   b   Bit set direct
+BSET    _addr8_,#_bmsk_  b   Bit set direct (alternate form)
+
+BSR     _rel8_               Branch subroutine
+BVC     _rel8_               Branch if overflow clear
+BVS     _rel8_               Branch if overflow set
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+CBA                          Compare registers A & B
+CLC                          Clear Carry
+CLI                          Clear Interrupt Mask
+
+CLR     _addr8_,X            Arithmetic shift right indirect,X
+CLR     _addr8_,Y       b    Arithmetic shift right indirect,Y
+CLR     _addr16_             Arithmetic shift right extended
+CLRA                         Arithmetic shift right Reg A
+CLRB                         Arithmetic shift right Reg B
+
+CLV                          Clear Overflow Bit
+
+CMPA    #_immed8_            Compare immediate  with Reg A
+CMPA    _addr8_,X            Compare indirect,X with Reg A
+CMPA    _addr8_,Y       b    Compare indirect,Y with Reg A
+CMPA    _addr16_             Compare extended   with Reg A
+
+CMPB    #_immed8_            Compare immediate  with Reg B
+CMPB    _addr8_,X            Compare indirect,X with Reg B
+CMPB    _addr8_,Y       b    Compare indirect,Y with Reg B
+CMPB    _addr16_             Compare extended   with Reg B
+
+COM     _addr8_,X            Complement indirect,X
+COM     _addr8_,Y       b    Complement indirect,Y
+COM     _addr16_             Complement extended
+COMA                         Complement Reg A
+COMB                         Complement Reg B
+
+CPD     #_immed16_      b    Compare double immediate  to Reg D
+CPD     _addr8_,X       b    Compare double indirect,X to Reg D
+CPD     _addr8_,Y       b    Compare double indirect,Y to Reg D
+CPD     _addr16_        b    Compare double extended   to Reg D
+
+CPX     #_immed8_            Compare double immediate  to Reg X
+CPX     _addr8_,X            Compare double indirect,X to Reg X
+CPX     _addr8_,Y       b    Compare double indirect,Y to Reg X
+CPX     _addr16_             Compare double extended   to Reg X
+
+CPY     #_immed8_       b    Compare double immediate  to Reg Y
+CPY     _addr8_,X       b    Compare double indirect,X to Reg Y
+CPY     _addr8_,Y       b    Compare double indirect,Y to Reg Y
+CPY     _addr16_        b    Compare double extended   to Reg Y
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+DAA                          Decimal Adjust Reg A
+
+DEC     _addr8_,X            Decrement indirect,X
+DEC     _addr8_,Y            Decrement indirect,Y
+DEC     _addr16_no8_         Decrement extended
+DECA                         Decrement Reg A
+DECB                         Decrement Reg B
+DES                          Decrement stack pointer
+DEX                          Decrement Reg X
+DEY                     b    Decrement Reg Y
+
+EORA    #_immed8_            Exclusive OR immediate  with Reg A
+EORA    _addr8_,X            Exclusive OR indirect,X with Reg A
+EORA    _addr8_,Y       b    Exclusive OR indirect,Y with Reg A
+EORA    _addr16_             Exclusive OR extended   with Reg A
+
+EORB    #_immed8_            Exclusive OR immediate  with Reg B
+EORB    _addr8_,X            Exclusive OR indirect,X with Reg B
+EORB    _addr8_,Y       b    Exclusive OR indirect,Y with Reg B
+EORB    _addr16_             Exclusive OR extended   with Reg B
+
+FDIV                    b    Fractional Divide (ACCD/IX)
+IDIV                    b    Integer Divide (ACCD/IX)
+
+INC     _addr8_,X            Increment indirect,X
+INC     _addr8_,Y            Increment indirect,Y
+INC     _addr16_no8_         Increment extended
+INCA                         Increment Reg A
+INCB                         Increment Reg B
+INS                          Increment stack pointer
+INX                          Increment Reg X
+INY                     b    Increment Reg Y
+
+JMP     _addr8_,X            Jump indirect,X
+JMP     _addr8_,Y       b    Jump indirect,Y
+JMP     _addr16_no8_         Jump extended
+
+JSR     _addr8_,X            Jump Subroutine indirect,X
+JSR     _addr8_,Y       b    Jump Subroutine indirect,Y
+JSR     _addr16_             Jump Subroutine extended
+
+LDAA    #_immed8_            Load Accumulator immediate  with Reg A
+LDAA    _addr8_,X            Load Accumulator indirect,X with Reg A
+LDAA    _addr8_,Y       b    Load Accumulator indirect,Y with Reg A
+LDAA    _addr16_             Load Accumulator extended   with Reg A
+
+LDAB    #_immed8_            Load Accumulator immediate  with Reg B
+LDAB    _addr8_,X            Load Accumulator indirect,X with Reg B
+LDAB    _addr8_,Y       b    Load Accumulator indirect,Y with Reg B
+LDAB    _addr16_             Load Accumulator extended   with Reg B
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+LDD     #_immed16_      a    Load double immediate  to Reg D
+LDD     _addr8_,X       a    Load double indirect,X to Reg D
+LDD     _addr8_,Y       b    Load double indirect,Y to Reg D
+LDD     _addr16_        a    Load double extended   to Reg D
+
+LDS     #_immed16_           Load double immediate  to Reg D
+LDS     _addr8_,X            Load double indirect,X to Reg D
+LDS     _addr8_,Y       b    Load double indirect,Y to Reg D
+LDS     _addr16_             Load double extended   to Reg D
+
+LDX     #_immed16_           Load immediate  to Reg X
+LDX     _addr8_,X            Load indirect,X to Reg X
+LDX     _addr8_,Y       b    Load indirect,Y to Reg X
+LDX     _addr16_             Load extended   to Reg X
+
+LDY     #_immed16_      b    Load immediate  to Reg Y
+LDY     _addr8_,X       b    Load indirect,X to Reg Y
+LDY     _addr8_,Y       b    Load indirect,Y to Reg Y
+LDY     _addr16_        b    Load extended   to Reg Y
+
+LSL     _addr8_,X            Logical Shift Left indirect,X
+LSL     _addr8_,Y       b    Logical Shift Left indirect,Y
+LSL     _addr16_no8_         Logical Shift Left extended
+LSLA                         Logical Shift Left Reg A
+LSLB                         Logical Shift Left Reg B
+LSLD                         Logical Shift Left Double Reg D
+
+LSR     _addr8_,X            Logical Shift Right indirect,X
+LSR     _addr8_,Y       b    Logical Shift Right indirect,Y
+LSR     _addr16_no8_         Logical Shift Right extended
+LSRA                         Logical Shift Right Reg A
+LSRB                         Logical Shift Right Reg B
+LSRD                         Logical Shift Right Double Reg D
+
+MUL                          Multiply Unsigned
+
+NEG     _addr8_,X            Negate indirect,X
+NEG     _addr8_,Y       b    Negate indirect,Y
+NEG     _addr16_no8_         Negate extended
+NEGA                         Negate Reg A
+NEGB                         Negate Reg B
+
+NOP                          No Operation
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+ORAA    #_immed8_            Inclusive OR immediate  with Reg A
+ORAA    _addr8_,X            Inclusive OR indirect,X with Reg A
+ORAA    _addr8_,Y       b    Inclusive OR indirect,Y with Reg A
+ORAA    _addr16_             Inclusive OR extended   with Reg A
+
+ORAB    #_immed8_            Inclusive OR immediate  with Reg B
+ORAB    _addr8_,X            Inclusive OR indirect,X with Reg B
+ORAB    _addr8_,Y       b    Inclusive OR indirect,Y with Reg B
+ORAB    _addr16_             Inclusive OR extended   with Reg B
+
+PSHA                         Push Reg A onto stack
+PSHB                         Push Reg B onto stack
+PSHX                         Push Reg X onto stack
+PSHY                         Push Reg Y onto stack
+
+PULA                         Pull Reg A from stack
+PULB                         Pull Reg B from stack
+PULX                         Pull Reg X from stack
+PULY                         Pull Reg Y from stack
+
+ROL     _addr8_,X            Rotate Left indirect,X
+ROL     _addr8_,Y            Rotate Left indirect,Y
+ROL     _addr16_no8_         Rotate Left extended
+ROLA                         Rotate Left Reg A
+ROLB                         Rotate Left Reg B
+
+ROR     _addr8_,X            Rotate Right indirect,X
+ROR     _addr8_,Y            Rotate Right indirect,Y
+ROR     _addr16_no8_         Rotate Right extended
+RORA                         Rotate Right Reg A
+RORB                         Rotate Right Reg B
+RTI                          Return from Interrupt
+RTS                          Return from subroutine
+
+SBA                          Subtract Accumulators
+SBCA    #_immed8_            Subtract with Carry immediate  with Reg A
+SBCA    _addr8_,X            Subtract with Carry indirect,X with Reg A
+SBCA    _addr8_,Y       b    Subtract with Carry indirect,Y with Reg A
+SBCA    _addr16_             Subtract with Carry extended   with Reg A
+SBCB    #_immed8_            Subtract with Carry immediate  with Reg B
+SBCB    _addr8_,X            Subtract with Carry indirect,X with Reg B
+SBCB    _addr8_,Y       b    Subtract with Carry indirect,Y with Reg B
+SBCB    _addr16_             Subtract with Carry extended   with Reg B
+SEC                          Set Carry
+SEI                          Set Interrupt Mask
+SEV                          Set Twos Complement Overflow Bit
+STAA    _addr8_,X            Store Reg A indirect,X
+STAA    _addr8_,Y       b    Store Reg A indirect,Y
+STAA    _addr16_             Store Reg A extended
+
+STAB    _addr8_,X            Store Reg B indirect,X
+STAB    _addr8_,Y       b    Store Reg B indirect,Y
+STAB    _addr16_             Store Reg B extended
+
+OPCODE  OPERANDS       EXT   DESCRIPTION
+--------------------------------------------------------------
+STD     _addr8_,X            Store Double Acc indirect,X to Reg B
+STD     _addr8_,Y       b    Store Double Acc indirect,Y to Reg B
+STD     _addr16_             Store Double Acc extended   to Reg B
+
+STOP                         Stop Processing
+
+STS     _addr8_,X            Store Accumulator indirect,X
+STS     _addr8_,Y       b    Store Accumulator indirect,Y
+STS     _addr16_             Store Accumulator extended
+
+STX     _addr8_,X            Store Index Reg X indirect,X
+STX     _addr8_,Y       b    Store Index Reg X indirect,Y
+STX     _addr16_             Store Index Reg X extended
+
+STY     _addr8_,X       b    Store Index Reg Y indirect,X
+STY     _addr8_,Y       b    Store Index Reg Y indirect,Y
+STY     _addr16_        b    Store Index Reg Y extended
+
+SUBA    #_immed8_            Subtract immediate  from Reg A
+SUBA    _addr8_,X            Subtract indirect,X from Reg A
+SUBA    _addr8_,Y       b    Subtract indirect,Y from Reg A
+SUBA    _addr16_             Subtract extended   from Reg A
+
+SUBB    #_immed8_            Subtract immediate  from Reg B
+SUBB    _addr8_,X            Subtract indirect,X from Reg B
+SUBB    _addr8_,Y       b    Subtract indirect,Y from Reg B
+SUBB    _addr16_             Subtract extended   from Reg B
+
+SUBD    #_immed16_      b    Subtract double immediate  from Reg D
+SUBD    _addr8_,X       b    Subtract double indirect,X from Reg D
+SUBD    _addr8_,Y       b    Subtract double indirect,Y from Reg D
+SUBD    _addr16_        b    Subtract double extended   from Reg D
+
+SWI                          Software Interrupt
+
+TAB                          Transfer Reg A to Reg B
+TAP                          Transfer Reg A to Condition Code Reg
+TPA                          Transfer Condition Code Reg to Reg A
+TBA                          Transfer Reg B to Reg A
+
+TST     _addr8_,X            Test indirect,X
+TST     _addr8_,Y            Test indirect,Y
+TST     _addr16_no8_         Test extended
+TSTA                         Test Reg A
+TSTB                         Test Reg B
+
+TSX                          Transfer Stack Pointer to Reg X
+TSY                     b    Transfer Stack Pointer to Reg Y
+TXS                          Transfer Reg X to Stack Pointer
+TYS                     b    Transfer Reg Y to Stack Pointer
+
+WAI                          Wait for Interrupt
+XGDX                    b    Exchange Double Reg D and Reg X
+XGDY                    b    Exchange Double Reg D and Reg Y
+
+
+
+

8048 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the 8048 version of TASM. Where 'Rn' is seen, +R0 through R7 may be substituted. Other symbolic fields are as follows: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr8_             Absolute address (8 bits)
+_addr11_            Absolute address (11 bits)
+_immed_             Immediate data
+
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics. +

+

The lines that are marked with an (8041), (8022), or (8021) on the far +right are extended instructions that are available only if a -x option has been +invoked on the command line. The classes of instructions (and their bit +assignment in the class mask) are shown below: +

+
BIT     PROCESSOR
+-------------------------------
+0       8X48, 8035, 8039, 8049
+1       8X41A
+2       8022
+3       8021
+
+

Thus, to enable the basic 8048 set plus the 8022 set, a -x5 could be used on +the command line. +

+

Note that some of the base instructions should be disabled for the 8041, +8022, and 8021, but are not. +

+
OPCODE  OPERANDS        DESCRIPTION
+-------------------------------------------------------------------
+ADD     A,Rn            Add Register to Acc
+ADD     A,@R0           Add Indirect RAM to Acc
+ADD     A,@R1           Add Indirect RAM to Acc
+ADD     A,#_immed_      Add Immediate data to Acc
+
+ADDC    A,Rn            Add Register to Acc with carry
+ADDC    A,@R0           Add Indirect RAM to Acc with carry
+ADDC    A,@R1           Add Indirect RAM to Acc with carry
+ADDC    A,#_immed_      Add Immediate data to Acc with carry
+
+ANL     A,Rn            AND Register to Acc
+ANL     A,@R0           AND Indirect RAM to Acc
+ANL     A,@R1           AND Indirect RAM to Acc
+ANL     A,#_immed_      AND Immediate data to Acc
+ANL     BUS,#_immed_    AND Immediate data to BUS
+ANL     P1,#_immed_     AND Immediate data to port P1
+ANL     P2,#_immed_     AND Immediate data to port P2
+
+ANLD    P4,A            AND Acc to Expander port P4
+ANLD    P5,A            AND Acc to Expander port P5
+ANLD    P6,A            AND Acc to Expander port P6
+ANLD    P7,A            AND Acc to Expander port P7
+
+CALL    _addr11_        Call subroutine
+
+CLR     A               Clear Acc
+CLR     C               Clear Carry
+CLR     F0              Clear Flag 0
+CLR     F1              Clear Flag 1
+
+CPL     A               Complement Acc
+CPL     C               Complement Carry
+CPL     F0              Complement Flag F0
+CPL     F1              Complement Flag F1
+
+DA      A               Decimal adjust Acc
+
+DEC     A               Decrement Acc
+DEC     Rn              Decrement Register
+
+DIS     I               Disable Interrupts
+DIS     TCNTI           Disable Timer/Counter Interrupt
+
+DJNZ    Rn,_addr8_      Decrement Register and Jump if nonzero
+
+EN      DMA             Enable DMA                           (8041)
+EN      FLAGS           Enable Flags                         (8041)
+EN      I               Enable External Interrupt
+EN      TCNTI           Enable Timer/Counter Interrupt
+ENT0    CLK             Enable Clock Output
+
+IN      A,DBB           Input Data Bus to Acc                (8041)
+IN      A,P0            Input Port 0 to Acc                  (8021)
+IN      A,P1            Input Port 1 to Acc
+IN      A,P2            Input Port 2 to Acc
+
+INC     A               Increment Acc
+INC     Rn              Increment Register
+INC     @R0             Increment Indirect RAM
+INC     @R1             Increment Indirect RAM
+
+INS     A,BUS           Strobed Input of Bus to Acc
+
+JB0     _addr8_         Jump if Acc bit 0 is set
+JB1     _addr8_         Jump if Acc bit 1 is set
+JB2     _addr8_         Jump if Acc bit 2 is set
+JB3     _addr8_         Jump if Acc bit 3 is set
+JB4     _addr8_         Jump if Acc bit 4 is set
+JB5     _addr8_         Jump if Acc bit 5 is set
+JB6     _addr8_         Jump if Acc bit 6 is set
+JB7     _addr8_         Jump if Acc bit 7 is set
+JMP     _addr11_        Jump
+JC      _addr8_         Jump if Carry is set
+JF0     _addr8_         Jump if Flag F0 is set
+JF1     _addr8_         Jump if Flag F1 is set
+JNC     _addr8_         Jump if Carry is clear
+JNI     _addr8_         Jump if Interrupt input is clear
+JNIBF   _addr8_         Jump if IBF is clear                 (8041)
+JNT0    _addr8_         Jump if T0 is clear
+JNT1    _addr8_         Jump if T1 is clear
+JNZ     _addr8_         Jump if Acc is not zero
+JOBF    _addr8_         Jump if OBF is set                   (8041)
+JTF     _addr8_         Jump if Timer Flag is set
+JT0     _addr8_         Jump if T0 pin is high
+JT1     _addr8_         Jump if T1 pin is high
+JZ      _addr8_         Jump if Acc is zero
+JMPP    @A              Jump Indirect (current page)
+
+MOV     A,PSW           Move PSW to Acc
+MOV     A,Rn            Move Register to Acc
+MOV     A,T             Move Timer/Counter to Acc
+MOV     A,@R0           Move Indirect RAM to Acc
+MOV     A,@R1           Move Indirect RAM to Acc
+MOV     A,#_immed_      Move Immediate data to Acc
+MOV     PSW,A           Move Acc to PSW
+MOV     Rn,A            Move Acc to Register
+MOV     Rn,#_immed_     Move Immediate data to Register
+MOV     STS,A           Move Acc to STS                      (8041)
+MOV     T,A             Move Acc to Timer/Counter
+MOV     @R0,A           Move Acc to Indirect RAM
+MOV     @R1,A           Move Acc to Indirect RAM
+MOV     @R0,#_immed_    Move Immediate data to Indirect RAM
+MOV     @R1,#_immed_    Move Immediate data to Indirect RAM
+
+MOVD    A,P4            Move half-byte Port 4 to Acc (lower nibble)
+MOVD    A,P5            Move half-byte Port 5 to Acc (lower nibble)
+MOVD    A,P6            Move half-byte Port 6 to Acc (lower nibble)
+MOVD    A,P7            Move half-byte Port 7 to Acc (lower nibble)
+MOVD    P4,A            Move lower nibble of Acc to Port 4
+MOVD    P5,A            Move lower nibble of Acc to Port 5
+MOVD    P6,A            Move lower nibble of Acc to Port 6
+MOVD    P7,A            Move lower nibble of Acc to Port 7
+
+MOVP    A,@A            Move Indirect Program data to Acc
+MOVP3   A,@A            Move Indirect Program data to Acc (page 3)
+
+MOVX    A,@R0           Move Indirect External RAM to Acc
+MOVX    A,@R1           Move Indirect External RAM to Acc
+MOVX    @R0,A           Move Acc to Indirect External RAM
+MOVX    @R1,A           Move Acc to Indirect External RAM
+
+NOP                     No operation
+
+ORL     A,Rn            OR Register to Acc
+ORL     A,@R0           OR Indirect RAM to Acc
+ORL     A,@R1           OR Indirect RAM to Acc
+ORL     A,#_immed_      OR Immediate data to Acc
+ORL     BUS,#_immed_    OR Immediate data to BUS
+ORL     P1,#_immed_     OR Immediate data to port P1
+ORL     P2,#_immed_     OR Immediate data to port P2
+
+ORLD    P4,A            OR lower nibble of Acc with P4
+ORLD    P5,A            OR lower nibble of Acc with P5
+ORLD    P6,A            OR lower nibble of Acc with P6
+ORLD    P7,A            OR lower nibble of Acc with P7
+
+OUTL    BUS,A           Output Acc to Bus
+OUT     DBB,A           Output Acc to DBB                    (8041)
+OUTL    P0,A            Output Acc to Port P0                (8021)
+OUTL    P1,A            Output Acc to Port P1
+OUTL    P2,A            Output Acc to Port P2
+
+RAD                     Move A/D Converter to Acc            (8022)
+
+RET                     Return from subroutine
+RETI                    Return from Interrupt w/o PSW restore(8022)
+RETR                    Return from Interrupt w/  PSW restore
+
+RL      A               Rotate Acc Left
+RLC     A               Rotate Acc Left through Carry
+RR      A               Rotate Acc Right
+RRC     A               Rotate Acc Right through Carry
+
+SEL     AN0             Select Analog Input 0                (8022)
+SEL     AN1             Select Analog Input 1                (8022)
+SEL     MB0             Select Memory Bank 0
+SEL     MB1             Select Memory Bank 1
+SEL     RB0             Select Register Bank 0
+SEL     RB1             Select Register Bank 1
+
+STOP    TCNT            Stop Timer/Counter
+STRT    CNT             Start Counter
+STRT    T               Start Timer
+
+SWAP    A               Swap nibbles of Acc
+
+XCH     A,Rn            Exchange Register with Acc
+XCH     A,@R0           Exchange Indirect RAM with Acc
+XCH     A,@R1           Exchange Indirect RAM with Acc
+
+XCHD    A,@R0           Exchange lower nibble of Indirect RAM w/ Acc
+XCHD    A,@R1           Exchange lower nibble of Indirect RAM w/ Acc
+
+XRL     A,Rn            Exclusive OR Register to Acc
+XRL     A,@R0           Exclusive OR Indirect RAM to Acc
+XRL     A,@R1           Exclusive OR Indirect RAM to Acc
+XRL     A,#_immed_      Exclusive OR Immediate data to Acc
+
+

See manufacturer's data for a more complete description of the meaning of +the mnemonics and addressing modes. +

+
+

8051 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the 8051 version of TASM. Where 'Rn' is +seen, R0 through R7 may be substituted. Other symbolic fields are as +follows: +

+
        
+SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr11_            Absolute address (11 bits)
+_addr16_            Absolute address (16 bits)
+_bit_               Bit address
+_immed_             Immediate data
+_direct_            Direct RAM address
+_rel_               Relative address
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics. +

+
OPCODE  OPERAND             DESCRIPTION
+--------------------------------------------------------------------
+ACALL   _addr11_            Absolute Call
+ADD     A,Rn                Add Register to Acc
+ADD     A,@R0               Add Indirect RAM to Acc
+ADD     A,@R1               Add Indirect RAM to Acc
+ADD     A,#_immed_          Add Immediate data to Acc
+ADD     A,_direct_          Add Direct RAM to Acc
+ADDC    A,Rn                Add Register to Acc with carry
+ADDC    A,@R0               Add Indirect RAM to Acc with carry
+ADDC    A,@R1               Add Indirect RAM to Acc with carry
+ADDC    A,#_immed_          Add Immediate data to Acc with carry
+ADDC    A,_direct_          Add Direct RAM to Acc with carry
+
+AJMP    _addr11_            Absolute Jump
+
+ANL     A,Rn                AND Register and Acc
+ANL     A,@R0               AND Indirect RAM and Acc
+ANL     A,@R1               AND Indirect RAM and Acc
+ANL     A,#_immed_          AND Immediate data and Acc
+ANL     A,_direct_          AND Direct RAM and Acc
+ANL     C,/_bit_            AND Complement of direct bit to Carry
+ANL     C,bit>              AND direct bit to Carry
+ANL     _direct_,A          AND Acc to direct RAM
+ANL     _direct_,#_immed_   AND Immediate data and direct RAM
+
+CJNE    A,#_immed_,_rel_    Compare Immediate to Acc   and JNE
+CJNE    A,_direct_,_rel_    Compare direct RAM to Acc and JNE
+CJNE    Rn,#_immed_,_rel_   Compare Immediate to Register and JNE
+CJNE    @R0,#_immed_,_rel_  Compare Immediate to Indirect RAM and JNE
+CJNE    @R1,#_immed_,_rel_  Compare Immediate to Indirect RAM and JNE
+
+CLR     A                   Clear Accumulator
+CLR     C                   Clear Carry
+CLR     _bit_               Clear Bit
+
+CPL     A                   Complement Accumulator
+CPL     C                   Complement Carry
+CPL     _bit_               Complement Bit
+
+DA      A                   Decimal Adjust Accumulator
+DEC     A                   Decrement Acc
+DEC     Rn                  Decrement Register
+DEC     @R0                 Decrement Indirect RAM
+DEC     @R1                 Decrement Indirect RAM
+DEC     _direct_            Decrement Direct RAM
+
+DIV     AB                  Divide Acc by B
+
+DJNZ    Rn,_rel_            Decrement Register and JNZ
+DJNZ    _direct_,_rel_      Decrement Direct RAM and JNZ
+
+INC     A                   Increment Acc
+INC     Rn                  Increment Register
+INC     @R0                 Increment Indirect RAM
+INC     @R1                 Increment Indirect RAM
+INC     DPTR                Increment Data Pointer
+INC     _direct_            Increment Direct RAM
+
+JB      _bit_,_rel_         Jump if Bit is set
+JBC     _bit_,_rel_         Jump if Bit is set & clear Bit
+JC      _rel_               Jump if Carry is set
+JMP     @A+DPTR             Jump indirect relative to Data Pointer
+JNB     _bit_,_rel_         Jump if Bit is clear
+JNC     _rel_               Jump if Carry is clear
+JNZ     _rel_               Jump if Acc is not zero
+JZ      _rel_               Jump if Acc is zero
+
+LCALL   _addr16_            Long Subroutine Call
+LJMP    _addr16_            Long Jump
+
+MOV     A,Rn                Move Register to Acc
+MOV     A,@R0               Move Indirect RAM to Acc
+MOV     A,@R1               Move Indirect RAM to Acc
+MOV     A,#_immed_          Move Immediate data to Acc
+MOV     A,_direct_          Move direct RAM to Acc
+MOV     C,_bit_             Move bit to Acc
+MOV     DPTR,#_immed_       Move immediate data to Data Pointer
+MOV     Rn,A                Move Acc to Register
+MOV     Rn,#_immed_         Move Immediate data to Register
+MOV     Rn,_direct_         Move Direct RAM to Register
+MOV     @R0,A               Move Acc to Indirect RAM
+MOV     @R1,A               Move Acc to Indirect RAM
+MOV     @R0,#_immed_        Move Immediate data to Indirect RAM
+MOV     @R1,#_immed_        Move Immediate data to Indirect RAM
+MOV     @R0,_direct_        Move Direct RAM to Indirect RAM
+MOV     @R1,_direct_        Move Direct RAM to Indirect RAM
+MOV     _direct_,A          Move Acc to Direct RAM
+MOV     _bit_,C             Move Carry to Bit
+MOV     _direct_,Rn         Move Register to Direct RAM
+MOV     _direct_,@R0        Move Indirect RAM to Direct RAM
+MOV     _direct_,@R1        Move Indirect RAM to Direct RAM
+MOV     _direct_,#_immed_   Move Immediate data to Direct RAM
+MOV     _direct_,_direct_   Move Direct RAM to Direct RAM
+MOVC    A,@A+DPTR           Move code byte relative to DPTR to Acc
+MOVC    A,@A+PC             Move code byte relative to PC to Acc
+
+MOVX    A,@R0               Move external RAM to Acc
+MOVX    A,@R1               Move external RAM to Acc
+MOVX    A,@DPTR             Move external RAM to Acc (16 bit addr)
+MOVX    @R0,A               Move Acc to external RAM
+MOVX    @R1,A               Move Acc to external RAM
+MOVX    @DPTR,A             Move Acc to external RAM (16 bit addr)
+
+MUL     AB                  Multiply Acc by B
+
+NOP                         No operation
+
+ORL     A,Rn                OR Register and Acc
+ORL     A,@R0               OR Indirect RAM and Acc
+ORL     A,@R1               OR Indirect RAM and Acc
+ORL     A,#_immed_          OR Immediate data and Acc
+ORL     A,_direct_          OR Direct RAM and Acc
+ORL     C,/_bit_            OR Complement of direct bit to Carry
+ORL     C,_bit_             OR direct bit to Carry
+ORL     _direct_,A          OR Acc to direct RAM
+ORL     _direct_,#_immed_   OR Immediate data and direct RAM
+
+POP     _direct_            Pop  from Stack and put in Direct RAM
+PUSH    _direct_            Push from Direct RAM to Stack
+
+RET                         Return from subroutine
+RETI                        Return from Interrupt
+
+RL      A                   Rotate Acc left
+RLC     A                   Rotate Acc left through Carry
+RR      A                   Rotate Acc right
+RRC     A                   Rotate Acc right through Carry
+
+SETB    C                   Set the Carry Bit
+SETB    _bit_               Set Direct Bit
+
+SJMP    _rel_               Short jump
+
+SUBB    A,Rn                Subtract Register from Acc with Borrow
+SUBB    A,@R0               Subtract Indirect RAM from Acc w/ Borrow
+SUBB    A,@R1               Subtract Indirect RAM from Acc w/ Borrow
+SUBB    A,#_immed_          Subtract Immediate data from Acc w/ Borrow
+SUBB    A,_direct_          Subtract Direct RAM from Acc w/ Borrow
+
+SWAP    A                   Swap nibbles of Acc
+
+XCH     A,Rn                Exchange Acc with Register
+XCH     A,@R0               Exchange Acc with Indirect RAM
+XCH     A,@R1               Exchange Acc with Indirect RAM
+XCH     A,_direct_          Exchange Acc with Direct RAM
+
+XCHD    A,@R0               Exchange Digit in Acc with Indirect RAM
+XCHD    A,@R1               Exchange Digit in Acc with Indirect RAM
+
+XRL     A,Rn                Exclusive OR Register and Acc
+XRL     A,@R0               Exclusive OR Indirect RAM and Acc
+XRL     A,@R1               Exclusive OR Indirect RAM and Acc
+XRL     A,#_immed_          Exclusive OR Immediate data and Acc
+XRL     A,_direct_          Exclusive OR Direct RAM and Acc
+XRL     _direct_,A          Exclusive OR Acc to direct RAM
+XRL     _direct_,#_immed_   Exclusive OR Immediate data and direct RAM
+
+

Note that the above tables do not automatically define the various +mnemonics that may be used for addressing the special function registers +of the 8051. The user may wish to set up a file of equates (EQU's) that +can be included in the source file for this purpose. The following +illustrates some of the appropriate equates: +

+
P0      .equ    080H    ;Port 0
+SP      .equ    081H    ;Stack pointer
+DPL     .equ    082H
+DPH     .equ    083H
+PCON    .equ    087H
+TCON    .equ    088H
+TMOD    .equ    089H
+TL0     .equ    08AH
+TL1     .equ    08BH
+TH0     .equ    08CH
+TH1     .equ    08DH
+P1      .equ    090H    ;Port 1
+SCON    .equ    098H
+SBUF    .equ    099H
+P2      .equ    0A0H    ;Port 2
+IEC     .equ    0A8H
+P3      .equ    0B0H    ;Port 3
+IPC     .equ    0B8H
+PSW     .equ    0D0H
+ACC     .equ    0E0H    ;Accumulator
+B       .equ    0F0H    ;Secondary Accumulator
+;Now some bit addresses
+P0.0    .equ    080H    ;Port 0 bit 0
+P0.1    .equ    081H    ;Port 0 bit 1
+P0.2    .equ    082H    ;Port 0 bit 2
+P0.3    .equ    083H    ;Port 0 bit 3
+P0.4    .equ    084H    ;Port 0 bit 4
+P0.5    .equ    085H    ;Port 0 bit 5
+P0.6    .equ    086H    ;Port 0 bit 6
+P0.7    .equ    087H    ;Port 0 bit 7
+ACC.0   .equ    0E0H    ;Acc bit 0
+ACC.1   .equ    0E1H    ;Acc bit 1
+ACC.2   .equ    0E2H    ;Acc bit 2
+ACC.3   .equ    0E3H    ;Acc bit 3
+ACC.4   .equ    0E4H    ;Acc bit 4
+ACC.5   .equ    0E5H    ;Acc bit 5
+ACC.6   .equ    0E6H    ;Acc bit 6
+ACC.7   .equ    0E7H    ;Acc bit 7
+
+

See the manufacturer's data sheets for more information. +

+
+

8085 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the 8085 version of TASM. The following +symbols are used in the table: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr_              Absolute address (16 bits)
+_data_              Immediate data (8 bits)
+_data16_            Immediate data (16 bits)
+_reg_               Register (A,B,C,D,E,H,L)
+_rp_                Register pair (B,D,H,SP)
+_port_              Port address (0-255)
+_int_               Interrupt level (0 - 7)
+
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics except _reg_, _rp_ and _int_. +

+
OPCODE  OPERAND        DESCRIPTION
+--------------------------------------------------------------------
+ACI      _data_         Add immediate to A with carry
+ADC      _reg_          Add _reg_ to A with carry
+ADC      M              Add indirect memory (HL) with carry
+ADD      _reg_          Add _reg_ to A
+ADD      M              Add indirect memory (HL) to A
+ADI      _data_         Add immediate to A
+
+ANA      _reg_          And register with A
+ANA      M              And indirect memory (HL) to A
+ANI      _data_         And immediate to A
+
+CALL     _addr_         Call subroutine at _addr_
+CC       _addr_         Call subroutine if carry set
+CNC      _addr_         Call subroutine if carry clear
+CZ       _addr_         Call subroutine if zero
+CNZ      _addr_         Call subroutine if non zero
+CP       _addr_         Call subroutine if positive
+CM       _addr_         Call subroutine if negative
+CPE      _addr_         Call subroutine if even parity
+CPO      _addr_         Call subroutine if odd  parity
+CMA                     Complement A
+CMC                     Complemennt carry
+CMP      _reg_          Compare register with A
+CMP      M              Compare indirect memory (HL) with A
+CPI      _data_         Compare immediate data with A
+
+DAA                     Decimal adjust A
+DAD      _rp_           Add register pair to HL
+DCR      _reg_          Decrement register
+DCR      M              Decrement indirect memory (HL)
+DCX      _rp_           Decrement register pair
+
+DI                      Disable interrupts
+EI                      Enable interrupts
+HLT                     Halt
+
+IN       _port_         Input on port
+INR      _reg_          Increment register
+INR      M              Increment indirect memory (HL)
+INX      _rp_           Increment register pair
+
+JMP      _addr_         Jump
+JC       _addr_         Jump if carry set
+JNC      _addr_         Jump if carry clear
+JZ       _addr_         Jump if zero
+JNZ      _addr_         Jump if not zero
+JM       _addr_         Jump if minus
+JP       _addr_         Jump if plus
+JPE      _addr_         Jump if parity even
+JPO      _addr_         Jump if parity odd
+
+LDA      _addr_         Load A direct from memory
+LDAX     B              Load A indirect from memory using BC
+LDAX     D              Load A indirect from memory using DE
+LHLD     _addr_         Load HL direct from memory
+LXI      _rp_,_data16_  Load register pair with immediate data
+
+MOV      _reg_,_reg_    Move register to register
+MOV      _reg_,M        Move indirect memory (HL) to register
+MVI      _reg_,_data_   Move immediate data to register
+
+NOP                     No operation
+
+ORA      _reg_          Or register with A
+ORA      M              Or indirect memory (HL) with A
+ORI      _data_         Or immediate data to A
+OUT      _port_         Ouput to port
+
+PCHL                    Jump to instruction at (HL)
+POP      _rp_           Pop  register pair (excluding SP) from stack
+PUSH     _rp_           Push register pair (excluding SP) onto stack
+POP      PSW            Pop  PSW from stack
+PUSH     PSW            Pop  PSW onto stack
+
+RAL                     Rotate A left  with carry
+RAR                     Rotate A right with carry
+RLC                     Rotate A left  with branch carry
+RRC                     Rotate A right with branch carry
+
+RET                     Return from subroutine
+RZ                      Return if zero
+RNZ                     Return if non zero
+RC                      Return if carry set
+RNC                     Return if carry clear
+RM                      Return if minus
+RP                      Return if plus
+RPE                     Return if parity even
+RPO                     Return if parity odd
+
+RIM                     Read interrupt mask
+RST      _int_          Restart at vector _int_
+
+SBB      _reg_          Subtract _reg_ from A         with borrow
+SBB      M              Subtract indirect memory (HL) with borrow
+SBI      _data_         Subtract immediate from A     with borrow
+SUB      _reg_          Subtract _reg_ from A
+SUB      M              Subtract indirect memory (HL) from A
+SUI      _data_         Subtract immediate from A
+
+SHLD     _addr_         Store HL
+SIM                     Store Interrupt mask
+SPHL                    Exchange SP with HL
+
+STA      _addr_         Store A direct memory
+STAX     B              Store A indirect using BC
+STAX     D              Store A indirect using DE
+
+STC                     Set carry
+
+XRA      _reg_          Exclusive OR A with register
+XRA      M              Exclusive Or A with indirect memory (HL)
+XRI      _data_         Exclusive Or A with immediate data
+XCHG                    Exchange DE with HL
+XTHL                    Exchange HL with top of stack
+
+
+

See the manufacturer's data sheets for more information. +

+
+

Z80 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the Z80 version of TASM. The following +symbols are used in the table: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr_              Absolute address (16 bits)
+_bit_               Bit address
+_data_              Immediate data (8 bits)
+_data16_            Immediate data (16 bits)
+_disp_              Relative address
+_reg_               Register (A, B, C, D, E, H, or L)
+_rp_                Register pair (BC, DE, HL, or SP)
+_port_              Port (0 - 255)
+_cond_              Condition
+			NZ - not zero
+			Z  - zero
+			NC - not carry
+			C  - carry
+			PO - parity odd
+			PE - parity even
+			P  - positive
+			M  - minus
+
+
+

Any valid TASM expression can appear in the place of the _addr_, _bit_, +_data_, _data16_, or _disp_ symbolics. +

+
OPCODE  OPERAND         DESCRIPTION
+--------------------------------------------------------------------
+ADC  A,_data_           Add immediate with carry to accumulator
+ADC  A,_reg_            Add register with carry to accumulator
+ADC  A,(HL)             Add indirect memory with carry to accumulator
+ADC  A,(IX+_disp_)      Add indirect memory with carry to accumulator
+ADC  A,(IY+_disp_)      Add indirect memory with carry to accumulator
+ADC  HL,_rp_            Add register pair with carry to HL
+
+ADD  A,_data_           Add immediate to accumulator
+ADD  A,_reg_            Add register to accumulator
+ADD  A,(HL)             Add indirect memory to accumulator
+ADD  A,(IX+_disp_)      Add indirect memory to accumulator
+ADD  A,(IY+_disp_)      Add indirect memory to accumulator
+ADD  HL,_rp_            Add register pair to HL
+ADD  IX,_rp_            Add register pair to index register
+ADD  IY,_rp_            Add register pair to index register
+
+AND  _data_             And immediate with accumulator
+AND  _reg_              And register  with accumulator
+AND  (HL)               And memory with accumulator
+AND  (IX+_disp_)        And memory with accumulator
+AND  (IY+_disp_)        And memory with accumulator
+
+BIT  _bit_,_reg_        Test _bit_ in register
+BIT  _bit_,(HL)         Test _bit_ in indirect memory
+BIT  _bit_,(IY+_disp_)  Test _bit_ in indirect memory
+BIT  _bit_,(IX+_disp_)  Test _bit_ in indirect memory
+
+CALL _addr_             Call the routine at _addr_
+CALL _cond_,_addr_      Call the routine if _cond_ is satisfied
+
+CCF                     Complement carry flag
+
+CP   _data_             Compare immediate data with accumulator
+CP   _reg_              Compare register with accumulator
+CP   (HL)               Compare indirect memory with accumulator
+CP   (IX+_disp_)        Compare indirect memory with accumulator
+CP   (IY+_disp_)        Compare indirect memory with accumulator
+CPD                     Compare accumulator with memory and
+                            decrement address and byte counters
+CPDR                    Compare accumulator with memory and
+                            decrement address and byte counter,
+                            continue until match is found or
+                            byte counter is zero
+
+CPI                     Compare accumulator with memory and
+                            increment address and byte counters
+CPIR                    Compare accumulator with memory and
+                            increment address and byte counter,
+                            continue until match is found or
+                            byte counter is zero
+CPL                     Complement the accumulator
+DAA                     Decimal adjust accumulator
+DEC  _reg_              Decrement register contents
+DI                      Disable interrupts
+DJNZ _disp_             Decrement reg B and jump relative if zero
+EI                      Enable interrupts
+EX   AF,AF'             Exchange program status and alt program stat
+EX   DE,HL              Exchange DE and HL contents
+EX   (SP),HL            Exchange contents of HL and top of stack
+EX   (SP),IX            Exchange contents of IX and top of stack
+EX   (SP),IY            Exchange contents of IY and top of stack
+EXX                     Exchange register pairs and alt reg pairs
+HALT                    Program execution stops
+IM   0                  Interrupt mode 0
+IM   1                  Interrupt mode 1
+IM   2                  Interrupt mode 2
+IN   A,_port_           Input port to accumulator
+INC  _reg_              Increment contents of register
+INC  _rp_               Increment contents of register pair
+INC  IX                 Increment IX
+INC  IY                 Increment IY
+INC  (HL)               Increment indirect memory
+INC  (IX+_disp_)        Increment indirect memory
+INC  (IY+_disp_)        Increment indirect memory
+IND                     Input to memory and decrement pointer
+INDR                    Input to memory and decrement pointer until
+                            byte counter is zero
+INI                     Input to memory and increment pointer
+INIR                    Input to memory and increment pointer until
+                            byte counter is zero
+IN   _reg_,(C)          Input to register
+
+JP   _addr_             Jump to location
+JP   _cond_,_addr_      Jump to location if condition satisifed
+JP   (HL)               Jump to location pointed to by HL
+JP   (IX)               Jump to location pointed to by IX
+JP   (IY)               Jump to location pointed to by IY
+
+JR   _disp_             Jump relative
+JR   C,_disp_           Jump relative if carry is set
+JR   NC,_disp_          Jump relative if carry bit is reset
+JR   NZ,_disp_          Jump relative if zero flag is reset
+JR   Z,_disp_           Jump relative if zero flag is set
+
+LD   A,I                Move interrupt vector contents to accumulator
+LD   A,R                Move refresh reg contents to accumulator
+LD   A,(_addr_)         Load accumulator indirect from memory
+LD   A,(_rp_)           Load accumulator indirect from memory by _rp_
+LD   _reg_,_reg_        Load source register to destination register
+LD   _rp_,(_addr_)      Load register pair indirect from memory
+LD   IX,(_addr_)        Load IX indirect from memory
+LD   IY,(_addr_)        Load IY indirect from memory
+LD   I,A                Load interrup vector from accumulator
+LD   R,A                Load refresh register from accumulator
+LD   _reg_,_data_       Load register with immediate data
+LD   _rp_,_data16_      Load register pair with immediate data
+LD   IX,_data16_        Load  IX  with immediate data
+LD   IY,_data16_        Load  IY  with immediate data
+LD   _reg_,(HL)         Load register indirect from memory
+LD   _reg_,(IX+_disp_)  Load register indirect from memory
+LD   _reg_,(IY+_disp_)  Load register indirect from memory
+LD   SP,HL              Load contents of HL to stack pointer
+LD   SP,IX              Load contents of IX to stack pointer
+LD   SP,IY              Load contents of IY to stack pointer
+LD   (addr),A           Load contents of A to memory
+LD   (_addr_),HL        Load contents of HL to memory
+LD   (_addr_),_rp_      Load contents of register pair to memory
+LD   (_addr_),IX        Load contents of IX to memory
+LD   (_addr_),IY        Load contents of IY to memory
+LD   (HL),_data_        Load immediate into indirect memory
+LD   (IX+_disp_),_data_ Load immediate into indirect memory
+LD   (IY+_disp_),_data_ Load immediate into indirect memory
+LD   (HL),_reg_         Load register  into indirect memory
+LD   (IX+_disp_),_reg_  Load register  into indirect memory
+LD   (IY+_disp_),_reg_  Load register  into indirect memory
+LD   (_rp_),A           Load accumulator into indirect memory
+LDD                     Transfer data between memory and decrement
+                            destination and source addresses
+LDDR                    Transfer data between memory until byte
+                            counter is zero, decrement destintation
+                            and source addresses
+LDI                     Transfer data between memory and increment
+                            destination and source addresses
+LDIR                    Transfer data between memory until byte
+                            counter is zero, increment destination
+                            and source addresses
+NEG                     Negate contents of accumulator
+NOP                     No operation
+OR   _data_             Or immediate with accumulator
+OR   _reg_              Or register with accumulator
+OR   (HL)               Or indirect memory with accumulator
+OR   (IX+_disp_)        Or indirect memory with accumulator
+OR   (IY+_disp_)        Or indirect memory with accumulator
+OUT  (C),_reg_          Output from registor
+OUTD                    Output from memory, decrement address
+OTDR                    Output from memory, decrement address
+                            continue until reg B is zero
+OUTI                    Output from memory, increment address
+OTIR                    Output from memory, increment address
+                            continue until reg B is zero
+OUT  _port_,A           Output from accumulator
+POP  _rp_               Load register pair from top of stack
+POP  IX                 Load IX from top of stack
+POP  IY                 Load IY from top of stack
+PUSH _rp_               Store resister pair on top of stack
+PUSH IX                 Store IX on top of stack
+PUSH IY                 Store IY on top of stack
+RES  _bit_,_reg_        Reset register bit
+RES  _bit_,(HL)         Reset bit at indirect memory location
+RES  _bit_,(IX+disp)    Reset bit at indirect memory location
+RES  _bit_,(IY+_disp_)  Reset bit at indirect memory location
+RET                     Return from subroutine
+RET  _cond_             Return from subroutine if condition true
+RETI                    Return from interrupt
+RETN                    Return from non-maskable interrupt
+RL   _reg_              Rotate left through carry register contents
+RL   (HL)               Rotate left through carry indirect memory
+RL   (IX+_disp_)        Rotate left through carry indirect memory
+RL   (IY+_disp_)        Rotate left through carry indirect memory
+RLA                     Rotate left through carry accumulator
+RLC  _reg_              Rotate left branch  carry register contents
+RLC  (HL)               Rotate left branch  carry indirect memory
+RLC  (IX+_disp_)        Rotate left branch  carry indirect memory
+RLC  (IY+_disp_)        Rotate left branch  carry indirect memory
+RLCA                    Rotate left accumulator
+RLD                     Rotate one BCD digit left between the
+                            accumulator and memory
+RR   _reg_              Rotate right through carry register contents
+RR   (HL)               Rotate right through carry indirect memory
+RR   (IX+_disp_)        Rotate right through carry indirect memory
+RR   (IY+_disp_)        Rotate right through carry indirect memory
+RRA                     Rotate right through carry accumulator
+RRC  _reg_              Rotate right branch  carry register contents
+RRC  (HL)               Rotate right branch  carry indirect memory
+RRC  (IX+_disp_)        Rotate right branch  carry indirect memory
+RRC  (IY+_disp_)        Rotate right branch  carry indirect memory
+RRCA                    Rotate right branch  carry accumulator
+RRD                     Rotate one BCD digit right between the
+                            accumulator and memory
+RST                     Restart
+SBC  A,_data_           Subtract data            from A with borrow
+SBC  A,_reg_            Subtract register        from A with borrow
+SBC  A,(HL)             Subtract indirect memory from A with borrow
+SBC  A,(IX+_disp_)      Subtract indirect memory from A with borrow
+SBC  A,(IY+_disp_)      Subtract indirect memory from A with borrow
+SBC  HL,_rp_            Subtract register pair from HL with borrow
+SCF                     Set carry flag
+SET  _bit_,_reg_        Set register bit
+SET  _bit_,(HL)         Set indirect memory bit
+SET  _bit_,(IX+_disp_)  Set indirect memory bit
+SET  _bit_,(IY+_disp_)  Set indirect memory bit
+SLA  _reg_              Shift register left arithmetic
+SLA  (HL)               Shift indirect memory left arithmetic
+SLA  (IX+_disp_)        Shift indirect memory left arithmetic
+SLA  (IY+_disp_)        Shift indirect memory left arithmetic
+SRA  _reg_              Shift register right arithmetic
+SRA  (HL)               Shift indirect memory right arithmetic
+SRA  (IX+_disp_)        Shift indirect memory right arithmetic
+SRA  (IY+_disp_)        Shift indirect memory right arithmetic
+SRL  _reg_              Shift register right logical
+SRL  (HL)               Shift indirect memory right logical
+SRL  (IX+_disp_)        Shift indirect memory right logical
+SRL  (IY+_disp_)        Shift indirect memory right logical
+SUB  _data_             Subtract immediate from accumulator
+SUB  _reg_              Subtract register from accumulator
+SUB  (HL)               Subtract indirect memory from accumulator
+SUB  (IX+_disp_)        Subtract indirect memory from accumulator
+SUB  (IY+_disp_)        Subtract indirect memory from accumulator
+XOR  _data_             Exclusive or immediate with accumulator
+XOR  _reg_              Exclusive or register with accumulator
+XOR  (HL)               Exclusive or indirect memory with accumulator
+XOR  (IX+_disp_)        Exclusive or indirect memory with accumulator
+XOR  (IY+_disp_)        Exclusive or indirect memory with accumulator
+
+

See the manufacturer's data sheets for more information. +

+
+

6805 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the 6805 version of TASM. The following +symbols are used in the table: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_addr_              Absolute address (16 bits)
+_addr8_             Absolute address (8 bits)
+_bit_               Bit address
+_data_              Immediate data (8 bits)
+_rel_               Relative address
+
+
+

Any valid TASM expression can appear in the place of the _addr_, _addr8_, +_bit_, _data_, or _rel_ symbolics. +

+
OPCODE  OPERAND         DESCRIPTION
+--------------------------------------------------------------
+ADC     #_data_         Add with carry, immediate
+ADC     ,X              Add with carry, indexed, no offset
+ADC     _addr8_,X       Add with carry, indexed, 1 byte offset
+ADC     _addr_,X        Add with carry, indexed, 2 byte offset
+ADC     _addr8_         Add with carry, direct
+ADC     _addr_          Add with carry, extended
+
+ADD     #_data_         Add, immediate
+ADD     ,X              Add, indexed, no offset
+ADD     _addr8_,X       Add, indexed, 1 byte offset
+ADD     _addr_,X        Add, indexed, 2 byte offset
+ADD     _addr8_         Add, direct
+ADD     _addr_          Add, extended
+
+AND     #_data_         And, immediate
+AND     ,X              And, indexed, no offset
+AND     _addr8_,X       And, indexed, 1 byte offset
+AND     _addr_,X        And, indexed, 2 byte offset
+AND     _addr8_         And, direct
+AND     _addr_          And, extended
+
+ASLA                    Arithmetic Shift Left, accumulator
+ASLX                    Arithmetic Shift Left, index register
+ASL     _addr8_         Arithmetic Shift Left, direct
+ASL     ,X              Arithmetic Shift Left, indexed, no offset
+ASL     _addr8_,X       Arithmetic Shift Left, indexed, 1 byte offset
+
+ASRA                    Arithmetic Shift Right, accumulator
+ASRX                    Arithmetic Shift Right, index register
+ASR     _addr8_         Arithmetic Shift Right, direct
+ASR     ,X              Arithmetic Shift Right, indexed, no offset
+ASR     _addr8_,X       Arithmetic Shift Right, indexed, 1 byte offset
+
+BCC     _rel_           Branch if carry clear
+BCLR    _bit_,_addr8_   Bit Clear in memory
+BCS     _rel_           Branch if carry set
+BEQ     _rel_           Branch if equal
+BHCC    _rel_           Branch if half carry clear
+BHCS    _rel_           Branch if half carry set
+BHI     _rel_           Branch if higher
+BHS     _rel_           Branch if higher or same
+BIH     _rel_           Branch if interrupt line is high
+BIL     _rel_           Branch if interrupt is low
+
+BIT     #_data_         Bit test, immediate
+BIT     ,X              Bit test, indexed, no offset
+BIT     _addr8_,X       Bit test, indexed, 1 byte offset
+BIT     _addr_,X        Bit test, indexed, 2 byte offset
+BIT     _addr8_         Bit test, direct
+BIT     _addr_          Bit test, extended
+
+BLO     _rel_           Branch if lower
+BLS     _rel_           Branch if lower or same
+BMC     _rel_           Branch if interrupt mask is clear
+BMI     _rel_           Branch if minus
+BMS     _rel_           Branch if interuupt mask bit is set
+BNE     _rel_           Branch if not equal
+BPL     _rel_           Branch if plus
+BRA     _rel_           Branch always
+BRCLR   _bit_,_addr8_,_rel_     Branch if bit is clear
+BRN     _rel_           Branch never
+BRSET   _bit_,_addr8_,_rel_     Branch if bit is set
+BSET    _bit_,_addr8_   Bit set in memory
+BSR     _rel_           Branch to subroutine
+
+CLC                     Clear carry bit
+CLI                     Clear interuupt mask bit
+
+CLRA                    Clear, accumulator
+CLRX                    Clear, index register
+CLR     _addr8_         Clear, direct
+CLR     ,X              Clear, indexed, no offset
+CLR     _addr8_,X       Clear, indexed, 1 byte offset
+
+CMP     #_data_         Compare Acc, immediate
+CMP     ,X              Compare Acc, indexed, no offset
+CMP     _addr8_,X       Compare Acc, indexed, 1 byte offset
+CMP     _addr_,X        Compare Acc, indexed, 2 byte offset
+CMP     _addr8_         Compare Acc, direct
+CMP     _addr_          Compare Acc, extended
+
+COMA                    Complement, accumulator
+COMX                    Complement, index register
+COM     _addr8_         Complement, direct
+COM     ,X              Complement, indexed, no offset
+COM     _addr8_,X       Complement, indexed, 1 byte offset
+
+CPX     #_data_         Compare Index, immediate
+CPX     ,X              Compare Index, indexed, no offset
+CPX     _addr8_,X       Compare Index, indexed, 1 byte offset
+CPX     _addr_,X        Compare Index, indexed, 2 byte offset
+CPX     _addr8_         Compare Index, direct
+CPX     _addr_          Compare Index, extended
+
+DECA                    Decrement, accumulator
+DECX                    Decrement, index register
+DEX                     Decrement, index register (alternate of DECX)
+DEC     _addr8_         Decrement, direct
+DEC     ,X              Decrement, indexed, no offset
+DEC     _addr8_,X       Decrement, indexed, 1 byte offset
+
+EOR     #_data_         Exclusive OR, immediate
+EOR     ,X              Exclusive OR, indexed, no offset
+EOR     _addr8_,X       Exclusive OR, indexed, 1 byte offset
+EOR     _addr_,X        Exclusive OR, indexed, 2 byte offset
+EOR     _addr8_         Exclusive OR, direct
+EOR     _addr_          Exclusive OR, extended
+
+INCA                    Increment, accumulator
+INCX                    Increment, index register
+INX                     Increment, index register (alternate of INCX)
+INC     _addr8_         Increment, direct
+INC     ,X              Increment, indexed, no offset
+INC     _addr8_,X       Increment, indexed, 1 byte offset
+
+JMP     ,X              Jump, indexed, no offset
+JMP     _addr8_,X       Jump, indexed, 1 byte offset
+JMP     _addr_,X        Jump, indexed, 2 byte offset
+JMP     _addr8_         Jump, direct
+JMP     _addr_          Jump, extended
+
+JSR     ,X              Jump Subroutine, indexed, no offset
+JSR     _addr8_,X       Jump Subroutine, indexed, 1 byte offset
+JSR     _addr_,X        Jump Subroutine, indexed, 2 byte offset
+JSR     _addr8_         Jump Subroutine, direct
+JSR     _addr_          Jump Subroutine, extended
+
+LDA     #_data_         Load Acc, immediate
+LDA     ,X              Load Acc, indexed, no offset
+LDA     _addr8_,X       Load Acc, indexed, 1 byte offset
+LDA     _addr_,X        Load Acc, indexed, 2 byte offset
+LDA     _addr8_         Load Acc, direct
+LDA     _addr_          Load Acc, extended
+
+LDX     #_data_         Load Index, immediate
+LDX     ,X              Load Index, indexed, no offset
+LDX     _addr8_,X       Load Index, indexed, 1 byte offset
+LDX     _addr_,X        Load Index, indexed, 2 byte offset
+LDX     _addr8_         Load Index, direct
+LDX     _addr_          Load Index, extended
+
+LSLA                    Logical Shift Left, accumulator
+LSLX                    Logical Shift Left, index register
+LSL     _addr8_         Logical Shift Left, direct
+LSL     ,X              Logical Shift Left, indexed, no offset
+LSL     _addr8_,X       Logical Shift Left, indexed, 1 byte offset
+
+LSRA                    Logical Shift Right, accumulator
+LSRX                    Logical Shift Right, index register
+LSR     _addr8_         Logical Shift Right, direct
+LSR     ,X              Logical Shift Right, indexed, no offset
+LSR     _addr8_,X       Logical Shift Right, indexed, 1 byte offset
+
+NEGA                    Negate, accumulator
+NEGX                    Negate, index register
+NEG     _addr8_         Negate, direct
+NEG     ,X              Negate, indexed, no offset
+NEG     _addr8_,X       Negate, indexed, 1 byte offset
+
+NOP                     No Operation
+
+ORA     #_data_         Inclusive OR Acc, immediate
+ORA     ,X              Inclusive OR Acc, indexed, no offset
+ORA     _addr8_,X       Inclusive OR Acc, indexed, 1 byte offset
+ORA     _addr_,X        Inclusive OR Acc, indexed, 2 byte offset
+ORA     _addr8_         Inclusive OR Acc, direct
+ORA     _addr_          Inclusive OR Acc, extended
+
+ROLA                    Rotate Left thru Carry, accumulator
+ROLX                    Rotate Left thru Carry, index register
+ROL     _addr8_         Rotate Left thru Carry, direct
+ROL     ,X              Rotate Left thru Carry, indexed, no offset
+ROL     _addr8_,X       Rotate Left thru Carry, indexed, 1 byte offset
+
+RORA                    Rotate Right thru Carry, accumulator
+RORX                    Rotate Right thru Carry, index register
+ROR     _addr8_         Rotate Right thru Carry, direct
+ROR     ,X              Rotate Right thru Carry, indexed, no offset
+ROR     _addr8_,X       Rotate Right thru Carry, indexed, 1 byte offset
+
+RSP                     Reset Stack Pointer
+RTI                     Return from Interrupt
+RTS                     Return from Subroutine
+
+SBC     #_data_         Subtract with Carry, immediate
+SBC     ,X              Subtract with Carry, indexed, no offset
+SBC     _addr8_,X       Subtract with Carry, indexed, 1 byte offset
+SBC     _addr_,X        Subtract with Carry, indexed, 2 byte offset
+SBC     _addr8_         Subtract with Carry, direct
+SBC     _addr_          Subtract with Carry, extended
+
+SEC                     Set carry bit
+SEI                     Set interrupt Mask bit
+
+STA     #_data_         Store Acc, immediate
+STA     ,X              Store Acc, indexed, no offset
+STA     _addr8_,X       Store Acc, indexed, 1 byte offset
+STA     _addr_,X        Store Acc, indexed, 2 byte offset
+STA     _addr8_         Store Acc, direct
+STA     _addr_          Store Acc, extended
+
+STOP                    Enable IRQ, Stop Oscillator
+
+STX     #_data_         Store Index, immediate
+STX     ,X              Store Index, indexed, no offset
+STX     _addr8_,X       Store Index, indexed, 1 byte offset
+STX     _addr_,X        Store Index, indexed, 2 byte offset
+STX     _addr8_         Store Index, direct
+STX     _addr_          Store Index, extended
+
+SUB     #_data_         Subtract, immediate
+SUB     ,X              Subtract, indexed, no offset
+SUB     _addr8_,X       Subtract, indexed, 1 byte offset
+SUB     _addr_,X        Subtract, indexed, 2 byte offset
+SUB     _addr8_         Subtract, direct
+SUB     _addr_          Subtract, extended
+
+SWI                     Software Interrupt
+
+TAX                     Transfer Acc to Index
+
+TSTA                    Test for neg or zero, accumulator
+TSTX                    Test for neg or zero, index register
+TST     _addr8_         Test for neg or zero, direct
+TST     ,X              Test for neg or zero, indexed, no offset
+TST     _addr8_,X       Test for neg or zero, indexed, 1 byte offset
+
+TXA                     Transfer Index to Acc
+
+WAIT                    Enable Interrupt, Stop Processor
+
+
+

See the manufacturer's data sheets for more information. +

+
+

TMS32010 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the TMS32010 version of TASM. The following +symbols are used in the table: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_ar_                Auxiliary register (AR0, AR1)
+_arp_               Auxiliary register pointer
+_dma_               Direct memory address
+_pma_               Program memory address
+_port_              Port address (0 - 7)
+_shift_             Shift count  (0 - 15)
+_const1_            Constant (1 bit)
+_const8_            Constant (8 bit)
+_const13_           Constant (13 bit)
+
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics. +

+
OPCODE   OPERAND            DESCRIPTION
+--------------------------------------------------------------------
+ABS                         Absolute value of ACC
+
+ADD      *+,_shift_,_arp_   Add to ACC with shift
+ADD      *-,_shift_,_arp_
+ADD      *, _shift_,_arp_
+ADD      *+,_shift_
+ADD      *-,_shift_
+ADD      *, _shift_
+ADD      *+
+ADD      *-
+ADD      *
+ADD      _dma_,_shift_
+ADD      _dma_
+
+ADDH     *+,_arp_           Add to high-order ACC bits
+ADDH     *-,_arp_
+ADDH     *, _arp_
+ADDH     *+
+ADDH     *-
+ADDH     *
+ADDH     _dma_
+
+ADDS     *+,_arp_           Add to ACC with no sign extension
+ADDS     *-,_arp_
+ADDS     *, _arp_
+ADDS     *+
+ADDS     *-
+ADDS     *
+ADDS     _dma_
+
+AND      *+,_arp_           AND with ACC
+AND      *-,_arp_
+AND      *, _arp_
+AND      *+
+AND      *-
+AND      *
+AND      _dma_
+
+APAC                        Add P register to ACC
+
+B        _pma_              Branch unconditionally
+BANZ     _pma_              Branch on auxiliary register not zero
+BGEZ     _pma_              Branch if ACC >= 0
+BGZ      _pma_              Branch if ACC >  0
+BIOZ     _pma_              Branch on BIO- = 0
+BLEZ     _pma_              Branch if ACC <= 0
+BLZ      _pma_              Branch if ACC <  0
+BNZ      _pma_              Branch if ACC 
+
 0
+BV       _pma_              Branch on overflow
+BZ       _pma_              Branch if ACC =  0
+
+CALA                        Call subroutine from ACC
+CALL     _pma_              Call subroutine at _pma_
+
+DINT                        Disable interrupt
+
+DMOV     *+,_arp_           Data move in memory
+DMOV     *-,_arp_
+DMOV     *, _arp_
+DMOV     *+
+DMOV     *-
+DMOV     *
+DMOV     _dma_
+
+EINT                        Enable Interrupt
+
+IN       *+,_port_ ,_arp_   Input data from port
+IN       *-,_port_ ,_arp_
+IN       * ,_port_ ,_arp_
+IN       *+,_port_
+IN       *-,_port_
+IN       * ,_port_
+IN       _dma_,_port_
+
+LAC      *+,_shift_,_arp_   Load ACC with shift
+LAC      *-,_shift_,_arp_
+LAC      *, _shift_,_arp_
+LAC      *+,_shift_
+LAC      *-,_shift_
+LAC      *, _shift_
+LAC      *+
+LAC      *-
+LAC      *
+LAC      _dma_,_shift_
+LAC      _dma_
+
+LACK     _const8_                   Load ACC with 8 bit constant
+
+LAR      _ar_,*+,_arp_              Load auxiliary Register
+LAR      _ar_,*-,_arp_
+LAR      _ar_,*, _arp_
+LAR      _ar_,*+
+LAR      _ar_,*-
+LAR      _ar_,*
+LAR      _ar_,_dma_
+
+LARK     _ar_,_const8_              Load aux register with constant
+LARP     _const1_                   Load aux register pointer immed
+
+LDP      *+,_arp_                   Load data memory page pointer
+LDP      *-,_arp_
+LDP      *, _arp_
+LDP      *+
+LDP      *-
+LDP      *
+LDP      _dma_
+
+LDPK     _const1_                   Load data page pointer immediate
+
+LST      *+,_arp_                   Load status from data memory
+LST      *-,_arp_
+LST      *, _arp_
+LST      *+
+LST      *-
+LST      *
+LST      _dma_
+
+LT       *+,_arp_                   Load T register
+LT       *-,_arp_
+LT       *, _arp_
+LT       *+
+LT       *-
+LT       *
+LT       _dma_
+
+LTA      *+,_arp_                   Load T register and accumulate
+LTA      *-,_arp_                     product
+LTA      *, _arp_
+LTA      *+
+LTA      *-
+LTA      *
+LTA      _dma_
+
+LTD      *+,_arp_                   Load T reg, accumulate product,
+LTD      *-,_arp_                     and move
+LTD      *, _arp_
+LTD      *+
+LTD      *-
+LTD      *
+LTD      _dma_
+
+MAR      *+,_arp_                   Modify auxiliary register
+MAR      *-,_arp_
+MAR      *, _arp_
+MAR      *+
+MAR      *-
+MAR      *
+MAR      _dma_
+
+MPY      *+,_arp_                   Multiply
+MPY      *-,_arp_
+MPY      *, _arp_
+MPY      *+
+MPY      *-
+MPY      *
+MPY      _dma_
+
+MPYK     _const13_                  Multiply immediate
+
+NOP                                 No Operation
+
+OR       *+,_arp_                   OR  with low order bits of ACC
+OR       *-,_arp_
+OR       *, _arp_
+OR       *+
+OR       *-
+OR       *
+OR       _dma_
+
+OUT      *+,_port_,_arp_            Output data to port
+OUT      *-,_port_,_arp_
+OUT      *, _port_,_arp_
+OUT      *+,_port_
+OUT      *-,_port_
+OUT      *, _port_
+OUT      _dma_,_port_
+
+PAC                                 Load ACC with P register
+POP                                 Pop top of stack to ACC
+PUSH                                Push ACC onto stack
+RET                                 Return from subroutine
+ROVM                                Reset overflow mode register
+
+SACH     *+,_shift_,_arp_           Store ACC high with shift
+SACH     *-,_shift_,_arp_             Note: shift can only be 0, 1,
+SACH     *, _shift_,_arp_                   or 4
+SACH     *+,_shift_
+SACH     *-,_shift_
+SACH     *, _shift_
+SACH     *+
+SACH     *-
+SACH     *
+SACH     _dma_,_shift_
+SACH     _dma_
+
+SACL     *+,_arp_                   Store ACC low
+SACL     *-,_arp_
+SACL     *, _arp_
+SACL     *+
+SACL     *-
+SACL     *
+SACL     _dma_
+
+SAR      _ar_,*+,_arp_              Store auxiliary Register
+SAR      _ar_,*-,_arp_
+SAR      _ar_,*, _arp_
+SAR      _ar_,*+
+SAR      _ar_,*-
+SAR      _ar_,*
+SAR      _ar_,_dma_
+
+SOVM                                Set overflow mode register
+SPAC                                Subtract P register from ACC
+
+SST      *+,_arp_                   Store status
+SST      *-,_arp_
+SST      *, _arp_
+SST      *+
+SST      *-
+SST      *
+SST      _dma_
+
+SUB      *+,_shift_,_arp_           Subtract from ACC with shift
+SUB      *-,_shift_,_arp_
+SUB      *, _shift_,_arp_
+SUB      *+,_shift_
+SUB      *-,_shift_
+SUB      *, _shift_
+SUB      *+
+SUB      *-
+SUB      *
+SUB      _dma_,_shift_
+SUB      _dma_
+
+SUBC     *+,_arp_                   Conditional subtract
+SUBC     *-,_arp_
+SUBC     *, _arp_
+SUBC     *+
+SUBC     *-
+SUBC     *
+SUBC     _dma_
+
+SUBH     *+,_arp_                   Subtract from high-order ACC
+SUBH     *-,_arp_
+SUBH     *, _arp_
+SUBH     *+
+SUBH     *-
+SUBH     *
+SUBH     _dma_
+
+SUBS     *+,_arp_                   Subtract from low ACC with
+SUBS     *-,_arp_                     sign-extension suppressed
+SUBS     *, _arp_
+SUBS     *+
+SUBS     *-
+SUBS     *
+SUBS     _dma_
+
+TBLR     *+,_arp_                   Table Read
+TBLR     *-,_arp_
+TBLR     *, _arp_
+TBLR     *+
+TBLR     *-
+TBLR     *
+TBLR     _dma_
+
+TBLW     *+,_arp_                   Table Write
+TBLW     *-,_arp_
+TBLW     *, _arp_
+TBLW     *+
+TBLW     *-
+TBLW     *
+TBLW     _dma_
+
+XOR      *+,_arp_                   Exclusive OR with low bits of ACC
+XOR      *-,_arp_
+XOR      *, _arp_
+XOR      *+
+XOR      *-
+XOR      *
+XOR      _dma_
+
+ZAC                                 Zero the ACC
+
+ZALH     *+,_arp_                   Zero ACC and load high
+ZALH     *-,_arp_
+ZALH     *, _arp_
+ZALH     *+
+ZALH     *-
+ZALH     *
+ZALH     _dma_
+
+ZALS     *+,_arp_                   Zero ACC and load low with
+ZALS     *-,_arp_                     sign extension suppressed
+ZALS     *, _arp_
+ZALS     *+
+ZALS     *-
+ZALS     *
+ZALS     _dma_
+
+

See manufacturer's data for more information. +

+
+

TMS32025 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the TMS32025 version of TASM. The following +symbols are used in the table: +

+
SYMBOLIC            DESCRIPTION
+-----------------------------------------------
+_ar_                Auxiliary register (AR0, AR1, ...)
+_arp_               Auxiliary register pointer
+_nextarp_           Auxiliary register pointer (for next operation)
+_dma_               Direct memory address
+_pma_               Program memory address
+_port_              Port address (0 - 7)
+_shift_             Shift count  (0 - 15)
+_const1_            Constant (1 bit)
+_const2_            Constant (2 bit)
+_const8_            Constant (8 bit)
+_const13_           Constant (13 bit)
+_ind_               Indirect addressing mode indicator
+                      (see following table)
+
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics except for _ind_. The _ind_ symbolic must be one of the following: +

+
        
+_ind_
+-------
+*BR0+
+*BR0-
+*0+
+*0-
+*+
+*-
+*
+
+OPCODE   OPERAND                DESCRIPTION
+--------------------------------------------------------------------
+ABS                             Absolute value of ACC
+
+ADD  _ind_,_shift_,_nextarp_    Add to ACC with shift
+ADD  _ind_,_shift_
+ADD  _ind_
+ADD  _dma_,_shift_
+ADD  _dma_
+
+ADDC _ind_,_nextarp_            Add to ACC with carry
+ADDC _ind_
+ADDC _dma_
+
+ADDH _ind_,_nextarp_            Add to high ACC
+ADDH _ind_
+ADDH _dma_
+
+ADDK _const8_                   Add to ACC short immediate
+ADDS _ind_,_nextarp_            Add to ACC with sign-extension suppressed
+ADDS _ind_
+ADDS _dma_
+
+ADDT _ind_,_nextarp_            Add to ACC with shift specified by T reg
+ADDT _ind_
+ADDT _dma_
+
+ADLK _const8_,_shift_           Add to ACC long immediate with shift
+ADLK _const8_
+
+ADRK _const8_                   Add to aux register short immediate
+
+AND  _ind_,_nextarp_            And with ACC
+AND  _ind_
+AND  _dma_
+
+ANDK _const8_,_shift_           And immediate with ACC with shift
+ANDK _const8_
+
+APAC                            Add P register to ACC
+
+B    _pma_,_ind_,_nextarp_      Branch unconditionally
+B    _pma_,_ind_
+B    _pma_
+
+BACC                            Branch to address specified by ACC
+
+BANZ _pma_,_ind_,_nextarp_      Branch on Aux register not zero
+BANZ _pma_,_ind_
+BANZ _pma_
+
+BBNZ _pma_,_ind_,_nextarp_      Branch on TC bit not zero
+BBNZ _pma_,_ind_
+BBNZ _pma_
+
+BBZ  _pma_,_ind_,_nextarp_      Branch on TC bit equal to zero
+BBZ  _pma_,_ind_
+BBZ  _pma_
+
+BC   _pma_,_ind_,_nextarp_      Branch on carry
+BC   _pma_,_ind_
+BC   _pma_
+
+BGEZ _pma_,_ind_,_nextarp_      Branch if ACC >= zero
+BGEZ _pma_,_ind_
+BGEZ _pma_
+
+BGZ  _pma_,_ind_,_nextarp_      Branch if ACC > zero
+BGZ  _pma_,_ind_
+BGZ  _pma_
+
+BIOZ _pma_,_ind_,_nextarp_      Branch on I/O status = zero
+BIOZ _pma_,_ind_
+BIOZ _pma_
+
+BIT  _ind_,_bitcode_,_nextarp_  Test bit
+BIT  _ind_,_bitcode_
+BIT  _dma_,_bitcode_
+
+BITT _ind_,_nextarp_            Test bit specified by T register
+BITT _ind_
+BITT _dma_
+
+BLEZ _pma_,_ind_,_nextarp_      Branch if ACC <= zero
+BLEZ _pma_,_ind_
+BLEZ _pma_
+
+BLKD _dma_,_ind_,_nextarp_      Block move from data mem to data mem
+BLKD _dma_,_ind_
+BLKD _dma_,_dma_
+
+BLKP _pma_,_ind_,_nextarp_      Block move from prog mem to data mem
+BLKP _pma_,_ind_
+BLKP _pma_,_dma_
+
+BLZ  _pma_,_ind_,_nextarp_      Branch if ACC < zero
+BLZ  _pma_,_ind_
+BLZ  _pma_
+
+BNC  _pma_,_ind_,_nextarp_      Branch on no carry
+BNC  _pma_,_ind_
+BNC  _pma_
+
+BNV  _pma_,_ind_,_nextarp_      Branch if no overflow
+BNV  _pma_,_ind_
+BNV  _pma_
+
+BNZ  _pma_,_ind_,_nextarp_      Branch if ACC 
+
 zero
+BNZ  _pma_,_ind_
+BNZ  _pma_
+
+BV   _pma_,_ind_,_nextarp_      Branch on overflow
+BV   _pma_,_ind_
+BV   _pma_
+
+BZ   _pma_,_ind_,_nextarp_      Branch if ACC = zero
+BZ   _pma_,_ind_
+BZ   _pma_
+
+CALA                            Call subroutine indirect
+
+CALL _pma_,_ind_,_nextarp_      Call subroutine
+CALL _pma_,_ind_
+CALL _pma_
+
+CMPL                            Complement ACC
+CMPR _const2_                   Compare Aux reg with Aux AR0
+CNFD                            Configure block as data memory
+CNFP                            Configure block as program memory
+CONF _const2_                   Configure block as data/prog memory
+DINT                            Disable interrupt
+
+DMOV _ind_,_nextarp_            Data move in data memory
+DMOV _ind_
+DMOV _dma_
+
+EINT                            Enable interrupt
+
+FORT _const1_                   Format serial port registers
+
+IDLE                            Idle until interrupt
+
+IN   _ind_,_port_,_nextarp_     Input data from port
+IN   _ind_,_port_
+IN   _dma_,_port_
+
+LAC  _ind_,_shift_,_nextarp_    Load ACC with shift
+LAC  _ind_,_shift_
+LAC  _ind_
+LAC  _dma_,_shift_
+LAC  _dma_
+
+LACK _const8_                   Load ACC immediate short
+
+LACT _ind_,_nextarp_            Load ACC with shift specified by T reg
+LACT _ind_
+LACT _dma_
+
+LALK _const16_,_shift_          Load ACC long immediate with shift
+LALK _const16_
+
+LAR  _ar_,_ind_,_nextarp_       Load auxilary register
+LAR  _ar_,_ind_
+LAR  _ar_,_dma_
+
+LARK _ar_,_const8_              Load auxilary register immediate short
+
+LARP _arp_                      Load auxilary register pointer
+
+LDP  _ind_,_nextarp_            Load data memory page pointer
+LDP  _ind_
+LDP  _dma_
+
+LDPK _const8_                   Load data memory page pointer immediate
+
+LPH  _ind_,_nextarp_            Load high P register
+LPH  _ind_
+LPH  _dma_
+
+LRLK _ar_,_const16_             Load auxilary register long immediate
+
+LST  _ind_,_nextarp_            Load status register ST0
+LST  _ind_
+LST  _dma_
+
+LST1 _ind_,_nextarp_            Load status register ST1
+LST1 _ind_
+LST1 _dma_
+
+LT   _ind_,_nextarp_            Load T register
+LT   _ind_
+LT   _dma_
+
+LTA  _ind_,_nextarp_            Load T reg and accumulate prev product
+LTA  _ind_
+LTA  _dma_
+
+LTD  _ind_,_nextarp_            Load T reg, accum prev product & move
+LTD  _ind_
+LTD  _dma_
+
+LTP  _ind_,_nextarp_            Load T reg and store P in ACC
+LTP  _ind_
+LTP  _dma_
+
+LTS  _ind_,_nextarp_            Load T reg, subract previous product
+LTS  _ind_
+LTS  _dma_
+
+MAC  _pma_,_ind_,_nextarp_      Multiply and accumulate
+MAC  _pma_,_ind_
+MAC  _pma_,_dma_
+
+MACD _pma_,_ind_,_nextarp_      Multiply and accumulate with data move
+MACD _pma_,_ind_
+MACD _pma_,_dma_
+
+MAR  _ind_,_nextarp_            Modify auxiliary register
+MAR  _ind_
+MAR  _dma_
+
+MPY  _ind_,_nextarp_            Multiply
+MPY  _ind_
+MPY  _dma_
+
+MPYA _ind_,_nextarp_            Multiply and accum previous product
+MPYA _ind_
+MPYA _dma_
+
+MPYK _const13_                  Multiply immediate
+
+MPYS _ind_,_nextarp_            Multiply and subtract previous product
+MPYS _ind_
+MPYS _dma_
+
+MPYU _ind_,_nextarp_            Multiply unsigned
+MPYU _ind_
+MPYU _dma_
+
+NEG                             Negate ACC
+
+NOP                             No operation
+
+NORM _ind_                      Normalize contents of ACC
+NORM
+
+OR   _ind_,_nextarp_            Or with ACC
+OR   _ind_
+OR   _dma_
+
+ORK  _dma_,_shift_              Or immediate with ACC with shift
+ORK  _dma_
+
+OUT  _ind_,_shift_,_nextarp_    Output data to port
+OUT  _ind_,_shift_
+OUT  _dma_,_shift_
+
+PAC                             Load ACC with P register
+
+POP                             Pop top of stack to low ACC
+
+POPD _ind_,_nextarp_            Pop top of stack to data memory
+POPD _ind_
+POPD _dma_
+
+PSHD _ind_,_nextarp_            Push data memory value onto stack
+PSHD _ind_
+PSHD _dma_
+
+PUSH                            Push low ACC onto stack
+RC                              Reset carry bit
+RET                             Return from subroutine
+RFSM                            Reset serial port frame syn mode
+RHM                             Reset hold mode
+ROL                             Rotate ACC left
+ROR                             Rotate ACC right
+ROVM                            Reset overflow mode
+
+RPT  _ind_,_nextarp_            Repeat instructions as per data mem
+RPT  _ind_
+RPT  _dma_
+
+RPTK _const8_                   Repeat instructions as per immediate
+
+RSXM                            Reset sign extension mode
+RTC                             Reset test control flag
+RTXM                            Reset serial port transmit mode
+RXF                             Reset external flag
+
+SACH _ind_,_shift_,_nextarp_    Store high ACC with shift
+SACH _ind_,_shift_
+SACH _ind_
+SACH _dma_,_shift_
+SACH _dma_
+
+SACL _ind_,_shift_,_nextarp_    Store low ACC with shift
+SACL _ind_,_shift_
+SACL _ind_
+SACL _dma_,_shift_
+SACL _dma_
+
+SAR  _ar_,_ind_,_nextarp_       Store AUX register
+SAR  _ar_,_ind_
+SAR  _ar_,_dma_
+
+SBLK _const16_,_shift_          Subtract from ACC long immediate with shift
+SBLK _const16_
+
+SBRK _const8_                   Subtract from AUX register short immediate
+
+SC                              Set carry bit
+SFL                             Shift ACC left
+SFR                             Shift ACC right
+SFSM                            Set serial port frame sync mode
+SHM                             Set hold mode
+SOVM                            Set overflow mode
+SPAC                            Subtract P register from ACC
+
+SPH  _ind_,_nextarp_            Store high P register
+SPH  _ind_
+SPH  _dma_
+
+SPL  _ind_,_nextarp_            Store low P register
+SPL  _ind_
+SPL  _dma_
+
+SPM  _dma_                      Set P register output shift mode
+
+SQRA _ind_,_nextarp_            Square and accumulate previous product
+SQRA _ind_
+SQRA _dma_
+
+SQRS _ind_,_nextarp_            Square and subtract previous product
+SQRS _ind_
+SQRS _dma_
+
+SST  _ind_,_nextarp_            Store status register ST0
+SST  _ind_
+SST  _dma_
+
+SST1 _ind_,_nextarp_            Store status register ST1
+SST1 _ind_
+SST1 _dma_
+
+SSXM                            Set sign extension mode
+STC                             Set test/control flag
+STXM                            Set serial port transmit mode
+
+
+SUB  _ind_,_shift_,_nextarp_    Subtract from ACC with shift
+SUB  _ind_,_shift_
+SUB  _ind_
+SUB  _dma_,_shift_
+SUB  _dma_
+
+SUBB _ind_,_nextarp_            Subtract from ACC with borrow
+SUBB _ind_
+SUBB _dma_
+SUBC _ind_,_nextarp_            Subtract conditional
+SUBC _ind_
+SUBC _dma_
+
+SUBH _ind_,_nextarp_            Subtract from high ACC
+SUBH _ind_
+SUBH _dma_
+
+SUBK _const8_                   Subtract from ACC short immediate
+
+SUBS _ind_,_nextarp_            Subtract from low ACC without sign-extension
+SUBS _ind_
+SUBS _dma_
+
+SUBT _ind_,_nextarp_            Subtract from ACC with shift as per T reg
+SUBT _ind_
+SUBT _dma_
+
+SXF                             Set external flag
+
+TBLR _ind_,_nextarp_            Table read
+TBLR _ind_
+TBLR _dma_
+
+TBLW _ind_,_nextarp_            Table write
+TBLW _ind_
+TBLW _dma_
+
+TRAP                            Software interrupt
+
+XOR  _ind_,_nextarp_            Exclusive OR with ACC
+XOR  _ind_
+XOR  _dma_
+
+XORK_dma_,_shift_               Exclusive OR immediate ACC with shift
+XORK _dma_
+
+ZAC                             Zero ACC
+
+ZALH _ind_,_nextarp_            Zero low ACC and load high ACC
+ZALH _ind_
+ZALH _dma_
+
+ZALR _ind_,_nextarp_            Zero low ACC, load high ACC with rounding
+ZALR _ind_
+ZALR _dma_
+
+ZALS _ind_,_nextarp_            Zero ACC, load low ACC without sign-extension
+ZALS _ind_
+ZALS _dma_
+
+
+
+

TMS7000 INSTRUCTIONS AND ADDRESSING MODES

+

The following list shows the acceptable opcode mnemonics and their +corresponding operand formats for the TMS7000 version of TASM. The following +symbolic fields used in the table: +

+
SYMBOLIC        DESCRIPTION
+-------------------------------------------
+_iop_           Immediate data (8 bits)
+_Rn_            Register file (memory locations 0 to 127 or
+                   0 to 255 depending on on-chip RAM)
+_Pn_            Peripheral file (0-255)
+_rel_           Program address (relative)
+_addr_          Program address (16 bit)
+_trap_          Trap number (0-23)
+
+

Any valid TASM expression can appear in the place of any of the above +symbolics. +

+

Note that TASM allows an alternate syntax for expressing indirection. +Parenthesis can be replaced with brackets (which are less ambiguous because they +do not occur in expressions). Thus, the following are equivalent: +

+
    BR      @addr1(B)
+    BR      @addr1[B]
+
+
OPCODE  OPERANDS
+---------------------------------------
+ADC    B,A
+ADC    %_iop_,A
+ADC    %_iop_,B
+ADC    %_iop_,_Rn_
+ADC    _Rn_,A
+ADC    _Rn_,B
+ADC    _Rn_,_Rn_
+
+ADD    B,A
+ADD    %_iop_,A
+ADD    %_iop_,B
+ADD    %_iop_,_Rn_
+ADD    _Rn_,A
+ADD    _Rn_,B
+ADD    _Rn_,_Rn_
+
+AND    B,A
+AND    %_iop_,A
+AND    %_iop_,B
+AND    %_iop_,_Rn_
+AND    _Rn_,A
+AND    _Rn_,B
+AND    _Rn_,_Rn_
+
+ANDP   A,_Pn_
+ANDP   B,_Pn_
+ANDP   %_iop_,_Pn_
+
+BTJO   B,A,_rel_
+BTJO   %_iop_,A,_rel_
+BTJO   %_iop_,B,_rel_
+BTJO   %_iop_,_Rn_,_rel_
+BTJO   _Rn_,A,_rel_
+BTJO   _Rn_,B,_rel_
+BTJO   _Rn_,_Rn_,_rel_
+
+BTJOP  A,_Pn_,_rel_
+BTJOP  B,_Pn_,_rel_
+BTJOP  %_iop_,_Pn_,_rel_
+
+BTJZ   B,A,_rel_
+BTJZ   %_iop_,A,_rel_
+BTJZ   %_iop_,B,_rel_
+BTJZ   %_iop_,_Rn_,_rel_
+BTJZ   _Rn_,A,_rel_
+BTJZ   _Rn_,B,_rel_
+BTJZ   _Rn_,_Rn_,_rel_
+
+BTJZP  A,_Pn_,_rel_
+BTJZP  B,_Pn_,_rel_
+BTJZP  %_iop_,_Pn_,_rel_
+
+BR      @_addr_(B)
+BR      @_addr_[B]
+BR      @_addr_
+BR      *_Rn_
+
+CALL    @_addr_(B)
+CALL    @_addr_[B]
+CALL    @_addr_
+CALL    *_Rn_
+
+CLR     A
+CLR     B
+CLR     _Rn_
+CLRC
+
+CMP     B,A
+CMP     %_iop_,A
+CMP     %_iop_,B
+CMP     %_iop_,_Rn_
+CMP     _Rn_,A
+CMP     _Rn_,B
+CMP     _Rn_,_Rn_
+
+CMPA    @_addr_(B)
+CMPA    @_addr_[B]
+CMPA    @_addr_
+CMPA    *_Rn_
+
+DAC     B,A
+DAC     %_iop_,A
+DAC     %_iop_,B
+DAC     %_iop_,_Rn_
+DAC     _Rn_,A
+DAC     _Rn_,B
+DAC     _Rn_,_Rn_
+
+DEC     A
+DEC     B
+DEC     _Rn_
+
+DECD    A
+DECD    B
+DECD    _Rn_
+
+DINT
+
+DJNZ    A,_rel_
+DJNZ    B,_rel_
+DJNZ    _Rn_,_rel_
+
+DSB     B,A
+DSB     %_iop_,A
+DSB     %_iop_,B
+DSB     %_iop_,_Rn_
+DSB     _Rn_,A
+DSB     _Rn_,B
+DSB     _Rn_,_Rn_
+
+EINT
+IDLE
+
+INC     A
+INC     B
+INC     _Rn_
+
+INV     A
+INV     B
+INV     _Rn_
+
+JMP     _rel_
+
+JC      _rel_
+JEQ     _rel_
+JGE     _rel_
+JGT     _rel_
+JHS     _rel_
+JL      _rel_
+JN      _rel_
+JNC     _rel_
+JNE     _rel_
+JNZ     _rel_
+JP      _rel_
+JPZ     _rel_
+JZ      _rel_
+
+LDA     @_addr_(B)
+LDA     @_addr_[B]
+LDA     @_addr_
+LDA     *_Rn_
+
+LDSP
+
+MOV     A,B
+MOV     B,A
+MOV     A,_Rn_
+MOV     B,_Rn_
+MOV     %_iop_,A
+MOV     %_iop_,B
+MOV     %_iop_,_Rn_
+MOV     _Rn_,A
+MOV     _Rn_,B
+MOV     _Rn_,_Rn_
+
+MOVD    %_iop_[B],_Rn_
+MOVD    %_iop_,_Rn_
+MOVD    _Rn_,_Rn_
+
+MOVP    A,_Pn_
+MOVP    B,_Pn_
+MOVP    %_iop_,_Pn_
+MOVP    _Pn_,A
+MOVP    _Pn_,B
+
+MPY     B,A
+MPY     %_iop_,A
+MPY     %_iop_,B
+MPY     %_iop_,_Rn_
+MPY     _Rn_,A
+MPY     _Rn_,B
+MPY     _Rn_,_Rn_
+
+NOP
+
+OR      B,A
+OR      %_iop_,A
+OR      %_iop_,B
+OR      %_iop_,_Rn_
+OR      _Rn_,A
+OR      _Rn_,B
+OR      _Rn_,_Rn_
+
+ORP     A,_Pn_
+ORP     B,_Pn_
+ORP     %_iop_,_Pn_
+
+POP     A
+POP     B
+POP     ST
+POP     _Rn_
+POPST
+
+PUSH    A
+PUSH    B
+PUSH    ST
+PUSH    _Rn_
+PUSHST
+
+RETI
+
+RETS
+
+RL      A
+RL      B
+RL      _Rn_
+
+RLC     A
+RLC     B
+RLC     _Rn_
+
+RR      A
+RR      B
+RR      _Rn_
+
+RRC     A
+RRC     B
+RRC     _Rn_
+
+SBB     B,A
+SBB     %_iop_,A
+SBB     %_iop_,B
+SBB     %_iop_,_Rn_
+SBB     _Rn_,A
+SBB     _Rn_,B
+SBB     _Rn_,_Rn_
+
+SETC
+
+STA     @_addr_(B)
+STA     @_addr_[B]
+STA     @_addr_
+STA     *_Rn_
+
+STSP
+
+SUB     B,A
+SUB     %_iop_,A
+SUB     %_iop_,B
+SUB     %_iop_,_Rn_
+SUB     _Rn_,A
+SUB     _Rn_,B
+SUB     _Rn_,_Rn_
+
+SWAP    A
+SWAP    B
+SWAP    _Rn_
+
+TRAP    _trap_
+
+TST     A
+TSTA
+TST     B
+TSTB
+
+XCHB    A
+XCHB    _Rn_
+
+XOR     B,A
+XOR     %_iop_,A
+XOR     %_iop_,B
+XOR     %_iop_,_Rn_
+XOR     _Rn_,A
+XOR     _Rn_,B
+XOR     _Rn_,_Rn_
+
+XORP    A,_Pn_
+XORP    B,_Pn_
+XORP    %_iop_,_Pn_
+
+
diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/8051.h b/branches/dwg/LSource/src/tasm-src-3.2/Examples/8051.h new file mode 100644 index 00000000..59ebfa0e --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/8051.h @@ -0,0 +1,162 @@ +;************************************************************* +;* TASM 8051/8052/80154 SFR BIT/BYTE MNEMONIC EQUATES LIST * +;************************************************************* + +P0 .equ 080H ;Port 0 +SP .equ 081H ;Stack pointer +DPL .equ 082H +DPH .equ 083H +PCON .equ 087H +TCON .equ 088H +TMOD .equ 089H +TL0 .equ 08AH +TL1 .equ 08BH +TH0 .equ 08CH +TH1 .equ 08DH +P1 .equ 090H ;Port 1 +SCON .equ 098H +SBUF .equ 099H +P2 .equ 0A0H ;Port 2 +IE .equ 0A8H +P3 .equ 0B0H ;Port 3 +IP .equ 0B8H +T2CON .equ 0C8H ;8052, 80154 only +RCAP2L .equ 0CAH ;8052, 80154 only +RCAP2H .equ 0CBH ;8052, 80154 only +TL2 .equ 0CCH ;8052, 80154 only +TH2 .equ 0CDH ;8052, 80154 only +PSW .equ 0D0H +ACC .equ 0E0H ;Accumulator +B .equ 0F0H ;Secondary Accumulator +IOCON .equ 0F8H ;80154 only + +;PORT 0 BITS +P0.0 .equ 080H ;Port 0 bit 0 +P0.1 .equ 081H ;Port 0 bit 1 +P0.2 .equ 082H ;Port 0 bit 2 +P0.3 .equ 083H ;Port 0 bit 3 +P0.4 .equ 084H ;Port 0 bit 4 +P0.5 .equ 085H ;Port 0 bit 5 +P0.6 .equ 086H ;Port 0 bit 6 +P0.7 .equ 087H ;Port 0 bit 7 + +;PORT 1 BITS +P1.0 .equ 090H ;Port 1 bit 0 +P1.1 .equ 091H ;Port 1 bit 1 +P1.2 .equ 092H ;Port 1 bit 2 +P1.3 .equ 093H ;Port 1 bit 3 +P1.4 .equ 094H ;Port 1 bit 4 +P1.5 .equ 095H ;Port 1 bit 5 +P1.6 .equ 096H ;Port 1 bit 6 +P1.7 .equ 097H ;Port 1 bit 7 + +;PORT 2 BITS +P2.0 .equ 0A0H ;Port 2 bit 0 +P2.1 .equ 0A1H ;Port 2 bit 1 +P2.2 .equ 0A2H ;Port 2 bit 2 +P2.3 .equ 0A3H ;Port 2 bit 3 +P2.4 .equ 0A4H ;Port 2 bit 4 +P2.5 .equ 0A5H ;Port 2 bit 5 +P2.6 .equ 0A6H ;Port 2 bit 6 +P2.7 .equ 0A7H ;Port 2 bit 7 + +;PORT 3 BITS +P3.0 .equ 0B0H ;Port 3 bit 0 +P3.1 .equ 0B1H ;Port 3 bit 1 +P3.2 .equ 0B2H ;Port 3 bit 2 +P3.3 .equ 0B3H ;Port 3 bit 3 +P3.4 .equ 0B4H ;Port 3 bit 4 +P3.5 .equ 0B5H ;Port 3 bit 5 +P3.6 .equ 0B6H ;Port 3 bit 6 +P3.7 .equ 0B7H ;Port 3 bit 7 + +;ACCUMULATOR BITS +ACC.0 .equ 0E0H ;Acc bit 0 +ACC.1 .equ 0E1H ;Acc bit 1 +ACC.2 .equ 0E2H ;Acc bit 2 +ACC.3 .equ 0E3H ;Acc bit 3 +ACC.4 .equ 0E4H ;Acc bit 4 +ACC.5 .equ 0E5H ;Acc bit 5 +ACC.6 .equ 0E6H ;Acc bit 6 +ACC.7 .equ 0E7H ;Acc bit 7 + +;B REGISTER BITS +B.0 .equ 0F0H ;Breg bit 0 +B.1 .equ 0F1H ;Breg bit 1 +B.2 .equ 0F2H ;Breg bit 2 +B.3 .equ 0F3H ;Breg bit 3 +B.4 .equ 0F4H ;Breg bit 4 +B.5 .equ 0F5H ;Breg bit 5 +B.6 .equ 0F6H ;Breg bit 6 +B.7 .equ 0F7H ;Breg bit 7 + +;PSW REGISTER BITS +P .equ 0D0H ;Parity flag +F1 .equ 0D1H ;User flag 1 +OV .equ 0D2H ;Overflow flag +RS0 .equ 0D3H ;Register bank select 1 +RS1 .equ 0D4H ;Register bank select 0 +F0 .equ 0D5H ;User flag 0 +AC .equ 0D6H ;Auxiliary carry flag +CY .equ 0D7H ;Carry flag + +;TCON REGISTER BITS +IT0 .equ 088H ;Intr 0 type control +IE0 .equ 089H ;Intr 0 edge flag +IT1 .equ 08AH ;Intr 1 type control +IE1 .equ 08BH ;Intr 1 edge flag +TR0 .equ 08CH ;Timer 0 run +TF0 .equ 08DH ;Timer 0 overflow +TR1 .equ 08EH ;Timer 1 run +TF1 .equ 08FH ;Timer 1 overflow + +;SCON REGISTER BITS +RI .equ 098H ;RX Intr flag +TI .equ 099H ;TX Intr flag +RB8 .equ 09AH ;RX 9th bit +TB8 .equ 09BH ;TX 9th bit +REN .equ 09CH ;Enable RX flag +SM2 .equ 09DH ;8/9 bit select flag +SM1 .equ 09EH ;Serial mode bit 1 +SM0 .equ 09FH ;Serial mode bit 0 + +;IE REGISTER BITS +EX0 .equ 0A8H ;External intr 0 +ET0 .equ 0A9H ;Timer 0 intr +EX1 .equ 0AAH ;External intr 1 +ET1 .equ 0ABH ;Timer 1 intr +ES .equ 0ACH ;Serial port intr +ET2 .equ 0ADH ;Timer 2 intr +;Reserved 0AEH Reserved +EA .equ 0AFH ;Global intr enable + +;IP REGISTER BITS +PX0 .equ 0B8H ;Priority level-External intr 0 +PT0 .equ 0B9H ;Priority level-Timer 0 intr +PX1 .equ 0BAH ;Priority level-External intr 1 +PT1 .equ 0BBH ;Priority level-Timer 1 intr +PS .equ 0BCH ;Priority level-Serial port intr +PT2 .equ 0BDH ;Priority level-Timer 2 intr +;Reserved 0BEH Reserved +PCT .equ 0BFH ;Global priority level + +;IOCON REGISTER BITS 80154 ONLY +ALF .equ 0F8H ;Power down port condition +P1HZ .equ 0F9H ;Port 1 control +P2HZ .equ 0FAH ;Port 2 control +P3HZ .equ 0FBH ;Port 3 control +IZC .equ 0FCH ;Pullup select +SERR .equ 0FDH ;Serial reception error +T32 .equ 0FEH ;32 bit timer config +WDT .equ 0FFH ;Watchdog config + +;T2CON REGISTER BITS 8052/80154 ONLY +CP/RL2 .equ 0C8H ;Timer 2 capture/reload flag +C/T2 .equ 0C9H ;Timer 2 timer/counter select +TR2 .equ 0CAH ;Timer 2 start/stop +EXEN2 .equ 0CBH ;Timer 2 external enable +TCLK .equ 0CCH ;TX clock flag +RCLK .equ 0CDH ;RX clock flag +EXF2 .equ 0CEH ;Timer 2 external flag +TF2 .equ 0CFH ;Timer 2 overflow + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/moto.h b/branches/dwg/LSource/src/tasm-src-3.2/Examples/moto.h new file mode 100644 index 00000000..989689b2 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/moto.h @@ -0,0 +1,20 @@ +; A few handy defines to make TASM more like typcial +; motorola syntax + +.MSFIRST ; Most Significant byte first + +#define EQU .EQU +#define ORG .ORG +#define RMB .BLOCK +#define FCB .BYTE +#define FCC .TEXT +#define FDB .WORD + +#define equ .EQU +#define org .ORG +#define rmb .BLOCK +#define fcb .BYTE +#define fcc .TEXT +#define fdb .WORD + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test05.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test05.asm new file mode 100644 index 00000000..a8f7b88f --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test05.asm @@ -0,0 +1,251 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test05.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 6805 +; + + + .org 0 +bit3 .equ 3 +data .equ $12 + .block $46 +addz .equ $46 + + .org $1007 +addr: + ADC #data ;A9 2 NOP 1 + ADC ,X ;F9 1 NOP 1 + ADC addr,X ;D9 3 MZERO 1 + ADC addz,X ;D9 3 MZERO 1 + ADC addr ;C9 3 MZERO 1 + ADC addz ;C9 3 MZERO 1 + + ADD #data ;AB 2 NOP 1 + ADD ,X ;FB 1 NOP 1 + ADD addr,X ;DB 3 MZERO 1 + ADD addz,X ;DB 3 MZERO 1 + ADD addr ;CB 3 MZERO 1 + ADD addz ;CB 3 MZERO 1 + + AND #data ;A4 2 NOP 1 + AND ,X ;F4 1 NOP 1 + AND addr,X ;D4 3 MZERO 1 + AND addz,X ;D4 3 MZERO 1 + AND addr ;C4 3 MZERO 1 + AND addz ;C4 3 MZERO 1 + + ASLA ;48 1 NOP 1 + ASLX ;58 1 NOP 1 + ASL ,X ;78 1 NOP 1 + ASL addz,X ;68 2 NOP 1 + ASL addz ;38 2 NOP 1 + + ASRA ;47 1 NOP 1 + ASRX ;57 1 NOP 1 + ASR ,X ;77 1 NOP 1 + ASR addz,X ;37 2 NOP 1 + ASR addz ;37 2 NOP 1 + +loop1: + BCC loop1 ;24 2 R1 1 + BCS loop1 ;25 2 R1 1 + BEQ loop1 ;27 2 R1 1 + BHCC loop1 ;28 2 R1 1 + BHCS loop1 ;29 2 R1 1 + BHI loop1 ;22 2 R1 1 + BHS loop1 ;24 2 R1 1 + BIH loop1 ;2F 2 R1 1 + BIL loop1 ;2E 2 R1 1 + + BIT #data ;A5 2 NOP 1 + BIT ,X ;F5 1 NOP 1 + BIT addr,X ;D5 3 MZERO 1 + BIT addz,X ;C5 3 MZERO 1 + BIT addr ;C5 3 MZERO 1 + BIT addz ;C5 3 MZERO 1 + + BLO loop1 ;25 2 R1 1 + BLS loop1 ;23 2 R1 1 + BMC loop1 ;2C 2 R1 1 + BMI loop1 ;2B 2 R1 1 + BMS loop1 ;2D 2 R1 1 + BNE loop1 ;26 2 R1 1 + BPL loop1 ;2A 2 R1 1 + BRA loop1 ;20 2 R1 1 + BRN loop1 ;21 2 R1 1 + BSR loop1 ;AD 2 R1 1 + + BRCLR bit3,addz,loop1 ;01 3 MBIT 1 + BRSET bit3,addz,loop1 ;00 3 MBIT 1 + + BCLR bit3,addz ;11 2 MBIT 1 + BSET bit3,addz ;10 2 MBIT 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 addz,X ;6F 2 NOP 1 + CLR addz ;3F 2 NOP 1 + + CMP #data ;A1 2 NOP 1 + CMP ,X ;F1 1 NOP 1 + CMP addr,X ;D1 3 MZERO 1 + CMP addz,X ;D1 3 MZERO 1 + CMP addr ;C1 3 MZERO 1 + CMP addz ;C1 3 MZERO 1 + + COMA ;43 1 NOP 1 + COMX ;53 1 NOP 1 + COM ,X ;73 1 NOP 1 + COM addz,X ;63 2 NOP 1 + COM addz ;33 2 NOP 1 + + CPX #data ;A3 2 NOP 1 + CPX ,X ;F3 1 NOP 1 + CPX addr,X ;D3 3 MZERO 1 + CPX addz,X ;D3 3 MZERO 1 + CPX addr ;C3 3 MZERO 1 + CPX addz ;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 addz,X ;6A 2 NOP 1 + DEC addz ;3A 2 NOP 1 + + EOR #data ;A8 2 NOP 1 + EOR ,X ;F8 1 NOP 1 + EOR addr,X ;D8 3 MZERO 1 + EOR addz,X ;D8 3 MZERO 1 + EOR addr ;C8 3 MZERO 1 + EOR addz ;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 addz,X ;6C 2 NOP 1 + INC addz ;3C 2 NOP 1 + + JMP ,X ;FC 1 NOP 1 + JMP addr,X ;DC 3 MZERO 1 + JMP addz,X ;DC 3 MZERO 1 + JMP addr ;CC 3 MZERO 1 + JMP addz ;CC 3 MZERO 1 + + JSR ,X ;FD 1 NOP 1 + JSR addr,X ;DD 3 MZERO 1 + JSR addz,X ;DD 3 MZERO 1 + JSR addr ;CD 3 MZERO 1 + JSR addz ;CD 3 MZERO 1 + + LDA #data ;A6 2 NOP 1 + LDA ,X ;F6 1 NOP 1 + LDA addr,X ;D6 3 MZERO 1 + LDA addz,X ;D6 3 MZERO 1 + LDA addr ;C6 3 MZERO 1 + LDA addz ;C6 3 MZERO 1 + + LDX #data ;AE 2 NOP 1 + LDX ,X ;FE 1 NOP 1 + LDX addr,X ;DE 3 MZERO 1 + LDX addz,X ;DE 3 MZERO 1 + LDX addr ;CE 3 MZERO 1 + LDX addz ;CE 3 MZERO 1 + + LSLA ;48 1 NOP 1 + LSLX ;58 1 NOP 1 + LSL ,X ;78 1 NOP 1 + LSL addz,X ;68 2 NOP 1 + LSL addz ;38 2 NOP 1 + + LSRA ;44 1 NOP 1 + LSRX ;54 1 NOP 1 + LSR ,X ;74 1 NOP 1 + LSR addz,X ;64 2 NOP 1 + LSR addz ;34 2 NOP 1 + + NEGA ;40 1 NOP 1 + NEGX ;50 1 NOP 1 + NEG ,X ;70 1 NOP 1 + NEG addz,X ;60 2 NOP 1 + NEG addz ;30 2 NOP 1 + + NOP ;9D 1 NOP 1 + + ORA #data ;AA 2 NOP 1 + ORA ,X ;FA 1 NOP 1 + ORA addr,X ;DA 3 MZERO 1 + ORA addz,X ;DA 3 MZERO 1 + ORA addr ;CA 3 MZERO 1 + ORA addz ;CA 3 MZERO 1 + + ROLA ;49 1 NOP 1 + ROLX ;59 1 NOP 1 + ROL ,X ;79 1 NOP 1 + ROL addz,X ;69 2 NOP 1 + ROL addz ;39 2 NOP 1 + + RORA ;46 1 NOP 1 + RORX ;56 1 NOP 1 + ROR ,X ;76 1 NOP 1 + ROR addz,X ;66 2 NOP 1 + ROR addz ;36 2 NOP 1 + + RSP ;9C 1 NOP 1 + RTI ;80 1 NOP 1 + RTS ;81 1 NOP 1 + + SBC #data ;A2 2 NOP 1 + SBC ,X ;F2 1 NOP 1 + SBC addr,X ;D2 3 MZERO 1 + SBC addz,X ;D2 3 MZERO 1 + SBC addr ;C2 3 MZERO 1 + SBC addz ;C2 3 MZERO 1 + + SEC ;99 1 NOP 1 + SEI ;9B 1 NOP 1 + + STA ,X ;F7 1 NOP 1 + STA addr,X ;D7 3 MZERO 1 + STA addz,X ;D7 3 MZERO 1 + STA addr ;C7 3 MZERO 1 + STA addz ;C7 3 MZERO 1 + + STOP ;8E 1 NOP 1 + + STX ,X ;FF 1 NOP 1 + STX addr,X ;DF 3 MZERO 1 + STX addz,X ;DF 3 MZERO 1 + STX addr ;CF 3 MZERO 1 + STX addz ;CF 3 MZERO 1 + + SUB #data ;A0 2 NOP 1 + SUB ,X ;F0 1 NOP 1 + SUB addr,X ;D0 3 MZERO 1 + SUB addz,X ;D0 3 MZERO 1 + SUB addr ;C0 3 MZERO 1 + SUB addz ;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 addz,X ;6D 2 NOP 1 + TST addz ;3D 2 NOP 1 + + TXA ;9F 1 NOP 1 + + WAIT ;8F 1 NOP 1 + .end diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3210.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3210.asm new file mode 100644 index 00000000..009bfe5d --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3210.asm @@ -0,0 +1,328 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test3210.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: TMS32010 +; + + + .org 100h +shift .equ 4 +shift0 .equ 0 +addr .equ 12h +port .equ 2 +arp .equ 1 +ar .equ 1 +const .equ 34h +const1 .equ 1h + + ABS ;7F88 2 NOP 1 + + ADD *+,shift,arp ;00A0 2 T1 1 8 0F00 + ADD *-,shift,arp ;0090 2 T1 1 8 0F00 + ADD *,shift,arp ;0080 2 T1 1 8 0F00 + ADD *+,shift ;00A8 2 T1 1 8 0F00 + ADD *-,shift ;0098 2 T1 1 8 0F00 + ADD *,shift ;0088 2 T1 1 8 0F00 + ADD *+ ;00A8 2 NOP 1 + ADD *- ;0098 2 NOP 1 + ADD * ;0088 2 NOP 1 + ADD addr,shift ;0000 2 TDMA 1 8 0F00 + ADD addr ;0000 2 T1 1 0 007F + + ADDH *+,arp ;60A0 2 T1 1 0 01 + ADDH *-,arp ;6090 2 T1 1 0 01 + ADDH *,arp ;6080 2 T1 1 0 01 + ADDH *+ ;60A8 2 NOP 1 + ADDH *- ;6098 2 NOP 1 + ADDH * ;6088 2 NOP 1 + ADDH addr ;6000 2 T1 1 0 007F + + ADDS *+,arp ;61A0 2 T1 1 0 01 + ADDS *-,arp ;6190 2 T1 1 0 01 + ADDS *,arp ;6180 2 T1 1 0 01 + ADDS *+ ;61A8 2 NOP 1 + ADDS *- ;6198 2 NOP 1 + ADDS * ;6188 2 NOP 1 + ADDS addr ;6100 2 T1 1 0 007F + + AND *+,arp ;79A0 2 T1 1 0 01 + AND *-,arp ;7990 2 T1 1 0 01 + AND *,arp ;7980 2 T1 1 0 01 + AND *+ ;79A8 2 NOP 1 + AND *- ;7998 2 NOP 1 + AND * ;7988 2 NOP 1 + AND addr ;7900 2 T1 1 0 7F + + APAC ;7F8F 2 NOP 1 + +loop1: + B loop1 ;F900 4 SWAP 1 + BANZ loop1 ;F400 4 SWAP 1 + BGEZ loop1 ;FD00 4 SWAP 1 + BGZ loop1 ;FC00 4 SWAP 1 + BIOZ loop1 ;F600 4 SWAP 1 + BLEZ loop1 ;FB00 4 SWAP 1 + BLZ loop1 ;FA00 4 SWAP 1 + BNZ loop1 ;FE00 4 SWAP 1 + BV loop1 ;F500 4 SWAP 1 + BZ loop1 ;FF00 4 SWAP 1 + + CALA ;7F8C 2 NOP 1 + CALL loop1 ;F800 4 SWAP 1 + DINT ;7F81 2 NOP 1 + + DMOV *+,arp ;69A0 2 T1 1 0 01 + DMOV *-,arp ;6990 2 T1 1 0 01 + DMOV *,arp ;6980 2 T1 1 0 01 + DMOV *+ ;69A8 2 NOP 1 + DMOV *- ;6998 2 NOP 1 + DMOV * ;6988 2 NOP 1 + DMOV addr ;6900 2 T1 1 0 007F + + EINT ;7F82 2 NOP 1 + + IN *+,port ,arp ;40A0 2 T1 1 8 0700 + IN *-,port ,arp ;4090 2 T1 1 8 0700 + IN * ,port ,arp ;4080 2 T1 1 8 0700 + IN *+,port ;40A8 2 T1 1 8 0700 + IN *-,port ;4098 2 T1 1 8 0700 + IN * ,port ;4088 2 T1 1 8 0700 + IN addr,port ;4000 2 TDMA 1 8 0700 + + LAC *+,shift,arp ;20A0 2 T1 1 8 0F00 + LAC *-,shift,arp ;2090 2 T1 1 8 0F00 + LAC *,shift,arp ;2080 2 T1 1 8 0F00 + LAC *+,shift ;20A8 2 T1 1 8 0F00 + LAC *-,shift ;2098 2 T1 1 8 0F00 + LAC *,shift ;2088 2 T1 1 8 0F00 + LAC *+ ;20A8 2 NOP 1 + LAC *- ;2098 2 NOP 1 + LAC * ;2088 2 NOP 1 + LAC addr,shift ;2000 2 TDMA 1 8 0F00 + LAC addr ;2000 2 T1 1 0 007F + + LACK const ;7E00 2 T1 1 0 00FF + + LAR ar,*+,arp ;38A0 2 TAR 1 0 0001 + LAR ar,*-,arp ;3890 2 TAR 1 0 0001 + LAR ar,*,arp ;3880 2 TAR 1 0 0001 + LAR ar,*+ ;38A8 2 TAR 1 0 0001 + LAR ar,*- ;3898 2 TAR 1 0 0001 + LAR ar,* ;3888 2 TAR 1 0 0001 + LAR ar, addr ;3800 2 TAR 1 0 007F + + LARK ar,const ;7000 2 TAR 1 0 00FF + LARP const1 ;6880 2 T1 1 0 0001 + + LDP *+,arp ;6FA0 2 T1 1 0 01 + LDP *-,arp ;6F90 2 T1 1 0 01 + LDP *,arp ;6F80 2 T1 1 0 01 + LDP *+ ;6FA8 2 NOP 1 + LDP *- ;6F98 2 NOP 1 + LDP * ;6F88 2 NOP 1 + LDP addr ;6F00 2 T1 1 0 007F + + LDPK const1 ;6E00 2 T1 1 0 01 + + LST *+,arp ;7BA0 2 T1 1 0 01 + LST *-,arp ;7B90 2 T1 1 0 01 + LST *,arp ;7B80 2 T1 1 0 01 + LST *+ ;7BA8 2 NOP 1 + LST *- ;7B98 2 NOP 1 + LST * ;7B88 2 NOP 1 + LST addr ;7B00 2 T1 1 0 007F + + LT *+,arp ;6AA0 2 T1 1 0 01 + LT *-,arp ;6A90 2 T1 1 0 01 + LT *,arp ;6A80 2 T1 1 0 01 + LT *+ ;6AA8 2 NOP 1 + LT *- ;6A98 2 NOP 1 + LT * ;6A88 2 NOP 1 + LT addr ;6A00 2 T1 1 0 007F + + LTA *+,arp ;6CA0 2 T1 1 0 01 + LTA *-,arp ;6C90 2 T1 1 0 01 + LTA *,arp ;6C80 2 T1 1 0 01 + LTA *+ ;6CA8 2 NOP 1 + LTA *- ;6C98 2 NOP 1 + LTA * ;6C88 2 NOP 1 + LTA addr ;6C00 2 T1 1 0 007F + + LTD *+,arp ;6BA0 2 T1 1 0 01 + LTD *-,arp ;6B90 2 T1 1 0 01 + LTD *,arp ;6B80 2 T1 1 0 01 + LTD *+ ;6BA8 2 NOP 1 + LTD *- ;6B98 2 NOP 1 + LTD * ;6B88 2 NOP 1 + LTD addr ;6B00 2 T1 1 0 007F + + MAR *+,arp ;68A0 2 T1 1 0 01 + MAR *-,arp ;6890 2 T1 1 0 01 + MAR *,arp ;6880 2 T1 1 0 01 + MAR *+ ;68A8 2 NOP 1 + MAR *- ;6898 2 NOP 1 + MAR * ;6888 2 NOP 1 + MAR addr ;6800 2 T1 1 0 007F + + MPY *+,arp ;6DA0 2 T1 1 0 01 + MPY *-,arp ;6D90 2 T1 1 0 01 + MPY *,arp ;6D80 2 T1 1 0 01 + MPY *+ ;6DA8 2 NOP 1 + MPY *- ;6D98 2 NOP 1 + MPY * ;6D88 2 NOP 1 + MPY addr ;6D00 2 T1 1 0 007F + + MPYK const ;8000 2 T1 1 0 1FFF + + NOP ;7F80 2 NOP 1 + + OR *+,arp ;7AA0 2 T1 1 0 01 + OR *-,arp ;7A90 2 T1 1 0 01 + OR *,arp ;7A80 2 T1 1 0 01 + OR *+ ;7AA8 2 NOP 1 + OR *- ;7A98 2 NOP 1 + OR * ;7A88 2 NOP 1 + OR addr ;7A00 2 T1 1 0 007F + + OUT *+,port,arp ;48A0 2 T1 1 8 0700 + OUT *-,port,arp ;4890 2 T1 1 8 0700 + OUT *, port,arp ;4880 2 T1 1 8 0700 + OUT *+,port ;48A8 2 T1 1 8 0700 + OUT *-,port ;4898 2 T1 1 8 0700 + OUT *, port ;4888 2 T1 1 8 0700 + OUT addr,port ;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 + +;Note that shift count can only be 0,1, or 4. +;Mask also allows 5. Beware. + SACH *+,shift,arp ;58A0 2 T1 1 8 0500 + SACH *-,shift,arp ;5890 2 T1 1 8 0500 + SACH *, shift,arp ;5880 2 T1 1 8 0500 + SACH *+,shift ;58A8 2 T1 1 8 0500 + SACH *-,shift ;5898 2 T1 1 8 0500 + SACH *, shift ;5888 2 T1 1 8 0500 + SACH *+ ;58A8 2 NOP 1 + SACH *- ;5898 2 NOP 1 + SACH * ;5888 2 NOP 1 + SACH addr,shift ;5800 2 TDMA 1 8 0500 + SACH addr ;5800 2 T1 1 0 007F + +; Shift count must be zero for SACL + SACL *+,shift0,arp ;50A0 2 T1 1 8 0000 + SACL *-,shift0,arp ;5090 2 T1 1 8 0000 + SACL *, shift0,arp ;5080 2 T1 1 8 0000 + SACL *+,shift0 ;50A8 2 T1 1 8 0000 + SACL *-,shift0 ;5098 2 T1 1 8 0000 + SACL *, shift0 ;5088 2 T1 1 8 0000 + SACL *+ ;50A8 2 NOP 1 + SACL *- ;5098 2 NOP 1 + SACL * ;5088 2 NOP 1 + SACL addr,shift0 ;5000 2 TDMA 1 8 0000 + SACL addr ;5000 2 T1 1 0 007F + + SAR ar,*+,arp ;30A0 2 TAR 1 0 0001 + SAR ar,*-,arp ;3090 2 TAR 1 0 0001 + SAR ar,*,arp ;3080 2 TAR 1 0 0001 + SAR ar,*+ ;30A8 2 TAR 1 0 0001 + SAR ar,*- ;3098 2 TAR 1 0 0001 + SAR ar,* ;3088 2 TAR 1 0 0001 + SAR ar,addr ;3000 2 TAR 1 0 007F + + SOVM ;7F8B 2 NOP 1 + SPAC ;7F90 2 NOP 1 + + SST *+,arp ;7CA0 2 T1 1 0 0001 + SST *-,arp ;7C90 2 T1 1 0 0001 + SST *,arp ;7C80 2 T1 1 0 0001 + SST *+ ;7CA8 2 NOP 1 + SST *- ;7C98 2 NOP 1 + SST * ;7C88 2 NOP 1 + SST addr ;7C00 2 T1 1 0 007F + + SUB *+,shift,arp ;10A0 2 T1 1 8 0F00 + SUB *-,shift,arp ;1090 2 T1 1 8 0F00 + SUB *, shift,arp ;1080 2 T1 1 8 0F00 + SUB *+,shift ;10A8 2 T1 1 8 0F00 + SUB *-,shift ;1098 2 T1 1 8 0F00 + SUB *, shift ;1088 2 T1 1 8 0F00 + SUB *+ ;10A8 2 NOP 1 + SUB *- ;1098 2 NOP 1 + SUB * ;1088 2 NOP 1 + SUB addr,shift ;1000 2 TDMA 1 8 0F00 + SUB addr ;1000 2 T1 1 0 007F + + SUBC *+,arp ;64A0 2 T1 1 0 01 + SUBC *-,arp ;6490 2 T1 1 0 01 + SUBC *,arp ;6480 2 T1 1 0 01 + SUBC *+ ;64A8 2 NOP 1 + SUBC *- ;6498 2 NOP 1 + SUBC * ;6488 2 NOP 1 + SUBC addr ;6400 2 T1 1 0 007F + + SUBH *+,arp ;62A0 2 T1 1 0 01 + SUBH *-,arp ;6290 2 T1 1 0 01 + SUBH *,arp ;6280 2 T1 1 0 01 + SUBH *+ ;62A8 2 NOP 1 + SUBH *- ;6298 2 NOP 1 + SUBH * ;6288 2 NOP 1 + SUBH addr ;6200 2 T1 1 0 007F + + SUBS *+,arp ;63A0 2 T1 1 0 01 + SUBS *-,arp ;6390 2 T1 1 0 01 + SUBS *,arp ;6380 2 T1 1 0 01 + SUBS *+ ;63A8 2 NOP 1 + SUBS *- ;6398 2 NOP 1 + SUBS * ;6388 2 NOP 1 + SUBS addr ;6300 2 T1 1 0 007F + + TBLR *+,arp ;67A0 2 T1 1 0 01 + TBLR *-,arp ;6790 2 T1 1 0 01 + TBLR *,arp ;6780 2 T1 1 0 01 + TBLR *+ ;67A8 2 NOP 1 + TBLR *- ;6798 2 NOP 1 + TBLR * ;6788 2 NOP 1 + TBLR addr ;6700 2 T1 1 0 007F + + TBLW *+,arp ;7DA0 2 T1 1 0 01 + TBLW *-,arp ;7D90 2 T1 1 0 01 + TBLW *,arp ;7D80 2 T1 1 0 01 + TBLW *+ ;7DA8 2 NOP 1 + TBLW *- ;7D98 2 NOP 1 + TBLW * ;7D88 2 NOP 1 + TBLW addr ;7D00 2 T1 1 0 007F + + XOR *+,arp ;78A0 2 T1 1 0 01 + XOR *-,arp ;7890 2 T1 1 0 01 + XOR *,arp ;7880 2 T1 1 0 01 + XOR *+ ;78A8 2 NOP 1 + XOR *- ;7898 2 NOP 1 + XOR * ;7888 2 NOP 1 + XOR addr ;7800 2 T1 1 0 007F + + ZAC ;7F89 2 NOP 1 + + ZALH *+,arp ;65A0 2 T1 1 0 01 + ZALH *-,arp ;6590 2 T1 1 0 01 + ZALH *,arp ;6580 2 T1 1 0 01 + ZALH *+ ;65A8 2 NOP 1 + ZALH *- ;6598 2 NOP 1 + ZALH * ;6588 2 NOP 1 + ZALH addr ;6500 2 T1 1 0 007F + + ZALS *+,arp ;66A0 2 T1 1 0 01 + ZALS *-,arp ;6690 2 T1 1 0 01 + ZALS *,arp ;6680 2 T1 1 0 01 + ZALS *+ ;66A8 2 NOP 1 + ZALS *- ;6698 2 NOP 1 + ZALS * ;6688 2 NOP 1 + ZALS addr ;6600 2 T1 1 0 007F + .end diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3225.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3225.asm new file mode 100644 index 00000000..2fc70558 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test3225.asm @@ -0,0 +1,1363 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test3225.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: TMS320C25 +; + + + .org 100h +shift: .equ 4 +shift0: .equ 0 +shiftmode: .equ 3 ;SPM instruction only +addr7: .equ 12h +addr9: .equ 123h +addr16: .equ 1234h +bit: .equ 05h +port: .equ 2 +arp: .equ 3 +nextarp: .equ 4 +ar: .equ 1 +const: .equ 34h +const1: .equ 1h +const8: .equ 0ffh +const13: .equ 0234h +const16: .equ 5678h +cmode: .equ 2 +format: .equ 1 + + ABS + + + ADD *BR0+,shift,nextarp + ADD *BR0-,shift,nextarp + ADD *0+, shift,nextarp + ADD *0-, shift,nextarp + ADD *+, shift,nextarp + ADD *-, shift,nextarp + ADD *, shift,nextarp + ADD *BR0+,shift + ADD *BR0-,shift + ADD *0+, shift + ADD *0-, shift + ADD *+, shift + ADD *-, shift + ADD *, shift + ADD *BR0+ + ADD *BR0- + ADD *0+ + ADD *0- + ADD *+ + ADD *- + ADD * + ADD addr7,shift + ADD addr7 + + ADDC *BR0+,nextarp + ADDC *BR0-,nextarp + ADDC *0+, nextarp + ADDC *0-, nextarp + ADDC *+, nextarp + ADDC *-, nextarp + ADDC *, nextarp + ADDC *BR0+ + ADDC *BR0- + ADDC *0+ + ADDC *0- + ADDC *+ + ADDC *- + ADDC * + ADDC addr7 + + ADDH *BR0+,nextarp + ADDH *BR0-,nextarp + ADDH *0+, nextarp + ADDH *0-, nextarp + ADDH *+, nextarp + ADDH *-, nextarp + ADDH *, nextarp + ADDH *BR0+ + ADDH *BR0- + ADDH *0+ + ADDH *0- + ADDH *+ + ADDH *- + ADDH * + ADDH addr7 + + + ADDK const8 + + ADDS *BR0+,nextarp + ADDS *BR0-,nextarp + ADDS *0+, nextarp + ADDS *0-, nextarp + ADDS *+, nextarp + ADDS *-, nextarp + ADDS *, nextarp + ADDS *BR0+ + ADDS *BR0- + ADDS *0+ + ADDS *0- + ADDS *+ + ADDS *- + ADDS * + ADDS addr7 + + ADDT *BR0+,nextarp + ADDT *BR0-,nextarp + ADDT *0+, nextarp + ADDT *0-, nextarp + ADDT *+, nextarp + ADDT *-, nextarp + ADDT *, nextarp + ADDT *BR0+ + ADDT *BR0- + ADDT *0+ + ADDT *0- + ADDT *+ + ADDT *- + ADDT * + ADDT addr7 + + ADLK const16,shift + ADLK const16 + ADLK 0 + ADLK 1 + ADLK 256 + ADLK 512 + ADLK $1234 + ADLK $1234,0 + + ADRK const8 + + AND *BR0+,nextarp + AND *BR0-,nextarp + AND *0+, nextarp + AND *0-, nextarp + AND *+, nextarp + AND *-, nextarp + AND *, nextarp + AND *BR0+ + AND *BR0- + AND *0+ + AND *0- + AND *+ + AND *- + AND * + AND addr7 + + ANDK const16,shift + ANDK const16 + + APAC + +loop1: + + B loop1,*BR0+,nextarp + B loop1,*BR0-,nextarp + B loop1,*0+, nextarp + B loop1,*0-, nextarp + B loop1,*+, nextarp + B loop1,*-, nextarp + B loop1,*, nextarp + B loop1,*BR0+ + B loop1,*BR0- + B loop1,*0+ + B loop1,*0- + B loop1,*+ + B loop1,*- + B loop1,* + B loop1 + + BACC + + BANZ loop1,*BR0+,nextarp + BANZ loop1,*BR0-,nextarp + BANZ loop1,*0+, nextarp + BANZ loop1,*0-, nextarp + BANZ loop1,*+, nextarp + BANZ loop1,*-, nextarp + BANZ loop1,*, nextarp + BANZ loop1,*BR0+ + BANZ loop1,*BR0- + BANZ loop1,*0+ + BANZ loop1,*0- + BANZ loop1,*+ + BANZ loop1,*- + BANZ loop1,* + BANZ loop1 + + BBNZ loop1,*BR0+,nextarp + BBNZ loop1,*BR0-,nextarp + BBNZ loop1,*0+, nextarp + BBNZ loop1,*0-, nextarp + BBNZ loop1,*+, nextarp + BBNZ loop1,*-, nextarp + BBNZ loop1,*, nextarp + BBNZ loop1,*BR0+ + BBNZ loop1,*BR0- + BBNZ loop1,*0+ + BBNZ loop1,*0- + BBNZ loop1,*+ + BBNZ loop1,*- + BBNZ loop1,* + BBNZ loop1 + + BBZ loop1,*BR0+,nextarp + BBZ loop1,*BR0-,nextarp + BBZ loop1,*0+, nextarp + BBZ loop1,*0-, nextarp + BBZ loop1,*+, nextarp + BBZ loop1,*-, nextarp + BBZ loop1,*, nextarp + BBZ loop1,*BR0+ + BBZ loop1,*BR0- + BBZ loop1,*0+ + BBZ loop1,*0- + BBZ loop1,*+ + BBZ loop1,*- + BBZ loop1,* + BBZ loop1 + + BC loop1,*BR0+,nextarp + BC loop1,*BR0-,nextarp + BC loop1,*0+, nextarp + BC loop1,*0-, nextarp + BC loop1,*+, nextarp + BC loop1,*-, nextarp + BC loop1,*, nextarp + BC loop1,*BR0+ + BC loop1,*BR0- + BC loop1,*0+ + BC loop1,*0- + BC loop1,*+ + BC loop1,*- + BC loop1,* + BC loop1 + + BGEZ loop1,*BR0+,nextarp + BGEZ loop1,*BR0-,nextarp + BGEZ loop1,*0+, nextarp + BGEZ loop1,*0-, nextarp + BGEZ loop1,*+, nextarp + BGEZ loop1,*-, nextarp + BGEZ loop1,*, nextarp + BGEZ loop1,*BR0+ + BGEZ loop1,*BR0- + BGEZ loop1,*0+ + BGEZ loop1,*0- + BGEZ loop1,*+ + BGEZ loop1,*- + BGEZ loop1,* + BGEZ loop1 + + BGZ loop1,*BR0+,nextarp + BGZ loop1,*BR0-,nextarp + BGZ loop1,*0+, nextarp + BGZ loop1,*0-, nextarp + BGZ loop1,*+, nextarp + BGZ loop1,*-, nextarp + BGZ loop1,*, nextarp + BGZ loop1,*BR0+ + BGZ loop1,*BR0- + BGZ loop1,*0+ + BGZ loop1,*0- + BGZ loop1,*+ + BGZ loop1,*- + BGZ loop1,* + BGZ loop1 + + BIOZ loop1,*BR0+,nextarp + BIOZ loop1,*BR0-,nextarp + BIOZ loop1,*0+, nextarp + BIOZ loop1,*0-, nextarp + BIOZ loop1,*+, nextarp + BIOZ loop1,*-, nextarp + BIOZ loop1,*, nextarp + BIOZ loop1,*BR0+ + BIOZ loop1,*BR0- + BIOZ loop1,*0+ + BIOZ loop1,*0- + BIOZ loop1,*+ + BIOZ loop1,*- + BIOZ loop1,* + BIOZ loop1 + + BLEZ loop1,*BR0+,nextarp + BLEZ loop1,*BR0-,nextarp + BLEZ loop1,*0+, nextarp + BLEZ loop1,*0-, nextarp + BLEZ loop1,*+, nextarp + BLEZ loop1,*-, nextarp + BLEZ loop1,*, nextarp + BLEZ loop1,*BR0+ + BLEZ loop1,*BR0- + BLEZ loop1,*0+ + BLEZ loop1,*0- + BLEZ loop1,*+ + BLEZ loop1,*- + BLEZ loop1,* + BLEZ loop1 + + BLZ loop1,*BR0+,nextarp + BLZ loop1,*BR0-,nextarp + BLZ loop1,*0+, nextarp + BLZ loop1,*0-, nextarp + BLZ loop1,*+, nextarp + BLZ loop1,*-, nextarp + BLZ loop1,*, nextarp + BLZ loop1,*BR0+ + BLZ loop1,*BR0- + BLZ loop1,*0+ + BLZ loop1,*0- + BLZ loop1,*+ + BLZ loop1,*- + BLZ loop1,* + BLZ loop1 + + BNC loop1,*BR0+,nextarp + BNC loop1,*BR0-,nextarp + BNC loop1,*0+, nextarp + BNC loop1,*0-, nextarp + BNC loop1,*+, nextarp + BNC loop1,*-, nextarp + BNC loop1,*, nextarp + BNC loop1,*BR0+ + BNC loop1,*BR0- + BNC loop1,*0+ + BNC loop1,*0- + BNC loop1,*+ + BNC loop1,*- + BNC loop1,* + BNC loop1 + + BNV loop1,*BR0+,nextarp + BNV loop1,*BR0-,nextarp + BNV loop1,*0+, nextarp + BNV loop1,*0-, nextarp + BNV loop1,*+, nextarp + BNV loop1,*-, nextarp + BNV loop1,*, nextarp + BNV loop1,*BR0+ + BNV loop1,*BR0- + BNV loop1,*0+ + BNV loop1,*0- + BNV loop1,*+ + BNV loop1,*- + BNV loop1,* + BNV loop1 + + BNZ loop1,*BR0+,nextarp + BNZ loop1,*BR0-,nextarp + BNZ loop1,*0+, nextarp + BNZ loop1,*0-, nextarp + BNZ loop1,*+, nextarp + BNZ loop1,*-, nextarp + BNZ loop1,*, nextarp + BNZ loop1,*BR0+ + BNZ loop1,*BR0- + BNZ loop1,*0+ + BNZ loop1,*0- + BNZ loop1,*+ + BNZ loop1,*- + BNZ loop1,* + BNZ loop1 + + BV loop1,*BR0+,nextarp + BV loop1,*BR0-,nextarp + BV loop1,*0+, nextarp + BV loop1,*0-, nextarp + BV loop1,*+, nextarp + BV loop1,*-, nextarp + BV loop1,*, nextarp + BV loop1,*BR0+ + BV loop1,*BR0- + BV loop1,*0+ + BV loop1,*0- + BV loop1,*+ + BV loop1,*- + BV loop1,* + BV loop1 + + BZ loop1,*BR0+,nextarp + BZ loop1,*BR0-,nextarp + BZ loop1,*0+, nextarp + BZ loop1,*0-, nextarp + BZ loop1,*+, nextarp + BZ loop1,*-, nextarp + BZ loop1,*, nextarp + BZ loop1,*BR0+ + BZ loop1,*BR0- + BZ loop1,*0+ + BZ loop1,*0- + BZ loop1,*+ + BZ loop1,*- + BZ loop1,* + BZ loop1 + + BIT *BR0+,bit ,nextarp + BIT *BR0-,bit ,nextarp + BIT *0+, bit ,nextarp + BIT *0-, bit ,nextarp + BIT *+, bit ,nextarp + BIT *-, bit ,nextarp + BIT *, bit ,nextarp + BIT *BR0+,bit + BIT *BR0-,bit + BIT *0+, bit + BIT *0-, bit + BIT *+, bit + BIT *-, bit + BIT *, bit + BIT addr7,bit + + BITT *BR0+,nextarp + BITT *BR0-,nextarp + BITT *0+, nextarp + BITT *0-, nextarp + BITT *+, nextarp + BITT *-, nextarp + BITT *, nextarp + BITT *BR0+ + BITT *BR0- + BITT *0+ + BITT *0- + BITT *+ + BITT *- + BITT * + BITT addr7 + + BLKD addr16,*BR0+,nextarp + BLKD addr16,*BR0-,nextarp + BLKD addr16,*0+, nextarp + BLKD addr16,*0-, nextarp + BLKD addr16,*+, nextarp + BLKD addr16,*-, nextarp + BLKD addr16,*, nextarp + BLKD addr16,*BR0+ + BLKD addr16,*BR0- + BLKD addr16,*0+ + BLKD addr16,*0- + BLKD addr16,*+ + BLKD addr16,*- + BLKD addr16,* + BLKD addr16,addr7 + + BLKP addr16,*BR0+,nextarp + BLKP addr16,*BR0-,nextarp + BLKP addr16,*0+, nextarp + BLKP addr16,*0-, nextarp + BLKP addr16,*+, nextarp + BLKP addr16,*-, nextarp + BLKP addr16,*, nextarp + BLKP addr16,*BR0+ + BLKP addr16,*BR0- + BLKP addr16,*0+ + BLKP addr16,*0- + BLKP addr16,*+ + BLKP addr16,*- + BLKP addr16,* + BLKP addr16,addr7 + + CALA + + CALL addr16,*BR0+,nextarp + CALL addr16,*BR0-,nextarp + CALL addr16,*0+, nextarp + CALL addr16,*0-, nextarp + CALL addr16,*+, nextarp + CALL addr16,*-, nextarp + CALL addr16,*, nextarp + CALL addr16,*BR0+ + CALL addr16,*BR0- + CALL addr16,*0+ + CALL addr16,*0- + CALL addr16,*+ + CALL addr16,*- + CALL addr16,* + CALL addr16 + + CMPL + + CMPR cmode + + CNFD + CNFP + + DINT + + DMOV *BR0+,nextarp + DMOV *BR0-,nextarp + DMOV *0+, nextarp + DMOV *0-, nextarp + DMOV *+, nextarp + DMOV *-, nextarp + DMOV *, nextarp + DMOV *BR0+ + DMOV *BR0- + DMOV *0+ + DMOV *0- + DMOV *+ + DMOV *- + DMOV * + DMOV addr7 + + EINT + + FORT format + + IDLE + + IN *BR0+,port,nextarp + IN *BR0-,port,nextarp + IN *0+, port,nextarp + IN *0-, port,nextarp + IN *+, port,nextarp + IN *-, port,nextarp + IN *, port,nextarp + IN *BR0+,port + IN *BR0-,port + IN *0+, port + IN *0-, port + IN *+, port + IN *-, port + IN *, port + IN addr7,port + + LAC *BR0+,shift,nextarp + LAC *BR0-,shift,nextarp + LAC *0+, shift,nextarp + LAC *0-, shift,nextarp + LAC *+, shift,nextarp + LAC *-, shift,nextarp + LAC *, shift,nextarp + LAC *BR0+,shift + LAC *BR0-,shift + LAC *0+, shift + LAC *0-, shift + LAC *+, shift + LAC *-, shift + LAC *, shift + LAC *BR0+ + LAC *BR0- + LAC *0+ + LAC *0- + LAC *+ + LAC *- + LAC * + LAC addr7,shift + LAC addr7 + + LACK const8 + + LACT *BR0+,nextarp + LACT *BR0-,nextarp + LACT *0+, nextarp + LACT *0-, nextarp + LACT *+, nextarp + LACT *-, nextarp + LACT *, nextarp + LACT *BR0+ + LACT *BR0- + LACT *0+ + LACT *0- + LACT *+ + LACT *- + LACT * + LACT addr7 + + LALK const16,shift + LALK const16 + + LAR arp,*BR0+,nextarp + LAR arp,*BR0-,nextarp + LAR arp,*0+, nextarp + LAR arp,*0-, nextarp + LAR arp,*+, nextarp + LAR arp,*-, nextarp + LAR arp,*, nextarp + LAR arp,*BR0+ + LAR arp,*BR0- + LAR arp,*0+ + LAR arp,*0- + LAR arp,*+ + LAR arp,*- + LAR arp,* + LAR arp,addr7 + + LARK arp, const8 + + LARP arp + + LDP *BR0+,nextarp + LDP *BR0-,nextarp + LDP *0+, nextarp + LDP *0-, nextarp + LDP *+, nextarp + LDP *-, nextarp + LDP *, nextarp + LDP *BR0+ + LDP *BR0- + LDP *0+ + LDP *0- + LDP *+ + LDP *- + LDP * + LDP addr7 + + LDPK addr9 + + LPH *BR0+,nextarp + LPH *BR0-,nextarp + LPH *0+, nextarp + LPH *0-, nextarp + LPH *+, nextarp + LPH *-, nextarp + LPH *, nextarp + LPH *BR0+ + LPH *BR0- + LPH *0+ + LPH *0- + LPH *+ + LPH *- + LPH * + LPH addr7 + + LRLK arp, const16 + + LST *BR0+,nextarp + LST *BR0-,nextarp + LST *0+, nextarp + LST *0-, nextarp + LST *+, nextarp + LST *-, nextarp + LST *, nextarp + LST *BR0+ + LST *BR0- + LST *0+ + LST *0- + LST *+ + LST *- + LST * + LST addr7 + + LST1 *BR0+,nextarp + LST1 *BR0-,nextarp + LST1 *0+, nextarp + LST1 *0-, nextarp + LST1 *+, nextarp + LST1 *-, nextarp + LST1 *, nextarp + LST1 *BR0+ + LST1 *BR0- + LST1 *0+ + LST1 *0- + LST1 *+ + LST1 *- + LST1 * + LST1 addr7 + + LT *BR0+,nextarp + LT *BR0-,nextarp + LT *0+, nextarp + LT *0-, nextarp + LT *+, nextarp + LT *-, nextarp + LT *, nextarp + LT *BR0+ + LT *BR0- + LT *0+ + LT *0- + LT *+ + LT *- + LT * + LT addr7 + + LTA *BR0+,nextarp + LTA *BR0-,nextarp + LTA *0+, nextarp + LTA *0-, nextarp + LTA *+, nextarp + LTA *-, nextarp + LTA *, nextarp + LTA *BR0+ + LTA *BR0- + LTA *0+ + LTA *0- + LTA *+ + LTA *- + LTA * + LTA addr7 + + LTD *BR0+,nextarp + LTD *BR0-,nextarp + LTD *0+, nextarp + LTD *0-, nextarp + LTD *+, nextarp + LTD *-, nextarp + LTD *, nextarp + LTD *BR0+ + LTD *BR0- + LTD *0+ + LTD *0- + LTD *+ + LTD *- + LTD * + LTD addr7 + + LTP *BR0+,nextarp + LTP *BR0-,nextarp + LTP *0+, nextarp + LTP *0-, nextarp + LTP *+, nextarp + LTP *-, nextarp + LTP *, nextarp + LTP *BR0+ + LTP *BR0- + LTP *0+ + LTP *0- + LTP *+ + LTP *- + LTP * + LTP addr7 + + LTS *BR0+,nextarp + LTS *BR0-,nextarp + LTS *0+, nextarp + LTS *0-, nextarp + LTS *+, nextarp + LTS *-, nextarp + LTS *, nextarp + LTS *BR0+ + LTS *BR0- + LTS *0+ + LTS *0- + LTS *+ + LTS *- + LTS * + LTS addr7 + + MAC addr16,*BR0+,nextarp + MAC addr16,*BR0-,nextarp + MAC addr16,*0+, nextarp + MAC addr16,*0-, nextarp + MAC addr16,*+, nextarp + MAC addr16,*-, nextarp + MAC addr16,*, nextarp + MAC addr16,*BR0+ + MAC addr16,*BR0- + MAC addr16,*0+ + MAC addr16,*0- + MAC addr16,*+ + MAC addr16,*- + MAC addr16,* + MAC addr16,addr7 + + MACD addr16,*BR0+,nextarp + MACD addr16,*BR0-,nextarp + MACD addr16,*0+, nextarp + MACD addr16,*0-, nextarp + MACD addr16,*+, nextarp + MACD addr16,*-, nextarp + MACD addr16,*, nextarp + MACD addr16,*BR0+ + MACD addr16,*BR0- + MACD addr16,*0+ + MACD addr16,*0- + MACD addr16,*+ + MACD addr16,*- + MACD addr16,* + MACD addr16,addr7 + + MAR *BR0+,nextarp + MAR *BR0-,nextarp + MAR *0+, nextarp + MAR *0-, nextarp + MAR *+, nextarp + MAR *-, nextarp + MAR *, nextarp + MAR *BR0+ + MAR *BR0- + MAR *0+ + MAR *0- + MAR *+ + MAR *- + MAR * + MAR addr7 + + MPY *BR0+,nextarp + MPY *BR0-,nextarp + MPY *0+, nextarp + MPY *0-, nextarp + MPY *+, nextarp + MPY *-, nextarp + MPY *, nextarp + MPY *BR0+ + MPY *BR0- + MPY *0+ + MPY *0- + MPY *+ + MPY *- + MPY * + MPY addr7 + + MPYA *BR0+,nextarp + MPYA *BR0-,nextarp + MPYA *0+, nextarp + MPYA *0-, nextarp + MPYA *+, nextarp + MPYA *-, nextarp + MPYA *, nextarp + MPYA *BR0+ + MPYA *BR0- + MPYA *0+ + MPYA *0- + MPYA *+ + MPYA *- + MPYA * + MPYA addr7 + + MPYK const13 + + MPYS *BR0+,nextarp + MPYS *BR0-,nextarp + MPYS *0+, nextarp + MPYS *0-, nextarp + MPYS *+, nextarp + MPYS *-, nextarp + MPYS *, nextarp + MPYS *BR0+ + MPYS *BR0- + MPYS *0+ + MPYS *0- + MPYS *+ + MPYS *- + MPYS * + MPYS addr7 + + MPYU *BR0+,nextarp + MPYU *BR0-,nextarp + MPYU *0+, nextarp + MPYU *0-, nextarp + MPYU *+, nextarp + MPYU *-, nextarp + MPYU *, nextarp + MPYU *BR0+ + MPYU *BR0- + MPYU *0+ + MPYU *0- + MPYU *+ + MPYU *- + MPYU * + MPYU addr7 + + NEG + + NOP + + NORM *BR0+ + NORM *BR0- + NORM *0+ + NORM *0- + NORM *+ + NORM *- + NORM * + NORM + + OR *BR0+,nextarp + OR *BR0-,nextarp + OR *0+, nextarp + OR *0-, nextarp + OR *+, nextarp + OR *-, nextarp + OR *, nextarp + OR *BR0+ + OR *BR0- + OR *0+ + OR *0- + OR *+ + OR *- + OR * + OR addr7 + + ORK const16, shift + ORK const16 + + OUT *BR0+,port,nextarp + OUT *BR0-,port,nextarp + OUT *0+, port,nextarp + OUT *0-, port,nextarp + OUT *+, port,nextarp + OUT *-, port,nextarp + OUT *, port,nextarp + OUT *BR0+,port + OUT *BR0-,port + OUT *0+, port + OUT *0-, port + OUT *+, port + OUT *-, port + OUT *, port + OUT addr7,port + + PAC + POP + + POPD *BR0+,nextarp + POPD *BR0-,nextarp + POPD *0+, nextarp + POPD *0-, nextarp + POPD *+, nextarp + POPD *-, nextarp + POPD *, nextarp + POPD *BR0+ + POPD *BR0- + POPD *0+ + POPD *0- + POPD *+ + POPD *- + POPD * + POPD addr7 + + PSHD *BR0+,nextarp + PSHD *BR0-,nextarp + PSHD *0+, nextarp + PSHD *0-, nextarp + PSHD *+, nextarp + PSHD *-, nextarp + PSHD *, nextarp + PSHD *BR0+ + PSHD *BR0- + PSHD *0+ + PSHD *0- + PSHD *+ + PSHD *- + PSHD * + PSHD addr7 + + PUSH + RC + RET + RFSM + RHM + ROL + ROR + ROVM + + RPT *BR0+,nextarp + RPT *BR0-,nextarp + RPT *0+, nextarp + RPT *0-, nextarp + RPT *+, nextarp + RPT *-, nextarp + RPT *, nextarp + RPT *BR0+ + RPT *BR0- + RPT *0+ + RPT *0- + RPT *+ + RPT *- + RPT * + RPT addr7 + + RPTK const8 + + RSXM + RTC + RTXM + RXF + + SACH *BR0+,shift,nextarp + SACH *BR0-,shift,nextarp + SACH *0+, shift,nextarp + SACH *0-, shift,nextarp + SACH *+, shift,nextarp + SACH *-, shift,nextarp + SACH *, shift,nextarp + SACH *BR0+,shift + SACH *BR0-,shift + SACH *0+, shift + SACH *0-, shift + SACH *+, shift + SACH *-, shift + SACH *, shift + SACH *BR0+ + SACH *BR0- + SACH *0+ + SACH *0- + SACH *+ + SACH *- + SACH * + SACH addr7,shift + SACH addr7 + + SACL *BR0+,shift,nextarp + SACL *BR0-,shift,nextarp + SACL *0+, shift,nextarp + SACL *0-, shift,nextarp + SACL *+, shift,nextarp + SACL *-, shift,nextarp + SACL *, shift,nextarp + SACL *BR0+,shift + SACL *BR0-,shift + SACL *0+, shift + SACL *0-, shift + SACL *+, shift + SACL *-, shift + SACL *, shift + SACL *BR0+ + SACL *BR0- + SACL *0+ + SACL *0- + SACL *+ + SACL *- + SACL * + SACL addr7,shift + SACL addr7 + + SAR arp,*BR0+,nextarp + SAR arp,*BR0-,nextarp + SAR arp,*0+, nextarp + SAR arp,*0-, nextarp + SAR arp,*+, nextarp + SAR arp,*-, nextarp + SAR arp,*, nextarp + SAR arp,*BR0+ + SAR arp,*BR0- + SAR arp,*0+ + SAR arp,*0- + SAR arp,*+ + SAR arp,*- + SAR arp,* + SAR arp,addr7 + + SBLK const16, shift + SBLK const16 + + SBRK const8 + + SC + SFL + SFR + SFSM + SHM + SOVM + SPAC + + SPH *BR0+,nextarp + SPH *BR0-,nextarp + SPH *0+, nextarp + SPH *0-, nextarp + SPH *+, nextarp + SPH *-, nextarp + SPH *, nextarp + SPH *BR0+ + SPH *BR0- + SPH *0+ + SPH *0- + SPH *+ + SPH *- + SPH * + SPH addr7 + + SPL *BR0+,nextarp + SPL *BR0-,nextarp + SPL *0+, nextarp + SPL *0-, nextarp + SPL *+, nextarp + SPL *-, nextarp + SPL *, nextarp + SPL *BR0+ + SPL *BR0- + SPL *0+ + SPL *0- + SPL *+ + SPL *- + SPL * + SPL addr7 + + SPM shiftmode + + SQRA *BR0+,nextarp + SQRA *BR0-,nextarp + SQRA *0+, nextarp + SQRA *0-, nextarp + SQRA *+, nextarp + SQRA *-, nextarp + SQRA *, nextarp + SQRA *BR0+ + SQRA *BR0- + SQRA *0+ + SQRA *0- + SQRA *+ + SQRA *- + SQRA * + SQRA addr7 + + SQRS *BR0+,nextarp + SQRS *BR0-,nextarp + SQRS *0+, nextarp + SQRS *0-, nextarp + SQRS *+, nextarp + SQRS *-, nextarp + SQRS *, nextarp + SQRS *BR0+ + SQRS *BR0- + SQRS *0+ + SQRS *0- + SQRS *+ + SQRS *- + SQRS * + SQRS addr7 + + SST *BR0+,nextarp + SST *BR0-,nextarp + SST *0+, nextarp + SST *0-, nextarp + SST *+, nextarp + SST *-, nextarp + SST *, nextarp + SST *BR0+ + SST *BR0- + SST *0+ + SST *0- + SST *+ + SST *- + SST * + SST addr7 + + SST1 *BR0+,nextarp + SST1 *BR0-,nextarp + SST1 *0+, nextarp + SST1 *0-, nextarp + SST1 *+, nextarp + SST1 *-, nextarp + SST1 *, nextarp + SST1 *BR0+ + SST1 *BR0- + SST1 *0+ + SST1 *0- + SST1 *+ + SST1 *- + SST1 * + SST1 addr7 + + SSXM + STC + STXM + + SUB *BR0+,shift,nextarp + SUB *BR0-,shift,nextarp + SUB *0+, shift,nextarp + SUB *0-, shift,nextarp + SUB *+, shift,nextarp + SUB *-, shift,nextarp + SUB *, shift,nextarp + SUB *BR0+,shift + SUB *BR0-,shift + SUB *0+, shift + SUB *0-, shift + SUB *+, shift + SUB *-, shift + SUB *, shift + SUB *BR0+ + SUB *BR0- + SUB *0+ + SUB *0- + SUB *+ + SUB *- + SUB * + SUB addr7,shift + SUB addr7 + + SUBB *BR0+,nextarp + SUBB *BR0-,nextarp + SUBB *0+, nextarp + SUBB *0-, nextarp + SUBB *+, nextarp + SUBB *-, nextarp + SUBB *, nextarp + SUBB *BR0+ + SUBB *BR0- + SUBB *0+ + SUBB *0- + SUBB *+ + SUBB *- + SUBB * + SUBB addr7 + + SUBC *BR0+,nextarp + SUBC *BR0-,nextarp + SUBC *0+, nextarp + SUBC *0-, nextarp + SUBC *+, nextarp + SUBC *-, nextarp + SUBC *, nextarp + SUBC *BR0+ + SUBC *BR0- + SUBC *0+ + SUBC *0- + SUBC *+ + SUBC *- + SUBC * + SUBC addr7 + + SUBH *BR0+,nextarp + SUBH *BR0-,nextarp + SUBH *0+, nextarp + SUBH *0-, nextarp + SUBH *+, nextarp + SUBH *-, nextarp + SUBH *, nextarp + SUBH *BR0+ + SUBH *BR0- + SUBH *0+ + SUBH *0- + SUBH *+ + SUBH *- + SUBH * + SUBH addr7 + + SUBK const8 + + SUBS *BR0+,nextarp + SUBS *BR0-,nextarp + SUBS *0+, nextarp + SUBS *0-, nextarp + SUBS *+, nextarp + SUBS *-, nextarp + SUBS *, nextarp + SUBS *BR0+ + SUBS *BR0- + SUBS *0+ + SUBS *0- + SUBS *+ + SUBS *- + SUBS * + SUBS addr7 + + SUBT *BR0+,nextarp + SUBT *BR0-,nextarp + SUBT *0+, nextarp + SUBT *0-, nextarp + SUBT *+, nextarp + SUBT *-, nextarp + SUBT *, nextarp + SUBT *BR0+ + SUBT *BR0- + SUBT *0+ + SUBT *0- + SUBT *+ + SUBT *- + SUBT * + SUBT addr7 + + SXF + + TBLR *BR0+,nextarp + TBLR *BR0-,nextarp + TBLR *0+, nextarp + TBLR *0-, nextarp + TBLR *+, nextarp + TBLR *-, nextarp + TBLR *, nextarp + TBLR *BR0+ + TBLR *BR0- + TBLR *0+ + TBLR *0- + TBLR *+ + TBLR *- + TBLR * + TBLR addr7 + + TBLW *BR0+,nextarp + TBLW *BR0-,nextarp + TBLW *0+, nextarp + TBLW *0-, nextarp + TBLW *+, nextarp + TBLW *-, nextarp + TBLW *, nextarp + TBLW *BR0+ + TBLW *BR0- + TBLW *0+ + TBLW *0- + TBLW *+ + TBLW *- + TBLW * + TBLW addr7 + + TRAP + + XOR *BR0+,nextarp + XOR *BR0-,nextarp + XOR *0+, nextarp + XOR *0-, nextarp + XOR *+, nextarp + XOR *-, nextarp + XOR *, nextarp + XOR *BR0+ + XOR *BR0- + XOR *0+ + XOR *0- + XOR *+ + XOR *- + XOR * + XOR addr7 + + XORK const16, shift + XORK const16 + + ZAC + + ZALH *BR0+,nextarp + ZALH *BR0-,nextarp + ZALH *0+, nextarp + ZALH *0-, nextarp + ZALH *+, nextarp + ZALH *-, nextarp + ZALH *, nextarp + ZALH *BR0+ + ZALH *BR0- + ZALH *0+ + ZALH *0- + ZALH *+ + ZALH *- + ZALH * + ZALH addr7 + + ZALR *BR0+,nextarp + ZALR *BR0-,nextarp + ZALR *0+, nextarp + ZALR *0-, nextarp + ZALR *+, nextarp + ZALR *-, nextarp + ZALR *, nextarp + ZALR *BR0+ + ZALR *BR0- + ZALR *0+ + ZALR *0- + ZALR *+ + ZALR *- + ZALR * + ZALR addr7 + + ZALS *BR0+,nextarp + ZALS *BR0-,nextarp + ZALS *0+, nextarp + ZALS *0-, nextarp + ZALS *+, nextarp + ZALS *-, nextarp + ZALS *, nextarp + ZALS *BR0+ + ZALS *BR0- + ZALS *0+ + ZALS *0- + ZALS *+ + ZALS *- + ZALS * + ZALS addr7 + .end + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test48.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test48.asm new file mode 100644 index 00000000..c51eabeb --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test48.asm @@ -0,0 +1,279 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test48.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 8048 +; + + +label1 .equ 12H + + ADD A,R0 + ADD A,R1 + ADD A,R2 + ADD A,R3 + ADD A,R4 + ADD A,R5 + ADD A,R6 + ADD A,R7 + ADD A,@R0 + ADD A,@R1 + ADD A,#label1 + + ADDC A,R0 + ADDC A,R1 + ADDC A,R2 + ADDC A,R3 + ADDC A,R4 + ADDC A,R5 + ADDC A,R6 + ADDC A,R7 + ADDC A,@R0 + ADDC A,@R1 + ADDC A,#label1 + + ANL A,R0 + ANL A,R1 + ANL A,R2 + ANL A,R3 + ANL A,R4 + ANL A,R5 + ANL A,R6 + ANL A,R7 + ANL A,@R0 + ANL A,@R1 + ANL A,#label1 + ANL BUS,#label1 + ANL P1,#label1 + ANL P2,#label1 + + ANLD P4,A + ANLD P5,A + ANLD P6,A + ANLD P7,A + + CALL label1 + + CLR A + CLR C + CLR F0 + CLR F1 + + CPL A + CPL C + CPL F0 + CPL F1 + + DA A + + DEC A + DEC R0 + DEC R1 + DEC R2 + DEC R3 + DEC R4 + DEC R5 + DEC R6 + DEC R7 + + DIS I + DIS TCNTI + + DJNZ R0,label1 + DJNZ R1,label1 + DJNZ R2,label1 + DJNZ R3,label1 + DJNZ R4,label1 + DJNZ R5,label1 + DJNZ R6,label1 + DJNZ R7,label1 + + EN DMA + EN FLAGS + EN I + EN TCNTI + ENT0 CLK + + IN A,DBB + IN A,P0 + IN A,P1 + IN A,P2 + + INC A + INC R0 + INC R1 + INC R2 + INC R3 + INC R4 + INC R5 + INC R6 + INC R7 + INC @R0 + INC @R1 + + INS A,BUS + + JB0 label1 + JB1 label1 + JB2 label1 + JB3 label1 + JB4 label1 + JB5 label1 + JB6 label1 + JB7 label1 + + JMP label1 + + JC label1 + JF0 label1 + JF1 label1 + JNC label1 + JNI label1 + JNIBF label1 + JNT0 label1 + JNT1 label1 + JNZ label1 + JOBF label1 + JTF label1 + JT0 label1 + JT1 label1 + JZ label1 + + JMPP @A + + MOV A,PSW + MOV A,R0 + MOV A,R1 + MOV A,R2 + MOV A,R3 + MOV A,R4 + MOV A,R5 + MOV A,R6 + MOV A,R7 + MOV A,T + MOV A,@R0 + MOV A,@R1 + MOV A,#label1 + MOV PSW,A + MOV R0,A + MOV R1,A + MOV R2,A + MOV R3,A + MOV R4,A + MOV R5,A + MOV R6,A + MOV R7,A + MOV R0,#label1 + MOV R1,#label1 + MOV R2,#label1 + MOV R3,#label1 + MOV R4,#label1 + MOV R5,#label1 + MOV R6,#label1 + MOV R7,#label1 + MOV STS,A + MOV T,A + MOV @R0,A + MOV @R1,A + MOV @R0,#label1 + MOV @R1,#label1 + + MOVD A,P4 + MOVD A,P5 + MOVD A,P6 + MOVD A,P7 + MOVD P4,A + MOVD P5,A + MOVD P6,A + MOVD P7,A + + MOVP A,@A + MOVP3 A,@A + + + MOVX A,@R0 + MOVX A,@R1 + MOVX @R0,A + MOVX @R1,A + + NOP + + ORL A,R0 + ORL A,R1 + ORL A,R2 + ORL A,R3 + ORL A,R4 + ORL A,R5 + ORL A,R6 + ORL A,R7 + ORL A,@R0 + ORL A,@R1 + ORL A,#label1 + ORL BUS,#label1 + ORL P1,#label1 + ORL P2,#label1 + + ORLD P4,A + ORLD P5,A + ORLD P6,A + ORLD P7,A + + OUTL BUS,A + OUT DBB,A + OUTL P0,A + OUTL P1,A + OUTL P2,A + + RAD + + RET + RETI + RETR + + RL A + RLC A + RR A + RRC A + + SEL AN0 + SEL AN1 + SEL MB0 + SEL MB1 + SEL RB0 + SEL RB1 + + STOP TCNT + STRT CNT + STRT T + + SWAP A + + XCH A,R0 + XCH A,R1 + XCH A,R2 + XCH A,R3 + XCH A,R4 + XCH A,R5 + XCH A,R6 + XCH A,R7 + XCH A,@R0 + XCH A,@R1 + + XCHD A,@R0 + XCHD A,@R1 + + XRL A,R0 + XRL A,R1 + XRL A,R2 + XRL A,R3 + XRL A,R4 + XRL A,R5 + XRL A,R6 + XRL A,R7 + XRL A,@R0 + XRL A,@R1 + XRL A,#label1 + .end diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test51.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test51.asm new file mode 100644 index 00000000..781ff094 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test51.asm @@ -0,0 +1,297 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test51.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 8051 +; + + + .AVSYM + +labimm: .EQU 56h +lab2: .EQU 12h +lab3: .EQU 1234h +lab5: .EQU 0feh +labbt_1: .EQU 34h +bit .equ 81h + + + ACALL lab4 ;11 2 JMP 1 +lab4: + 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,#labimm ;24 2 NOP 1 + ADD A,lab2 ;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,#labimm ;34 2 NOP 1 + ADDC A,lab2 ;35 2 NOP 1 + + AJMP jlab ;01 2 JMP 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 ;56 1 NOP 1 + ANL A,@R1 ;57 1 NOP 1 + ANL A,#labimm + ANL A,lab2 + ANL C,/bit + ANL C,bit + ANL lab2,A + ANL lab2,#labimm + + CJNE A,#labimm,jlab ;b4 3 CR 1 + CJNE A,lab2,jlab ;b5 3 CR 1 + CJNE R0,#labimm,jlab ;b8 3 CR 1 + CJNE R1,#labimm,jlab ;b9 3 CR 1 + CJNE R2,#labimm,jlab ;ba 3 CR 1 + CJNE R3,#labimm,jlab ;bb 3 CR 1 + CJNE R4,#labimm,jlab ;bc 3 CR 1 + CJNE R5,#labimm,jlab ;bd 3 CR 1 + CJNE R6,#labimm,jlab ;be 3 CR 1 + CJNE R7,#labimm,jlab ;bf 3 CR 1 + CJNE @R0,#labimm,jlab ;b6 3 CR 1 + CJNE @R1,#labimm,jlab ;b7 3 CR 1 + + CLR A ;e4 1 NOP 1 + CLR C ;c3 1 NOP 1 + CLR bit + + CPL A ;f4 1 NOP 1 + CPL C ;b3 1 NOP 1 + CPL bit + + 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 lab2 ;15 2 NOP 1 + + DIV AB ;84 1 NOP 1 + + DJNZ R0,jlab ;d8 2 NOP 1 + DJNZ R1,jlab ;d9 2 NOP 1 + DJNZ R2,jlab ;dA 2 NOP 1 + DJNZ R3,jlab ;dB 2 NOP 1 + DJNZ R4,jlab ;dC 2 NOP 1 + DJNZ R5,jlab ;dD 2 NOP 1 + DJNZ R6,jlab ;dE 2 NOP 1 + DJNZ R7,jlab ;dF 2 NOP 1 + DJNZ lab2,jlab ;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 lab2 ;05 2 NOP 1 + +jlab: + JB labbt_1,jlab ;20 3 CR 1 + JBC labbt_1,jlab ;10 3 CR 1 + JC jlab ;40 2 R1 1 + JMP @A+DPTR ;73 1 NOP 1 + JNB labbt_1,jlab ;30 3 CR 1 + JNC jlab ;50 2 R1 1 + JNZ jlab ;70 2 R1 1 + JZ jlab ;60 2 R1 1 + + LCALL lab3 ;12 3 SWAP 1 + + LJMP lab3 ;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,#labimm ;74 2 NOP 1 + MOV A,lab2 ;e5 2 NOP 1 + MOV C,bit ;a2 2 NOP 1 + MOV DPTR,#labimm ;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,#labimm ;78 2 NOP 1 + MOV R1,#labimm ;79 2 NOP 1 + MOV R2,#labimm ;7A 2 NOP 1 + MOV R3,#labimm ;7B 2 NOP 1 + MOV R4,#labimm ;7C 2 NOP 1 + MOV R5,#labimm ;7D 2 NOP 1 + MOV R6,#labimm ;7E 2 NOP 1 + MOV R7,#labimm ;7F 2 NOP 1 + MOV R0,lab2 ;a8 2 NOP 1 + MOV R1,lab2 ;a9 2 NOP 1 + MOV R2,lab2 ;aA 2 NOP 1 + MOV R3,lab2 ;aB 2 NOP 1 + MOV R4,lab2 ;aC 2 NOP 1 + MOV R5,lab2 ;aD 2 NOP 1 + MOV R6,lab2 ;aE 2 NOP 1 + MOV R7,lab2 ;aF 2 NOP 1 + MOV @R0,A ;f6 1 NOP 1 + MOV @R1,A ;f7 1 NOP 1 + MOV @R0,#labimm ;76 2 NOP 1 + MOV @R1,#labimm ;77 2 NOP 1 + MOV @R0,lab2 ;a6 2 NOP 1 + MOV @R1,lab2 ;a7 2 NOP 1 + MOV lab2,A ;f5 2 NOP 1 + MOV bit,C ;92 2 NOP 1 + MOV lab2,R0 ;88 2 NOP 1 + MOV lab2,R1 ;89 2 NOP 1 + MOV lab2,R2 ;8A 2 NOP 1 + MOV lab2,R3 ;8B 2 NOP 1 + MOV lab2,R4 ;8C 2 NOP 1 + MOV lab2,R5 ;8D 2 NOP 1 + MOV lab2,R6 ;8E 2 NOP 1 + MOV lab2,R7 ;8F 2 NOP 1 + MOV lab2,@R0 ;86 2 NOP 1 + MOV lab2,@R1 ;87 2 NOP 1 + MOV lab2,#labimm ;75 3 COMBINE 1 + MOV lab5,lab2 ;85 3 COMBINE 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,#labimm ;44 2 NOP 1 + ORL A,lab2 ;45 2 NOP 1 + ORL C,/bit ;a0 2 NOP 1 + ORL C,bit ;72 2 NOP 1 + ORL lab2,A ;42 2 NOP 1 + ORL lab2,#labimm ;43 3 COMBINE 1 + + POP lab2 ;d0 2 NOP 1 + PUSH lab2 ;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 + +jlab5: + SETB C ;d3 1 NOP 1 + SETB bit ;d2 2 NOP 1 + + SJMP jlab5 ;80 2 NOP 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,#labimm ;94 2 NOP 1 + SUBB A,lab2 ;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,lab2 ;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,#labimm ;64 2 NOP 1 + XRL A,lab2 ;65 2 NOP 1 + XRL lab2,A ;62 2 NOP 1 + XRL lab2,#labimm ;63 3 COMBINE 1 + + .end diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test65.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test65.asm new file mode 100644 index 00000000..d7efce4e --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test65.asm @@ -0,0 +1,298 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test65.asm 1.2 1997/11/29 13:07:53 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 6502 +; + + + +#define FLAG1 +#define TORG $1234 + .org $56 +zlabel .byte $12 + .word $1234 + .word $1234/3 + .word 1234h + .word %0101010 + .word 0101010b + .word @1234 + .word 1234o + .word 1234 + .word 1234d + .word 0d + .word 1d + .word 2d + .word 3d + .word 4d + .word 10d + .word 20d + .word 100d + .word * + .word $ + .word 3 * 7 + .word 3 + 7 + .word 3 - 7 + .word 73 % 7 + .word $1234 >> 4 + .word $1234 << 4 + .word 1 = 1 + .word 1 = 0 + .word 1 >= 1 + .word 1 >= 2 + .word 1 >= 0 + .word 1 <= 1 + .word 1 <= 2 + .word 1 <= 0 + .word 1 <= -1 + .word TORG + + .org $0234 +alabel + ADC #zlabel + ADC (zlabel,X) + ADC (zlabel),Y + ADC (zlabel) + ADC (alabel & $ff) ; suppress UNUSED DATA error + ADC zlabel,X + ADC zlabel,Y + ADC zlabel + ADC alabel + + AND #zlabel + AND (zlabel,X) + AND (zlabel),Y + AND (zlabel) + AND zlabel,X + AND zlabel,Y + AND zlabel + AND alabel + + ASL A + ASL zlabel,X + ASL zlabel +loop + BCC loop + BCS loop + BEQ loop + BNE loop + BMI loop + BPL loop + BVC loop + BVS loop + + BIT #zlabel + BIT zlabel,X + BIT zlabel + BIT alabel + + BRK + + CLC + CLD + CLI + CLV + + CMP #zlabel + CMP (zlabel,X) + CMP (zlabel),Y + CMP (zlabel) + CMP zlabel,X + CMP zlabel,Y + CMP zlabel + CMP alabel + + CPX #zlabel + CPX zlabel + CPX alabel + + CPY #zlabel + CPY zlabel + CPY alabel + + DEC A + DEC zlabel,X + DEC alabel,X + DEC zlabel + DEC alabel + + DEX + DEY + + EOR #zlabel + EOR (zlabel,X) + EOR (zlabel),Y + EOR (zlabel) + EOR zlabel,X + EOR zlabel,Y + EOR zlabel + EOR alabel + + INC A + INC zlabel,X + INC alabel,X + INC zlabel + INC alabel + + INX + INY + + JMP (zlabel,X) + JMP (zlabel) + JMP zlabel + + JSR zlabel + JSR alabel + + LDA #zlabel + LDA (zlabel,X) + LDA (zlabel),Y + LDA (zlabel) + LDA zlabel,X + LDA zlabel,Y + LDA zlabel + LDA alabel + + LDX #zlabel + LDX zlabel,Y + LDX zlabel + LDX alabel + + LDY #zlabel + LDY zlabel,X + LDY zlabel + LDY alabel + + LSR A + LSR zlabel,X + LSR zlabel + LSR alabel + + NOP + + ORA #zlabel + ORA (zlabel,X) + ORA (zlabel),Y + ORA (zlabel) + ORA zlabel,X + ORA zlabel,Y + ORA zlabel + ORA alabel + + PHA + PHP + PLA + PLP + + ROL A + ROL zlabel,X + ROL zlabel + ROL alabel + + ROR A + ROR zlabel,X + ROR alabel,X + ROR zlabel + ROR alabel + + RTI + RTS + + SBC #zlabel + SBC (zlabel,X) + SBC (zlabel),Y + SBC (zlabel) + SBC zlabel,X + SBC zlabel,Y + SBC zlabel + SBC alabel + + SEC + SED + SEI + + STA (zlabel,X) + STA (zlabel),Y + STA (zlabel) + STA zlabel,X + STA zlabel,Y + STA zlabel + STA alabel + + STX zlabel,Y + STX zlabel + STX alabel + + STY zlabel,X + STY zlabel + STY alabel + + TAX + TAY + TSX + TXA + TXS + TYA + + BRA loop2 +loop2 + BBR0 zlabel,loop2 + BBR1 zlabel,loop2 + BBR2 zlabel,loop2 + BBR3 zlabel,loop2 + BBR4 zlabel,loop2 + BBR5 zlabel,loop2 + BBR6 zlabel,loop2 + BBR7 zlabel,loop2 + + BBS0 zlabel,loop2 + BBS1 zlabel,loop2 + BBS2 zlabel,loop2 + BBS3 zlabel,loop2 + BBS4 zlabel,loop2 + BBS5 zlabel,loop2 + BBS6 zlabel,loop2 + BBS7 zlabel,loop2 + + MUL + + PHX + PHY + PLX + PLY + + RMB0 zlabel + RMB1 zlabel + RMB2 zlabel + RMB3 zlabel + RMB4 zlabel + RMB5 zlabel + RMB6 zlabel + RMB7 zlabel + + SMB0 zlabel + SMB1 zlabel + SMB2 zlabel + SMB3 zlabel + SMB4 zlabel + SMB5 zlabel + SMB6 zlabel + SMB7 zlabel + + + STZ zlabel,X + STZ zlabel + STZ alabel + + TRB zlabel + TSB zlabel + .end + + + + + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test68.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test68.asm new file mode 100644 index 00000000..54ae1023 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test68.asm @@ -0,0 +1,422 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test68.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 6801/6803/68HC11 +; + + +data1 .equ $12 +data2 .equ $1234 + + ABA + ABX + + ADDA #data1 ;8B + ADDA data1,X ;AB + ADDA data1 ;9B + ADDA data2 ;BB + + ADDB #data1 ;CB + ADDB data1,X ;EB + ADDB data1 ;DB + ADDB data2 ;FB + + ADCA #data1 ;89 + ADCA data1,X ;A9 + ADCA data1 ;99 + ADCA data2 ;B9 + + ADCB #data1 ;C9 + ADCB data1,X ;E9 + ADCB data1 ;D9 + ADCB data2 ;F9 + + ADDD #data1 ;C3 + ADDD data1,X ;E3 + ADDD data1 ;D3 + ADDD data2 ;F3 + + ANDA #data1 ;84 + ANDA data1,X ;A4 + ANDA data1 ;94 + ANDA data2 ;B4 + + ANDB #data1 ;C4 + ANDB data1,X ;E4 + ANDB data1 ;D4 + ANDB data2 ;F4 + + ASL data1,X ;68 + ASL data1 ;78 + ASL data2 ;78 + ASLA ;48 + ASLB ;58 + ASLD ;05 + + ASR data1,X ; + ASR data1 ; + ASR data2 ; + ASRA ; + ASRB ; + +loop1: + BRA loop1 ;20 + BRN loop1 ;21 + BCC loop1 ;24 + BCS loop1 ;25 + BEQ loop1 ;27 + BGE loop1 ;2C + BGT loop1 ;2E + BHI loop1 ;22 + BHS loop1 ;24 + + BITA #data1 ;85 + BITA data1,X ;A5 + BITA data1 ;B5 + BITA data2 ;B5 + + BITB #data1 ;C5 + BITB data1,X ;E5 + BITB data1 ;F5 + BITB data2 ;F5 + + BLE loop1 ;2F + BLO loop1 ;25 + BLS loop1 ;23 + BLT loop1 ;2D + BMI loop1 ;2B + BNE loop1 ;26 + BVC loop1 ;28 + BVS loop1 ;29 + BPL loop1 ;2A + BSR loop1 ;8D + + CBA + CLC ;0C + CLI ;0E + CLR data1,X ;6F + CLR data1 ;7F + CLR data2 ;7F + CLRA ;4F + CLRB ;5F + CLV ;0A + + COM data1,X ;63 + COM data1 ;73 + COM data2 ;73 + COMA ;43 + COMB ;53 + + CPX #data1 ;8C + CPX data1,X ;AC + CPX data1 ;9C + CPX data2 ;BC + + CMPA #data1 ; + CMPA data1,X ; + CMPA data1 ; + CMPA data2 ; + + CMPB #data1 ; + CMPB data1,X ; + CMPB data1 ; + CMPB data2 ; + + DAA ;19 + + DEC data1,X + DEC data1 + DEC data2 + + DECA ;4A + DECB ;5A + DES ;34 + DEX ;09 + + EORA #data1 ; + EORA data1,X ; + EORA data1 ; + EORA data2 ; + + EORB #data1 ; + EORB data1,X ; + EORB data1 ; + EORB data2 ; + + INC data1,X + INC data1 + INC data2 + + INCA ;4C + INCB ;5C + INS ;31 + INX ;08 + + JMP data1,X ;63 + JMP data1 ;7E + JMP data2 ;7E + + JSR data1,X ;AD + JSR data1 ;9D + JSR data2 ;BD + + LDAA #data1 ;86 + LDAA data1,X ;A6 + LDAA data1 ;96 + LDAA data2 ;B6 + + LDAB #data1 ;C6 + LDAB data1,X ;E6 + LDAB data1 ;D6 + LDAB data2 ;F6 + + LDD #data1 ;CC + LDD data1,X ;EC + LDD data1 ;DC + LDD data2 ;FC + + LDS #data1 ;8E + LDS data1,X ;AE + LDS data1 ;9E + LDS data2 ;BE + + LDX #data1 ;CE + LDX data1,X ;EE + LDX data1 ;DE + LDX data2 ;FE + + LSLA ;48 + LSLB ;58 + LSLD ;05 + + LSRA ;44 + LSRB ;54 + LSRD ;04 + LSR data1,X ;64 + LSR data1 ;74 + LSR data2 ;74 + + MUL ;3D + + NEG data1,X ;60 + NEG data1 ;70 + NEG data2 ;70 + NEGA ;40 + NEGB ;50 + + NOP ;01 + + ORAA #data1 ;8A + ORAA data1,X ;AA + ORAA data1 ;BA + ORAA data2 ;9A + + ORAB #data1 ;CA + ORAB data1,X ;EA + ORAB data1 ;DA + ORAB data2 ;FA + + PSHA ;36 + PSHB ;37 + PSHX ;3C + + PULA ;32 + PULB ;33 + PULX ;38 + + ROL data1,X ;69 + ROL data1 ;79 + ROLA ;49 + ROLB ;59 + + ROR data1,X ;66 + ROR data1 ;76 + RORA ;46 + RORB ;56 + + RTI ;3B + RTS ;39 + + SBA ;10 + + SBCA #data1 ;82 + SBCA data1,X ;A2 + SBCA data1 ;92 + SBCA data2 ;B2 + + SBCB #data1 ;C2 + SBCB data1,X ;E2 + SBCB data1 ;D2 + SBCB data2 ;F2 + + SEI ;0F + SEV ;0B + SEC + + STS data1,X + STS data1 + STS data2 + + STAA data1,X ;A7 + STAA data1 ;97 + STAA data2 ;B7 + + STAB data1,X ;E7 + STAB data1 ;D7 + STAB data2 ;F7 + + STD data1,X ;ED + STD data1 ;DD + STD data2 ;FD + + STX data1,X ;EF + STX data1 ;FF + + SUBA #data1 ;80 + SUBA data1,X ;A0 + SUBA data1 ;90 + SUBA data2 ;B0 + + SUBB #data1 ;C0 + SUBB data1,X ;E0 + SUBB data1 ;D0 + SUBB data2 ;F0 + + SUBD #data1 ;83 + SUBD data1,X ;A3 + SUBD data1 ;93 + SUBD data2 ;B3 + + SWI ;3F + + TAB ;16 + TAP ;06 + TPA ;07 + TBA ;17 + + TST data1,X + TST data1 + TST data2 + + TSTA ;4D + TSTB ;5D + + TXS ;35 + TSX ;30 + + WAI ;3E + +; +; Test all the new 68HC11 instructions +; +bmsk .equ 12h +addr1 .equ 34h +addr2 .equ 5678h +imm .equ 55h + + ABY ;183A + ADCA addr1,Y ;18A9 + ADCB addr1,Y ;18E9 + ADDA addr1,Y ;18AB + ADDB addr1,Y ;18EB + ADDD addr1,Y ;18E3 + ANDA addr1,Y ;18A4 + ANDB addr1,Y ;18E4 + ASL addr1,Y ;1868 + ASR addr1,Y ;1867 +lab1 + BCLR addr1,Y,bmsk + BCLR addr1,X,bmsk + BCLR addr1,bmsk + + BITA addr1,Y ;18A5 + BITB addr1,Y ;18E5 + + BRCLR addr1,Y,bmsk,lab1 + BRCLR addr1,X,bmsk,lab1 + BRCLR addr1,bmsk,lab1 + BRCLR addr2,bmsk,lab1 + + BRSET addr1,Y,bmsk,lab1 + BRSET addr1,X,bmsk,lab1 + BRSET addr1,bmsk,lab1 + BRSET addr2,bmsk,lab1 + + BSET addr1,Y,bmsk + BSET addr1,X,bmsk + BSET addr1,bmsk + + CLR addr1,Y ;186F + CMPA addr1,Y ;18A1 + CMPB addr1,Y ;18E1 + COM addr1,Y ;1863 + CPD #imm ;1A83 + CPD addr1,X ;1AA3 + CPD addr1,Y ;CDA3 + CPD addr1 ;1AB3 + CPD addr2 ;1AB3 + CPX addr1,Y ;CDAC + CPY #imm ;188C + CPY addr1,Y ;18AC + CPY addr1,X ;1AAC + CPY addr1 ;18BC + CPY addr2 ;18BC + DEC addr1,Y ;186A + DEY ;1809 + EORA addr1,Y ;18A8 + EORB addr1,Y ;18E8 + FDIV ;03 + IDIV ;02 + INC addr1,Y ;186C + INY ;1808 + JMP addr1,Y ;186E + JSR addr1,Y ;18AD + LDAA addr1,Y ;18A6 + LDAB addr1,Y ;18E6 + LDD addr1,Y ;18EC + LDS addr1,Y ;18AE + LDX addr1,Y ;CDEE + LDY #imm ;18CE + LDY addr1,Y ;18EE + LDY addr1,X ;1AEE + LDY addr1 ;18FE + LDY addr2 ;18FE + LSL addr1,Y ;1868 + LSR addr1,Y ;1864 + NEG addr1,Y ;1860 + ORAA addr1,Y ;18AA + ORAB addr1,Y ;18EA + PSHY ;183C + PULY ;1838 + ROL addr1,Y ;1869 + ROR addr1,Y ;1866 + SBCA addr1,Y ;18A2 + SBCB addr1,Y ;18E2 + STAA addr1,Y ;18A7 + STAB addr1,Y ;18E7 + STD addr1,Y ;18ED + STS addr1,Y ;CDAF + STX addr1,Y ;CDEF + STY addr1,Y ;18EF + STY addr1,X ;1AEF + STY addr1 ;18FF + STY addr2 ;18FF + SUBA addr1,Y ;18A0 + SUBB addr1,Y ;18E0 + SUBD addr1,Y ;18A3 + TST addr1,Y ;186D +; TEST ; + TSY ;1830 2 NOP 4 + TYS ;1835 2 NOP 4 + XGDX ;8F 1 NOP 4 + XGDY ;188F 2 NOP 4 + + .end + + + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test70.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test70.asm new file mode 100644 index 00000000..f31223ed --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test70.asm @@ -0,0 +1,305 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test70.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: TMS7000 +; + + + +R0 .equ 0 +R1 .equ 1 +R2 .equ 2 +R3 .equ 3 +R12 .equ 12 +R13 .equ 13 +R7 .equ 7 +data1 .equ $34 +data2 .equ $1287 +table .equ $1234 +P7 .equ 7 + + .org $f000 +start: + ADC B,A + ADC %data1,A + ADC %data1,B + ADC %data1,R7 + ADC R12,A + ADC R13,B + ADC R12,R7 + + ADD B,A + ADD %data1,A + ADD %data1,B + ADD %data1,R7 + ADD R12,A + ADD R13,B + ADD R12,R7 + + AND B,A + AND %data1,A + AND %data1,B + AND %data1,R7 + AND R12,A + AND R13,B + AND R12,R7 + + ANDP A,R7 + ANDP B,R7 + ANDP %data1,R7 + + BTJO B,A,start + BTJO %data1,A,start + BTJO %data1,B,start + BTJO %data1,R7,start + BTJO R12,A,start + BTJO R13,B,start + BTJO R12,R7,start + +loop1 + BTJOP A,P7,loop1 + BTJOP B,P7,loop1 + BTJOP %data1,P7,loop1 + + BTJZ B,A,loop1 + BTJZ %data1,A,loop1 + BTJZ %data1,B,loop1 + BTJZ %data1,R7,loop1 + BTJZ R12,A,loop1 + BTJZ R12,B,loop1 + BTJZ R12,R7,loop1 + + BTJZP A,P7,loop1 + BTJZP B,P7,loop1 + BTJZP %data1,P7,loop1 + + BR @start(B) + BR @start[B] + BR @start + BR *R7 + + CALL @sub1(B) + CALL @sub1 + CALL *R7 + +sub1: CLR A + CLR B + CLR R12 + + CLRC + + CMP B,A + CMP %data1,A + CMP %data1,B + CMP %data1,R7 + CMP R12,A + CMP R12,B + CMP R12,R7 + + CMPA @R7(B) + CMPA @R7[B] + CMPA @R7 + CMPA *R7 + + DAC B,A + DAC %data1,A + DAC %data1,B + DAC %data1,R7 + DAC R12,A + DAC R12,B + DAC R12,R7 + + DEC A + DEC B + DEC R7 + + DECD A + DECD B + DECD R7 + + DINT + + DJNZ A,loop2 + DJNZ B,loop2 + DJNZ R12,loop2 + + DSB B,A + DSB %data1,A + DSB %data1,B + DSB %data1,R7 + DSB R12,A + DSB R12,B + DSB R12,R7 + + EINT + + IDLE + + INC A + INC B + INC R7 + + INV A + INV B + INV R7 +loop2: + JMP loop2 + + JC loop2 + JEQ loop2 + JGE loop2 + JGT loop2 + JHS loop2 + JL loop2 + JN loop2 + JNC loop2 + JNE loop2 + JNZ loop2 + JP loop2 + JPZ loop2 + JZ loop2 + + LDA @table(B) + LDA @table + LDA *R7 + + LDSP + + MOV A,B + MOV B,A + MOV A,R7 + MOV B,R7 + MOV %data1,A + MOV %data1,B + MOV %data1,R7 + MOV R12,A + MOV R12,B + MOV R12,R7 + + MOVD %data2,R7 + MOVD %data2[B],R7 + MOVD R12,R7 + + MOVP A,P7 + MOVP B,P7 + MOVP %data1,P7 + MOVP P7,A + MOVP P7,B + + MPY B,A + MPY %data1,A + MPY %data1,B + MPY %data1,R7 + MPY R12,A + MPY R12,B + MPY R12,R7 + + NOP + + OR B,A + OR %data1,A + OR %data1,B + OR %data1,R7 + OR R12,A + OR R12,B + OR R12,R7 + + ORP A,P7 + ORP B,P7 + ORP %data1,P7 + + POP A + POP B + POP R7 + + POPST + POP ST + + PUSH A + PUSH B + PUSH R7 + + PUSHST + PUSH ST + + RETI + + RETS + + RL A + RL B + RL R7 + + RLC A + RLC B + RLC R7 + + RR A + RR B + RR R7 + + RRC A + RRC B + RRC R7 + + SBB B,A + SBB %data1,A + SBB %data1,B + SBB %data1,R7 + SBB R12,A + SBB R12,B + SBB R12,R7 + + SETC + + STA @table(B) + STA @table + STA *R7 + + STSP + + SUB B,A + SUB %data1,A + SUB %data1,B + SUB %data1,R7 + SUB R12,A + SUB R12,B + SUB R12,R7 + + SWAP A + SWAP B + SWAP R7 + + TRAP 0 + TRAP 1 + TRAP 6 + TRAP 12 + TRAP 23 + + TST A + TSTA + TST B + TSTB + + XCHB A + XCHB R7 + + XOR B,A + XOR %data1,A + XOR %data1,B + XOR %data1,R7 + XOR R12,A + XOR R12,B + XOR R12,R7 + + XORP A,P7 + XORP B,P7 + XORP %data1,P7 + + + .end + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.lst b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.lst new file mode 100644 index 00000000..e69de29b diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.obj b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test80.obj new file mode 100644 index 00000000..e69de29b diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test85.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test85.asm new file mode 100644 index 00000000..f21f9c2f --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test85.asm @@ -0,0 +1,294 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test85.asm 1.1 1993/08/02 01:24:21 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 8080/8085 +; + + + +idata16 .equ 1234h +idata8 .equ 12h +port .equ 34h +addr16 .equ 5678h + + .org 1000h + +start: + nop + lxi b,idata16 + stax b + inx b + inr b + dcr b + mvi b,idata8 + rlc + + dad b + ldax b + dcx b + inr c + dcr c + mvi c,idata8 + rrc + +; --- ; 10 + lxi d,idata16 + stax d + inx d + inr d + dcr d + mvi d,idata8 + ral +; --- + dad d + ldax d + dcx d + inr e + dcr e + mvi e,idata8 + rar + + rim ; 20 + lxi h,idata16 + shld addr16 + inx h + inr h + dcr h + mvi h,idata8 + daa +; --- + dad h + lhld addr16 + dcx h + inr l + dcr l + mvi l,idata8 + cma + + sim ; 30 + lxi sp,idata16 + sta addr16 + inx sp + inr m + dcr m + mvi m,idata8 + stc +; --- + dad sp + lda addr16 + dcx sp + inr a + dcr a + mvi a,idata8 + cmc + + mov b,b ; 40 + mov b,c + mov b,d + mov b,e + mov b,h + mov b,l + mov b,m + mov b,a + mov c,b + mov c,c + mov c,d + mov c,e + mov c,h + mov c,l + mov c,m + mov c,a + + mov d,b ; 50 + mov d,c + mov d,d + mov d,e + mov d,h + mov d,l + mov d,m + mov d,a + mov e,b + mov e,c + mov e,d + mov e,e + mov e,h + mov e,l + mov e,m + mov e,a + + mov h,b ; 60 + mov h,c + mov h,d + mov h,e + mov h,h + mov h,l + mov h,m + mov h,a + mov l,b + mov l,c + mov l,d + mov l,e + mov l,h + mov l,l + mov l,m + mov l,a + + mov m,b ; 70 + mov m,c + mov m,d + mov m,e + mov m,h + mov m,l + hlt + mov m,a + mov a,b + mov a,c + mov a,d + mov a,e + mov a,h + mov a,l + mov a,m + mov a,a + + add b ; 80 + add c + add d + add e + add h + add l + add m + add a + adc b ; 88 + adc c + adc d + adc e + adc h + adc l + adc m + adc a + + sub b ; 90 + sub c + sub d + sub e + sub h + sub l + sub m + sub a + sbb b ; 98 + sbb c + sbb d + sbb e + sbb h + sbb l + sbb m + sbb a + + ana b ; a0 + ana c + ana d + ana e + ana h + ana l + ana m + ana a + xra b ; a8 + xra c + xra d + xra e + xra h + xra l + xra m + xra a + + ora b ; b0 + ora c + ora d + ora e + ora h + ora l + ora m + ora a + cmp b ; b8 + cmp c + cmp d + cmp e + cmp h + cmp l + cmp m + cmp a + + rnz ; c0 + pop b + jnz start + jmp start + cnz start + push b + adi idata8 + rst 0 + rz + ret + jz start +; --- + cz start + call start + aci idata8 + rst 1 + + rnc ; d0 + pop d + jnc start + out port + cnc start + push d + sui idata8 + rst 2 + rc +; --- + jc start + in port + cc start +; --- + sbi idata8 + rst 3 + + rpo ; e0 + pop h + jpo start + xthl + cpo start + push h + ani idata8 + rst 4 + rpe + pchl + jpe start + xchg + cpe start +; --- + xri idata8 + rst 5 + + rp ; f0 + pop psw + jp start + di + cp start + push psw + ori idata8 + rst 6 + rm + sphl + jm start + ei + cm start +; --- + cpi idata8 + rst 7 + + .END + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/test96.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test96.asm new file mode 100644 index 00000000..be74931e --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/test96.asm @@ -0,0 +1,887 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: test96.asm 1.1 1997/11/23 15:51:20 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: 8096/8XC196KC +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; + +; CPU "8096.TBL" ; CPU TABLE +; HOF "INT8" ; HEX FORMAT + +#define EQU .equ +#define END .end +#define ORG .org +#define DWL .dw +#define IF #if +#define ENDI #endif + +wreg: EQU 12h ; word register even address +wreg1: EQU 22h ; word register even address +wreg2: EQU 32h ; word register even address +wreg3: EQU 42h ; word register even address +lreg1: EQU 44h ; long register (32 bit) +lreg2: EQU 48h ; long register (32 bit) +breg: EQU wreg+1 ; low byte of reg. where odd is allowed +breg1: EQU wreg+3 ; low byte of reg. where odd is allowed +breg2: EQU wreg+5 ; low byte of reg. where odd is allowed +breg3: EQU wreg+7 ; low byte of reg. where odd is allowed + +imm8: EQU 88H +imm16: EQU 4321H + +addr8: EQU 12H +addr16: EQU 3456H + +ishort: EQU 12H +ishrt: EQU 12H +ilong: EQU 4567H + +count: EQU 7H + + ORG 7418h + +dtable: DWL $1234 + DWL $5678 + DWL $1234 + + +;------------------------------------- +; ADD + add wreg1,#imm8 + add wreg1,#imm16 + add wreg1,wreg2 + add wreg1,addr16 + add wreg1,[wreg2] + add wreg1,[wreg2]+ + add wreg1,addr8[wreg2] + add wreg1,addr16[wreg2] + + add wreg1,wreg2,#imm8 + add wreg1,wreg2,#imm16 + add wreg1,wreg2,wreg3 + add wreg1,wreg2,addr16 + add wreg1,wreg2,[wreg3] + add wreg1,wreg2,[wreg3]+ + add wreg1,wreg2,addr8[wreg3] + add wreg1,wreg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; ADDB + addb breg1,#imm8 + addb breg1,breg2 + addb breg1,addr16 + addb breg1,[wreg2] + addb breg1,[wreg2]+ + addb breg1,addr8[wreg2] + addb breg1,addr16[wreg2] + + addb breg1,breg2,#imm8 + addb breg1,breg2,breg3 + addb breg1,breg2,addr16 + addb breg1,breg2,[wreg3] + addb breg1,breg2,[wreg3]+ + addb breg1,breg2,addr8[wreg3] + addb breg1,breg2,addr16[wreg3] +;------------------------------------- + + +;------------------------------------- +; ADDB + addc wreg1,#imm8 + addc wreg1,#imm16 + addc wreg1,wreg2 + addc wreg1,addr16 + addc wreg1,[wreg2] + addc wreg1,[wreg2]+ + addc wreg1,addr8[wreg2] + addc wreg1,addr16[wreg2] + + ; No three arg form for addc +;------------------------------------- + +;------------------------------------- +; ADDCB + addcb breg1,#imm8 + addcb breg1,breg2 + addcb breg1,addr16 + addcb breg1,[wreg2] + addcb breg1,[wreg2]+ + addcb breg1,addr8[wreg2] + addcb breg1,addr16[wreg2] + + ; No three arg form for addcb +;------------------------------------- + +;------------------------------------- +; AND + and wreg1,#imm8 + and wreg1,#imm16 + and wreg1,wreg2 + and wreg1,addr16 + and wreg1,[wreg2] + and wreg1,[wreg2]+ + and wreg1,addr8[wreg2] + and wreg1,addr16[wreg2] + + and wreg1,wreg2,#imm8 + and wreg1,wreg2,#imm16 + and wreg1,wreg2,wreg3 + and wreg1,wreg2,addr16 + and wreg1,wreg2,[wreg3] + and wreg1,wreg2,[wreg3]+ + and wreg1,wreg2,addr8[wreg3] + and wreg1,wreg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; ANDB + andb breg1,#imm8 + andb breg1,breg2 + andb breg1,addr16 + andb breg1,[wreg2] + andb breg1,[wreg2]+ + andb breg1,addr8[wreg2] + andb breg1,addr16[wreg2] + + andb breg1,breg2,#imm8 + andb breg1,breg2,breg3 + andb breg1,breg2,addr16 + andb breg1,breg2,[wreg3] + andb breg1,breg2,[wreg3]+ + andb breg1,breg2,addr8[wreg3] + andb breg1,breg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; BMOV + bmov lreg1,wreg1 + bmov lreg1,wreg2 +;------------------------------------- + +;------------------------------------- +; BR + br [wreg1] +;------------------------------------- + +;------------------------------------- +; MISC CLR + clr wreg1 + clrb breg1 + clrc + clrvt +;------------------------------------- + + + +;------------------------------------- +; CMP + cmp wreg1,#imm8 + cmp wreg1,#imm16 + cmp wreg1,wreg2 + cmp wreg1,addr16 + cmp wreg1,[wreg2] + cmp wreg1,[wreg2]+ + cmp wreg1,addr8[wreg2] + cmp wreg1,addr16[wreg2] + + ; No three arg form for cmp +;------------------------------------- + +;------------------------------------- +; CMPB + cmpb breg1,#imm8 + cmpb breg1,breg2 + cmpb breg1,addr16 + cmpb breg1,[wreg2] + cmpb breg1,[wreg2]+ + cmpb breg1,addr8[wreg2] + cmpb breg1,addr16[wreg2] + + ; No three arg form for cmpb +;------------------------------------- + +;------------------------------------- +; CMPL + cmpl lreg1,lreg2 +;------------------------------------- + +;------------------------------------- +; DEC + dec wreg1 + decb breg1 +;------------------------------------- + +;------------------------------------- +; DEC + di +;------------------------------------- + + +;------------------------------------- +; DIV + div lreg1,#imm8 + div lreg1,#imm16 + div lreg1,wreg2 + div lreg1,addr16 + div lreg1,[wreg2] + div lreg1,[wreg2]+ + div lreg1,addr8[wreg2] + div lreg1,addr16[wreg2] + + ; No three arg form for div +;------------------------------------- + +;------------------------------------- +; DIVB + divb wreg1,#imm8 + divb wreg1,breg2 + divb wreg1,addr16 + divb wreg1,[wreg2] + divb wreg1,[wreg2]+ + divb wreg1,addr8[wreg2] + divb wreg1,addr16[wreg2] + + ; No three arg form for divb +;------------------------------------- + + +;------------------------------------- +; DIVU + divu lreg1,#imm8 + divu lreg1,#imm16 + divu lreg1,wreg2 + divu lreg1,addr16 + divu lreg1,[wreg2] + divu lreg1,[wreg2]+ + divu lreg1,addr8[wreg2] + divu lreg1,addr16[wreg2] + + ; No three arg form for divu +;------------------------------------- + +;------------------------------------- +; DIVUB + divub wreg1,#imm8 + divub wreg1,breg2 + divub wreg1,addr16 + divub wreg1,[wreg2] + divub wreg1,[wreg2]+ + divub wreg1,addr8[wreg2] + divub wreg1,addr16[wreg2] + + ; No three arg form for divub +;------------------------------------- + + +;------------------------------------- +; DJNZ +rtest1: ;backward reference + djnz breg1,rtest1 + djnz breg1,rtest1 + djnz breg1,rtest2 + djnz breg1,rtest2 +rtest2: ;forward reference +;------------------------------------- + +;------------------------------------- +; DJNZW + djnzw wreg1,rtest1 + djnzw wreg1,rtest1 + djnzw wreg1,rtest3 + djnzw wreg1,rtest3 +rtest3: ;forward reference +;------------------------------------- + +;------------------------------------- +; DPTS + dpts +;------------------------------------- + +;------------------------------------- +; EI + ei +;------------------------------------- + +;------------------------------------- +; EPTS + epts +;------------------------------------- + +;------------------------------------- +; EXT & EXTB + ext lreg1 + ext lreg2 + extb wreg1 + extb wreg2 +;------------------------------------- + +;------------------------------------- +; IDLPD + idlpd #1 + idlpd #2 +;------------------------------------- + +;------------------------------------- +; INC & INCB + inc wreg1 + inc wreg2 + incb breg1 + incb breg2 +;------------------------------------- + + +FLAG: EQU 3 +;------------------------------------- +; JBC + jbc breg1,0,rtest1 + jbc breg1,1,rtest1 + jbc breg1,2,rtest1 + jbc breg1,3,rtest1 + jbc breg1,4,rtest1 + jbc breg1,5,rtest1 + jbc breg1,6,rtest1 + jbc breg1,7,rtest1 +;------------------------------------- + +;------------------------------------- +; JBS + jbs breg1,0,rtest1 + jbs breg1,1,rtest1 + jbs breg1,2,rtest1 + jbs breg1,3,rtest1 + jbs breg1,4,rtest1 + jbs breg1,5,rtest1 + jbs breg1,6,rtest1 + jbs breg1,7,rtest1 +;------------------------------------- + +;------------------------------------- +; MISC Jump backward + jc rtest1 + je rtest1 + jge rtest1 + jgt rtest1 + jh rtest1 + jle rtest1 + jlt rtest1 + jnc rtest1 + jne rtest1 + jnh rtest1 + jnst rtest1 + jnv rtest1 + jnvt rtest1 + jst rtest1 + jv rtest1 + jvt rtest1 +;------------------------------------- + +;------------------------------------- +; MISC Jump forward + jc rtest4 + je rtest4 + jge rtest4 + jgt rtest4 + jh rtest4 + jle rtest4 + jlt rtest4 + jnc rtest4 + jne rtest4 + jnh rtest4 + jnst rtest4 + jnv rtest4 + jnvt rtest4 + jst rtest4 + jv rtest4 +rtest4: jvt rtest4 +;------------------------------------- + +;------------------------------------- +; LCALL + lcall rtest1 + lcall rtest2 + lcall rtest4 + lcall addr8 + lcall addr16 +;------------------------------------- + + +;------------------------------------- +; LD + ld wreg1,#imm8 + ld wreg1,#imm16 + ld wreg1,wreg2 + ld wreg1,addr16 + ld wreg1,[wreg2] + ld wreg1,[wreg2]+ + ld wreg1,addr8[wreg2] + ld wreg1,addr16[wreg2] + + ; No three arg form for ld +;------------------------------------- + +;------------------------------------- +; LDB + ldb breg1,#imm8 + ldb breg1,breg2 + ldb breg1,addr16 + ldb breg1,[wreg2] + ldb breg1,[wreg2]+ + ldb breg1,addr8[wreg2] + ldb breg1,addr16[wreg2] + + ; No three arg form for ldb +;------------------------------------- + +;------------------------------------- +; LDBSE + ldbse wreg1,#imm8 + ldbse wreg1,breg2 + ldbse wreg1,addr16 + ldbse wreg1,[wreg2] + ldbse wreg1,[wreg2]+ + ldbse wreg1,addr8[wreg2] + ldbse wreg1,addr16[wreg2] + + ; No three arg form for ldbse +;------------------------------------- + +;------------------------------------- +; LDBZE + ldbze wreg1,#imm8 + ldbze wreg1,breg2 + ldbze wreg1,addr16 + ldbze wreg1,[wreg2] + ldbze wreg1,[wreg2]+ + ldbze wreg1,addr8[wreg2] + ldbze wreg1,addr16[wreg2] + + ; No three arg form for ldbze +;------------------------------------- + +;------------------------------------- +; LJMP + ljmp addr8 + ljmp addr16 +;------------------------------------- + + +;------------------------------------- +; MUL + mul lreg1,#imm8 + mul lreg1,#imm16 + mul lreg1,wreg2 + mul lreg1,addr16 + mul lreg1,[wreg2] + mul lreg1,[wreg2]+ + mul lreg1,addr8[wreg2] + mul lreg1,addr16[wreg2] + + mul lreg1,wreg2,#imm8 + mul lreg1,wreg2,#imm16 + mul lreg1,wreg2,wreg3 + mul lreg1,wreg2,addr16 + mul lreg1,wreg2,[wreg3] + mul lreg1,wreg2,[wreg3]+ + mul lreg1,wreg2,addr8[wreg3] + mul lreg1,wreg2,addr16[wreg3] + +;------------------------------------- + + +;------------------------------------- +; MULB + mulb wreg1,#imm8 + mulb wreg1,breg2 + mulb wreg1,addr16 + mulb wreg1,[wreg2] + mulb wreg1,[wreg2]+ + mulb wreg1,addr8[wreg2] + mulb wreg1,addr16[wreg2] + + mulb wreg1,breg2,#imm8 + mulb wreg1,breg2,breg3 + mulb wreg1,breg2,addr16 + mulb wreg1,breg2,[wreg3] + mulb wreg1,breg2,[wreg3]+ + mulb wreg1,breg2,addr8[wreg3] + mulb wreg1,breg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; MULU + mulu lreg1,#imm8 + mulu lreg1,#imm16 + mulu lreg1,wreg2 + mulu lreg1,addr16 + mulu lreg1,[wreg2] + mulu lreg1,[wreg2]+ + mulu lreg1,addr8[wreg2] + mulu lreg1,addr16[wreg2] + + mulu lreg1,wreg2,#imm8 + mulu lreg1,wreg2,#imm16 + mulu lreg1,wreg2,wreg3 + mulu lreg1,wreg2,addr16 + mulu lreg1,wreg2,[wreg3] + mulu lreg1,wreg2,[wreg3]+ + mulu lreg1,wreg2,addr8[wreg3] + mulu lreg1,wreg2,addr16[wreg3] + +;------------------------------------- + + +;------------------------------------- +; MULUB + mulub wreg1,#imm8 + mulub wreg1,breg2 + mulub wreg1,addr16 + mulub wreg1,[wreg2] + mulub wreg1,[wreg2]+ + mulub wreg1,addr8[wreg2] + mulub wreg1,addr16[wreg2] + + mulub wreg1,breg2,#imm8 + mulub wreg1,breg2,breg3 + mulub wreg1,breg2,addr16 + mulub wreg1,breg2,[wreg3] + mulub wreg1,breg2,[wreg3]+ + mulub wreg1,breg2,addr8[wreg3] + mulub wreg1,breg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; NEG & NEGB + neg wreg1 + negb breg1 +;------------------------------------- + +;------------------------------------- +; NOP + nop +;------------------------------------- + +;------------------------------------- +; NORML + norml lreg1,breg1 +;------------------------------------- + +;------------------------------------- +; NOT & NOTB + not wreg1 + notb breg1 +;------------------------------------- + + +;------------------------------------- +; OR + or wreg1,#imm8 + or wreg1,#imm16 + or wreg1,wreg2 + or wreg1,addr16 + or wreg1,[wreg2] + or wreg1,[wreg2]+ + or wreg1,addr8[wreg2] + or wreg1,addr16[wreg2] + + ; No three arg form for or +;------------------------------------- + +;------------------------------------- +; ORB + orb breg1,#imm8 + orb breg1,breg2 + orb breg1,addr16 + orb breg1,[wreg2] + orb breg1,[wreg2]+ + orb breg1,addr8[wreg2] + orb breg1,addr16[wreg2] + + ; No three arg form for orb +;------------------------------------- + + +;------------------------------------- +; POP + pop wreg1 + pop [wreg1] + pop [wreg1]+ + pop addr8[wreg1] + pop addr16[wreg1] + + popa + popf +;------------------------------------- + +;------------------------------------- +; PUSH + push wreg1 + push [wreg1] + push [wreg1]+ + push addr8[wreg1] + push addr16[wreg1] + + pusha + pushf +;------------------------------------- + + +;------------------------------------- +; RET - return + ret +;------------------------------------- + +;------------------------------------- +; RST - reset + rst +;------------------------------------- + +;------------------------------------- +; SCALL - short call +scall1: +scall2: EQU scall1-1015 + scall scall1 + scall scall1 + scall scall2 + scall scall2 + scall scall3 + scall scall4 +scall3: +scall4: EQU scall3+1020 +;------------------------------------- + +;------------------------------------- +; SETC - set carry + setc +;------------------------------------- + +;------------------------------------- +; shl - shift word left + shl wreg1,#count + shl wreg2,breg1 +;------------------------------------- + +;------------------------------------- +; shlb - shift byte left + shlb breg1,#count + shlb breg2,breg1 +;------------------------------------- + +;------------------------------------- +; shll - shift long word left + shll lreg1,#count + shll lreg1,breg1 +;------------------------------------- + +;------------------------------------- +; shr - logical shift word right + shr wreg1,#count + shr wreg2,breg1 +;------------------------------------- + +;------------------------------------- +; shra - arithmetic shift word right + shra wreg1,#count + shra wreg2,breg1 +;------------------------------------- + +;------------------------------------- +; shrab - arithmetic shift byte right + shrab breg1,#count + shrab breg2,breg1 +;------------------------------------- + +;------------------------------------- +; shral - arithmetic shift long word right + shral lreg1,#count + shral lreg1,breg1 +;------------------------------------- + +;------------------------------------- +; shrb - logical shift byte right + shrb breg1,#count + shrb breg2,breg1 +;------------------------------------- + +;------------------------------------- +; shrl - logical shift long word right + shrl lreg1,#count + shrl lreg1,breg1 +;------------------------------------- + + +;------------------------------------- +; SJMP - short jump +sjump1: +sjump2: EQU sjump1-1015 + sjmp sjump1 + sjmp sjump1 + sjmp sjump2 + sjmp sjump2 + sjmp sjump3 + sjmp sjump4 +sjump3: +sjump4: EQU sjump3+1020 +;------------------------------------- + +;------------------------------------- +; skip - two byte nop + skip breg1 +;------------------------------------- + + +;------------------------------------- +; ST - store word + st wreg1,wreg2 + st wreg1,addr16 + st wreg1,[wreg2] + st wreg1,[wreg2]+ + st wreg1,addr8[wreg2] + st wreg1,addr16[wreg2] + + ; No three arg form for st; No immediate +;------------------------------------- + +;------------------------------------- +; STB - store byte + stb breg1,breg2 + stb breg1,addr16 + stb breg1,[wreg2] + stb breg1,[wreg2]+ + stb breg1,addr8[wreg2] + stb breg1,addr16[wreg2] + + ; No three arg form for stb; No immediate +;------------------------------------- + + +;------------------------------------- +; SUB - subtract word + sub wreg1,#imm8 + sub wreg1,#imm16 + sub wreg1,wreg2 + sub wreg1,addr16 + sub wreg1,[wreg2] + sub wreg1,[wreg2]+ + sub wreg1,addr8[wreg2] + sub wreg1,addr16[wreg2] + + sub wreg1,wreg2,#imm8 + sub wreg1,wreg2,#imm16 + sub wreg1,wreg2,wreg3 + sub wreg1,wreg2,addr16 + sub wreg1,wreg2,[wreg3] + sub wreg1,wreg2,[wreg3]+ + sub wreg1,wreg2,addr8[wreg3] + sub wreg1,wreg2,addr16[wreg3] +;------------------------------------- + +;------------------------------------- +; SUBB - subtract byte + subb breg1,#imm8 + subb breg1,breg2 + subb breg1,addr16 + subb breg1,[wreg2] + subb breg1,[wreg2]+ + subb breg1,addr8[wreg2] + subb breg1,addr16[wreg2] + + subb breg1,breg2,#imm8 + subb breg1,breg2,breg3 + subb breg1,breg2,addr16 + subb breg1,breg2,[wreg3] + subb breg1,breg2,[wreg3]+ + subb breg1,breg2,addr8[wreg3] + subb breg1,breg2,addr16[wreg3] +;------------------------------------- + + +;------------------------------------- +; SUBC - subtract word with carry + subc wreg1,#imm8 + subc wreg1,#imm16 + subc wreg1,wreg2 + subc wreg1,addr16 + subc wreg1,[wreg2] + subc wreg1,[wreg2]+ + subc wreg1,addr8[wreg2] + subc wreg1,addr16[wreg2] + + ; No three arg form for subc +;------------------------------------- + +;------------------------------------- +; SUBCB - subtract byte with carry + subcb breg1,#imm8 + subcb breg1,breg2 + subcb breg1,addr16 + subcb breg1,[wreg2] + subcb breg1,[wreg2]+ + subcb breg1,addr8[wreg2] + subcb breg1,addr16[wreg2] + + ; No three arg form for subcb +;------------------------------------- + + +;------------------------------------- +; tijmp - table indirect jump + tijmp wreg1,[wreg2],#imm8 + tijmp wreg2,[wreg1],#imm8 + tijmp wreg3,[wreg2],#13 +;------------------------------------- + +;------------------------------------- +; TRAP - software trap + trap +;------------------------------------- + +;------------------------------------- +; XCH - exchange word + xch wreg1,wreg2 + xch wreg1,addr16 + xch wreg1,addr8[wreg2] + xch wreg1,addr16[wreg2] +;------------------------------------- + +;------------------------------------- +; XCHB - exchange byte + xchb breg1,breg2 + xchb breg1,addr16 + xchb breg1,addr8[wreg2] + xchb breg1,addr16[wreg2] +;------------------------------------- + + +;------------------------------------- +; XOR + xor wreg1,#imm8 + xor wreg1,#imm16 + xor wreg1,wreg2 + xor wreg1,addr16 + xor wreg1,[wreg2] + xor wreg1,[wreg2]+ + xor wreg1,addr8[wreg2] + xor wreg1,addr16[wreg2] + + ; No three arg form for xor +;------------------------------------- + +;------------------------------------- +; XORB + xorb breg1,#imm8 + xorb breg1,breg2 + xorb breg1,addr16 + xorb breg1,[wreg2] + xorb breg1,[wreg2]+ + xorb breg1,addr8[wreg2] + xorb breg1,addr16[wreg2] + + ; No three arg form for xorb +;------------------------------------- + + END diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/testtabs.bat b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testtabs.bat new file mode 100644 index 00000000..af183eca --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testtabs.bat @@ -0,0 +1,34 @@ +@echo off +rem mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +rem $Id: testtabs.bat 1.3 1998/02/25 12:27:04 toma Exp $ +rem mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm +rem Run TASM on all the table test files. Those that have +rem extended instuctions use the -x option. + +rem If TASMTABS is defined then use it to compute the full path to the +rem the TASM executable. Otherwise assume it is in the PATH or local +rem directory. + +IF DEFINED TASMTABS ( + set TASMEXE=%TASMTABS%\tasm +) ELSE ( + set TASMEXE=tasm +) + + +rem Assemble a sample file for each supported processor. + +"%TASMEXE%" -48 -x test48.asm +"%TASMEXE%" -65 -x test65.asm +"%TASMEXE%" -51 test51.asm +"%TASMEXE%" -85 test85.asm +"%TASMEXE%" -80 -x testz80.asm +"%TASMEXE%" -05 -x test05.asm +"%TASMEXE%" -3210 test3210.asm +"%TASMEXE%" -3225 test3225.asm +"%TASMEXE%" -68 -x test68.asm +"%TASMEXE%" -70 test70.asm +"%TASMEXE%" -96 -x test96.asm + +pause + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.asm b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.asm new file mode 100644 index 00000000..a4437f23 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.asm @@ -0,0 +1,831 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; $Id: testz80.asm 1.4 1998/02/25 12:18:20 toma Exp $ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +; TASM test file +; Test all instructions and addressing modes. +; Processor: Z80 +; +; SEPT. 16,1987 +; CARL A. WALL +; VE3APY +; +; + +#define equ .equ +#define end .end + +n: equ 20h +nn: equ 0584h +dddd: equ 07h +addr16: equ $1234 +port: equ 3 +imm8: equ 56h ;immediate data (8 bits) +offset: equ 7 +offset_neg: equ -7 + +; try a few cases that have two expressions in the args and +; one is inside (). + LD (IX+offset),n+1+4+8-9 + LD (IX+offset+5),n-1 + LD (IX+dddd),n + LD (IX+offset),n + LD (IX+offset),n + +; Try all possible instructions + + ADC A,(HL) + ADC A,(IX+offset) + ADC A,(IX+offset_neg) + ADC A,(IY+offset) + ADC A,(IY+offset_neg) + ADC A,A + ADC A,B + ADC A,C + ADC A,D + ADC A,E + ADC A,H + ADC A,L + ADC A,n + ADC HL,BC + ADC HL,DE + ADC HL,HL + ADC HL,SP + + ADD A,(HL) + ADD A,(IX+offset) + ADD A,(IY+offset) + ADD A,A + ADD A,B + ADD A,C + ADD A,D + ADD A,E + ADD A,H + ADD A,L + ADD A,n + ADD HL,BC + ADD HL,DE + ADD HL,HL + ADD HL,SP + ADD IX,BC + ADD IX,DE + ADD IX,IX + ADD IX,SP + ADD IY,BC + ADD IY,DE + ADD IY,IY + ADD IY,SP + + AND (HL) + AND (IX+offset) + AND (IY+offset) + AND A + AND B + AND C + AND D + AND E + AND H + AND L + AND n + + BIT 0,(HL) + BIT 0,(IX+offset) + BIT 0,(IY+offset) + BIT 0,A + BIT 0,B + BIT 0,C + BIT 0,D + BIT 0,E + BIT 0,H + BIT 0,L + + BIT 1,(HL) + BIT 1,(IX+offset) + BIT 1,(IY+offset) + BIT 1,A + BIT 1,B + BIT 1,C + BIT 1,D + BIT 1,E + BIT 1,H + BIT 1,L + + BIT 2,(HL) + BIT 2,(IX+offset) + BIT 2,(IY+offset) + BIT 2,A + BIT 2,B + BIT 2,C + BIT 2,D + BIT 2,E + BIT 2,H + BIT 2,L + + BIT 3,(HL) + BIT 3,(IX+offset) + BIT 3,(IY+offset) + BIT 3,A + BIT 3,B + BIT 3,C + BIT 3,D + BIT 3,E + BIT 3,H + BIT 3,L + + BIT 4,(HL) + BIT 4,(IX+offset) + BIT 4,(IY+offset) + BIT 4,A + BIT 4,B + BIT 4,C + BIT 4,D + BIT 4,E + BIT 4,H + BIT 4,L + + BIT 5,(HL) + BIT 5,(IX+offset) + BIT 5,(IY+offset) + BIT 5,A + BIT 5,B + BIT 5,C + BIT 5,D + BIT 5,E + BIT 5,H + BIT 5,L + + BIT 6,(HL) + BIT 6,(IX+offset) + BIT 6,(IY+offset) + BIT 6,A + BIT 6,B + BIT 6,C + BIT 6,D + BIT 6,E + BIT 6,H + BIT 6,L + + BIT 7,(HL) + BIT 7,(IX+offset) + BIT 7,(IY+offset) + BIT 7,A + BIT 7,B + BIT 7,C + BIT 7,D + BIT 7,E + BIT 7,H + BIT 7,L + + CALL C,addr16 + CALL M,addr16 + CALL NC,addr16 + CALL NZ,addr16 + CALL P,addr16 + CALL PE,addr16 + CALL PO,addr16 + CALL Z,addr16 + CALL addr16 + + CCF + + CP (HL) + CP (IX+offset) + CP (IY+offset) + CP A + CP B + CP C + CP D + CP E + CP H + CP L + CP imm8 + CPD + CPDR + CPIR + CPI + CPL + + DAA + + DEC (HL) + DEC (IX+offset) + DEC (IY+offset) + DEC A + DEC B + DEC BC + DEC C + DEC D + DEC DE + DEC E + DEC H + DEC HL + DEC IX + DEC IY + DEC L + DEC SP + DI +loop1: + DJNZ loop1 + + EI + EX (SP),HL + EX (SP),IX + EX (SP),IY + EX AF,AF' + EX DE,HL + EXX + HALT + + IM 0 + IM 1 + IM 2 + + IN A,(C) + IN B,(C) + IN C,(C) + IN D,(C) + IN E,(C) + IN H,(C) + IN L,(C) + IN A,(port) + + IN0 B,(n) + IN0 C,(n) + IN0 D,(n) + IN0 E,(n) + IN0 H,(n) + IN0 L,(n) + + INC (HL) + INC (IX+offset) + INC (IY+offset) + INC A + INC B + INC BC + INC C + INC D + INC DE + INC E + INC H + INC HL + INC IX + INC IY + INC L + INC SP + + IND + INDR + INI + INIR + + JP addr16 + JP (HL) + JP (IX) + JP (IY) + JP C,addr16 + JP M,addr16 + JP NC,addr16 + JP NZ,addr16 + JP P,addr16 + JP PE,addr16 + JP PO,addr16 + JP Z,addr16 + +loop2: + JR C,loop2 + JR NC,loop2 + JR NZ,loop2 + JR Z,loop2 + JR loop2 + + LD (BC),A + LD (DE),A + LD (HL),A + LD (HL),B + LD (HL),C + LD (HL),D + LD (HL),E + LD (HL),H + LD (HL),L + LD (HL),n + LD (IX+offset),A + LD (IX+offset),B + LD (IX+offset),C + LD (IX+offset),D + LD (IX+offset),E + LD (IX+offset),H + LD (IX+offset),L + LD (IX+offset),n + LD (IY+offset),A + LD (IY+offset),B + LD (IY+offset),C + LD (IY+offset),D + LD (IY+offset),E + LD (IY+offset),H + LD (IY+offset),L + LD (IY+offset),n + LD (nn),A + LD (nn),BC + LD (nn),DE + LD (nn),HL + LD (nn),IX + LD (nn),IY + LD (nn),SP + LD A,(BC) + LD A,(DE) + LD A,(HL) + LD A,(IX+offset) + LD A,(IY+offset) + LD A,(nn) + LD A,A + LD A,B + LD A,C + LD A,D + LD A,E + LD A,H + LD A,I + LD A,L + LD A,n + LD A,R + LD B,(HL) + LD B,(IX+offset) + LD B,(IY+offset) + LD B,A + LD B,B + LD B,C + LD B,D + LD B,E + LD B,H + LD B,L + LD B,n + LD BC,(nn) + LD BC,nn + LD C,(HL) + LD C,(IX+offset) + LD C,(IY+offset) + LD C,A + LD C,B + LD C,C + LD C,D + LD C,E + LD C,H + LD C,L + LD C,n + LD D,(HL) + LD D,(IX+offset) + LD D,(IY+offset) + LD D,A + LD D,B + LD D,C + LD D,D + LD D,E + LD D,H + LD D,L + LD D,n + LD DE,(nn) + LD DE,nn + LD E,(HL) + LD E,(IX+offset) + LD E,(IY+offset) + LD E,A + LD E,B + LD E,C + LD E,D + LD E,E + LD E,H + LD E,L + LD E,n + LD H,(HL) + LD H,(IX+offset) + LD H,(IY+offset) + LD H,A + LD H,B + LD H,C + LD H,D + LD H,E + LD H,H + LD H,L + LD H,n + LD HL,(nn) + LD HL,nn + LD I,A + LD IX,(nn) + LD IX,nn + LD IY,(nn) + LD IY,nn + LD L,(HL) + LD L,(IX+offset) + LD L,(IY+offset) + LD L,A + LD L,B + LD L,C + LD L,D + LD L,E + LD L,H + LD L,L + LD L,n + LD R,A + LD SP,(nn) + LD SP,HL + LD SP,IX + LD SP,IY + LD SP,nn + + LDD + LDDR + LDI + LDIR + + MLT BC + MLT DE + MLT HL + MLT SP + + NEG + NOP + + OR (HL) + OR (IX+offset) + OR (IY+offset) + OR A + OR B + OR C + OR D + OR E + OR H + OR L + OR imm8 + + OTDR + OTIR + + OUT (C),A + OUT (C),B + OUT (C),C + OUT (C),D + OUT (C),E + OUT (C),H + OUT (C),L + OUT (port),A + + OUT0 (imm8),A + OUT0 (imm8),B + OUT0 (imm8),C + OUT0 (imm8),D + OUT0 (imm8),E + OUT0 (imm8),H + OUT0 (imm8),L + + OUTD + OUTI + OTIM + OTDM + OTIMR + OTDMR + + POP AF + POP BC + POP DE + POP HL + POP IX + POP IY + + PUSH AF + PUSH BC + PUSH DE + PUSH HL + PUSH IX + PUSH IY + + RES 0,(HL) + RES 0,(IX+offset) + RES 0,(IY+offset) + RES 0,A + RES 0,B + RES 0,C + RES 0,D + RES 0,E + RES 0,H + RES 0,L + + RES 1,(HL) + RES 1,(IX+offset) + RES 1,(IY+offset) + RES 1,A + RES 1,B + RES 1,C + RES 1,D + RES 1,E + RES 1,H + RES 1,L + + RES 2,(HL) + RES 2,(IX+offset) + RES 2,(IY+offset) + RES 2,A + RES 2,B + RES 2,C + RES 2,D + RES 2,E + RES 2,H + RES 2,L + + RES 3,(HL) + RES 3,(IX+offset) + RES 3,(IY+offset) + RES 3,A + RES 3,B + RES 3,C + RES 3,D + RES 3,E + RES 3,H + RES 3,L + + RES 4,(HL) + RES 4,(IX+offset) + RES 4,(IY+offset) + RES 4,A + RES 4,B + RES 4,C + RES 4,D + RES 4,E + RES 4,H + RES 4,L + + RES 5,(HL) + RES 5,(IX+offset) + RES 5,(IY+offset) + RES 5,A + RES 5,B + RES 5,C + RES 5,D + RES 5,E + RES 5,H + RES 5,L + + RES 6,(HL) + RES 6,(IX+offset) + RES 6,(IY+offset) + RES 6,A + RES 6,B + RES 6,C + RES 6,D + RES 6,E + RES 6,H + RES 6,L + + RES 7,(HL) + RES 7,(IX+offset) + RES 7,(IY+offset) + RES 7,A + RES 7,B + RES 7,C + RES 7,D + RES 7,E + RES 7,H + RES 7,L + + RET + RET C + RET M + RET NC + RET NZ + RET P + RET PE + RET PO + RET Z + RETI + RETN + + RL (HL) + RL (IX+offset) + RL (IY+offset) + RL A + RL B + RL C + RL D + RL E + RL H + RL L + RLA + + RLC (HL) + RLC (IX+offset) + RLC (IY+offset) + RLC A + RLC B + RLC C + RLC D + RLC E + RLC H + RLC L + RLCA + RLD + + RR (HL) + RR (IX+offset) + RR (IY+offset) + RR A + RR B + RR C + RR D + RR E + RR H + RR L + RRA + + RRC (HL) + RRC (IX+offset) + RRC (IY+offset) + RRC A + RRC B + RRC C + RRC D + RRC E + RRC H + RRC L + RRCA + RRD + + RST 00H + RST 08H + RST 10H + RST 18H + RST 20H + RST 28H + RST 30H + RST 38H + + SBC A,n + SBC A,(HL) + SBC A,(IX+offset) + SBC A,(IY+offset) + SBC A,A + SBC A,B + SBC A,C + SBC A,D + SBC A,E + SBC A,H + SBC A,L + SBC HL,BC + SBC HL,DE + SBC HL,HL + SBC HL,SP + SCF + + SET 0,(HL) + SET 0,(IX+offset) + SET 0,(IY+offset) + SET 0,A + SET 0,B + SET 0,C + SET 0,D + SET 0,E + SET 0,H + SET 0,L + + SET 1,(HL) + SET 1,(IX+offset) + SET 1,(IY+offset) + SET 1,A + SET 1,B + SET 1,C + SET 1,D + SET 1,E + SET 1,H + SET 1,L + + SET 2,(HL) + SET 2,(IX+offset) + SET 2,(IY+offset) + SET 2,A + SET 2,B + SET 2,C + SET 2,D + SET 2,E + SET 2,H + SET 2,L + + SET 3,(HL) + SET 3,(IX+offset) + SET 3,(IY+offset) + SET 3,A + SET 3,B + SET 3,C + SET 3,D + SET 3,E + SET 3,H + SET 3,L + + SET 4,(HL) + SET 4,(IX+offset) + SET 4,(IY+offset) + SET 4,A + SET 4,B + SET 4,C + SET 4,D + SET 4,E + SET 4,H + SET 4,L + + SET 5,(HL) + SET 5,(IX+offset) + SET 5,(IY+offset) + SET 5,A + SET 5,B + SET 5,C + SET 5,D + SET 5,E + SET 5,H + SET 5,L + + SET 6,(HL) + SET 6,(IX+offset) + SET 6,(IY+offset) + SET 6,A + SET 6,B + SET 6,C + SET 6,D + SET 6,E + SET 6,H + SET 6,L + + SET 7,(HL) + SET 7,(IX+offset) + SET 7,(IY+offset) + SET 7,A + SET 7,B + SET 7,C + SET 7,D + SET 7,E + SET 7,H + SET 7,L + + SLA (HL) + SLA (IX+offset) + SLA (IY+offset) + SLA A + SLA B + SLA C + SLA D + SLA E + SLA H + SLA L + + SLP + + SRA (HL) + SRA (IX+offset) + SRA (IY+offset) + SRA A + SRA B + SRA C + SRA D + SRA E + SRA H + SRA L + + SRL (HL) + SRL (IX+offset) + SRL (IY+offset) + SRL A + SRL B + SRL C + SRL D + SRL E + SRL H + SRL L + + SUB (HL) + SUB (IX+offset) + SUB (IY+offset) + SUB A + SUB B + SUB C + SUB D + SUB E + SUB H + SUB L + SUB n + + TST A + TST B + TST C + TST D + TST E + TST (HL) + TST n + + XOR (HL) + XOR (IX+offset) + XOR (IY+offset) + XOR A + XOR B + XOR C + XOR D + XOR E + XOR H + XOR L + XOR n + end diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.lst b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.lst new file mode 100644 index 00000000..9f1b939c --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.lst @@ -0,0 +1,861 @@ +0001 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +0002 0000 ; $Id: testz80.asm 1.4 1998/02/25 12:18:20 toma Exp $ +0003 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +0004 0000 +0005 0000 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +0006 0000 ; TASM test file +0007 0000 ; Test all instructions and addressing modes. +0008 0000 ; Processor: Z80 +0009 0000 ; +0010 0000 ; SEPT. 16,1987 +0011 0000 ; CARL A. WALL +0012 0000 ; VE3APY +0013 0000 ; +0014 0000 ; +0015 0000 +0016 0000 #define equ .equ +0017 0000 #define end .end +0018 0000 +0019 0000 n: equ 20h +0020 0000 nn: equ 0584h +0021 0000 dddd: equ 07h +0022 0000 addr16: equ $1234 +0023 0000 port: equ 3 +0024 0000 imm8: equ 56h ;immediate data (8 bits) +0025 0000 offset: equ 7 +0026 0000 offset_neg: equ -7 +0027 0000 +0028 0000 ; try a few cases that have two expressions in the args and +0029 0000 ; one is inside (). +0030 0000 DD 36 07 24 LD (IX+offset),n+1+4+8-9 +0031 0004 DD 36 0C 1F LD (IX+offset+5),n-1 +0032 0008 DD 36 07 20 LD (IX+dddd),n +0033 000C DD 36 07 20 LD (IX+offset),n +0034 0010 DD 36 07 20 LD (IX+offset),n +0035 0014 +0036 0014 ; Try all possible instructions +0037 0014 +0038 0014 8E ADC A,(HL) +0039 0015 DD 8E 07 ADC A,(IX+offset) +0040 0018 DD 8E F9 ADC A,(IX+offset_neg) +0041 001B FD 8E 07 ADC A,(IY+offset) +0042 001E FD 8E F9 ADC A,(IY+offset_neg) +0043 0021 8F ADC A,A +0044 0022 88 ADC A,B +0045 0023 89 ADC A,C +0046 0024 8A ADC A,D +0047 0025 8B ADC A,E +0048 0026 8C ADC A,H +0049 0027 8D ADC A,L +0050 0028 CE 20 ADC A,n +0051 002A ED 4A ADC HL,BC +0052 002C ED 5A ADC HL,DE +0053 002E ED 6A ADC HL,HL +0054 0030 ED 7A ADC HL,SP +0055 0032 +0056 0032 86 ADD A,(HL) +0057 0033 DD 86 07 ADD A,(IX+offset) +0058 0036 FD 86 07 ADD A,(IY+offset) +0059 0039 87 ADD A,A +0060 003A 80 ADD A,B +0061 003B 81 ADD A,C +0062 003C 82 ADD A,D +0063 003D 83 ADD A,E +0064 003E 84 ADD A,H +0065 003F 85 ADD A,L +0066 0040 C6 20 ADD A,n +0067 0042 09 ADD HL,BC +0068 0043 19 ADD HL,DE +0069 0044 29 ADD HL,HL +0070 0045 39 ADD HL,SP +0071 0046 DD 09 ADD IX,BC +0072 0048 DD 19 ADD IX,DE +0073 004A DD 29 ADD IX,IX +0074 004C DD 39 ADD IX,SP +0075 004E FD 09 ADD IY,BC +0076 0050 FD 19 ADD IY,DE +0077 0052 FD 29 ADD IY,IY +0078 0054 FD 39 ADD IY,SP +0079 0056 +0080 0056 A6 AND (HL) +0081 0057 DD A6 07 AND (IX+offset) +0082 005A FD A6 07 AND (IY+offset) +0083 005D A7 AND A +0084 005E A0 AND B +0085 005F A1 AND C +0086 0060 A2 AND D +0087 0061 A3 AND E +0088 0062 A4 AND H +0089 0063 A5 AND L +0090 0064 E6 20 AND n +0091 0066 +0092 0066 CB 46 BIT 0,(HL) +0093 0068 DD CB 07 46 BIT 0,(IX+offset) +0094 006C FD CB 07 46 BIT 0,(IY+offset) +0095 0070 CB 47 BIT 0,A +0096 0072 CB 40 BIT 0,B +0097 0074 CB 41 BIT 0,C +0098 0076 CB 42 BIT 0,D +0099 0078 CB 43 BIT 0,E +0100 007A CB 44 BIT 0,H +0101 007C CB 45 BIT 0,L +0102 007E +0103 007E CB 4E BIT 1,(HL) +0104 0080 DD CB 07 4E BIT 1,(IX+offset) +0105 0084 FD CB 07 4E BIT 1,(IY+offset) +0106 0088 CB 4F BIT 1,A +0107 008A CB 48 BIT 1,B +0108 008C CB 49 BIT 1,C +0109 008E CB 4A BIT 1,D +0110 0090 CB 4B BIT 1,E +0111 0092 CB 4C BIT 1,H +0112 0094 CB 4D BIT 1,L +0113 0096 +0114 0096 CB 56 BIT 2,(HL) +0115 0098 DD CB 07 56 BIT 2,(IX+offset) +0116 009C FD CB 07 56 BIT 2,(IY+offset) +0117 00A0 CB 57 BIT 2,A +0118 00A2 CB 50 BIT 2,B +0119 00A4 CB 51 BIT 2,C +0120 00A6 CB 52 BIT 2,D +0121 00A8 CB 53 BIT 2,E +0122 00AA CB 54 BIT 2,H +0123 00AC CB 55 BIT 2,L +0124 00AE +0125 00AE CB 5E BIT 3,(HL) +0126 00B0 DD CB 07 5E BIT 3,(IX+offset) +0127 00B4 FD CB 07 5E BIT 3,(IY+offset) +0128 00B8 CB 5F BIT 3,A +0129 00BA CB 58 BIT 3,B +0130 00BC CB 59 BIT 3,C +0131 00BE CB 5A BIT 3,D +0132 00C0 CB 5B BIT 3,E +0133 00C2 CB 5C BIT 3,H +0134 00C4 CB 5D BIT 3,L +0135 00C6 +0136 00C6 CB 66 BIT 4,(HL) +0137 00C8 DD CB 07 66 BIT 4,(IX+offset) +0138 00CC FD CB 07 66 BIT 4,(IY+offset) +0139 00D0 CB 67 BIT 4,A +0140 00D2 CB 60 BIT 4,B +0141 00D4 CB 61 BIT 4,C +0142 00D6 CB 62 BIT 4,D +0143 00D8 CB 63 BIT 4,E +0144 00DA CB 64 BIT 4,H +0145 00DC CB 65 BIT 4,L +0146 00DE +0147 00DE CB 6E BIT 5,(HL) +0148 00E0 DD CB 07 6E BIT 5,(IX+offset) +0149 00E4 FD CB 07 6E BIT 5,(IY+offset) +0150 00E8 CB 6F BIT 5,A +0151 00EA CB 68 BIT 5,B +0152 00EC CB 69 BIT 5,C +0153 00EE CB 6A BIT 5,D +0154 00F0 CB 6B BIT 5,E +0155 00F2 CB 6C BIT 5,H +0156 00F4 CB 6D BIT 5,L +0157 00F6 +0158 00F6 CB 76 BIT 6,(HL) +0159 00F8 DD CB 07 76 BIT 6,(IX+offset) +0160 00FC FD CB 07 76 BIT 6,(IY+offset) +0161 0100 CB 77 BIT 6,A +0162 0102 CB 70 BIT 6,B +0163 0104 CB 71 BIT 6,C +0164 0106 CB 72 BIT 6,D +0165 0108 CB 73 BIT 6,E +0166 010A CB 74 BIT 6,H +0167 010C CB 75 BIT 6,L +0168 010E +0169 010E CB 7E BIT 7,(HL) +0170 0110 DD CB 07 7E BIT 7,(IX+offset) +0171 0114 FD CB 07 7E BIT 7,(IY+offset) +0172 0118 CB 7F BIT 7,A +0173 011A CB 78 BIT 7,B +0174 011C CB 79 BIT 7,C +0175 011E CB 7A BIT 7,D +0176 0120 CB 7B BIT 7,E +0177 0122 CB 7C BIT 7,H +0178 0124 CB 7D BIT 7,L +0179 0126 +0180 0126 DC 34 12 CALL C,addr16 +0181 0129 FC 34 12 CALL M,addr16 +0182 012C D4 34 12 CALL NC,addr16 +0183 012F C4 34 12 CALL NZ,addr16 +0184 0132 F4 34 12 CALL P,addr16 +0185 0135 EC 34 12 CALL PE,addr16 +0186 0138 E4 34 12 CALL PO,addr16 +0187 013B CC 34 12 CALL Z,addr16 +0188 013E CD 34 12 CALL addr16 +0189 0141 +0190 0141 3F CCF +0191 0142 +0192 0142 BE CP (HL) +0193 0143 DD BE 07 CP (IX+offset) +0194 0146 FD BE 07 CP (IY+offset) +0195 0149 BF CP A +0196 014A B8 CP B +0197 014B B9 CP C +0198 014C BA CP D +0199 014D BB CP E +0200 014E BC CP H +0201 014F BD CP L +0202 0150 FE 56 CP imm8 +0203 0152 ED A9 CPD +0204 0154 ED B9 CPDR +0205 0156 ED B1 CPIR +0206 0158 ED A1 CPI +0207 015A 2F CPL +0208 015B +0209 015B 27 DAA +0210 015C +0211 015C 35 DEC (HL) +0212 015D DD 35 07 DEC (IX+offset) +0213 0160 FD 35 07 DEC (IY+offset) +0214 0163 3D DEC A +0215 0164 05 DEC B +0216 0165 0B DEC BC +0217 0166 0D DEC C +0218 0167 15 DEC D +0219 0168 1B DEC DE +0220 0169 1D DEC E +0221 016A 25 DEC H +0222 016B 2B DEC HL +0223 016C DD 2B DEC IX +0224 016E FD 2B DEC IY +0225 0170 2D DEC L +0226 0171 3B DEC SP +0227 0172 F3 DI +0228 0173 loop1: +0229 0173 10 FE DJNZ loop1 +0230 0175 +0231 0175 FB EI +0232 0176 E3 EX (SP),HL +0233 0177 DD E3 EX (SP),IX +0234 0179 FD E3 EX (SP),IY +0235 017B 08 EX AF,AF' +0236 017C EB EX DE,HL +0237 017D D9 EXX +0238 017E 76 HALT +0239 017F +0240 017F ED 46 IM 0 +0241 0181 ED 56 IM 1 +0242 0183 ED 5E IM 2 +0243 0185 +0244 0185 ED 78 IN A,(C) +0245 0187 ED 40 IN B,(C) +0246 0189 ED 48 IN C,(C) +0247 018B ED 50 IN D,(C) +0248 018D ED 58 IN E,(C) +0249 018F ED 60 IN H,(C) +0250 0191 ED 68 IN L,(C) +0251 0193 DB 03 IN A,(port) +0252 0195 +0253 0195 IN0 B,(n) +testz80.asm line 0253: unrecognized instruction. (IN0) +0254 0195 IN0 C,(n) +testz80.asm line 0254: unrecognized instruction. (IN0) +0255 0195 IN0 D,(n) +testz80.asm line 0255: unrecognized instruction. (IN0) +0256 0195 IN0 E,(n) +testz80.asm line 0256: unrecognized instruction. (IN0) +0257 0195 IN0 H,(n) +testz80.asm line 0257: unrecognized instruction. (IN0) +0258 0195 IN0 L,(n) +testz80.asm line 0258: unrecognized instruction. (IN0) +0259 0195 +0260 0195 34 INC (HL) +0261 0196 DD 34 07 INC (IX+offset) +0262 0199 FD 34 07 INC (IY+offset) +0263 019C 3C INC A +0264 019D 04 INC B +0265 019E 03 INC BC +0266 019F 0C INC C +0267 01A0 14 INC D +0268 01A1 13 INC DE +0269 01A2 1C INC E +0270 01A3 24 INC H +0271 01A4 23 INC HL +0272 01A5 DD 23 INC IX +0273 01A7 FD 23 INC IY +0274 01A9 2C INC L +0275 01AA 33 INC SP +0276 01AB +0277 01AB ED AA IND +0278 01AD ED BA INDR +0279 01AF ED A2 INI +0280 01B1 ED B2 INIR +0281 01B3 +0282 01B3 C3 34 12 JP addr16 +0283 01B6 E9 JP (HL) +0284 01B7 DD E9 JP (IX) +0285 01B9 FD E9 JP (IY) +0286 01BB DA 34 12 JP C,addr16 +0287 01BE FA 34 12 JP M,addr16 +0288 01C1 D2 34 12 JP NC,addr16 +0289 01C4 C2 34 12 JP NZ,addr16 +0290 01C7 F2 34 12 JP P,addr16 +0291 01CA EA 34 12 JP PE,addr16 +0292 01CD E2 34 12 JP PO,addr16 +0293 01D0 CA 34 12 JP Z,addr16 +0294 01D3 +0295 01D3 loop2: +0296 01D3 38 FE JR C,loop2 +0297 01D5 30 FC JR NC,loop2 +0298 01D7 20 FA JR NZ,loop2 +0299 01D9 28 F8 JR Z,loop2 +0300 01DB 18 F6 JR loop2 +0301 01DD +0302 01DD 02 LD (BC),A +0303 01DE 12 LD (DE),A +0304 01DF 77 LD (HL),A +0305 01E0 70 LD (HL),B +0306 01E1 71 LD (HL),C +0307 01E2 72 LD (HL),D +0308 01E3 73 LD (HL),E +0309 01E4 74 LD (HL),H +0310 01E5 75 LD (HL),L +0311 01E6 36 20 LD (HL),n +0312 01E8 DD 77 07 LD (IX+offset),A +0313 01EB DD 70 07 LD (IX+offset),B +0314 01EE DD 71 07 LD (IX+offset),C +0315 01F1 DD 72 07 LD (IX+offset),D +0316 01F4 DD 73 07 LD (IX+offset),E +0317 01F7 DD 74 07 LD (IX+offset),H +0318 01FA DD 75 07 LD (IX+offset),L +0319 01FD DD 36 07 20 LD (IX+offset),n +0320 0201 FD 77 07 LD (IY+offset),A +0321 0204 FD 70 07 LD (IY+offset),B +0322 0207 FD 71 07 LD (IY+offset),C +0323 020A FD 72 07 LD (IY+offset),D +0324 020D FD 73 07 LD (IY+offset),E +0325 0210 FD 74 07 LD (IY+offset),H +0326 0213 FD 75 07 LD (IY+offset),L +0327 0216 FD 36 07 20 LD (IY+offset),n +0328 021A 32 84 05 LD (nn),A +0329 021D ED 43 84 05 LD (nn),BC +0330 0221 ED 53 84 05 LD (nn),DE +0331 0225 22 84 05 LD (nn),HL +0332 0228 DD 22 84 05 LD (nn),IX +0333 022C FD 22 84 05 LD (nn),IY +0334 0230 ED 73 84 05 LD (nn),SP +0335 0234 0A LD A,(BC) +0336 0235 1A LD A,(DE) +0337 0236 7E LD A,(HL) +0338 0237 DD 7E 07 LD A,(IX+offset) +0339 023A FD 7E 07 LD A,(IY+offset) +0340 023D 3A 84 05 LD A,(nn) +0341 0240 7F LD A,A +0342 0241 78 LD A,B +0343 0242 79 LD A,C +0344 0243 7A LD A,D +0345 0244 7B LD A,E +0346 0245 7C LD A,H +0347 0246 ED 57 LD A,I +0348 0248 7D LD A,L +0349 0249 3E 20 LD A,n +0350 024B ED 5F LD A,R +0351 024D 46 LD B,(HL) +0352 024E DD 46 07 LD B,(IX+offset) +0353 0251 FD 46 07 LD B,(IY+offset) +0354 0254 47 LD B,A +0355 0255 40 LD B,B +0356 0256 41 LD B,C +0357 0257 42 LD B,D +0358 0258 43 LD B,E +0359 0259 44 LD B,H +0360 025A 45 LD B,L +0361 025B 06 20 LD B,n +0362 025D ED 4B 84 05 LD BC,(nn) +0363 0261 01 84 05 LD BC,nn +0364 0264 4E LD C,(HL) +0365 0265 DD 4E 07 LD C,(IX+offset) +0366 0268 FD 4E 07 LD C,(IY+offset) +0367 026B 4F LD C,A +0368 026C 48 LD C,B +0369 026D 49 LD C,C +0370 026E 4A LD C,D +0371 026F 4B LD C,E +0372 0270 4C LD C,H +0373 0271 4D LD C,L +0374 0272 0E 20 LD C,n +0375 0274 56 LD D,(HL) +0376 0275 DD 56 07 LD D,(IX+offset) +0377 0278 FD 56 07 LD D,(IY+offset) +0378 027B 57 LD D,A +0379 027C 50 LD D,B +0380 027D 51 LD D,C +0381 027E 52 LD D,D +0382 027F 53 LD D,E +0383 0280 54 LD D,H +0384 0281 55 LD D,L +0385 0282 16 20 LD D,n +0386 0284 ED 5B 84 05 LD DE,(nn) +0387 0288 11 84 05 LD DE,nn +0388 028B 5E LD E,(HL) +0389 028C DD 5E 07 LD E,(IX+offset) +0390 028F FD 5E 07 LD E,(IY+offset) +0391 0292 5F LD E,A +0392 0293 58 LD E,B +0393 0294 59 LD E,C +0394 0295 5A LD E,D +0395 0296 5B LD E,E +0396 0297 5C LD E,H +0397 0298 5D LD E,L +0398 0299 1E 20 LD E,n +0399 029B 66 LD H,(HL) +0400 029C DD 66 07 LD H,(IX+offset) +0401 029F FD 66 07 LD H,(IY+offset) +0402 02A2 67 LD H,A +0403 02A3 60 LD H,B +0404 02A4 61 LD H,C +0405 02A5 62 LD H,D +0406 02A6 63 LD H,E +0407 02A7 64 LD H,H +0408 02A8 65 LD H,L +0409 02A9 26 20 LD H,n +0410 02AB 2A 84 05 LD HL,(nn) +0411 02AE 21 84 05 LD HL,nn +0412 02B1 ED 47 LD I,A +0413 02B3 DD 2A 84 05 LD IX,(nn) +0414 02B7 DD 21 84 05 LD IX,nn +0415 02BB FD 2A 84 05 LD IY,(nn) +0416 02BF FD 21 84 05 LD IY,nn +0417 02C3 6E LD L,(HL) +0418 02C4 DD 6E 07 LD L,(IX+offset) +0419 02C7 FD 6E 07 LD L,(IY+offset) +0420 02CA 6F LD L,A +0421 02CB 68 LD L,B +0422 02CC 69 LD L,C +0423 02CD 6A LD L,D +0424 02CE 6B LD L,E +0425 02CF 6C LD L,H +0426 02D0 6D LD L,L +0427 02D1 2E 20 LD L,n +0428 02D3 ED 4F LD R,A +0429 02D5 ED 7B 84 05 LD SP,(nn) +0430 02D9 F9 LD SP,HL +0431 02DA DD F9 LD SP,IX +0432 02DC FD F9 LD SP,IY +0433 02DE 31 84 05 LD SP,nn +0434 02E1 +0435 02E1 ED A8 LDD +0436 02E3 ED B8 LDDR +0437 02E5 ED A0 LDI +0438 02E7 ED B0 LDIR +0439 02E9 +0440 02E9 MLT BC +testz80.asm line 0440: unrecognized instruction. (MLT) +0441 02E9 MLT DE +testz80.asm line 0441: unrecognized instruction. (MLT) +0442 02E9 MLT HL +testz80.asm line 0442: unrecognized instruction. (MLT) +0443 02E9 MLT SP +testz80.asm line 0443: unrecognized instruction. (MLT) +0444 02E9 +0445 02E9 ED 44 NEG +0446 02EB 00 NOP +0447 02EC +0448 02EC B6 OR (HL) +0449 02ED DD B6 07 OR (IX+offset) +0450 02F0 FD B6 07 OR (IY+offset) +0451 02F3 B7 OR A +0452 02F4 B0 OR B +0453 02F5 B1 OR C +0454 02F6 B2 OR D +0455 02F7 B3 OR E +0456 02F8 B4 OR H +0457 02F9 B5 OR L +0458 02FA F6 56 OR imm8 +0459 02FC +0460 02FC ED BB OTDR +0461 02FE ED B3 OTIR +0462 0300 +0463 0300 ED 79 OUT (C),A +0464 0302 ED 41 OUT (C),B +0465 0304 ED 49 OUT (C),C +0466 0306 ED 51 OUT (C),D +0467 0308 ED 59 OUT (C),E +0468 030A ED 61 OUT (C),H +0469 030C ED 69 OUT (C),L +0470 030E D3 03 OUT (port),A +0471 0310 +0472 0310 OUT0 (imm8),A +testz80.asm line 0472: unrecognized instruction. (OUT0) +0473 0310 OUT0 (imm8),B +testz80.asm line 0473: unrecognized instruction. (OUT0) +0474 0310 OUT0 (imm8),C +testz80.asm line 0474: unrecognized instruction. (OUT0) +0475 0310 OUT0 (imm8),D +testz80.asm line 0475: unrecognized instruction. (OUT0) +0476 0310 OUT0 (imm8),E +testz80.asm line 0476: unrecognized instruction. (OUT0) +0477 0310 OUT0 (imm8),H +testz80.asm line 0477: unrecognized instruction. (OUT0) +0478 0310 OUT0 (imm8),L +testz80.asm line 0478: unrecognized instruction. (OUT0) +0479 0310 +0480 0310 ED AB OUTD +0481 0312 ED A3 OUTI +0482 0314 OTIM +testz80.asm line 0482: unrecognized instruction. (OTIM) +0483 0314 OTDM +testz80.asm line 0483: unrecognized instruction. (OTDM) +0484 0314 OTIMR +testz80.asm line 0484: unrecognized instruction. (OTIMR) +0485 0314 OTDMR +testz80.asm line 0485: unrecognized instruction. (OTDMR) +0486 0314 +0487 0314 F1 POP AF +0488 0315 C1 POP BC +0489 0316 D1 POP DE +0490 0317 E1 POP HL +0491 0318 DD E1 POP IX +0492 031A FD E1 POP IY +0493 031C +0494 031C F5 PUSH AF +0495 031D C5 PUSH BC +0496 031E D5 PUSH DE +0497 031F E5 PUSH HL +0498 0320 DD E5 PUSH IX +0499 0322 FD E5 PUSH IY +0500 0324 +0501 0324 CB 86 RES 0,(HL) +0502 0326 DD CB 07 86 RES 0,(IX+offset) +0503 032A FD CB 07 86 RES 0,(IY+offset) +0504 032E CB 87 RES 0,A +0505 0330 CB 80 RES 0,B +0506 0332 CB 81 RES 0,C +0507 0334 CB 82 RES 0,D +0508 0336 CB 83 RES 0,E +0509 0338 CB 84 RES 0,H +0510 033A CB 85 RES 0,L +0511 033C +0512 033C CB 8E RES 1,(HL) +0513 033E DD CB 07 8E RES 1,(IX+offset) +0514 0342 FD CB 07 8E RES 1,(IY+offset) +0515 0346 CB 8F RES 1,A +0516 0348 CB 88 RES 1,B +0517 034A CB 89 RES 1,C +0518 034C CB 8A RES 1,D +0519 034E CB 8B RES 1,E +0520 0350 CB 8C RES 1,H +0521 0352 CB 8D RES 1,L +0522 0354 +0523 0354 CB 96 RES 2,(HL) +0524 0356 DD CB 07 96 RES 2,(IX+offset) +0525 035A FD CB 07 96 RES 2,(IY+offset) +0526 035E CB 97 RES 2,A +0527 0360 CB 90 RES 2,B +0528 0362 CB 91 RES 2,C +0529 0364 CB 92 RES 2,D +0530 0366 CB 93 RES 2,E +0531 0368 CB 94 RES 2,H +0532 036A CB 95 RES 2,L +0533 036C +0534 036C CB 9E RES 3,(HL) +0535 036E DD CB 07 9E RES 3,(IX+offset) +0536 0372 FD CB 07 9E RES 3,(IY+offset) +0537 0376 CB 9F RES 3,A +0538 0378 CB 98 RES 3,B +0539 037A CB 99 RES 3,C +0540 037C CB 9A RES 3,D +0541 037E CB 9B RES 3,E +0542 0380 CB 9C RES 3,H +0543 0382 CB 9D RES 3,L +0544 0384 +0545 0384 CB A6 RES 4,(HL) +0546 0386 DD CB 07 A6 RES 4,(IX+offset) +0547 038A FD CB 07 A6 RES 4,(IY+offset) +0548 038E CB A7 RES 4,A +0549 0390 CB A0 RES 4,B +0550 0392 CB A1 RES 4,C +0551 0394 CB A2 RES 4,D +0552 0396 CB A3 RES 4,E +0553 0398 CB A4 RES 4,H +0554 039A CB A5 RES 4,L +0555 039C +0556 039C CB AE RES 5,(HL) +0557 039E DD CB 07 AE RES 5,(IX+offset) +0558 03A2 FD CB 07 AE RES 5,(IY+offset) +0559 03A6 CB AF RES 5,A +0560 03A8 CB A8 RES 5,B +0561 03AA CB A9 RES 5,C +0562 03AC CB AA RES 5,D +0563 03AE CB AB RES 5,E +0564 03B0 CB AC RES 5,H +0565 03B2 CB AD RES 5,L +0566 03B4 +0567 03B4 CB B6 RES 6,(HL) +0568 03B6 DD CB 07 B6 RES 6,(IX+offset) +0569 03BA FD CB 07 B6 RES 6,(IY+offset) +0570 03BE CB B7 RES 6,A +0571 03C0 CB B0 RES 6,B +0572 03C2 CB B1 RES 6,C +0573 03C4 CB B2 RES 6,D +0574 03C6 CB B3 RES 6,E +0575 03C8 CB B4 RES 6,H +0576 03CA CB B5 RES 6,L +0577 03CC +0578 03CC CB BE RES 7,(HL) +0579 03CE DD CB 07 BE RES 7,(IX+offset) +0580 03D2 FD CB 07 BE RES 7,(IY+offset) +0581 03D6 CB BF RES 7,A +0582 03D8 CB B8 RES 7,B +0583 03DA CB B9 RES 7,C +0584 03DC CB BA RES 7,D +0585 03DE CB BB RES 7,E +0586 03E0 CB BC RES 7,H +0587 03E2 CB BD RES 7,L +0588 03E4 +0589 03E4 C9 RET +0590 03E5 D8 RET C +0591 03E6 F8 RET M +0592 03E7 D0 RET NC +0593 03E8 C0 RET NZ +0594 03E9 F0 RET P +0595 03EA E8 RET PE +0596 03EB E0 RET PO +0597 03EC C8 RET Z +0598 03ED ED 4D RETI +0599 03EF ED 45 RETN +0600 03F1 +0601 03F1 CB 16 RL (HL) +0602 03F3 DD CB 07 16 RL (IX+offset) +0603 03F7 FD CB 07 16 RL (IY+offset) +0604 03FB CB 17 RL A +0605 03FD CB 10 RL B +0606 03FF CB 11 RL C +0607 0401 CB 12 RL D +0608 0403 CB 13 RL E +0609 0405 CB 14 RL H +0610 0407 CB 15 RL L +0611 0409 17 RLA +0612 040A +0613 040A CB 06 RLC (HL) +0614 040C DD CB 07 06 RLC (IX+offset) +0615 0410 FD CB 07 06 RLC (IY+offset) +0616 0414 CB 07 RLC A +0617 0416 CB 00 RLC B +0618 0418 CB 01 RLC C +0619 041A CB 02 RLC D +0620 041C CB 03 RLC E +0621 041E CB 04 RLC H +0622 0420 CB 05 RLC L +0623 0422 07 RLCA +0624 0423 ED 6F RLD +0625 0425 +0626 0425 CB 1E RR (HL) +0627 0427 DD CB 07 1E RR (IX+offset) +0628 042B FD CB 07 1E RR (IY+offset) +0629 042F CB 1F RR A +0630 0431 CB 18 RR B +0631 0433 CB 19 RR C +0632 0435 CB 1A RR D +0633 0437 CB 1B RR E +0634 0439 CB 1C RR H +0635 043B CB 1D RR L +0636 043D 1F RRA +0637 043E +0638 043E CB 0E RRC (HL) +0639 0440 DD CB 07 0E RRC (IX+offset) +0640 0444 FD CB 07 0E RRC (IY+offset) +0641 0448 CB 0F RRC A +0642 044A CB 08 RRC B +0643 044C CB 09 RRC C +0644 044E CB 0A RRC D +0645 0450 CB 0B RRC E +0646 0452 CB 0C RRC H +0647 0454 CB 0D RRC L +0648 0456 0F RRCA +0649 0457 ED 67 RRD +0650 0459 +0651 0459 C7 RST 00H +0652 045A CF RST 08H +0653 045B D7 RST 10H +0654 045C DF RST 18H +0655 045D E7 RST 20H +0656 045E EF RST 28H +0657 045F F7 RST 30H +0658 0460 FF RST 38H +0659 0461 +0660 0461 DE 20 SBC A,n +0661 0463 9E SBC A,(HL) +0662 0464 DD 9E 07 SBC A,(IX+offset) +0663 0467 FD 9E 07 SBC A,(IY+offset) +0664 046A 9F SBC A,A +0665 046B 98 SBC A,B +0666 046C 99 SBC A,C +0667 046D 9A SBC A,D +0668 046E 9B SBC A,E +0669 046F 9C SBC A,H +0670 0470 9D SBC A,L +0671 0471 ED 42 SBC HL,BC +0672 0473 ED 52 SBC HL,DE +0673 0475 ED 62 SBC HL,HL +0674 0477 ED 72 SBC HL,SP +0675 0479 37 SCF +0676 047A +0677 047A CB C6 SET 0,(HL) +0678 047C DD CB 07 C6 SET 0,(IX+offset) +0679 0480 FD CB 07 C6 SET 0,(IY+offset) +0680 0484 CB C7 SET 0,A +0681 0486 CB C0 SET 0,B +0682 0488 CB C1 SET 0,C +0683 048A CB C2 SET 0,D +0684 048C CB C3 SET 0,E +0685 048E CB C4 SET 0,H +0686 0490 CB C5 SET 0,L +0687 0492 +0688 0492 CB CE SET 1,(HL) +0689 0494 DD CB 07 CE SET 1,(IX+offset) +0690 0498 FD CB 07 CE SET 1,(IY+offset) +0691 049C CB CF SET 1,A +0692 049E CB C8 SET 1,B +0693 04A0 CB C9 SET 1,C +0694 04A2 CB CA SET 1,D +0695 04A4 CB CB SET 1,E +0696 04A6 CB CC SET 1,H +0697 04A8 CB CD SET 1,L +0698 04AA +0699 04AA CB D6 SET 2,(HL) +0700 04AC DD CB 07 D6 SET 2,(IX+offset) +0701 04B0 FD CB 07 D6 SET 2,(IY+offset) +0702 04B4 CB D7 SET 2,A +0703 04B6 CB D0 SET 2,B +0704 04B8 CB D1 SET 2,C +0705 04BA CB D2 SET 2,D +0706 04BC CB D3 SET 2,E +0707 04BE CB D4 SET 2,H +0708 04C0 CB D5 SET 2,L +0709 04C2 +0710 04C2 CB DE SET 3,(HL) +0711 04C4 DD CB 07 DE SET 3,(IX+offset) +0712 04C8 FD CB 07 DE SET 3,(IY+offset) +0713 04CC CB DF SET 3,A +0714 04CE CB D8 SET 3,B +0715 04D0 CB D9 SET 3,C +0716 04D2 CB DA SET 3,D +0717 04D4 CB DB SET 3,E +0718 04D6 CB DC SET 3,H +0719 04D8 CB DD SET 3,L +0720 04DA +0721 04DA CB E6 SET 4,(HL) +0722 04DC DD CB 07 E6 SET 4,(IX+offset) +0723 04E0 FD CB 07 E6 SET 4,(IY+offset) +0724 04E4 CB E7 SET 4,A +0725 04E6 CB E0 SET 4,B +0726 04E8 CB E1 SET 4,C +0727 04EA CB E2 SET 4,D +0728 04EC CB E3 SET 4,E +0729 04EE CB E4 SET 4,H +0730 04F0 CB E5 SET 4,L +0731 04F2 +0732 04F2 CB EE SET 5,(HL) +0733 04F4 DD CB 07 EE SET 5,(IX+offset) +0734 04F8 FD CB 07 EE SET 5,(IY+offset) +0735 04FC CB EF SET 5,A +0736 04FE CB E8 SET 5,B +0737 0500 CB E9 SET 5,C +0738 0502 CB EA SET 5,D +0739 0504 CB EB SET 5,E +0740 0506 CB EC SET 5,H +0741 0508 CB ED SET 5,L +0742 050A +0743 050A CB F6 SET 6,(HL) +0744 050C DD CB 07 F6 SET 6,(IX+offset) +0745 0510 FD CB 07 F6 SET 6,(IY+offset) +0746 0514 CB F7 SET 6,A +0747 0516 CB F0 SET 6,B +0748 0518 CB F1 SET 6,C +0749 051A CB F2 SET 6,D +0750 051C CB F3 SET 6,E +0751 051E CB F4 SET 6,H +0752 0520 CB F5 SET 6,L +0753 0522 +0754 0522 CB FE SET 7,(HL) +0755 0524 DD CB 07 FE SET 7,(IX+offset) +0756 0528 FD CB 07 FE SET 7,(IY+offset) +0757 052C CB FF SET 7,A +0758 052E CB F8 SET 7,B +0759 0530 CB F9 SET 7,C +0760 0532 CB FA SET 7,D +0761 0534 CB FB SET 7,E +0762 0536 CB FC SET 7,H +0763 0538 CB FD SET 7,L +0764 053A +0765 053A CB 26 SLA (HL) +0766 053C DD CB 07 26 SLA (IX+offset) +0767 0540 FD CB 07 26 SLA (IY+offset) +0768 0544 CB 27 SLA A +0769 0546 CB 20 SLA B +0770 0548 CB 21 SLA C +0771 054A CB 22 SLA D +0772 054C CB 23 SLA E +0773 054E CB 24 SLA H +0774 0550 CB 25 SLA L +0775 0552 +0776 0552 SLP +testz80.asm line 0776: unrecognized instruction. (SLP) +0777 0552 +0778 0552 CB 2E SRA (HL) +0779 0554 DD CB 07 2E SRA (IX+offset) +0780 0558 FD CB 07 2E SRA (IY+offset) +0781 055C CB 2F SRA A +0782 055E CB 28 SRA B +0783 0560 CB 29 SRA C +0784 0562 CB 2A SRA D +0785 0564 CB 2B SRA E +0786 0566 CB 2C SRA H +0787 0568 CB 2D SRA L +0788 056A +0789 056A CB 3E SRL (HL) +0790 056C DD CB 07 3E SRL (IX+offset) +0791 0570 FD CB 07 3E SRL (IY+offset) +0792 0574 CB 3F SRL A +0793 0576 CB 38 SRL B +0794 0578 CB 39 SRL C +0795 057A CB 3A SRL D +0796 057C CB 3B SRL E +0797 057E CB 3C SRL H +0798 0580 CB 3D SRL L +0799 0582 +0800 0582 96 SUB (HL) +0801 0583 DD 96 07 SUB (IX+offset) +0802 0586 FD 96 07 SUB (IY+offset) +0803 0589 97 SUB A +0804 058A 90 SUB B +0805 058B 91 SUB C +0806 058C 92 SUB D +0807 058D 93 SUB E +0808 058E 94 SUB H +0809 058F 95 SUB L +0810 0590 D6 20 SUB n +0811 0592 +0812 0592 TST A +testz80.asm line 0812: unrecognized instruction. (TST) +0813 0592 TST B +testz80.asm line 0813: unrecognized instruction. (TST) +0814 0592 TST C +testz80.asm line 0814: unrecognized instruction. (TST) +0815 0592 TST D +testz80.asm line 0815: unrecognized instruction. (TST) +0816 0592 TST E +testz80.asm line 0816: unrecognized instruction. (TST) +0817 0592 TST (HL) +testz80.asm line 0817: unrecognized instruction. (TST) +0818 0592 TST n +testz80.asm line 0818: unrecognized instruction. (TST) +0819 0592 +0820 0592 AE XOR (HL) +0821 0593 DD AE 07 XOR (IX+offset) +0822 0596 FD AE 07 XOR (IY+offset) +0823 0599 AF XOR A +0824 059A A8 XOR B +0825 059B A9 XOR C +0826 059C AA XOR D +0827 059D AB XOR E +0828 059E AC XOR H +0829 059F AD XOR L +0830 05A0 EE 20 XOR n +0831 05A2 end +tasm: Number of errors = 29 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.obj b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.obj new file mode 100644 index 00000000..cc54e3cc --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Examples/testz80.obj @@ -0,0 +1,62 @@ +:18000000DD360724DD360C1FDD360720DD360720DD3607208EDD8E07BE +:18001800DD8EF9FD8E07FD8EF98F88898A8B8C8DCE20ED4AED5AED6AC5 +:18003000ED7A86DD8607FD860787808182838485C62009192939DD09F1 +:18004800DD19DD29DD39FD09FD19FD29FD39A6DDA607FDA607A7A0A154 +:18006000A2A3A4A5E620CB46DDCB0746FDCB0746CB47CB40CB41CB42A3 +:18007800CB43CB44CB45CB4EDDCB074EFDCB074ECB4FCB48CB49CB4ABA +:18009000CB4BCB4CCB4DCB56DDCB0756FDCB0756CB57CB50CB51CB5252 +:1800A800CB53CB54CB55CB5EDDCB075EFDCB075ECB5FCB58CB59CB5AEA +:1800C000CB5BCB5CCB5DCB66DDCB0766FDCB0766CB67CB60CB61CB6282 +:1800D800CB63CB64CB65CB6EDDCB076EFDCB076ECB6FCB68CB69CB6A1A +:1800F000CB6BCB6CCB6DCB76DDCB0776FDCB0776CB77CB70CB71CB72B2 +:18010800CB73CB74CB75CB7EDDCB077EFDCB077ECB7FCB78CB79CB7A49 +:18012000CB7BCB7CCB7DDC3412FC3412D43412C43412F43412EC3412FE +:18013800E43412CC3412CD34123FBEDDBE07FDBE07BFB8B9BABBBCBDE1 +:18015000FE56EDA9EDB9EDB1EDA12F2735DD3507FD35073D050B0D158F +:180168001B1D252BDD2BFD2B2D3BF310FEFBE3DDE3FDE308EBD976EDB1 +:1801800046ED56ED5EED78ED40ED48ED50ED58ED60ED68DB0334DD3485 +:1801980007FD34073C04030C14131C2423DD23FD232C33EDAAEDBAED8D +:1801B000A2EDB2C33412E9DDE9FDE9DA3412FA3412D23412C23412F2E6 +:1801C8003412EA3412E23412CA341238FE30FC20FA28F818F60212773C +:1801E0007071727374753620DD7707DD7007DD7107DD7207DD7307DD74 +:1801F8007407DD7507DD360720FD7707FD7007FD7107FD7207FD730790 +:18021000FD7407FD7507FD360720328405ED438405ED538405228405A3 +:18022800DD228405FD228405ED7384050A1A7EDD7E07FD7E073A84055C +:180240007F78797A7B7CED577D3E20ED5F46DD4607FD46074740414296 +:180258004344450620ED4B84050184054EDD4E07FD4E074F48494A4B0A +:180270004C4D0E2056DD5607FD5607575051525354551620ED5B840578 +:180288001184055EDD5E07FD5E075F58595A5B5C5D1E2066DD6607FD59 +:1802A00066076760616263646526202A8405218405ED47DD2A8405DDDF +:1802B800218405FD2A8405FD2184056EDD6E07FD6E076F68696A6B6C7A +:1802D0006D2E20ED4FED7B8405F9DDF9FDF9318405EDA8EDB8EDA0EDFB +:1802E800B0ED4400B6DDB607FDB607B7B0B1B2B3B4B5F656EDBBEDB399 +:18030000ED79ED41ED49ED51ED59ED61ED69D303EDABEDA3F1C1D1E191 +:18031800DDE1FDE1F5C5D5E5DDE5FDE5CB86DDCB0786FDCB0786CB87EC +:18033000CB80CB81CB82CB83CB84CB85CB8EDDCB078EFDCB078ECB8F97 +:18034800CB88CB89CB8ACB8BCB8CCB8DCB96DDCB0796FDCB0796CB972F +:18036000CB90CB91CB92CB93CB94CB95CB9EDDCB079EFDCB079ECB9FC7 +:18037800CB98CB99CB9ACB9BCB9CCB9DCBA6DDCB07A6FDCB07A6CBA75F +:18039000CBA0CBA1CBA2CBA3CBA4CBA5CBAEDDCB07AEFDCB07AECBAFF7 +:1803A800CBA8CBA9CBAACBABCBACCBADCBB6DDCB07B6FDCB07B6CBB78F +:1803C000CBB0CBB1CBB2CBB3CBB4CBB5CBBEDDCB07BEFDCB07BECBBF27 +:1803D800CBB8CBB9CBBACBBBCBBCCBBDC9D8F8D0C0F0E8E0C8ED4DED1C +:1803F00045CB16DDCB0716FDCB0716CB17CB10CB11CB12CB13CB14CB27 +:180408001517CB06DDCB0706FDCB0706CB07CB00CB01CB02CB03CB0482 +:18042000CB0507ED6FCB1EDDCB071EFDCB071ECB1FCB18CB19CB1ACB8D +:180438001BCB1CCB1D1FCB0EDDCB070EFDCB070ECB0FCB08CB09CB0ADA +:18045000CB0BCB0CCB0D0FED67C7CFD7DFE7EFF7FFDE209EDD9E07FD79 +:180468009E079F98999A9B9C9DED42ED52ED62ED7237CBC6DDCB07C640 +:18048000FDCB07C6CBC7CBC0CBC1CBC2CBC3CBC4CBC5CBCEDDCB07CED6 +:18049800FDCB07CECBCFCBC8CBC9CBCACBCBCBCCCBCDCBD6DDCB07D66E +:1804B000FDCB07D6CBD7CBD0CBD1CBD2CBD3CBD4CBD5CBDEDDCB07DE06 +:1804C800FDCB07DECBDFCBD8CBD9CBDACBDBCBDCCBDDCBE6DDCB07E69E +:1804E000FDCB07E6CBE7CBE0CBE1CBE2CBE3CBE4CBE5CBEEDDCB07EE36 +:1804F800FDCB07EECBEFCBE8CBE9CBEACBEBCBECCBEDCBF6DDCB07F6CE +:18051000FDCB07F6CBF7CBF0CBF1CBF2CBF3CBF4CBF5CBFEDDCB07FE65 +:18052800FDCB07FECBFFCBF8CBF9CBFACBFBCBFCCBFDCB26DDCB0726BD +:18054000FDCB0726CB27CB20CB21CB22CB23CB24CB25CB2EDDCB072E55 +:18055800FDCB072ECB2FCB28CB29CB2ACB2BCB2CCB2DCB3EDDCB073EDD +:18057000FDCB073ECB3FCB38CB39CB3ACB3BCB3CCB3D96DD9607FD9698 +:180588000797909192939495D620AEDDAE07FDAE07AFA8A9AAABACADB8 +:0205A000EE204B +:00000001FF diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotes.txt b/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotes.txt new file mode 100644 index 00000000..541cd127 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotes.txt @@ -0,0 +1,18 @@ +To build the software from the source distribution: + +1. Install Microsoft Visual C++ 6.0 + +2. Extract the TASM archive file tasm32sr.zip using PKUNZIP into + an empty directory. + +3. Execute Microsoft Visual C++ and open the Tasm32.dsw file. + +4. Select the Build menu, then "Build Tasm32.exe". + +5. Note that both a release and debug version can be built + (selectable under the Build/Set Active Configuration). + +6. Note that the executable, as-built, is named Tasm32.exe, + but is renamed Tasm.exe in the TASM distribution. + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotesLinux.txt b/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotesLinux.txt new file mode 100644 index 00000000..261e8431 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/BuildNotesLinux.txt @@ -0,0 +1,17 @@ +To build the software on LINUX: + + +1. Copy the entire Tasm32 installation folder from the Windows environment + to the LINUX system in whatever manner you find convenient. You must + remove the CR from the lines of text files (using mcopy or + other such utility). + +2. Move to the "src" directory and rename "MAKEFILE.UNX" as "makefile". + +3. Execute "make". The resulting executable will be named "tasm". + +4. Copy the executable to a place in your "PATH" and set the TASMTABS + environment variable to point to the location of the table files. + + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.read.1.tlog new file mode 100644 index 00000000..7afeac84 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.write.1.tlog new file mode 100644 index 00000000..f59b04e9 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/CL.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Errlog.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Errlog.obj new file mode 100644 index 00000000..39bcc3a1 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Errlog.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Fname.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Fname.obj new file mode 100644 index 00000000..daebd5fc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Fname.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Lookup.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Lookup.obj new file mode 100644 index 00000000..d9e97fb2 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Lookup.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Macro.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Macro.obj new file mode 100644 index 00000000..3177a349 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Macro.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Parse.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Parse.obj new file mode 100644 index 00000000..93cb526c Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Parse.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Rules.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Rules.obj new file mode 100644 index 00000000..18dbd680 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Rules.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Str.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Str.obj new file mode 100644 index 00000000..7cdd1dcc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Str.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm.obj new file mode 100644 index 00000000..ea735b47 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.Build.CppClean.log b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.Build.CppClean.log new file mode 100644 index 00000000..744bd405 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.Build.CppClean.log @@ -0,0 +1,41 @@ +.\Debug\Tasm32.ilk +.\Debug\Tasm32.pdb +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\.\Debug\Tasm32.exe +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\.\Debug\Tasm32.exe.intermediate.manifest +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\cl.command.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\CL.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\CL.write.1.tlog +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\ERRLOG.OBJ +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\FNAME.OBJ +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.4428.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.4428.write.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.4428-cvtres.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.4428-cvtres.write.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.command.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link.write.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link-cvtres.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\link-cvtres.write.1.tlog +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\LOOKUP.OBJ +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\MACRO.OBJ +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\mt.command.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\mt.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\mt.write.1.tlog +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\PARSE.OBJ +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\rc.command.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\rc.read.1.tlog +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\rc.write.1.tlog +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\RULES.OBJ +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\STR.OBJ +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM.OBJ +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.EXE +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.EXE.EMBED.MANIFEST +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.EXE.EMBED.MANIFEST.RES +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.EXE.INTERMEDIATE.MANIFEST +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.ILK +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASM32.PDB +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\Tasm32_manifest.rc +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\TASMMAIN.OBJ +C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\vc100.idb +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\VC100.PDB +C:\USERS\DOUG\DESKTOP\GOODALL.COM\PRIVATE\TASM-3.2\SRC\DEBUG\WRTOBJ.OBJ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe new file mode 100644 index 00000000..9d4934f9 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest new file mode 100644 index 00000000..e693382a --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest.res b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest.res new file mode 100644 index 00000000..9c8df0e3 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.embed.manifest.res differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.intermediate.manifest b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.intermediate.manifest new file mode 100644 index 00000000..1c06b619 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.exe.intermediate.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.ilk b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.ilk new file mode 100644 index 00000000..8ad3564f Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.ilk differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.lastbuildstate b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.lastbuildstate new file mode 100644 index 00000000..93c849a4 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100 +Debug|Win32|C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\| diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.log b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.log new file mode 100644 index 00000000..69236904 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32.log @@ -0,0 +1,380 @@ +Build started 10/8/2011 6:35:59 PM. + 1>Project "C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Tasm32.vcxproj" on node 2 (rebuild target(s)). + 1>_PrepareForClean: + Deleting file ".\Debug\Tasm32.lastbuildstate". + InitializeBuildStatus: + Creating ".\Debug\Tasm32.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _VC80_UPGRADE=0x0600 /D _MBCS /Gm /EHsc /RTC1 /MTd /GS /Gy- /fp:precise /Zc:wchar_t /Zc:forScope /Fo".\Debug\\" /Fd".\Debug\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt Errlog.c Fname.c Lookup.c Macro.c Parse.c Rules.c Str.c Tasm.c Tasmmain.c Wrtobj.c + Wrtobj.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(98): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(102): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(107): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(111): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(129): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(136): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(146): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(151): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\wrtobj.c(216): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + Tasmmain.c + Tasm.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(543): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(433) : see declaration of 'getenv' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(720): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(732): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(742): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(762): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(793): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(821): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(835): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(864): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(870): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1002): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1005): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1055): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1081): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1086): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1090): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1138): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1156): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1170): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1185): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1239): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1241): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1375): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1388): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1395): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1400): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1485): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1519): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1556): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1647): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1724): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1729): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1731): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1732): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1733): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1734): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1759): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1761): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1765): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1772): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1775): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1864): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1867): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1870): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1873): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1887): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1891): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1896): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1901): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1907): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1947): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1955): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1956): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(1960): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2020): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2045): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2049): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2050): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2052): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2100): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2106): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2109): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2171): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2173): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2195): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2196): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2231): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2233): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2243): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2244): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2245): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2246): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\tasm.c(2247): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Str.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(116): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(117): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(118): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(187): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(215): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\str.c(324): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Rules.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(145): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(172): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(192): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(324): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(351): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(365): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(446): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(460): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(692): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(710): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(821): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(857): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(863): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(884): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1015): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1021): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1075): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1090): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1131): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\rules.c(1164): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Parse.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(196): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(201): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(236): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(349): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(368): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\parse.c(381): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + Macro.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(118): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(139): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(155): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(222): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(296): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(313): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(354): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(368): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(424): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(450): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(467): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(578): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(650): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(661): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(848): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(853): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(862): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(913): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(919): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1042): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(433) : see declaration of 'getenv' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1045): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1049): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1052): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(234) : see declaration of 'fopen' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1056): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1161): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1248): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1310): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\macro.c(1354): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Lookup.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(275): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(278): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(359): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(363): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(371): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(382): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(394): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(398): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(438): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\lookup.c(442): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Fname.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\fname.c(54): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + Errlog.c + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(72): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(81): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(83): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(105) : see declaration of 'strcpy' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(88): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdlib.h(433) : see declaration of 'getenv' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(90): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(93): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\stdio.h(371) : see declaration of 'sprintf' + 1>c:\users\doug\desktop\goodall.com\private\tasm-3.2\src\errlog.c(96): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\program files (x86)\microsoft visual studio 10.0\vc\include\string.h(110) : see declaration of 'strcat' + Generating Code... + ManifestResourceCompile: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo".\Debug\Tasm32.exe.embed.manifest.res" .\Debug\Tasm32_manifest.rc + Link: + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:".\Debug\Tasm32.exe" /INCREMENTAL /NOLOGO odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:".\Debug\Tasm32.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\Tasm32.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Debug\Tasm32.lib" /MACHINE:X86 .\Debug\Tasm32.exe.embed.manifest.res + .\Debug\Errlog.obj + .\Debug\Fname.obj + .\Debug\Lookup.obj + .\Debug\Macro.obj + .\Debug\Parse.obj + .\Debug\Rules.obj + .\Debug\Str.obj + .\Debug\Tasm.obj + .\Debug\Tasmmain.obj + .\Debug\Wrtobj.obj + Manifest: + Deleting file ".\Debug\Tasm32.exe.embed.manifest". + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /out:".\Debug\Tasm32.exe.embed.manifest" /manifest .\Debug\Tasm32.exe.intermediate.manifest + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\rc.exe /nologo /fo".\Debug\Tasm32.exe.embed.manifest.res" .\Debug\Tasm32_manifest.rc + LinkEmbedManifest: + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:".\Debug\Tasm32.exe" /INCREMENTAL /NOLOGO odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:".\Debug\Tasm32.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /DEBUG /PDB:"C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Debug\Tasm32.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Debug\Tasm32.lib" /MACHINE:X86 .\Debug\Tasm32.exe.embed.manifest.res + .\Debug\Errlog.obj + .\Debug\Fname.obj + .\Debug\Lookup.obj + .\Debug\Macro.obj + .\Debug\Parse.obj + .\Debug\Rules.obj + .\Debug\Str.obj + .\Debug\Tasm.obj + .\Debug\Tasmmain.obj + .\Debug\Wrtobj.obj + Tasm32.vcxproj -> C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\.\Debug\Tasm32.exe + FinalizeBuildStatus: + Deleting file ".\Debug\Tasm32.unsuccessfulbuild". + Touching ".\Debug\Tasm32.lastbuildstate". + 1>Done Building Project "C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Tasm32.vcxproj" (rebuild target(s)). + +Build succeeded. + +Time Elapsed 00:00:05.80 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32_manifest.rc b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32_manifest.rc new file mode 100644 index 00000000..1385c1af Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasm32_manifest.rc differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasmmain.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasmmain.obj new file mode 100644 index 00000000..a715f2f4 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Tasmmain.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Wrtobj.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Wrtobj.obj new file mode 100644 index 00000000..ed7e1196 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/Wrtobj.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/cl.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/cl.command.1.tlog new file mode 100644 index 00000000..fd452401 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/cl.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.cpp b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.cpp new file mode 100644 index 00000000..07f29dd5 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.cpp @@ -0,0 +1,7 @@ +#include +#include + +void main(int argc, char **argv) +{ + printf("%s\n",argv[0]); +} diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.lst b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.lst new file mode 100644 index 00000000..e69de29b diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/hello.obj new file mode 100644 index 00000000..e69de29b diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.read.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.read.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.write.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link-cvtres.write.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.read.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.read.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.write.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092-cvtres.write.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.read.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.read.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.write.1.tlog new file mode 100644 index 00000000..46b134b1 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.7092.write.1.tlog @@ -0,0 +1 @@ +ÿþ \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.command.1.tlog new file mode 100644 index 00000000..f468e93e Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.read.1.tlog new file mode 100644 index 00000000..f927deb4 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.write.1.tlog new file mode 100644 index 00000000..21c4aed3 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/link.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.command.1.tlog new file mode 100644 index 00000000..a6a138af Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.read.1.tlog new file mode 100644 index 00000000..0e8b324e Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.write.1.tlog new file mode 100644 index 00000000..169dcdbf Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/mt.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.command.1.tlog new file mode 100644 index 00000000..0c706787 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.read.1.tlog new file mode 100644 index 00000000..e7150aa1 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.write.1.tlog new file mode 100644 index 00000000..ca4cc502 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/rc.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/tasm80.tab b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/tasm80.tab new file mode 100644 index 00000000..058fa145 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/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 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.idb b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.idb new file mode 100644 index 00000000..affea877 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.idb differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.pdb b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.pdb new file mode 100644 index 00000000..6d44845f Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Debug/vc100.pdb differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Makefile b/branches/dwg/LSource/src/tasm-src-3.2/Src/Makefile new file mode 100644 index 00000000..d80f2034 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Makefile @@ -0,0 +1,115 @@ +############################################################################# +# $Id: makefile.unx 1.6 1998/03/03 01:58:24 toma Exp $ +############################################################################# +# +# File: makefile.unx +# Description: Make TASM in the LINUX environment (GNU make) +# +# Thomas N. Anderson, Squak Valley Software +# +# Invoked as: +# +# make -f makefile.unx +# +# or copy makefile.unx to makefile and invoke as: +# +# make +# +# +# +# For debug +#CFLAGS+=-ggdb +CFLAGS+=-Wall -O +CC=gcc +RM=rm -f + +# Where to find current working files +TASMDOSPATH=/dosc/tasmnew + +CFILES=tasmmain.c tasm.c macro.c parse.c rules.c str.c lookup.c \ + wrtobj.c fname.c errlog.c +HFILES=tasm.h + +TABLES=tasm05.tab \ + tasm3210.tab \ + tasm3225.tab \ + tasm48.tab \ + tasm51.tab \ + tasm65.tab \ + tasm68.tab \ + tasm70.tab \ + tasm80.tab \ + tasm85.tab \ + tasm96.tab + +TESTFILES=\ + test05.asm \ + test3210.asm \ + test3225.asm \ + test48.asm \ + test51.asm \ + test65.asm \ + test68.asm \ + test70.asm \ + testz80.asm \ + test85.asm \ + test96.asm \ + testtabs.sh + +SOURCES=$(CFILES) $(HFILES) + +DOCS=tasmman.htm tasmtabs.htm readme.txt relnotes.txt orderfrm.txt orderfrm.htm + + +OFILES=$(CFILES:%.c=%.o) + + + +# LINUX version of TASM. +all: tasm +tasm: $(OFILES) + +import: + getdos.sh $(SOURCES) + getdos.sh $(TABLES) + getdos.sh $(DOCS) + getdos.sh $(TESTFILES) + # Replace readme.txt with the LINUX version + rm readme.txt + getdos.sh readmel.txt + mv readmel.txt readme.txt + +tar: + tar -cvf tasm.tar tasm $(TABLES) $(DOCS) $(TESTFILES) + gzip tasm.tar + mv tasm.tar.gz tasm.taz + tar -cvf tasmsrc.tar tasm $(SOURCES) makefile.unx + gzip tasmsrc.tar + mv tasmsrc.tar.gz tasmsrc.taz + +clean: + rm -f *.o tasm + +################################################################# +# Dependencies + +tasmmain.o: tasmmain.c tasm.h + +tasm.o: tasm.c tasm.h + +macro.o: macro.c tasm.h + +parse.o: parse.c tasm.h + +str.o: str.c tasm.h + +lookup.o: lookup.c tasm.h + +wrtobj.o: wrtobj.c tasm.h + +fname.o: fname.c tasm.h + +rules.o: rules.c tasm.h + +errlog.o: errlog.c tasm.h + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.read.1.tlog new file mode 100644 index 00000000..25a16e28 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.write.1.tlog new file mode 100644 index 00000000..a7ea8bab Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/CL.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Errlog.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Errlog.obj new file mode 100644 index 00000000..d8c758bc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Errlog.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Fname.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Fname.obj new file mode 100644 index 00000000..a605b4da Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Fname.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Lookup.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Lookup.obj new file mode 100644 index 00000000..91e68a14 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Lookup.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Macro.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Macro.obj new file mode 100644 index 00000000..25a3b63e Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Macro.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Parse.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Parse.obj new file mode 100644 index 00000000..c8a55acc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Parse.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Rules.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Rules.obj new file mode 100644 index 00000000..ae711378 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Rules.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Str.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Str.obj new file mode 100644 index 00000000..0bc41642 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Str.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm.obj new file mode 100644 index 00000000..1c25b5cc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe new file mode 100644 index 00000000..18da5fa6 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe.intermediate.manifest b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe.intermediate.manifest new file mode 100644 index 00000000..1c06b619 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.exe.intermediate.manifest @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.lastbuildstate b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.lastbuildstate new file mode 100644 index 00000000..aab7a9f3 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.lastbuildstate @@ -0,0 +1,2 @@ +#v4.0:v100 +Release|Win32|C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\| diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.log b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.log new file mode 100644 index 00000000..9cfbd738 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasm32.log @@ -0,0 +1,280 @@ +Build started 10/8/2011 7:22:54 PM. + 1>Project "C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Tasm32.vcxproj" on node 2 (build target(s)). + 1>InitializeBuildStatus: + Creating ".\Release\Tasm32.unsuccessfulbuild" because "AlwaysCreate" was specified. + ClCompile: + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\CL.exe /c /Zi /nologo /W3 /WX- /O2 /Ob1 /Oy- /D WIN32 /D NDEBUG /D _CONSOLE /D _VC80_UPGRADE=0x0600 /D _MBCS /GF /Gm- /EHsc /MT /GS /Gy /fp:precise /Zc:wchar_t /Zc:forScope /Fo".\Release\\" /Fd".\Release\vc100.pdb" /Gd /TC /analyze- /errorReport:prompt Errlog.c Fname.c Lookup.c Macro.c Parse.c Rules.c Str.c Tasm.c Tasmmain.c Wrtobj.c + Errlog.c + 1>Errlog.c(72): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Errlog.c(81): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Errlog.c(83): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Errlog.c(88): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h(433) : see declaration of 'getenv' + 1>Errlog.c(90): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Errlog.c(93): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Errlog.c(96): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Fname.c + 1>Fname.c(54): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Lookup.c + 1>Lookup.c(275): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(278): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(359): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Lookup.c(363): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(371): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(382): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(394): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Lookup.c(398): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Lookup.c(438): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Lookup.c(442): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Macro.c + 1>Macro.c(118): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(139): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(155): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(222): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(296): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(313): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(354): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(368): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(424): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(450): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(467): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(578): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(650): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(661): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(848): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(853): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(862): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(913): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(919): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1042): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h(433) : see declaration of 'getenv' + 1>Macro.c(1045): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1049): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1052): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Macro.c(1056): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1161): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Macro.c(1248): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1310): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Macro.c(1354): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Parse.c + 1>Parse.c(196): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Parse.c(201): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Parse.c(236): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Parse.c(349): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Parse.c(368): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Parse.c(381): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + Rules.c + 1>Rules.c(145): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(172): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(192): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(324): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(351): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(365): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(433): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(446): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(460): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(692): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(710): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(821): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(857): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(863): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(884): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(1015): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(1021): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(1075): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(1090): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Rules.c(1131): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Rules.c(1164): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Str.c + 1>Str.c(116): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Str.c(117): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Str.c(118): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Str.c(187): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Str.c(215): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Str.c(324): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Tasm.c + 1>Tasm.c(543): warning C4996: 'getenv': This function or variable may be unsafe. Consider using _dupenv_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdlib.h(433) : see declaration of 'getenv' + 1>Tasm.c(720): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(732): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(742): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(762): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(793): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(821): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(835): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(864): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(870): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1002): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(1005): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1055): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1081): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1086): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1090): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1138): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1156): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1170): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1185): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1239): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(1241): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1375): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1388): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1395): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1400): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1485): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1519): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1556): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1647): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1724): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1729): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1731): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1732): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1733): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1734): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1759): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(1761): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(1765): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1772): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(1775): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1864): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1867): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1870): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1873): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1887): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1891): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1896): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1901): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1907): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1947): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1955): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(1956): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(1960): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2020): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2045): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2049): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2050): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2052): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2100): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2106): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2109): warning C4996: 'strcat': This function or variable may be unsafe. Consider using strcat_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2171): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2173): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2195): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(2196): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2231): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(234) : see declaration of 'fopen' + 1>Tasm.c(2233): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Tasm.c(2243): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2244): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2245): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2246): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + 1>Tasm.c(2247): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + Tasmmain.c + Wrtobj.c + 1>Wrtobj.c(98): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(102): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(107): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(111): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(129): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(136): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(146): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(151): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + 1>Wrtobj.c(216): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\stdio.h(371) : see declaration of 'sprintf' + Generating Code... + Link: + c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:".\Release\Tasm32.exe" /INCREMENTAL:NO /NOLOGO odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /ManifestFile:".\Release\Tasm32.exe.intermediate.manifest" /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:"C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Release\Tasm32.pdb" /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:".\Release\Tasm32.lib" /MACHINE:X86 .\Release\Errlog.obj + .\Release\Fname.obj + .\Release\Lookup.obj + .\Release\Macro.obj + .\Release\Parse.obj + .\Release\Rules.obj + .\Release\Str.obj + .\Release\Tasm.obj + .\Release\Tasmmain.obj + .\Release\Wrtobj.obj + Tasm32.vcxproj -> C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\.\Release\Tasm32.exe + Manifest: + C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\bin\mt.exe /nologo /verbose /outputresource:".\Release\Tasm32.exe;#1" /manifest .\Release\Tasm32.exe.intermediate.manifest + FinalizeBuildStatus: + Deleting file ".\Release\Tasm32.unsuccessfulbuild". + Touching ".\Release\Tasm32.lastbuildstate". + 1>Done Building Project "C:\Users\doug\Desktop\goodall.com\private\tasm-3.2\Src\Tasm32.vcxproj" (build target(s)). + +Build succeeded. + +Time Elapsed 00:00:04.72 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasmmain.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasmmain.obj new file mode 100644 index 00000000..d657c639 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Tasmmain.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Wrtobj.obj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Wrtobj.obj new file mode 100644 index 00000000..c734cce2 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/Wrtobj.obj differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/cl.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/cl.command.1.tlog new file mode 100644 index 00000000..fc9b384d Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/cl.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.command.1.tlog new file mode 100644 index 00000000..68afb4e5 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.read.1.tlog new file mode 100644 index 00000000..b62075ef Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.write.1.tlog new file mode 100644 index 00000000..09fbff2d Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/link.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.command.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.command.1.tlog new file mode 100644 index 00000000..09c57fb0 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.command.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.read.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.read.1.tlog new file mode 100644 index 00000000..1d860b5e Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.read.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.write.1.tlog b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.write.1.tlog new file mode 100644 index 00000000..af5f3bc3 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/mt.write.1.tlog differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/vc100.pdb b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/vc100.pdb new file mode 100644 index 00000000..d236b2b8 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Release/vc100.pdb differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dep b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dep new file mode 100644 index 00000000..853c57af --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dep @@ -0,0 +1,41 @@ +# Microsoft Developer Studio Generated Dependency File, included by Tasm32.mak + +.\Errlog.c : \ + ".\Tasm.h"\ + + +.\Fname.c : \ + ".\Tasm.h"\ + + +.\Lookup.c : \ + ".\Tasm.h"\ + + +.\Macro.c : \ + ".\Tasm.h"\ + + +.\Parse.c : \ + ".\Tasm.h"\ + + +.\Rules.c : \ + ".\Tasm.h"\ + + +.\Str.c : \ + ".\Tasm.h"\ + + +.\Tasm.c : \ + ".\Tasm.h"\ + + +.\Tasmmain.c : \ + ".\Tasm.h"\ + + +.\Wrtobj.c : \ + ".\Tasm.h"\ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsp b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsp new file mode 100644 index 00000000..1beaa0e3 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsp @@ -0,0 +1,141 @@ +# Microsoft Developer Studio Project File - Name="Tasm32" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=Tasm32 - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "Tasm32.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Tasm32.mak" CFG="Tasm32 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Tasm32 - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Tasm32 - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Tasm32 - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 + +!ELSEIF "$(CFG)" == "Tasm32 - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "Tasm32 - Win32 Release" +# Name "Tasm32 - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\Errlog.c +# End Source File +# Begin Source File + +SOURCE=.\Fname.c +# End Source File +# Begin Source File + +SOURCE=.\Lookup.c +# End Source File +# Begin Source File + +SOURCE=.\Macro.c +# End Source File +# Begin Source File + +SOURCE=.\Parse.c +# End Source File +# Begin Source File + +SOURCE=.\Rules.c +# End Source File +# Begin Source File + +SOURCE=.\Str.c +# End Source File +# Begin Source File + +SOURCE=.\Tasm.c +# End Source File +# Begin Source File + +SOURCE=.\Tasmmain.c +# End Source File +# Begin Source File + +SOURCE=.\Wrtobj.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\Tasm.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsw b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsw new file mode 100644 index 00000000..6ebf4c8d --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Tasm32"=.\Tasm32.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.mak b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.mak new file mode 100644 index 00000000..52221aee --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.mak @@ -0,0 +1,266 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on Tasm32.dsp +!IF "$(CFG)" == "" +CFG=Tasm32 - Win32 Debug +!MESSAGE No configuration specified. Defaulting to Tasm32 - Win32 Debug. +!ENDIF + +!IF "$(CFG)" != "Tasm32 - Win32 Release" && "$(CFG)" != "Tasm32 - Win32 Debug" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "Tasm32.mak" CFG="Tasm32 - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Tasm32 - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "Tasm32 - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +!IF "$(CFG)" == "Tasm32 - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release +# Begin Custom Macros +OutDir=.\Release +# End Custom Macros + +ALL : "$(OUTDIR)\Tasm32.exe" + + +CLEAN : + -@erase "$(INTDIR)\Errlog.obj" + -@erase "$(INTDIR)\Fname.obj" + -@erase "$(INTDIR)\Lookup.obj" + -@erase "$(INTDIR)\Macro.obj" + -@erase "$(INTDIR)\Parse.obj" + -@erase "$(INTDIR)\Rules.obj" + -@erase "$(INTDIR)\Str.obj" + -@erase "$(INTDIR)\Tasm.obj" + -@erase "$(INTDIR)\Tasmmain.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\Wrtobj.obj" + -@erase "$(OUTDIR)\Tasm32.exe" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\Tasm32.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\Tasm32.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\Tasm32.pdb" /machine:I386 /out:"$(OUTDIR)\Tasm32.exe" +LINK32_OBJS= \ + "$(INTDIR)\Errlog.obj" \ + "$(INTDIR)\Fname.obj" \ + "$(INTDIR)\Lookup.obj" \ + "$(INTDIR)\Macro.obj" \ + "$(INTDIR)\Parse.obj" \ + "$(INTDIR)\Rules.obj" \ + "$(INTDIR)\Str.obj" \ + "$(INTDIR)\Tasm.obj" \ + "$(INTDIR)\Tasmmain.obj" \ + "$(INTDIR)\Wrtobj.obj" + +"$(OUTDIR)\Tasm32.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "Tasm32 - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "$(OUTDIR)\Tasm32.exe" + + +CLEAN : + -@erase "$(INTDIR)\Errlog.obj" + -@erase "$(INTDIR)\Fname.obj" + -@erase "$(INTDIR)\Lookup.obj" + -@erase "$(INTDIR)\Macro.obj" + -@erase "$(INTDIR)\Parse.obj" + -@erase "$(INTDIR)\Rules.obj" + -@erase "$(INTDIR)\Str.obj" + -@erase "$(INTDIR)\Tasm.obj" + -@erase "$(INTDIR)\Tasmmain.obj" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(INTDIR)\Wrtobj.obj" + -@erase "$(OUTDIR)\Tasm32.exe" + -@erase "$(OUTDIR)\Tasm32.ilk" + -@erase "$(OUTDIR)\Tasm32.pdb" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP=cl.exe +CPP_PROJ=/nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"$(INTDIR)\Tasm32.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +RSC=rc.exe +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\Tasm32.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\Tasm32.pdb" /debug /machine:I386 /out:"$(OUTDIR)\Tasm32.exe" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\Errlog.obj" \ + "$(INTDIR)\Fname.obj" \ + "$(INTDIR)\Lookup.obj" \ + "$(INTDIR)\Macro.obj" \ + "$(INTDIR)\Parse.obj" \ + "$(INTDIR)\Rules.obj" \ + "$(INTDIR)\Str.obj" \ + "$(INTDIR)\Tasm.obj" \ + "$(INTDIR)\Tasmmain.obj" \ + "$(INTDIR)\Wrtobj.obj" + +"$(OUTDIR)\Tasm32.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("Tasm32.dep") +!INCLUDE "Tasm32.dep" +!ELSE +!MESSAGE Warning: cannot find "Tasm32.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "Tasm32 - Win32 Release" || "$(CFG)" == "Tasm32 - Win32 Debug" +SOURCE=.\Errlog.c + +"$(INTDIR)\Errlog.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Fname.c + +"$(INTDIR)\Fname.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Lookup.c + +"$(INTDIR)\Lookup.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Macro.c + +"$(INTDIR)\Macro.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Parse.c + +"$(INTDIR)\Parse.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Rules.c + +"$(INTDIR)\Rules.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Str.c + +"$(INTDIR)\Str.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Tasm.c + +"$(INTDIR)\Tasm.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Tasmmain.c + +"$(INTDIR)\Tasmmain.obj" : $(SOURCE) "$(INTDIR)" + + +SOURCE=.\Wrtobj.c + +"$(INTDIR)\Wrtobj.obj" : $(SOURCE) "$(INTDIR)" + + + +!ENDIF + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.ncb b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.ncb new file mode 100644 index 00000000..7239f2f7 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.ncb differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.opt b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.opt new file mode 100644 index 00000000..ecc77642 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.opt differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.plg b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.plg new file mode 100644 index 00000000..bd2c0f9f --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.plg @@ -0,0 +1,59 @@ + + +
+

Build Log

+

+--------------------Configuration: Tasm32 - Win32 Release-------------------- +

+

Command Lines

+Creating temporary file "c:\windows\TEMP\RSP164.TMP" with contents +[ +/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fp"Release/Tasm32.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c +"C:\Windows\Profiles\Tom\Tasm32\Errlog.c" +"C:\Windows\Profiles\Tom\Tasm32\Fname.c" +"C:\Windows\Profiles\Tom\Tasm32\Lookup.c" +"C:\Windows\Profiles\Tom\Tasm32\Macro.c" +"C:\Windows\Profiles\Tom\Tasm32\Parse.c" +"C:\Windows\Profiles\Tom\Tasm32\Rules.c" +"C:\Windows\Profiles\Tom\Tasm32\Str.c" +"C:\Windows\Profiles\Tom\Tasm32\Tasm.c" +"C:\Windows\Profiles\Tom\Tasm32\Tasmmain.c" +"C:\Windows\Profiles\Tom\Tasm32\Wrtobj.c" +] +Creating command line "cl.exe @c:\windows\TEMP\RSP164.TMP" +Creating temporary file "c:\windows\TEMP\RSP0165.TMP" with contents +[ +kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /incremental:no /pdb:"Release/Tasm32.pdb" /machine:I386 /out:"Release/Tasm32.exe" +.\Release\Errlog.obj +.\Release\Fname.obj +.\Release\Lookup.obj +.\Release\Macro.obj +.\Release\Parse.obj +.\Release\Rules.obj +.\Release\Str.obj +.\Release\Tasm.obj +.\Release\Tasmmain.obj +.\Release\Wrtobj.obj +] +Creating command line "link.exe @c:\windows\TEMP\RSP0165.TMP" +

Output Window

+Compiling... +Errlog.c +Fname.c +Lookup.c +Macro.c +Parse.c +Rules.c +Str.c +Tasm.c +Tasmmain.c +Wrtobj.c +Linking... + + + +

Results

+Tasm32.exe - 0 error(s), 0 warning(s) +
+ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sdf b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sdf new file mode 100644 index 00000000..f01cff72 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sdf differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sln b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sln new file mode 100644 index 00000000..ec8e93aa --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tasm32", "Tasm32.vcxproj", "{1C708DCE-7BF6-26E2-090C-658931CCACDF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1C708DCE-7BF6-26E2-090C-658931CCACDF}.Debug|Win32.ActiveCfg = Release|Win32 + {1C708DCE-7BF6-26E2-090C-658931CCACDF}.Debug|Win32.Build.0 = Release|Win32 + {1C708DCE-7BF6-26E2-090C-658931CCACDF}.Release|Win32.ActiveCfg = Release|Win32 + {1C708DCE-7BF6-26E2-090C-658931CCACDF}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.suo b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.suo new file mode 100644 index 00000000..ff0875ad Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.suo differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj new file mode 100644 index 00000000..574ba173 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj @@ -0,0 +1,137 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + + + + + + Application + false + MultiByte + + + Application + false + MultiByte + + + + + + + + + + + + + + + .\Release\ + .\Release\ + false + + + .\Debug\ + .\Debug\ + true + + + + MultiThreaded + OnlyExplicitInline + true + true + MaxSpeed + true + Level3 + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + .\Release\ + .\Release\Tasm32.pch + .\Release\ + .\Release\ + + + .\Release\Tasm32.tlb + + + 0x0409 + NDEBUG;%(PreprocessorDefinitions) + + + true + .\Release\Tasm32.bsc + + + true + Console + .\Release\Tasm32.exe + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + MultiThreadedDebug + Default + false + Disabled + true + Level3 + true + EditAndContinue + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + .\Debug\ + .\Debug\Tasm32.pch + .\Debug\ + .\Debug\ + EnableFastChecks + + + .\Debug\Tasm32.tlb + + + 0x0409 + _DEBUG;%(PreprocessorDefinitions) + + + true + .\Debug\Tasm32.bsc + + + true + true + Console + .\Debug\Tasm32.exe + odbc32.lib;odbccp32.lib;%(AdditionalDependencies) + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.filters b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.filters new file mode 100644 index 00000000..f2535287 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.filters @@ -0,0 +1,54 @@ + + + + + {22595b52-6a59-42d5-8e18-beeb9888569d} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {1117c96e-b7d2-4304-ad8c-84b72e4ed6ec} + h;hpp;hxx;hm;inl + + + {d03649bd-7c7b-4f89-aee8-d95950697963} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.user b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.user new file mode 100644 index 00000000..ace9a86a --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/Tasm32.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/errlog.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/errlog.c new file mode 100644 index 00000000..372d713e --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/errlog.c @@ -0,0 +1,102 @@ +/**************************************************************************** + * $Id: errlog.c 1.3 1999/08/20 00:36:42 toma Exp $ + **************************************************************************** + * File: errlog.c + * + * Description: + * Modules to log error messages for TASM, the table driven assembler. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * + * See rlog for file revision history. + * + */ + +//static char *id_errlog_c = "$Id: errlog.c 1.3 1999/08/20 00:36:42 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + +/* DEFINES */ + + + +/************************************************************************/ +/* + * Function: errlog() + * + * Description: + * Format an error message and output to the list file and the + * standard output. + * + */ + +void +errlog( +char *err_mess, /* Error message */ +errout_t output_mode) /* Enable output on Pass1/Pass2 */ +{ + + char errbuf[LINESIZE]; + char err_data[LINESIZE]; + char file_name[PATHSIZE]; + char *err_format; + char *file; + + extern int Errcnt; + extern pass_t Pass; + extern int Line_number; + extern int Skip; + extern char Errorbuf[]; + + /* Suppress errors if this is the first pass or if we are + * just skipping over source code looking for an 'endif'. + */ + if( (Skip == FALSE) && ((output_mode == ALWAYS) || (Pass == SECOND))){ + Errcnt++; + + if(Errorbuf[0]) + sprintf(err_data,"(%s)",Errorbuf); + else + err_data[0] = '\0'; + + /* Fetch the name of the current source file */ + file = fname_get ( ); + + /* Use the applicable file name if we know it */ + if((file != NULL) && (*file)) + strcpy(file_name, file ); + else + strcpy(file_name, "tasm"); + + /* Check for alternate error log format string and + * use it if it exists + */ + if( (err_format=getenv("TASMERRFORMAT")) == NULL) + sprintf(errbuf,"%s line %04d: %s %s", + file, Line_number, err_mess, err_data); + else + sprintf(errbuf,err_format, + file, Line_number, err_mess, err_data); + + + strcat (errbuf, "\n"); /* Add newline */ + errprt (errbuf); + listprt(errbuf); + } +} + +/* that's all folks */ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/fname.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/fname.c new file mode 100644 index 00000000..5c1805ad --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/fname.c @@ -0,0 +1,81 @@ +/**************************************************************************** + * $Id: fname.c 1.4 1997/11/15 13:08:12 toma Exp $ + **************************************************************************** + * File: fname.c + * + * Description: + * File name functions for TASM, the table driven assembler. + * + * Copyright 1989-1995 Speech Technology Incorporated. + * Copyright 1997 Squak Valley Software. + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + */ + +//static char *id_fname_c = "$Id: fname.c 1.4 1997/11/15 13:08:12 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + + +/* Static */ +static char fname_list[MAXFILES][PATHSIZE]; + +static int SourceIncludeDepth = 0; + + +/******************************************************************/ +/* Function: fname_push() + * Description: + * Save the indicated filename (by fd) for later use by errlog(). + */ +void +fname_push( +char *fname) /* File name */ + +{ + + SourceIncludeDepth++; + + if( (SourceIncludeDepth >=0) && + (SourceIncludeDepth < MAXFILES) && + (strlen(fname) < PATHSIZE)) + { + strcpy( &fname_list[SourceIncludeDepth][0], fname); + } +} + +/******************************************************************/ +/* Function: fname_pop() + * Description: + * Pop a source filename off the source file name stack. + */ +void +fname_pop( void ) + +{ + SourceIncludeDepth--; +} + +/******************************************************************/ +/* Function: fname_get() + * Description: + * Fetch the current source file name. + */ +char * +fname_get( void ) +{ + return( &fname_list[SourceIncludeDepth][0]); +} + +/* That's all folks. */ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/ipch/tasm32-ca344073/tasm32-ad23a830.ipch b/branches/dwg/LSource/src/tasm-src-3.2/Src/ipch/tasm32-ca344073/tasm32-ad23a830.ipch new file mode 100644 index 00000000..d316e409 Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/ipch/tasm32-ca344073/tasm32-ad23a830.ipch differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/lookup.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/lookup.c new file mode 100644 index 00000000..a107b6f7 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/lookup.c @@ -0,0 +1,482 @@ +/**************************************************************************** + * $Id: lookup.c 1.5 1997/11/15 13:10:50 toma Exp $ + **************************************************************************** + * File: lookup.c + * + * Description: + * Functions to lookup instructions and directives. + * + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997 Squak Valley Software. + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * + * + */ + +//static char *id_lookup_c = "$Id: lookup.c 1.5 1997/11/15 13:10:50 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" +#ifdef T_MEMCHECK +#include +#endif + +/* EXTERNALS */ +extern ushort Debug; +extern char Errorbuf[LINESIZE]; + +/************************************************************************/ +/* FUNCTIONS */ + +/* Function: inst_lookup() + * Description: + * Lookup instruction and args string in tables to see if valid. + * If it is valid, then return op_code, number of bytes, and + * an argument expression (if any). + */ +error_t +inst_lookup( +char *inst, /* Instruction */ +char *args, /* Argument string */ +ulong *op_code, +ushort *obytes, +ushort *abytes, +ushort *modop, +ubyte *shift, +ulong *bor, +ushort *argc, +char **argv) +{ + static char expbuf[LINESIZE]; + + extern ushort Class_mask; + extern ushort Ihash[]; + extern ushort Num_instr; + extern ushort Num_reg; + extern OPTAB *Optab[]; + extern REGTAB *Regtab[]; + extern char Wild_char; + extern char Reg_char; + extern char Errorbuf[LINESIZE]; + + char argbuf[LINESIZE]; + ushort j; + ushort jj; + error_t errflag; + ushort len1; + char *argpattern; + char *argu; + char *argl; + char *arge; + char *p; + char *q; + char c; + ushort inst_match; + ulong regfield; + + /* Just for safety, make sure we do not return a NULL pointer in argv[0] + * even if no args are found. If we match an op_code that needs args + * but none were provided in the source, then we might have such a case. + */ + expbuf[0] = '\0'; + argv[0] = expbuf; + + /* search table for a match with inst and args */ + + /* Set the error flag hoping it will be cleared when + a legal instruction is found */ + errflag = ER_BADINST; + + /* Convert the instruction to upper case */ + p = inst; + while(*p) + { + if((*p >= 'a') && (*p <= 'z')) *p -= ('a' - 'A'); + p++; + } + + /* Convert the args to upper case. Don't do it in place since + * we need to extract the expressions in mixed case so labels + * remain true. + */ + p = args; + q = argbuf; + while(*p) + { + if((*p >= 'a') && (*p <= 'z')) + *q++ = (*p++) - 'a' + 'A'; + else + *q++ = *p++; + } + *q = '\0'; + + /* Get the first element of Optab that we should look at for + * this instruction from the instruction hash table + */ + jj = Ihash[HASHKEY(inst)]; + inst_match = FALSE; + + for(; jj < Num_instr; jj++) + { + + if(Optab[jj]->same_inst == FALSE) + { + /* New instruction. Check to see if it matches. */ + p = inst; + q = Optab[jj]->instruction; + while((*p == *q) && (*p)){ + p++; + q++; + } + inst_match = (*p == *q); + } + + if(inst_match && (Optab[jj]->iclass & Class_mask)) + { + /* Instruction matches, now check args. + * Set the error flag hoping it will be cleared when + * a legal argument is found + */ + errflag = ER_BADARG; + + argpattern = Optab[jj]->args; /* fetch expected arg */ + argu = argbuf; /* pointer to args (upper case only) */ + argl = args; /* pointer to args (mixed case) */ + arge = expbuf; /* pointer to extracted expression */ + *argc = 0; /* Arg count */ + regfield = 0; /* optional register set bits */ + + do + { + /* Check for the wild card character '*'. + * If '*' in argpattern is immediately + * followed by a comma then that arg is + * taken to be everything up to the next + * comma. If it isn't followed by a comma + * then copy over enough chars so the same + * number of chars remain in argpattern as + * the args under test. + * + * Thus, if multiple '*'s are used in an + * argpattern, all but the last one must + * be followed by a comma or ']' for proper + * operation. + */ + if(*argpattern == Wild_char){ + argv[*argc] = arge; + *argc += 1; + c = *(argpattern+1); + if((c == ',') || (c == ']') || (c == '[')){ + /* copy over until a comma or ] or [ is found */ + while((*argl) && (*argl != ',') && + (*argl != ']') && + (*argl != '[')){ + *arge++ = *argl++; + argu++; + } + argpattern++; + } + else if((*(argpattern+1) == ')') && + (*(argpattern+2) == ',') ){ + /* copy over until '),' is found */ + while((*argl) && !((*argl == ')')&&(*(argl+1) == ','))){ + *arge++ = *argl++; + argu++; + } + argpattern++; + } +#if 0 + else if(*(argpattern+1) == '(') + { + /* SPR 1008. This is an attempt to allow a left + * paren to terminate an expression (instead of + * just the ,[] set). Since parens are valid + * in expressions, this is difficult. + * The approach here is to only terminate the + * gobble of the expression if a paren is encountered + * that is not preceeded by a binary operator. + * This is weak, since nested parens may also + * appear. This parsing is not required by + * any existing TASM table (as of 3.0) but + * is in support of a user. + * Example of the application: @(@),@ + * Note char2toktype() does not yet exist. + * Can't use toktype directly since it does not + * accept char as input. + */ + while((*argl) && !((*argl == '(') && + (char2toktype((*(argl-1)) != TOK_BINOP))){ + *arge++ = *argl++; + argu++; + } + argpattern++; + } +#endif + else + { + /* General case. Last '*' in arg. */ + short n,i; + n = strlen(argl) - strlen(argpattern) + 1; + for(i=0;i < n;i++) + { + *arge++ = *argl++; + argu++; + } + argpattern++; + } + + *arge++ = '\0'; + } + else if (*argpattern == Reg_char) + { + for (j=0; j < Num_reg; j++) + { + if((Regtab[j]->iclass & Class_mask) == 0)continue; + len1 = strlen (Regtab[j]->reg); + if ( strncmp(Regtab[j]->reg, argu, len1) == SAME){ + regfield = Regtab[j]->opcode; + argpattern++; + argu += len1; + argl += len1; + break; + } + } + + } + + /* if we made it to the end of both the argument + * pattern (argpattern) and actual arg, it must match. + */ + if((*argpattern == '\0')&&(*argu == '\0')) + { + *op_code = Optab[jj]->opcode | regfield; + *obytes = Optab[jj]->obytes; + *abytes = Optab[jj]->abytes; + *modop = Optab[jj]->modop; + *shift = Optab[jj]->shift; + *bor = Optab[jj]->bor; + return(ER_NOERR); + } + argl++; + }while(*argu++ == *argpattern++); + } + + } /* end for (each instruction) */ + + if(errflag == ER_BADARG) + strcpy(Errorbuf, args); + + if(errflag == ER_BADINST) + strcpy(Errorbuf, inst); + + return(errflag); +} + +/* Function: dir_lookup() + * Description: + * Look up the assembler directive in the table + */ + +dir_t +dir_lookup(char *directive) +{ + + extern char *Dirtab[]; + + ushort i; + char *p; + char *q; + + /* Convert the directive to upper case */ + p = directive; + while(*p) + { + if((*p >= 'a') && (*p <= 'z')) *p -= ('a' - 'A'); + p++; + } + + for(i = 0; i < (int)NDIR; i++) + { + p = directive; + q = Dirtab[i]; + while((*p == *q) && (*p)) + { + p++; + q++; + } + if(*p == *q)break; + } + + /* Treat the following as the same as some other directive */ + switch(i){ + case NDIR: return(NOTDIR); /* not found */ + case ORG2: return(ORG); + case ORG3: return(ORG); + case EQU2: return(EQU); + case DB: return(BYTE); + case DW: return(WORD); + default: return((dir_t)i); + } +} + +/* Function: save_label() + * Description: + * Save this label in the label table. + */ + +void +save_label(char *plabel, expr_t labval) +{ + + extern LABTAB *Labtab[]; + extern ushort Nlab; + extern int Seg; + extern int Err_check; + extern int Ignore_case; + extern char Local_char; + extern char Module_name[]; + + ushort labsize; + char label[LINESIZE]; + int local_flag; + + /* If this is a local label then build the full label by + * concatenating the current module name with the local label. + * We can't really free local labels at the end of a module because + * of the two pass nature of TASM. All labels must be defined on the + * first pass and must be retained for code generation in the second + * pass. + */ + if(*plabel == Local_char){ + sprintf(label, "%s.%s", Module_name, plabel); + local_flag = F_LOCAL; + } + else{ + strcpy(label, plabel); + local_flag = 0; + } + + if(Err_check & EC_DUP_LABELS) + { + if(find_label(label) != FAILURE) + { + strcpy(Errorbuf,label); + errlog("Duplicate label:", ALWAYS); + return; + } + } + + /* compute size of label */ + labsize = strlen(label); + + if(labsize >= LABLEN) + { + strcpy(Errorbuf,label); + errlog("Label too long:", ALWAYS); + return; + } + + /* Compute size of labtab entry. The 'lab' buffer is declared as + * 2 chars. Grow as necessary. This approach is a little messy, + * but avoids saving another pointer and incurring the overhead of + * another malloc (another 4 bytes). + */ + GETLABTAB(Nlab) = (LABTAB *)malloc(sizeof(LABTAB) + labsize - 1); + if(GETLABTAB(Nlab) == NULL){ + sprintf(label, "Cannot malloc for label storage. NumLabels=%d\n", Nlab); + errprt(label); + tasmexit(EXIT_MALLOC); + } + strcpy(GETLABTAB(Nlab)->lab, label); + + DEBUG2("Malloc %lx %s\n",(long)GETLABTAB(Nlab),GETLABTAB(Nlab)->lab); + + GETLABTAB(Nlab)->val = labval; + GETLABTAB(Nlab)->flags = (Seg & F_SEG) | local_flag; + + /* If we are ignoring case then convert to upper case always */ + if(Ignore_case) stoupper(GETLABTAB(Nlab)->lab); + + Nlab++; + return; +} + +/* Function: find_label() + * Description: + * Find this label in the label table. + */ + +int +find_label(char *plabel) +{ + extern LABTAB *Labtab[]; + extern ushort Lhash[]; + extern ushort Nlab; + extern pass_t Pass; + extern int Ignore_case; + extern char Module_name[]; + extern char Local_char; + + ushort i; + short j; + char firstc; + char label[LINESIZE]; + + /* If we are looking for a local label then prefix with the module + * name since that is how it will actually be stored in the table. + */ + if(*plabel == Local_char) + { + sprintf(label, "%s.%s", Module_name, plabel); + } + else + { + strcpy(label, plabel); + } + + i = 0; /* starting point for search */ + if(Ignore_case == TRUE) + { + stoupper(label); + } + + /* On second pass the label table is sorted, so do simple indexing */ + if(Pass != FIRST){ + /* lookup the starting point in the label table to begin + * the search + */ + j = *label - 'A'; + if((j >=0) && (j < MAXLHASH)) i = Lhash[j]; + + for(; i < Nlab; i++) + { + if(strcmp(label, GETLABTAB(i)->lab) == SAME) return(i); + } + + } + else{ + firstc = *label; + for(; i < Nlab; i++) + { + /* Check for first char match before calling strcmp + * just for a little more speed. + */ + if((firstc == *(GETLABTAB(i)->lab)) && + (strcmp(label, GETLABTAB(i)->lab) == SAME)) + return(i); + } + } + + return(FAILURE); +} + +/* that's all folks */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/macro.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/macro.c new file mode 100644 index 00000000..3f9ad691 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/macro.c @@ -0,0 +1,1361 @@ +/**************************************************************************** + * $Id: macro.c 1.10 2000/06/08 01:50:26 toma Exp $ + **************************************************************************** + * File: macro.c + * + * Description: + * Modules to save and expand macros for TASM, the table driven assembler. + * Also, expression evaluator. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997-2000 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * + * See rlog for file revision history. + * + */ + +//static char *id_macro_c = "$Id: macro.c 1.10 2000/06/08 01:50:26 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + +/* DEFINES */ + + +#define MAXMACRO 1000 /* Max number of macros */ +#define MAXPARMS 10 /* Max number of parms per macro */ +#define MAXARGSIZE 16 /* Max length of parm label */ + +/* Constants to indicate the rules for finding the end of a string for + * save_string() (malloc). + */ +typedef enum {STR_NULLEND, STR_SPACEEND} strend_t; + + +/* STATIC */ +int Num_macros = 0; +int Num_macros_predefined = 0; +char Emptystring[] = ""; + +static ptok_t Lasttok; +static int Elevel; +static char Last_inst[10]; + +/* these pointer arrays keep track of where in heap the appropriate + * macro definitions are */ +static char *macrolabel[MAXMACRO+1]; +static char *macrodef[MAXMACRO+1]; + +/* Make the following static so that they are available to add to macro + * definitions with the DEFCONT directive. + */ + +static int Nparms; +static char Parm[MAXPARMS+1][MAXARGSIZE+1]; + +/* STATIC FUNCTION PROTOTYPES */ +static void add_reg (char *s); +static expr_t eval (void); +static ptok_t gettok (expr_t *tokval); +static expr_t nextval (void); +static int next_operator (char *s); +static tok_t toktype (ptok_t token); +static char *save_string(char *s, strend_t strtype); + + +/* EXTERNALS */ +extern ushort Debug; +extern char Errorbuf[LINESIZE]; + +/************************************************************************/ +/* FUNCTIONS */ + +/* Function: macro_expand() + * Description: + * Scan an input line for an invocation of a macro. + * If one is found then expand it. + */ +void +macro_expand( +char *src, /* Source line to scan */ +char *target) /* Put expanded line here */ +{ + + int len; + int pos; + int i,j; + int macargi; + int nnparms; + int c; + int comment; + int macro_found; + char parm[MAXPARMS+1][MAXARGSIZE+1]; + char *s; + char *ss; + char *mm; + char *pparm; + char *save_targ; + char sbuf[LINESIZE]; + char comment_buf[LINESIZE]; + + extern char Comment_char1; + + save_targ = target; + s = sbuf; + + strcpy(target,src); + + if(Num_macros == 0)return; + + /* First make sure this is not a preprocessor command (define, ifdef, + * or ifndef) because if it is, to expand it would mess things up. + * For now require first character to be a '#'. This could cause + * problems if the user does things like '.define' or '#word'. + * + * Actually, expand should be done on everything except + * DEFINE, IFDEF, IFNDEF (fix later). + * + * Also, do not expand comments. + */ + /* Skip past leading white space */ + while( isspace(*src) && (*src != '\0')) src++; + if((*src == '#') || (*src == Comment_char1))return; + + /* locate the position of the start of a comment (if any) */ + comment = find_comment(target); + if (comment > 0){ + strcpy( comment_buf, &target[comment]); + target[comment] = '\0'; + } + else{ + comment_buf[0] = '\0'; + } + + do{ + /* Continue to scan for macros until a complete scan results in + * no hits. This, to ensure that multiple instances on a line + * and macros-in-macros get expanded. + */ + macro_found = FALSE; + + for(i=0; i < Num_macros; i++){ + target = save_targ; + strcpy(s, save_targ); + + /* look for macro label in the input string */ + if((pos = search(s,macrolabel[i])) >= 0){ + /* We have found a match. + * Abort if it is after the start of comments or in quotes. + */ + if(inquotes(s, pos)) continue; + + macro_found = TRUE; + + /* first extract parameters, if any */ + nnparms = 0; + len = strlen(macrolabel[i]); + ss = &s[pos+len]; + if(*ss == '('){ + ss++; + do{ + j = 0; + while((*ss != ',') && (*ss != ')') + && (*ss != '\0') + && (j < MAXARGSIZE)){ + parm[nnparms][j++] = *ss++; + } + parm[nnparms][j] = '\0'; + nnparms++; + }while((*ss++ != ')') && (*ss != '\0')&&( nnparms < MAXPARMS)); + } + + + /* copy preceeding part to temp buffer directly */ + for(j=0; j < pos; j++)*target++ = s[j]; + + /* now copy the macro expansion and expand args as we go */ + mm = macrodef[i]; + while((c = *mm++) != '\0'){ + if(c == '?'){ + macargi = *mm++ - '0'; + /* Make sure we saw the appropriate number of macros + * in the source. + */ + if (macargi >= nnparms) { + errlog("Macro expects args but none found", + PASS2_ONLY); + } + else{ + pparm = parm[macargi]; + while(*pparm)*target++ = *pparm++; + } + }else + *target++ = c; + } + + /* copy the rest of the line in */ + while(*ss)*target++ = *ss++; + *target = 0; + + if(target > (save_targ + LINESIZE - 20)){ + errlog("Macro expansion too long ", PASS2_ONLY); + return; + } + + } + } /* end for */ + }while (macro_found == TRUE); + + /* Append the comment that was removed (if any) */ + if(comment > 0) strcat (target, comment_buf); + +} + + +/* Function: macro_get_index() + * Description: + * Find the index to the macro, if it exists. + */ + +int +macro_get_index(char *s) +{ + + int i; + + for(i = 0; i < Num_macros; i++){ + if(strcmp(s,macrolabel[i]) == SAME) return(i); + } + + return (-1); + +} + + +/* Function: macro_save() + * Description: + * Save this macro definition. + */ + +void +macro_save(char *s) +{ + + static char argtoken[] = {'?', '0','\0'}; + int j; + char *macp; + char buf[LINESIZE]; + char *p; + + /* discard initial whitespace */ + while((*s == ' ') || (*s == '\t'))s++; + + /* save macro label (excluding arguments) */ + p = buf; + while((*s != ' ') && (*s != '\t') && (*s != '(') && (*s != '=') && (*s)) + *p++ = *s++; + + *p++ = '\0'; + + macrolabel[Num_macros] = save_string(buf, STR_NULLEND); + + if(*s == '=')s++; /* gobble '=' in macro defs from the command line */ + + Nparms = 0; + if(*s == '('){ + s++; + do{ + j = 0; + while((*s != ',') && (*s != ')') && (*s) + && (j < MAXARGSIZE)) + Parm[Nparms][j++] = *s++; + + Parm[Nparms][j] = '\0'; + Nparms++; + }while((*s++ != ')') && ( Nparms < MAXPARMS)); + } + + /* SKip forward to start of macro definition */ + while((*s == ' ') || (*s == '\t'))s++; + + /* make temp copy to replace parm tokens (since resulting string + * may be longer). + */ + strcpy(buf, s); + + /* substitute the appropriate argument strings in macro definition. + * Replace each argument with a two character string of the + * form '?n' where n = 0-9. + */ + macp = buf; + for(j = 0; j < Nparms; j++){ + argtoken[1] = '0' + j; + replace(macp,Parm[j],argtoken); + } + + macrodef[Num_macros] = save_string(buf, STR_NULLEND); + + Num_macros++; + + if(Num_macros >= MAXMACRO){ + sprintf(Errorbuf,"MAXMACRO=%d",MAXMACRO); + errlog("maximum number of macros exceeded ", ALWAYS); + } +} + + +/* Function: macro_append() + * Description: + * Add to an existing macro (the last one defined). + */ + +void +macro_append(char *s) +{ + + static char argtoken[] = {'?', '0','\0'}; + int j; + int cnt; + char *macp; + char *ss; + + /* discard initial whitespace */ + while((*s == ' ') || (*s == '\t'))s++; + + /* Compute additional bytes needed to save this */ + cnt = 0; + ss = s; + while(*ss++)cnt++; + + /* Increase the size of the memory block used to save the macro */ + ss = macrodef[Num_macros-1]; + while(*ss++)cnt++; + macp = (char *)realloc(macrodef[Num_macros-1], cnt + 2); + if(macp == NULL) + { + errprt("tasm: Cannot realloc for macro definition\n"); + tasmexit(EXIT_MALLOC); + } + macrodef[Num_macros-1] = macp; + + /* tag additional stuff on the end of the existing macro buffer */ + strcat(macp,s); + + /* Substitute the appropriate argument strings in macro definition. + * Replace each argument with a two character string of the + * form '?n' where n = 0-9. + */ + for(j = 0; j < Nparms; j++) + { + argtoken[1] = '0' + j; + replace(macp,Parm[j],argtoken); + } + + if(Num_macros >= MAXMACRO) + { + sprintf(Errorbuf,"MAXMACRO=%d",MAXMACRO); + errlog("Maximum number of macros exceeded ", ALWAYS); + } +} + + +/* Function: macro_free() + * Description: + * Free all the macro storage expect those macros defined on the + * the command line. + */ + +void +macro_free(int freeAll) +{ + int macro; + + if ( freeAll ) macro = 0; + else macro = Num_macros_predefined; + + for (; macro < Num_macros; macro++) + { + if (macrodef[macro] != Emptystring) free ( macrodef [ macro ] ); + free ( macrolabel [ macro ] ); + } + + if (freeAll) Num_macros = 0; + else Num_macros = Num_macros_predefined; + +} + +/*********************************************************************/ +/* Expression evaluation functions */ + +/* Function: val() + * Description: + * Compute value of an expression. + * This function merely sets up static pointers to the beginning + * of the expression and calls eval() to do the real work. + */ +expr_t +val(char *expr_buf) +{ + extern char *Expr; + expr_t ival; + extern int Err_check; + extern line_t Linetype; + + /* If expression surrounded by parens then complain if strict + * error checking is enabled. This is to avoid ambiguity with + * some micros that use a paren group around an address + * to indicate indirection. The error message is just a warning. + */ + if(Err_check & EC_OUTER_PAREN){ + if(Linetype == INSTRUCT){ + if((*expr_buf == '(') && (expr_buf[strlen(expr_buf)-1] == ')')){ + strcpy(Errorbuf,expr_buf); + errlog("Invalid operand. No indirection for this instruction.", + PASS2_ONLY); + } + } + } + /* Check for non-unary operators starting out. + * This is sometimes useful since some tables use valid operators + * to indicate addressing mode. For example, the TMS7000 + * uses '%' to indicate immediate. Thus, a user may give + * %01 as an operand and if no immediate instruction applied + * it could match a wild card and no warning would be issued. + * Further ambiguity arises from the fact that % could either + * be a binary prefix, or a stray modulo operator. + * Such is life when trying to accommodate many dialects. + */ + if(Err_check & EC_NON_UNARY){ + if(Linetype == INSTRUCT){ + if((*expr_buf == '%') || /* This could be OK if binary pref*/ + (*expr_buf == '*') || /* This could be OK if PC */ + (*expr_buf == '/') || + (*expr_buf == '<') || + (*expr_buf == '>') || + (*expr_buf == '=') || + (*expr_buf == '&') || + (*expr_buf == '!') ){ + strcpy(Errorbuf,expr_buf); + errlog("Non-unary operator at beginning of expression.", + PASS2_ONLY); + } + } + } + /* Go ahead and evaluate anyway */ + + /* Initialize parsing buffer pointer to start of expression + * buffer and evaluate */ + Lasttok = UNDEFTOKEN; + Elevel = 0; /* eval stack level */ + Expr = expr_buf; + ival = eval(); + + if (Elevel != 0){ + /* Parenthesis are imbalanced */ + strcpy(Errorbuf, expr_buf); + errlog ("Paren imbalance.", PASS2_ONLY); + } + + return(ival); +} + +/* Function: eval() + * Description: + * Compute value of expression in the expression buffer + * Scan left to right calling eval recursively to evaluate the + * remaining portion of the expression. + */ +static expr_t +eval(void) +{ + expr_t ival; + expr_t tokval; + ptok_t token; + + ival = 0; + Elevel++; /* eval() stack level */ + + /* Extract next token from line and perform cooresponding action. + * Evaluate recursively from left to right. + * Note that because of the recursive nature of the + * parsing, if expressions are not grouped with + * parenthesis, they will be evaluated from right to left. + * Thus, 1+2*3+4 = 1+(2*(3+4)) = 15 + */ + while((token = gettok(&tokval)) != EOL){ + + switch(token){ + case LABEL: + ival = tokval; + break; + case PLUS: + ival += nextval(); + break; + case MINUS: + ival -= nextval(); + break; + case MULTIPLY: + ival *= nextval(); + break; + case DIVIDE: + ival /= nextval(); + break; + case MODULO: + ival %= nextval(); + break; + case SHIFTR: + ival >>= nextval(); + break; + case SHIFTL: + ival <<= nextval(); + break; + case BINAND: + ival &= nextval(); + break; + case BINOR: + ival |= nextval(); + break; + case BINEOR: + ival ^= nextval(); + break; + case EQUAL: + ival = (ival == nextval()); + break; + case LESSTHAN: + ival = (ival < nextval()); + break; + case GREATERTHAN: + ival = (ival > nextval()); + break; + case GEQUAL: + ival = (ival >= nextval()); + break; + case LEQUAL: + ival = (ival <= nextval()); + break; + case NOTEQUAL: + ival = (ival != nextval()); + break; + case TILDE: + ival = (~(uexpr_t)nextval()); + break; + case LOGICALNOT: + ival = (!(uexpr_t)nextval()); + break; + case PC: + ival = tokval; + break; + case LITERAL: + ival = tokval; + break; + case CHAR: + ival = tokval; + break; + case LPAREN: + ival = eval(); + break; + case RPAREN: + Elevel--; + return(ival); + case SPACE: + break; + case EOL: + break; + case UNDEFTOKEN: + default: + strcpy(Errorbuf,""); + errlog("Unknown token. ", PASS2_ONLY); + break; + } + } + Elevel--; + return(ival); + +} + +/* Function: gettok() + * Description: + * Extract the next token from the expression buffer and return + * the token ID and value of the token if applicable (for labels + * and constants. + */ +static ptok_t +gettok(expr_t *tokval) +{ + extern char *Expr; /* Pointer to expression buffer */ + extern pc_t Pc; /* Instruction pointer */ + extern LABTAB *Labtab[]; /* Label data */ + extern char Local_char; /* First char for local labels */ + + int i; + int base; + int lastc; + expr_t tval; + char lbuf[80]; + ptok_t tok; + tok_t ttype; + + tok = UNDEFTOKEN; + + switch(*Expr){ + case '\0': tok = EOL; break; + case '+' : tok = PLUS; Expr++; break; + case '-' : tok = MINUS; Expr++; break; + case '/' : tok = DIVIDE; Expr++; break; + case '(' : tok = LPAREN; Expr++; break; + case ')' : tok = RPAREN; Expr++; break; + case '~' : tok = TILDE; Expr++; break; + case '&' : tok = BINAND; Expr++; break; + case '|' : tok = BINOR; Expr++; break; + case '^' : tok = BINEOR; Expr++; break; + case ' ' : tok = SPACE; Expr++; break; + case '\t': tok = SPACE; Expr++; break; + + case '*': /* allow '*' to be MULTIPLY or PC. If followed by + nothing or an operator then it is the PC */ + Expr++; + if(next_operator(Expr) >= 0){ + *tokval = Pc; + tok = PC; + } + else{ + tok = MULTIPLY; + } + break; + + case '\'': + Expr++; + /* Make sure that a valid character follows. + * Premature end of expression can result from stuff like + * .byte ';' + * which is not parsed correctly (; is not escaped in single + * quotes). This is all a side effect of supporting + * char tokens with a single quote and not paired quotes. + */ + if (*Expr == '\0'){ + + *tokval = 0; + strcpy(Errorbuf,""); + errlog("Premature end of CHAR token", PASS2_ONLY); + } + else + { + *tokval = *Expr++; + + if(*Expr == '\''){ + Expr++; + } + else{ + strcpy(Errorbuf,(Expr - 2)); + errlog("No terminating quote:", PASS2_ONLY); + + } + + } + tok = CHAR; + break; + + case '>': + Expr++; + switch(*Expr){ + case '>': tok = SHIFTR; Expr++; break; + case '=': tok = GEQUAL; Expr++; break; + default : tok = GREATERTHAN; break; + } + break; + + case '<': + Expr++; + switch(*Expr){ + case '<': tok = SHIFTL; Expr++; break; + case '=': tok = LEQUAL; Expr++; break; + default : tok = LESSTHAN; break; + } + break; + + case '=': /* accept either '=' or '==' for equal comparison */ + Expr++; + if(*Expr == '=')Expr++; + tok = EQUAL; + break; + + case '!': /* not equal or logical not */ + Expr++; + if(*Expr == '=') + { + Expr++; + tok = NOTEQUAL; + } + else + { + tok = LOGICALNOT; + } + break; + + + case '%': /* allow % to be either modulo or binary prefix */ + Expr++; + /* Assume it is binary radix specifier unless the context implies + * the need for a binary operator. + */ + ttype = toktype(Lasttok); + if((ttype == TOK_VAL) || (ttype == TOK_RPAREN)){ + tok = MODULO; + }else{ + tval = 0; + while((*Expr == '0') || (*Expr == '1')){ + tval *= 2; + tval += hex_val(*Expr++); + } + *tokval = tval; + tok = LITERAL; + } + break; + + case '$': /* allow $ to be either PC or hex prefix */ + Expr++; + if(isxdigit(*Expr)){ + tval = 0; + base = 16; + while(isxdigit(*Expr)){ + tval *= base; + tval += hex_val(*Expr++); + } + *tokval = tval; + tok = LITERAL; + + }else{ + *tokval = Pc; + tok = PC; + } + break; + + case '@': /* allow @ for alternate octal prefix */ + Expr++; + tval = 0; + while(isdigit(*Expr)){ + tval *= 8; + tval += hex_val(*Expr++); + } + *tokval = tval; + tok = LITERAL; + break; + + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* numeric literal */ + base = 10; /* default base = decimal */ + i = 0; + while(isxdigit(*Expr))lbuf[i++] = *Expr++; + lbuf[i] = '\0'; + /* check for last character being 'd' or 'b'. Since + * these are valid hex digits they won't terminate + * the literal even when they are supposed to + * be radix suffixes. */ + lastc = *(Expr -1); + if(islower(lastc))lastc = toupper(lastc); + if(((*Expr != 'H') && (*Expr != 'h')) + && ((lastc == 'B') || (lastc == 'D'))){ + /* back up one character */ + Expr--; + lbuf[--i] = '\0'; + } + + switch(*Expr){ + case 'h': + case 'H': /* hexadecimal base */ + base = 16; + Expr++; + break; + + case 'B': /* binary base */ + case 'b': + base = 2; + Expr++; + break; + case 'Q': + case 'q': + case 'O': /* octal base */ + case 'o': + base = 8; + Expr++; + break; + + case 'D': /* decimal base */ + case 'd': + base = 10; + Expr++; + break; + + default: + break; + + } + + tval = 0; + i = 0; + while(lbuf[i] != '\0'){ + tval *= base; + tval += hex_val(lbuf[i++]); + } + *tokval = tval; + tok = LITERAL; + break; + + default: + if((isalpha(*Expr)) || (*Expr == '_') || (*Expr == Local_char)){ + i = 0; + while(isalnum(*Expr) || + (*Expr == '_') || + (*Expr == '.') || + (*Expr == Local_char)) + lbuf[i++] = *Expr++; + + lbuf[i] = '\0'; + + + if((i = find_label(lbuf)) != FAILURE){ + *tokval = GETLABTAB(i)->val; + tok = LABEL; + } + else{ + + /* Do not tolerate undefined labels in EQUate statements + * even on pass 1. + */ + if ( isequate () ){ + strcpy(Errorbuf,lbuf); + errlog("Forward reference in equate:", ALWAYS); + *tokval = UNDEF_LABVAL; + } + else{ + strcpy(Errorbuf,lbuf); + errlog("Label not found:", PASS2_ONLY); + *tokval = UNDEF_LABVAL; + } + tok = LABEL; + } + + } + else{ + sprintf(Errorbuf,"%c", *Expr); + errlog("Unknown token:", PASS2_ONLY); + tok = UNDEFTOKEN; + Expr++; + } + break; + } + + if(tok != SPACE){ + Lasttok = tok; + } + + return(tok); + +} + +/* Function: nextval() + * Description: + * Extract the value of the next token in the expression buffer. + */ +static expr_t +nextval(void) +{ + + expr_t tokval; + ptok_t token; + tok_t ttype; + extern char *Expr; /* Pointer to expression buffer */ + + /* Ignore spaces */ + while((token = gettok(&tokval)) == SPACE) /* void */; + + /* Catch the unary operators here */ + switch(token){ + case MINUS: return (-nextval()); + case TILDE: return (~(uexpr_t)nextval()); + case LOGICALNOT: return (!(uexpr_t)nextval()); + default: /* OK */ break; + } + + ttype = toktype(token); + + + switch(ttype){ + case TOK_VAL: + return(tokval); + + case TOK_LPAREN: + return(eval()); + + case TOK_BINOP: + sprintf(Errorbuf,"%c", *(Expr-1)); + errlog("Binary operator where a value expected:", PASS2_ONLY); + break; + + case TOK_UNOP: + default: + sprintf(Errorbuf,"%s", (Expr-1)); + errlog("Invalid token where value expected:", PASS2_ONLY); + + } + + return(0L); + +} + + +tok_t +toktype(ptok_t token) +{ + + switch(token){ + case PLUS: + case MINUS: /* could be UNOP */ + case MULTIPLY: + case DIVIDE: + case MODULO: + case SHIFTR: + case SHIFTL: + case BINAND: + case BINOR: + case BINEOR: + case EQUAL: + case LESSTHAN: + case GREATERTHAN: + case GEQUAL: + case LEQUAL: + case NOTEQUAL: + return(TOK_BINOP); + + case TILDE: + case LOGICALNOT: + return(TOK_UNOP); + + case PC: + case LABEL: + case LITERAL: + case CHAR: + return(TOK_VAL); + + case RPAREN: + return(TOK_RPAREN); + + case LPAREN: + return(TOK_LPAREN); + + case UNDEFTOKEN: + case EOL: + case SPACE: + default: + return(TOK_VOID); + } +} + +/* Function: next_operator() + * Description: + * See if the next non whitespace character in s is an operator or not + * + * Return: + * 1 if operator is found + * 0 if null is found + * -1 if a non-operator is found + */ +static int +next_operator(char *s) +{ + /* scan forward until non-white or null is found */ + while((*s) && (isspace(*s)))s++; + + if(*s == '\0')return(0); + if(isalnum(*s)) return(-1); + if(*s == '(') return(-1); + if(*s == '$') return(-1); + if(*s == '@') return(-1); + + return(1); +} + +/* Function: read_table() + * Description: + * Read instruction set definition table + */ + +void +read_table( +char *pn) /* part number */ +{ + + char tab_filename[LINESIZE]; + char *tabpath; + char buf[LINESIZE]; + FILE *fp_tab; + char errbuf[LINESIZE]; + char *s; + char *p; + int i; + int nextc; + + extern char Banner[]; + extern ushort Num_instr; + extern ushort Num_reg; + extern ushort Ihash[]; + extern int Ols_first; + extern char Wild_char; + extern int Wordsize; + extern int No_arg_shift; + + Num_instr = 0; + Num_reg = 0; + Last_inst[0] = '\0'; + + /* Show version of the file */ + //DEBUG("%s\n", id_macro_c ); + + /* Initialize the hash table. Set each element to a large + * value which will be reduced as the instruction table + * is read in. + */ + for(i = 0; i < MAXIHASH; i++)Ihash[i] = MAXINSTR; + + tabpath = getenv("TASMTABS"); + if(tabpath == NULL) + { + sprintf(tab_filename,"tasm%s.tab",pn); + } + else + { + sprintf(tab_filename,"%s/tasm%s.tab",tabpath,pn); + } + + fp_tab = fopen( tab_filename, "r"); + if(fp_tab == NULL) + { + sprintf(errbuf,"tasm: table file open error on %s\n", + tab_filename); + errprt(errbuf); + tasmexit(EXIT_FILEACCESS); + } + + /* Read the first line */ + if(fgets( buf, LINESIZE-1, fp_tab) == NULL) + { + tasmexit(EXIT_FILEACCESS); + } + + /* the first line should contain the title (Banner) */ + /* look for starting quote */ + s = buf; + p = Banner; + while(*s++ != '"') /* void */; + while((*s != '"') && (*s != '\0'))*p++ = *s++; + *p = '\0'; + + while(fgets( buf, LINESIZE-1, fp_tab) != NULL) + { + /* Lines that start with '.' are Table directives */ + if(buf[0] == '.'){ + if(strncmp(&buf[1],"MSFIRST" ,7) == SAME) Ols_first = FALSE; + if(strncmp(&buf[1],"WORDADDRS" ,9) == SAME) Wordsize = 2; + if(strncmp(&buf[1],"NOARGSHIFT",10)== SAME) No_arg_shift = TRUE; + if(strncmp(&buf[1],"REGSET" ,6) == SAME) add_reg(&buf[7]); + if(strncmp(&buf[1],"ALTWILD" ,7) == SAME){ + Wild_char = '@'; + nextc = buf[8]; + if((nextc > 32) && (nextc < 128)) Wild_char = nextc; + } + + } + else{ + add_instruction(buf); + } + } + + /* set all unused elements in the hash table to point to + * the beginning of the Optab. */ + for(i = 0; i < MAXIHASH; i++) + if(Ihash[i] > Num_instr)Ihash[i] = 0; + + /* Close the Table file */ + fclose(fp_tab); + +} + +/* Function: add_instruction() + * Description: + * Add an instruction to the instruction set definition tables + */ +void +add_instruction(char *s) +{ + extern ushort Num_instr; + extern ushort Ihash[]; + extern OPTAB *Optab[]; + + ushort cfirst; + ubyte obytes; + char *ss; + int i; + char buf[LINESIZE]; + OPTAB *op; + + /* If we have exceeded the max number of instructions, abort */ + if(Num_instr >= MAXINSTR){ + errprt("tasm: Max number of instructions exceeded\n"); + tasmexit(EXIT_FATALERROR); + } + + /* If the first character is not A-Z then ignore */ + if((*s < 'A') || (*s > 'Z'))return; + + if(*s != '\0'){ + /* Update the hash table. + * The hash table has an entry for each letter A-Z + * indicating the point in the Optab to start + * looking for a match (a simple algorithm, but + * it significantly speeds things up). + */ + i = HASHKEY(s); + Ihash[i] = min(Ihash[i],Num_instr); + + /* Malloc memory for the Optab element */ + op = (OPTAB *)malloc(sizeof(OPTAB)); + if(op == NULL) + { + errprt("tasm: Cannot malloc for optab storage\n"); + tasmexit(EXIT_MALLOC); + } + Optab[Num_instr] = op; + + /* Process instruction string. + * Malloc memory for it and copy to that memory. + */ + op->instruction = save_string(s, STR_SPACEEND); + + if(strcmp(op->instruction, Last_inst) == SAME) + op->same_inst = TRUE; + else + op->same_inst = FALSE; + + strcpy(Last_inst, op->instruction); + + /* skip to end of instruction */ + while((*s != ' ') && (*s != '\t')) s++; + + /* Read args */ + while(isspace(*s))s++; + /* if the args are just double quotes then no arg is needed */ + if(*s == '"'){ + op->args = save_string("", STR_SPACEEND); + s += 2; /* skip past the double quotes */ + } + else{ + op->args = save_string(s, STR_SPACEEND); + while(!isspace(*s)) s++; + } + + /* Read opcode (in hex) */ + while(isspace(*s))s++; + op->opcode = lhex_to_bin(s); + ss = s; /* remember current position to compute number of bytes */ + while(isxdigit(*s))s++; + obytes = (s - ss)/2; + op->obytes = obytes; + + /* Read number of bytes total (in hex) */ + while(isspace(*s))s++; + op->abytes = hex_to_bin(s) - obytes; + while(isxdigit(*s))s++; + + /* Read Special case modifier */ + while(isspace(*s))s++; + if(*s){ + cfirst = (ubyte)*s++ << 8; + op->modop = cfirst | (ubyte)(*s); + while(isalnum(*s))s++; + } + else{ + op->modop = 0; + } + + /* Read class (in hex) */ + while(isspace(*s))s++; + if(*s) + op->iclass = (ubyte)hex_to_bin(s++); + else + op->iclass = 1; + + /* next two fields (arg shift and or values) are + * optional. Only procede to read these if + * the next non whitespace is a valid hex digit. + */ + + while(isspace(*s))s++; + if(isdigit(*s)){ + /* Read arg left shift value */ + if(*s){ + op->shift = (ubyte)hex_to_bin(s); + while(isalnum(*s))s++; + } + else + op->shift = 0; + + /* Read arg binary or mask (in hex) */ + while(isspace(*s))s++; + if(*s){ + op->bor = lhex_to_bin(s); + while(isalnum(*s))s++; + } + else + op->bor = 0; + } + else{ + op->shift = 0; + op->bor = 0; + } + if(Debug){ + sprintf(buf,"%-6s %-10s %4x %x %x %c%c %x %x %lx\n", + op->instruction, + op->args, + (short)op->opcode, + op->obytes, + op->abytes, + (op->modop >> 8) , + (op->modop & 0x7f), + op->iclass, + op->shift, + op->bor); + DEBUG(buf,0); + } + Num_instr++; + } +} + +/* Function: add_reg() + * Description: + * Add a register definition to the table + */ +static void +add_reg(char *s) +{ + extern ushort Num_reg; + extern REGTAB *Regtab[]; + + char buf[LINESIZE]; + REGTAB *op; + + /* If we have exceeded the max number of Register definitions, abort */ + if(Num_reg >= MAXREG){ + errprt("tasm: Max number of registers exceeded\n"); + tasmexit(EXIT_FATALERROR); + } + + while(isspace(*s))s++; + + if(*s != '\0'){ + + /* Malloc memory for the Regtab element */ + op = (REGTAB *)malloc(sizeof(REGTAB)); + if(op == NULL){ + errprt("tasm: Cannot malloc for regtab storage\n"); + tasmexit(EXIT_MALLOC); + } + Regtab[Num_reg] = op; + + /* Process instruction string. + * Malloc memory for it and copy to that memory. + */ + op->reg = save_string(s, STR_SPACEEND); + + /* skip to end of instruction */ + while((*s != ' ') && (*s != '\t')) s++; + + /* Read opcode (in hex) */ + while(isspace(*s))s++; + op->opcode = lhex_to_bin(s); + while(isxdigit(*s))s++; + + /* Read class (in hex) */ + while(isspace(*s))s++; + if(*s) + op->iclass = (ubyte)hex_to_bin(s++); + else + op->iclass = 1; + + if(Debug){ + sprintf(buf,"%-6s %4x %x\n", + op->reg, + (short)op->opcode, + op->iclass); + DEBUG(buf,0); + } + Num_reg++; + } +} + +/* Function: save_string() + * Description: + * Save a string in the heap (malloc). + */ + +static char * +save_string( +char *s, /* string to save */ +strend_t strtype) /* type of string (to determine length) */ +{ + int i; + char buf[LINESIZE]; + char *p; + + i = 0; + switch(strtype){ + case STR_NULLEND: + while(*s) buf[i++] = *s++; + break; + + case STR_SPACEEND: + while((*s) && (!isspace(*s))) buf[i++] = *s++; + break; + + default: + errprt("Bad string type.\n"); + tasmexit(EXIT_FATALERROR); + + } + buf[i++] = '\0'; + /* if we were asked to save an empty string, then avoid the malloc */ + if(i == 1) return(Emptystring); + p = (char *)malloc(i); + if(p == NULL){ + errprt("Cannot malloc for string storage.\n"); + tasmexit(EXIT_MALLOC); + } + strcpy(p,buf); +// DEBUG2("Malloc %x %s\n",(int)p,p); + return(p); +} + + +/* that's all folks */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/parse.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/parse.c new file mode 100644 index 00000000..9d3e8574 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/parse.c @@ -0,0 +1,424 @@ +/**************************************************************************** + * $Id: parse.c 1.7 2001/10/23 01:38:00 toma Exp $ + **************************************************************************** + * File: parse.c + * + * Description: + * Modules to parse source lines for TASM, the table driven assembler. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997-2000 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * 837 Front Street South + * Issaquah, WA 98027 + * + * + */ + +//static char *id_parse_c = "$Id: parse.c 1.7 2001/10/23 01:38:00 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" +#ifdef T_MEMCHECK +#include +#endif + + +/* Externals */ +extern ushort Debug; +extern pc_t Pc; +extern char Local_char; + +/* Static */ +static ushort argvect( char *args, char *argv[], ushort *argc); + +/**********************************************************************/ + +/* Function : parse + * Description : Parse one line of assembly source code. + * 1. Identify the instruction or directive + * 2. If a directive then perform the directive + * 3. If an instruction encode according to the + * applicable rule. + */ + + +int +parse( +/* Inputs: */ +char *buf, /* buffer containing input line to parse */ + +/* Outputs: */ +char *label, /* label string (if any) */ +char *inst, /* instruction string */ +dir_t *directive, /* directive code (if a directive lint */ +ulong *op_code, /* op code (if an instruction lint) */ +ushort *obytes, /* number of bytes of opcode */ +ushort *abytes, /* number of bytes of argument */ +ushort *argc, /* number of arguments found */ +char **argv, /* pointers to argument strings */ +ulong *argval) /* value of args (adjusted if necessary for this + particular instruction) */ +{ + + extern error_t Errorno; /* global error number */ + extern char Errorbuf[LINESIZE]; + extern char Comment_char1; /* First column comment char */ + extern char Comment_char2; /* Embedded comment char */ + extern line_t Linetype; + extern int No_arg_shift; /* Disable shift/or to args */ + extern int Use_argvalv; + + int i,j; + ushort modop; + ubyte shift; + ulong bor; + int withinquotes; /* inside quotes */ + int withinquotes1; /* inside single quotes */ + int withinquotes2; /* inside double quotes */ + + static char args[LINESIZE]; + + /* initialize */ + *label = '\0'; + *inst = '\0'; + argv[0] = (char *) 0; + *argc = 0; + *obytes = 0; + *abytes = 0; + Linetype = UNKNOWN; + Errorno = ER_NOERR; + args[0] = '\0'; + Errorbuf[0] = '\0'; + + i = 0; /* buf character counter */ + + /* if first character is a ';' then it is a comment */ + if(buf[0] == Comment_char1){ + /* comment */ + Linetype = COMMENT; + while(buf[i])i++; + } + else{ + /* must be an instruction or directive. + strip out label, instruction and argument fields first */ + /* If first character is alpha or '_' then it is a label */ + if((isalpha(buf[i])) || (buf[i] == '_') || (buf[i] == Local_char)){ + i = i + strget(label,buf); + if(buf[i] == ':')i++; /* skip ':' at end of label*/ + } + + /* look for next nonblank character */ + while((buf[i] == ' ') || (buf[i] == '\t'))i++; + + /* check to see if it is just a comment. If it is then + don't try to extract instruction and args. */ + if(buf[i] != Comment_char2){ + + /* get the instruction (or directive) */ + i = i + strget(inst,&buf[i]); + + while(isspace(buf[i]))i++; /* skip white space */ + + j = 0; + if(isalpha(inst[0])){ + /* Instruction */ + Linetype = INSTRUCT; + while((buf[i] != '\0') && + (buf[i] != Comment_char2 ) && + (buf[i] != '\n') && + (buf[i] != DELIM)){ + args[j++] = buf[i++]; + } + } + else{ + /* Directive */ + Linetype = DIRECTIVE; + withinquotes1 = FALSE; + withinquotes2 = FALSE; + withinquotes = FALSE; + + while((buf[i] != '\0') && + ((buf[i] != Comment_char2) || (withinquotes)) && + ((buf[i] != DELIM) || (withinquotes)) && + (buf[i] != '\n')){ + + /* Detect the withinquotes state. Do not + * consider quotes that are escaped with backslash. + */ + if(buf[i] == '\"' && (buf[i-1] != '\\')) + withinquotes2 = !withinquotes2; + if(buf[i] == '\'' && (buf[i-1] != '\\')) + withinquotes1 = !withinquotes1; + withinquotes = withinquotes1 || withinquotes2; + + args[j++] = buf[i++]; + } + } + + args[j] = '\0'; + } + + /* Check the next character to see if any + * special adjustments need to be made. If it is + * the multiple instruction delimiter, skip past + * it. If a ';' (thus a comment) then skip to the + * end of the line. If a newline then skip past it. + */ + + if (buf[i] == DELIM) i++; + else if(buf[i] == '\n') i++; + else if(buf[i] == Comment_char2) while(buf[i])i++; /*skip to eol */ + + if(inst[0] == '\0'){ + Linetype = BLANK; + return(i); + } + + /* if first character of instruction/directive field + is not alpha, then it must be a directive. + Directives should start with a '.', '#', '=', '*', or '='. */ + if(Linetype == DIRECTIVE){ + /* Directive */ + + /* Look up the directive code. + If the first character is '.' or '#' then + skip past it before doing the lookup, + otherwise use the whole field. */ + if((inst[0] == '.') || (inst[0] == '#')){ + + if((*directive = dir_lookup(inst+1)) == NOTDIR) + Errorno = ER_BADDIR; + + strcpy(Errorbuf,inst); + } + else{ + if((*directive = dir_lookup(inst)) ==NOTDIR) + Errorno = ER_BADDIR; + strcpy(Errorbuf,inst); + } + switch (*directive ){ + case BYTE: + crush(args); + *abytes = argvect(args,argv,argc); + break; + + case WORD: + crush (args); + *abytes = argvect(args,argv,argc) * 2; + break; + + case EXPORT: + crush(args); + (void) argvect(args, argv, argc); + break; + + case CHK: *abytes = 1; break; + + case FILL: + crush(args); + (void) argvect(args, argv, argc); + *abytes= (ushort)val(argv[0]); + break; + + case TEXT: + /* remove double quotes and count characters between them */ + *abytes = remquotes(args); + break; + + case ECHO: + if ( *args == '\"') + (void)remquotes (args); + else + sprintf ( args, "%ld", val(args)); + break; + + case INCLUDE: + case TITLE: + case SYM: + case AVSYM: + (void)remquotes(args); + break; + + /* If this is a DEFINE or DEFCONT statement then take the rest + * of the line as the args and don't stop at + * the multiple line delimiter + */ + + case DEFINE: + case DEFCONT: + if(buf[i-1] == DELIM){ + i--; + j = strlen(args); + while(buf[i]) + args[j++] = buf[i++]; + /* terminate before last newline */ + args[j-1] = 0; + } + break; + + case UNDEF: + break; + + default: + break; + + } /* end switch */ + + if(argv[0] == (char *)0) argv[0] = args; + if((*argc == 0) && (args[0] != '\0')) *argc = 1; + /* Set op_code to illegal value since it is not + * applicable. directive contains the real info. + */ + *op_code = 0; + } + else{ + /* INSTRUCTION + * Check instruction and args against legal inst table. + */ + crush(args); + + Errorno = inst_lookup(inst,args,op_code,obytes, + abytes,&modop,&shift,&bor,argc,argv); + + /* Handle special cases here. + * For 8048 fix up JMP and CALL instructions. + * For 6502 handle zero page addressing + * and relative branches. + * etc. etc. + * Use as the default argval as the value of the first + * expression. If there are additional + * expressions to be considered, let rules() + * take care of it. Perform the shift/or + * operation on the first arg also. + * + */ + + *argval = 0; + + if((*abytes > 0) && (argv[0])){ + *argval = val(argv[0]); + } + + /* Make sure this is false for every instruction so it is + * not left with the value from the previous instruction if + * if this is a NOTOUCH rule. + */ + Use_argvalv = FALSE; + + if((Errorno == ER_NOERR) && (modop != NOTOUCH)){ + rules(modop, op_code, obytes, abytes, argval, Pc, + *argc, argv, shift, bor); + } + + if((No_arg_shift == FALSE) && (*abytes > 0) && (shift || bor)){ + *argval = (*argval << shift) | bor; + } + } + } + DEBUG3("%04lx %04lx %s",*op_code, *argval, buf); + return(i); + +} + +/* Function : argvect + * Description : Vectorize an argument string. + */ + +static ushort +argvect( +char *args, /* String buffer for the arguments */ +char *argv[], /* Array of string pointers to each individual argument */ +ushort *argc) /* Pointer to the argument count */ +{ + static char argbuf[LINESIZE]; + static char strbuf[LINESIZE]; + static char txtbuf[LINESIZE][4]; + + char *p; + int withinquotes; + ushort acnt; + char *q; + ushort j; + ushort k; + + + strcpy(argbuf,args); + + /* Add an extra null on the end */ + p = argbuf; + while(*p++) /* void */; + *p++ = '\0'; + *p++ = '\0'; + + p = argbuf; + do{ + /* skip past any white space */ + while(*p && isspace(*p))p++; + + if(*p == '\"'){ + /* Treat each character in a quoted string as a + * seperate arg and save as a decimal ASCII string. + * This is an easy way to allow strings in places like + * BYTE directives. + */ + strcpy(strbuf, p); + j = remquotes(strbuf); + if((*argc + j) >= MAXARGS){ + j = MAXARGS - *argc; + //errlog("Maximum number of args exceeded.",ALWAYS); + } + + for (k = 0; k < j; k++) + { + /* Save the decimal strings in static local txtbuf. + * Avoid malloc just to avoid the hastle of freeing. + */ + q = txtbuf[*argc + k]; + sprintf(q, "%d", strbuf[k]); + argv[*argc + k] = q; + } + acnt = j; + + } + else{ + acnt = 1; + argv[*argc] = p; + } + + if((*argc + acnt) < MAXARGS){ + *argc = *argc + acnt; + } + else{ + errlog("Maximum number of args exceeded.",ALWAYS); + } + + /* skip to next element. Don't be confused by commas inside quotes */ + withinquotes = FALSE; + while(*p) { + + if((*p == '\'') || ((*p == '\"') && (*(p-1) != '\\'))){ + withinquotes = !withinquotes; + } + + if(*p == ','){ + /* If we get a comma outside of quotes break */ + if(!withinquotes) break; + + } + p++; + } + *p++ = '\0'; + }while(*p); + + for (j=0; j < *argc; j++) { +// DEBUG2( "argvect: #%s# len=%d\n", argv[j], strlen(argv[j])); + } + + return(*argc); +} + +/* That's all folks. */ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/rules.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/rules.c new file mode 100644 index 00000000..ef2edffe --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/rules.c @@ -0,0 +1,1172 @@ +/**************************************************************************** + * $Id: rules.c 1.9 2000/06/02 11:42:58 toma Exp $ + **************************************************************************** + * File: rules.c + * + * Description: + * Invoke specific rules for the current instruction and addressing mode. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997-2000 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * See rlog for file revision history. + * See relnotes.txt for general revision history. + * + */ + +//static char *id_rules_c = "$Id: rules.c 1.9 2000/06/02 11:42:58 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + +/* DEFINES */ + +/* Constants for the encoding rules (MODOPS) used in the instruction definition table (first + * two characters) and processed by the special_case() function. + */ +#define JMPANYPAGE (('J' << 8) | 'M') +#define JMPTHISPAGE (('J' << 8) | 'T') +#define ZEROPAGE (('Z' << 8) | 'P') +#define Z80BIT (('Z' << 8) | 'B') +#define Z80IDX (('Z' << 8) | 'I') +#define REL1 (('R' << 8) | '1') +#define REL2 (('R' << 8) | '2') +#define REL3 (('R' << 8) | '3') +#define SWAP (('S' << 8) | 'W') +#define COMBREL (('C' << 8) | 'R') +#define COMB_SWAP (('C' << 8) | 'S') +#define COMBINE (('C' << 8) | 'O') +#define COMB_NIBBLE (('C' << 8) | 'N') +#define COMB_NIBBLE_SWAP (('C' << 8) | '5') +#define ST7_ZEROPAGE (('S' << 8) | 'Z') +#define ST7_BIT (('S' << 8) | 'B') +#define MOTOR_ZEROPAGE (('M' << 8) | 'Z') +#define MOTOR_BIT (('M' << 8) | 'B') +#define THREE_ARG (('3' << 8) | 'A') +#define THREE_REL (('3' << 8) | 'R') +#define TMS1 (('T' << 8) | '1') +#define TMS2 (('T' << 8) | '2') +#define TMS3 (('T' << 8) | '3') +#define TMS4 (('T' << 8) | '4') +#define TMS5 (('T' << 8) | '5') +#define TMS6 (('T' << 8) | '6') +#define TDMA (('T' << 8) | 'D') +#define TLK (('T' << 8) | 'L') +#define TAR (('T' << 8) | 'A') +#define I8096_1_COMB (('I' << 8) | '1') +#define I8096_2_2FAR (('I' << 8) | '2') +#define I8096_3_3FAR (('I' << 8) | '3') +#define I8096_4_JBIT (('I' << 8) | '4') +#define I8096_5_REL (('I' << 8) | '5') +#define I8096_6_IND (('I' << 8) | '6') +#define I8096_7_1FAR (('I' << 8) | '7') +#define I8096_8_TIJMP (('I' << 8) | '8') +#define SUB (('S' << 8) | 'U') +#define Z8_WORKREG (('Z' << 8) | 'W') +#define Z8_DJNZ (('Z' << 8) | 'D') +#define Z8_LD (('Z' << 8) | 'L') + +/* Special opcodes for 6502 extended instructions. */ +#define STZ_ABS 0x9c +#define STZ_ABSX 0x9e + +#define LOW_NIBBLE 0x0FL + + +/* STATIC FUNCTIONS */ +static ushort shift_and (char *parg, int shiftcnt, ulong andmask); +static ushort arp_val (char *parg); + +static void isargvalid (long argval, ulong vmask, ushort sbit, + ushort width, + char *argtext); +static void isargrangevalid (long argval, long argmin, long argmax, + char *argtext); + + +/* EXTERNALS */ +extern ushort Debug; +extern char Errorbuf[LINESIZE]; + +/************************************************************************/ +/* FUNCTIONS */ + + +/* Function: rules() + * Description: + * Apply specified encoding rule for all instructions that did + * not specify NOP/NOTOUCH. + * + */ +void +rules( + ushort modop, + ulong *opcode, + ushort *obytes, + ushort *abytes, + ulong *argval, + pc_t pcx, + ushort argc, + char **argv, + ubyte shift, + ulong bor) +{ + + short delta; + ushort aval; + ulong arg0; + ulong arg1; + ulong arg2; + ulong arg3; + long sarg0; + long sarg1; + ushort reg; + ushort regsrc; + ushort regdst; + ulong dir_mem_add; + ulong arp; + ushort bit; + long idx; + + extern int Use_argvalv; + extern ubyte Argvalv[]; + + strcpy(Errorbuf,""); + Use_argvalv = FALSE; + + /* get a short version of argval since that is all that + * is needed for most of the things in the function. */ + arg0 = (ulong) *argval; + aval = (ushort)*argval; + + switch(modop){ + + case 0: + case NOTOUCH: + /* Don't do anything to this instruction */ + break; + + case 1: + case JMPANYPAGE: + /* 8048 and 8051 Page Jump or Call instructions. + * Only enable this check for the 8051. The 8048 JMP/CALL + * instructions use the SEL MB instruction to select the high + * bits of PC. + * The 8051 AJMP/ACALL instructions use the high bits of the + * PC after it is incremented beyond the current instruction. + * Use the bor field to to control the out-of-range check. + * For 8048 set bor=0000, for 8051 set bor=F800 + */ + if(((pcx + 2) & bor) != (aval & bor)){ + strcpy(Errorbuf,""); + errlog("Branch off of current 2K page.", PASS2_ONLY); + } + + *opcode |= ((aval & 0x700) >> 3); + + /* Clear out upper bits of arg so we don't complain about + * unused data. + */ + *argval = aval & 0xff; + break; + + case JMPTHISPAGE: + /* Jump to any location on current page. Complain if upper byte + * is not on the current page. + * Note that for the 8048, if the instruction starts on location + * XXFF the branch must be on the following page. Thus, the + * (pcx+1) below. + */ + if((aval & 0xff00) != (ushort)((pcx+1) & 0xff00)){ + strcpy(Errorbuf,""); + errlog("Branch off of current page.", PASS2_ONLY); + } + *argval = aval & 0xff; + break; + + case ZEROPAGE: + /* 6502 zero page mode */ + if((*argval < 0x10000L) && (aval < 0x100)){ + /* test for the two special cases in the + extended instruction set STZ */ + switch((int)(*opcode)){ + case STZ_ABS: + *opcode = 0x64; + break; + case STZ_ABSX: + *opcode = 0x74; + break; + default: + *opcode = *opcode & 0xf7; + } + *abytes = 1; + } + break; + + case MOTOR_ZEROPAGE: + /* Motorola 6800, 6805 zero page mode */ + if((*argval < 0x10000L) && (aval <= 0xff)){ + switch((int)(*opcode) & 0xf0){ + case 0xc0: /* 6805 Extended/direct */ + *opcode = (*opcode & 0x0f) | 0xb0; + break; + + case 0xd0: /* 6805 Indexed 2 byte/Indexed 1 byte*/ + *opcode = (*opcode & 0x0f) | 0xe0; + break; + + default: + /* 6800-6804,68HC11 zero page */ + *opcode = *opcode & 0xffdf; + break; + } + *abytes = 1; + } + else{ + /* Not zero page so swap bytes */ + *argval = ((aval >> 8) & 0x00ff) | ((aval << 8) & 0xff00); + } + break; + + case ST7_ZEROPAGE: + /* ST7 zero page mode */ + if((*argval < 0x10000L) && (aval <= 0xff)){ + /* Yes, the arg is on the zero page. */ + /* Adjust the opcode for 1 and 2 byte cases */ + /* CX -> BX */ + /* DX -> EX */ + /* XXCX -> XXBX */ + /* XXDX -> XXEX */ + if ((*opcode & 0xf0) == 0xc0) + *opcode = (*opcode & 0xff0f) | 0xb0; + else if ((*opcode & 0xf0) == 0xd0) + *opcode = (*opcode & 0xff0f) | 0xe0; + + *abytes = 1; + } + else{ + /* Not zero page so swap bytes of arg since this is a BigEndian MCU */ + *argval = ((aval >> 8) & 0x00ff) | ((aval << 8) & 0xff00); + } + break; + + case Z80BIT: + /* Z80 BIT instructions */ + bit = (ushort)val(argv[0]); + if(argc == 1){ + + isargrangevalid ((long)bit, 0L, 7L, argv[0] ); + *opcode = *opcode | ((bit & 0x7) << 11); + *argval = 0; + } + else{ + /* Index displacement is a signed byte quantity */ + sarg1 = val(argv[1]); /* DISP */ + isargrangevalid ((long)bit, 0L, 7L, argv[0] ); + isargrangevalid (sarg1, -128L, 127L, argv[1] ); + + *argval = ((bit & 0x7) << 11) | (sarg1 & 0xff); + } + break; + + case Z80IDX: + /* Z80 Indexed instructions. e.g. SRL (IX+DISP) */ + /* Truncate arg to a single byte even though it is + * returned as a two byte. The high byte is ORd with + * the mask to get the fourth byte of some instructions + * and if DISP is negative a conflict occurs. + */ + + if (argc == 1) { + /* Index displacement is a signed byte quantity */ + sarg0 = val(argv[0]); /* DISP */ + isargrangevalid (sarg0, -128L, 127L, argv[0] ); + + *argval = ((ushort)sarg0 & 0xff); + } + else { + sarg0 = val(argv[0]); /* DISP */ + sarg1 = val(argv[1]); /* DATA */ + isargrangevalid (sarg1, -128L, 255L, argv[1] ); + isargrangevalid (sarg0, -128L, 127L, argv[0] ); + + *argval = (sarg0 & 0xff) | ((sarg1 & 0xff) << 8); + + } + + break; + + case MOTOR_BIT: + /* MOTOROLA 6805 BIT instructions */ + if(argc == 2){ + /* BSET and BCLR instructions */ + /* OR the bit into the opcode, followed by Zpage address */ + *opcode = *opcode | (((ushort)val(argv[0]) & 0x7) << 1); + *argval = (ushort)val(argv[1]) & 0xff; + } + if(argc == 3){ + /* (BRSET and BRCLR instuctions (two args: bit and label) */ + *opcode = *opcode | (((ushort)val(argv[0]) & 0x7) << 1); + delta = (short)((ushort)val(argv[2]) - pcx - 3); + if((delta > 127) || (delta < -128)){ + *argval = 0; + strcpy(Errorbuf,""); + errlog("Range of relative branch exceeded.", PASS2_ONLY); + }else{ + *argval = (int)((delta & 0xff) << 8) | + ((ushort)val(argv[1]) & 0xff); + } + } + break; + + case ST7_BIT: + /* ST7 BRES, BSET, and BTJF instructions */ + if(argc == 2){ + /* BSET addr,#bit */ + /* BRES addr,#bit */ + /* BSET [addr],#bit */ + /* BRES [addr],#bit */ + /* OR the bit into the opcode, followed by Zpage address */ + *opcode = *opcode | (((ushort)val(argv[1]) & 0x7) << 1); + *argval = (ushort)val(argv[0]) & 0xff; + } + if(argc == 3){ + /* BTJF addr,#bit,rel */ + /* BTJT addr,#bit,rel */ + *opcode = *opcode | (((ushort)val(argv[1]) & 0x7) << 1); + delta = (short)((ushort)val(argv[2]) - pcx - (*obytes+2)); + if((delta > 127) || (delta < -128)){ + *argval = 0; + strcpy(Errorbuf,""); + errlog("Range of relative branch exceeded.", PASS2_ONLY); + }else{ + *argval = (int)((delta & 0xff) << 8) | + ((ushort)val(argv[0]) & 0xff); + } + } + break; + + case REL1: + /* arg is relative to PC and should be reduced to a single byte */ + delta = (short)((long)aval - (long)pcx - ((long)(*obytes) + *abytes)); + if((delta > 127) || (delta < -128)){ + *argval = 0; + strcpy(Errorbuf,""); + errlog("Range of relative branch exceeded.", PASS2_ONLY); + }else + *argval = delta & 0xff; + break; + + case REL2: + /* arg is relative to PC and is double byte */ + delta = (short)(*argval - pcx - ((long)(*obytes) + *abytes)); + *argval = delta; + break; + + case REL3: + /* arg is relative to PC and is to be OR'd into opcode */ + /* uPD75000 relative branch instruction */ + /* Note that the sign extension of the delta in the backwards branch */ + /* case is desired. The upper nibble is all 0's for the forward case */ + /* and all 1's for the backwards case. */ + delta = (short)(val(argv[0]) - (long)pcx) - (short)(*obytes + *abytes); + if ((delta > 15) || (delta < -16)){ + errlog("Range of relative branch exceeded.", PASS2_ONLY); + } + + *opcode = *opcode | (ushort)delta; + break; + + case COMBREL: + /* two arguments, second is relative */ + delta = (short)(val(argv[1]) - (long)pcx) - (short)(*obytes + *abytes); + if((delta > 127) || (delta < -128)){ + *argval = 0; + errlog("Range of relative branch exceeded.", PASS2_ONLY); + }else + *argval = (*argval & 0xff) | (ushort)((delta & 0xff) << 8); + break; + + case COMBINE: + /* two arguments, combine into argval */ + /* If three bytes expected then assume first arg provides two */ + if (*abytes == 2){ + *argval = (aval & 0xff) | (((ushort)val(argv[1]) & 0xff) << 8); + } + else{ + /* two bytes from second arg. */ + arg1 = val(argv[1]); + *argval = ((arg1 & 0xff) << 16) | + ((ulong)aval & 0xffff); + } + break; + + case COMB_SWAP: + /* Two arguments, combine into argval but swap bytes. + * If three bytes expected then assume first arg provides two. + */ + + if(*abytes == 2){ + /* just low bytes from each */ + *argval = (val(argv[1]) & 0xff) | ((aval & 0xff) << 8); + } + else{ + /* two bytes from second arg. */ + arg1 = val(argv[1]); + *argval = ((arg1 & 0xff) << 16) | + (((ulong)aval & 0xff) << 8) | + (((ulong)aval & 0xff00) >> 8); + } + + if ((bor) && (*argval != (*argval & bor))){ + sprintf(Errorbuf, "%s or %s", argv[0], argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + break; + + case COMB_NIBBLE: + /* two arguments, combine into one byte of argval */ + *argval = (aval & 0xf) | (((ushort)val(argv[1]) & 0xf) << 4); + /* If a mask is provided (bor) then use it to verify the + * correctness of the args. This can be used to check + * for even register use for some Z8 instructions. + */ + if ((bor) && (*argval != (*argval & bor))){ + sprintf(Errorbuf, "%s or %s", argv[0], argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + + break; + + case COMB_NIBBLE_SWAP: + /* two arguments, combine into one byte of argval, swap nibbles */ + *argval = ((aval & 0xf) << 4) | (((ushort)val(argv[1]) & 0xf)); + /* If a mask is provided (bor) then use it to verify the + * correctness of the args. This can be used to check + * for even register use for some Z8 instructions. + */ + if ((bor) && (*argval != (*argval & bor))){ + sprintf(Errorbuf, "%s or %s", argv[0], argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + break; + + case THREE_REL: + /* three arguments, last is relative */ + delta = (short)((ushort)val(argv[2]) - (long)pcx) - (short)(*obytes + *abytes); + if((delta > 127) || (delta < -128)){ + *argval = 0; + errlog("range of relative branch exceeded.", PASS2_ONLY); + }else + *argval = (aval & 0xff) | ((ulong)(val(argv[1]) & 0xff) << 8) + | ((ulong)(delta & 0xff) << 16); + break; + + case THREE_ARG: + /* three arguments, combine into argval */ + *argval = (aval & 0xff) | ((ulong)(val(argv[1]) & 0xff) << 8) + | ((ulong)(val(argv[2]) & 0xff) << 16); + break; + + case I8096_1_COMB: + /* Two or three arguments, combine into argval but swap bytes. + * If three bytes expected then assume first arg provides two. + * + * abytes argc op1 op2 op3 op4 + * --------------------------------------------------- + * 2 2 arg1 arg0 + * 3 2 arg1_lo arg1_hi arg0 + * 3 3 arg2 arg1 arg0 + * 4 3 + */ + + if (argc == 1){ + /* No need to do anything here, but validate */ + isargvalid (arg0, bor, 0, 8, argv[0]); + } + else if ((argc == 2) && (*abytes == 2)){ + /* just low bytes from each */ + arg1 = val(argv[1]); + *argval = (arg1 & 0xff) | ((arg0 & 0xff) << 8); + + isargvalid (arg0, bor, 8, 8, argv[0]); + isargvalid (arg1, bor, 0, 8, argv[1]); + + } + else if ((argc == 2) && (*abytes == 3)){ + /* two bytes from second arg. */ + arg1 = val(argv[1]); + *argval = (((ulong)aval & 0xff) << 16) | + (((ulong)arg1 & 0xff) ) | + (((ulong)arg1 & 0xff00) ); + + isargvalid (arg0, bor, 16, 8, argv[0]); + isargvalid (arg1, bor, 0, 16, argv[1]); + + } + else if((argc == 3) && (*abytes == 3)){ + /* just low bytes from each */ + arg1 = val(argv[1]); + arg2 = val(argv[2]); + *argval = (arg2 & 0xff) | + ((arg1 & 0xff) << 8) | + ((arg0 & 0xff) <<16); + + isargvalid (arg0, bor, 16, 8, argv[0]); + isargvalid (arg1, bor, 8, 8, argv[1]); + isargvalid (arg2, bor, 0, 8, argv[2]); + + } + else if((argc == 3) && (*abytes == 4)){ + /* low bytes from each */ + arg1 = val(argv[1]); + arg2 = val(argv[2]); + *argval = (arg2 & 0xffff) | + ((arg1 & 0xff) << 16) | + ((arg0 & 0xff) << 24); + + isargvalid (arg0, bor, 24, 8, argv[0]); + isargvalid (arg1, bor, 16, 8, argv[1]); + isargvalid (arg2, bor, 0, 16, argv[2]); + + } + else if((argc == 4)){ + arg1 = val(argv[1]); + arg2 = val(argv[2]); + arg3 = val(argv[3]); + + /* just low bytes from each */ + *argval = (arg3 & 0xff) | + ((arg2 & 0xff) << 8) | + ((arg1 & 0xff) << 16) | + ((arg0 & 0xff) << 24); + + isargvalid (arg0, bor, 24, 8, argv[0]); + isargvalid (arg1, bor, 16, 8, argv[1]); + isargvalid (arg2, bor, 8, 8, argv[2]); + isargvalid (arg3, bor, 0, 8, argv[3]); + + } + + + + + /* OR the argval with the shift field (which is really used + * as general purpose data; use defined by the rule). Here, + * we use it to turn on the LSB of the first arg bytes for + * the auto-increment modes of the 8096. + */ + *argval = *argval | (ulong) shift; + + break; + + case I8096_8_TIJMP: + /* TIJMP Rule. + * Three args combined as in the I8096_1_COMB, except arg2 & arg1 are + * swapped. + * + */ + + if((argc == 3) && (*abytes == 3)) + { + /* just low bytes from each */ + arg1 = val(argv[1]); + arg2 = val(argv[2]); + *argval = (arg1 & 0xff) | + ((arg2 & 0xff) << 8) | + ((arg0 & 0xff) <<16); + + isargvalid (arg0, bor, 16, 8, argv[0]); + isargvalid (arg1, bor, 8, 8, argv[1]); + isargvalid (arg2, bor, 0, 8, argv[2]); + + } + + break; + + + case I8096_2_2FAR: + /* I8096; 2 args, second might be far. */ + + arg1= val(argv[1]); + if( arg1 < 256) { + *argval = (val(argv[1]) & 0xff) | ((aval & 0xff) << 8); + /* Discard the LS byte and */ + /* turn off the low two bits */ + /* of the new LS byte. */ + /* Note: the XOR with shift is */ + /* specifically here for the XCH/XCHB*/ + /* instructions which do not follow */ + /* the general pattern of the other */ + /* instructions. Shift should be 00 */ + /* for all other instructions. */ + /* Shift=0C converts the X8 to X4 */ + /* as needed for XCH/XCHB. */ + *opcode = ((*opcode >> 8) & 0xfffc) ^ shift; + *obytes = *obytes - 1; + *abytes = 2; + } + else { + *argval = (((ulong)aval & 0xff) << 16) | + (((ulong)arg1 & 0xff) ) | + (((ulong)arg1 & 0xff00) ); + } + + isargvalid (arg0, bor, 0, 8, argv[0]); + + break; + + case I8096_7_1FAR: + /* I8096; 1 arg, might be far. */ + + if( arg0 < 256) { + *argval = (aval & 0xff); + /* Discard the LS byte and */ + /* turn off the low two bits */ + /* of the new LS byte. */ + *opcode = (*opcode >> 8) & 0xfffc; + *obytes = *obytes - 1; + *abytes = 1; + } + else { + *argval = (((ulong)arg0 & 0xff) ) | + (((ulong)arg0 & 0xff00) ); + } + + isargvalid (arg0, bor, 0, 16, argv[0]); + + break; + + case I8096_3_3FAR: + arg1= val(argv[1]); + arg2= val(argv[2]); + if( arg2 < 256) { + /* just low bytes from each */ + *argval = (arg2 & 0xff) | + ((arg1 & 0xff) << 8) | + ((arg0 & 0xff) <<16); + /* Discard the LS byte and */ + /* turn off the low two bits */ + /* of the new LS byte. */ + *opcode = (*opcode >> 8) & 0xfffc; + *obytes = *obytes - 1; + *abytes = 3; + } + else { + *argval = (arg2 & 0xffff) | + ((arg1 & 0xff) << 16) | + ((arg0 & 0xff) << 24); + + } + + isargvalid (arg0, bor, 8, 8, argv[0]); + isargvalid (arg1, bor, 0, 8, argv[1]); + + break; + + case I8096_4_JBIT: + /* I8096 JBC and JBS instructions */ + /* three arguments, 2nd is bit, last is relative */ + delta = (short)(val(argv[2]) - (long)pcx) - (short)(*obytes + *abytes); + bit = (short)val(argv[1]); + + if((delta > 127) || (delta < -128)) + { + *argval = 0; + errlog("range of relative branch exceeded.", PASS2_ONLY); + } + else if(bit > 7) + { + *argval = 0; + sprintf(Errorbuf, "%s", argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + else + { + *argval = (aval & 0xff) | ((ulong)(delta & 0xff) << 8); + *opcode = *opcode | bit; + } + + break; + + + case I8096_5_REL: + /* I8096 SJMP and SCALL */ + delta = (short)(val(argv[0]) - (long)pcx) - (short)(*obytes + *abytes); + + if((delta > 1023) || (delta < -1024)) + { + sprintf(Errorbuf, "offset=%d", delta); + errlog("range of relative branch exceeded.", PASS2_ONLY); + } + else + { + *opcode = *opcode | (ulong)(delta & 0x07ff); + } + + break; + + case I8096_6_IND: + /* Short and long indexed modes. */ + /* XXX idx[sreg] where idx may be short or long */ + /* XXX dreg,idx[sreg] where idx may be short or long */ + /* XXX dreg,reg,idx[sreg] where idx may be short or long */ + + if( argc == 3) { /* dreg,idx[sreg] form */ + idx = val( argv[1] ); + if ((idx < 0) && (idx >= -128)) idx = 256 + idx; + + arg2= (ushort)val( argv[2] ); + + if (idx < 256 ){ + /* short index */ + *argval = ( arg2 & 0xff) | + ((ulong)(idx & 0xff) << 8) | + ((ulong)(arg0 & 0xff) << 16); + *abytes = *abytes - 1; + } + else + { + /* long index */ + *argval = ( val(argv[2]) & 0xff) | + ((ulong)(idx & 0xffff) << 8) | + ((ulong)(aval & 0xff) << 24); + *argval = *argval | 0x01; /* force first byte odd */ + } + + /* No validation for the idx */ + isargvalid (arg0, bor, 8, 8, argv[0]); + isargvalid (arg2, bor, 0, 8, argv[2]); + + } + else if (argc == 4) + { + /* XXX dreg, sreg1, idx[sreg2] */ + Use_argvalv = TRUE; + idx = val( argv[2] ); + if ((idx < 0) && (idx >= -128)) idx = 256 + idx; + arg1= (ushort)val( argv[1] ); + arg3= (ushort)val( argv[3] ); + + if (idx < 256 ){ + /* short index */ + Argvalv[0] = (ubyte)(arg3 & 0xff); + Argvalv[1] = idx & 0xff; + Argvalv[2] = (ubyte)(arg1 & 0xff); + Argvalv[3] = (ubyte)(aval & 0xff); + + + *abytes = *abytes - 1; + } + else{ + /* long index */ + Argvalv[0] = (ubyte)((arg3 & 0xff) | 0x01); + Argvalv[1] = idx & 0xff; + Argvalv[2] = (idx >> 8 ) & 0xff; + Argvalv[3] = (ubyte)(arg1 & 0xff); + Argvalv[4] = aval & 0xff; + + } + + isargvalid (arg0, bor, 16, 8, argv[0]); + isargvalid (arg1, bor, 8, 8, argv[1]); + isargvalid (arg3, bor, 0, 8, argv[3]); + + } + else{ /* argc == 2 */ + + idx = val( argv[0] ); + if ((idx < 0) && (idx >= -128)) idx = 256 + idx; + + arg1= (ushort)val( argv[1] ); + + if (idx < 256 ){ + /* short index */ + *argval = ( arg1 & 0xff) | + ((ulong)(idx & 0xff) << 8); + *abytes = *abytes - 1; + } + else{ + /* long index */ + *argval = ( arg1 & 0xff) | + ((ulong)(idx & 0xffff) << 8); + *argval = *argval | 0x01; /* force first byte odd */ + } + + /* validate reg */ + isargvalid (arg1, bor, 0, 8, argv[1]); + /* No validation for the idx */ + } + break; + + case Z8_DJNZ: + /* Z8 DJNZ instruction. Two args; first is the working register; + * the second is the address of the jump point (which should be + * converted to a relative byte count) + */ + delta = (short)((long)val(argv[1]) - (long)pcx - ((long)(*obytes) + *abytes)); + if((delta > 127) || (delta < -128)){ + *argval = 0; + strcpy(Errorbuf,""); + errlog("Range of relative branch exceeded.", PASS2_ONLY); + }else + *argval = delta & 0xff; + + /* OR the first arg into the upper nibble of the opcode. */ + *opcode = *opcode | ((arg0 & 0xf) << 4); + break; + + + case Z8_WORKREG: + /* Z8. Two arguments. If both are working registers (in the range + * E0 to EF) then combine into one byte + * and adjust the byte count and opcode for the working register mode. + * If not, then swap bytes. + */ + Use_argvalv = TRUE; + arg1 = val(argv[1]); + + if(((arg0 >= 0xe0) && (arg0 < 0xf0)) && + ((arg1 >= 0xe0) && (arg1 < 0xf0)) ){ + Argvalv[0] = (ubyte)(((arg0 & 0xf) << 4) | (arg1 & 0xf)); + *abytes = 1; + /* turn bit 2 off and bit 1 on*/ + *opcode = (*opcode & 0xfb) | 0x02; + } + else + { + /* two bytes from second arg. */ + Argvalv[0] = (ubyte)arg1; + Argvalv[1] = (ubyte)arg0; + + } + + if ( arg0 > 255) + { + sprintf(Errorbuf, "%s", argv[0]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + + if ( arg1 > 255) + { + sprintf(Errorbuf, "%s", argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + + break; + + case Z8_LD: + /* Z8 LD immed[r1],r2 + * Where r1 is handled literally in the table. Thus, r2 is the + * second arg. + * Let the first arg (immed) get the default handling. + */ + arg1 = val(argv[1]); + + /* arg1 should be a working register (not including the R) */ + if( arg1 < 16 ) + { + *opcode = *opcode | (arg1 << 4); + } + else + { + sprintf(Errorbuf, "%s", argv[1]); + errlog("range of argument exceeded.", PASS2_ONLY); + } + break; + + + + + case SWAP: + /* swap low and high bytes of argval (one argument) */ + *argval = ((aval >> 8) & 0x00ff) | ((aval << 8) & 0xff00); + break; + + case TMS1: + /* TMS320, shift, mask, and or first arg into opcode. + * If there is a second arg assume it is an ARP designation. + */ + arg0 = shift_and(argv[0], shift, bor); + + if (argc > 1) arp = arp_val(argv[1]); + else arp = 0; + + *opcode = *opcode | arp | arg0; + break; + + case TMS2: + /* TMS9900, first arg is OR'd to opcode (register num). Second + * If there is a second arg it is a 16 bit constant. + */ + + if (argc > 1){ + /* Two args (e.g. SWPB @$1234(R7) ) */ + arg0 = ((ushort)val(argv[0])); + *argval = ((arg0 >> 8) & 0x00ff) | ((arg0 << 8) & 0xff00); + reg = shift_and(argv[1], 0, LOW_NIBBLE); + } + else{ + /* single arg ( e.g. SWPB R7 ) */ + reg = shift_and(argv[0], 0, LOW_NIBBLE); + } + + *opcode = *opcode | reg; + break; + + case TMS3: + /* TMS9900, two args, first is Reg, second is constant (16bit). + */ + + /* Two args (e.g. LI R7,$1234 ) */ + arg0 = ((ushort)val(argv[1])); + *argval = ((arg0 >> 8) & 0x00ff) | ((arg0 << 8) & 0xff00); + reg = shift_and(argv[0], 0, LOW_NIBBLE); + *opcode = *opcode | reg; + break; + + case TMS4: + /* TMS9900, two args, both Reg. (e.g. MOV R1,R2 ) */ + + regsrc = shift_and(argv[0], 0, LOW_NIBBLE); + regdst = shift_and(argv[1], 0, LOW_NIBBLE); + *opcode = *opcode | regsrc | (int)(regdst << 6); + break; + + case TDMA: + /* TMS320, first arg is a DMA (direct memory address). + * Second arg gets the shift, mask and or treatment. + */ + dir_mem_add = shift_and(argv[0], 0, 0x7fL); + if (argc > 1) arg1 = shift_and(argv[1], shift, bor); + else arg1 = 0; + + *opcode = *opcode | dir_mem_add | arg1; + break; + + case TLK: + /* TMS320, first arg is a Long Constant (16 bit) + * Second arg (if present) gets the shift, mask and or treatment. + */ + arg0 = ((ushort)val(argv[0])); + *argval = ((arg0 >> 8) & 0x00ff) | ((arg0 << 8) & 0xff00); + if (argc > 1) arg1 = shift_and(argv[1], shift, bor); + else arg1 = 0; + + *opcode = *opcode | arg1; + break; + + case TMS5: + /* Same as TLK, but swap args + * TMS320, second arg is a Long Constant (16 bit) + * First arg gets the shift, mask and or treatment. + */ + arg1 = ((ushort)val(argv[1])); + *argval = ((arg1 >> 8) & 0x00ff) | ((arg1 << 8) & 0xff00); + arg0 = shift_and(argv[0], shift, bor); + + *opcode = *opcode | arg0; + break; + + + case TMS6: + /* uPD75xxx and TMS320 + * First arg is 8 bits and is right justified in the opcode + * Second arg gets the shift, mask and or treatment. + */ + dir_mem_add = shift_and(argv[0], 0, LOW_NIBBLE); + if (argc > 1) arg1 = shift_and(argv[1], shift, bor); + else arg1 = 0; + + *opcode = *opcode | dir_mem_add | arg1; + break; + + case TAR: + /* TMS320, first arg is a AR (auxilliary register). + * Second arg gets the shift, mask and or treatment. + */ + arp = (ushort)(arp_val(argv[0]) << 8); + if (argc > 1) arg1 = shift_and(argv[1], shift, bor); + else arg1 = 0; + + *opcode = *opcode | arp | arg1; + break; + + case SUB: + /* Subtract first arg from opcode. TMS7000 TRAP instruction. + * Cant use aval or argval here since abytes == 0 + */ + arg1 = val(argv[0]); + *opcode = *opcode - arg1; + + /* Check for out of range */ + if(arg1 > 23){ + strcpy(Errorbuf,argv[0]); + errlog("Range of argument exceeded.", PASS2_ONLY); + } + break; + + default: + sprintf(Errorbuf,"%04X", modop); + errlog("Invalid MODOP.", PASS2_ONLY); + break; + + } /* end of switch */ + +} + +/* + * Function: isargvalid() + * + * Description: + * + */ + +static void +isargvalid( + long argval, + ulong vmask, + ushort sbit, + ushort width, + char *argtext) + +{ + ulong valmask; + static ulong widthmask[] = { 0x0000, + 0x0001, + 0x0003, + 0x0007, + 0x000F, + 0x001F, + 0x003F, + 0x007F, + 0x00FF, + 0x01FF, + 0x03FF, + 0x07FF, + 0x0FFF, + 0x1FFF, + 0x3FFF, + 0x7FFF, + 0xFFFF}; + + if ( vmask ) + valmask = (widthmask[width] & (vmask >> sbit)); + else + valmask = widthmask[width]; + + if ( argval < 0 ) { + /* Ignore overflow due to sign extension */ + argval = argval & widthmask[width]; + } + + if ((ulong)argval != (argval & valmask)){ + sprintf(Errorbuf, "%s", argtext); + errlog("range of argument exceeded.", PASS2_ONLY); + } + +} +static void +isargrangevalid( + long argval, + long argmin, + long argmax, + char *argtext) + +{ + + if ((argval < argmin) || (argval > argmax)){ + sprintf(Errorbuf, "%s", argtext); + errlog("Range of argument exceeded.", PASS2_ONLY); + } + + DEBUG4("isargrangevalid: %ld %ld %ld %s\n", argval, argmin, argmax, + argtext); + +} + +/* + * Function: shift_and() + * + * Description: + * Determine the value of the indicated expression then shift + * left and AND. Generate an error message if data is out of + * range. + * + */ + +static ushort +shift_and( +char *parg, +int shiftcnt, +ulong andmask) +{ + ushort argt; + ushort arg; + int aoperator; + /* Extract the shift count from the low nibble, the optional operator + * from the upper nibble. If the operator is non-zero then invert the + * arg. Perhaps more operators in the future. + * The operator should get its own argument; this is a bit of a + * kludge to meet the need for TMS320C25 BIT instruction (for the moment). + */ + aoperator = shiftcnt & 0xf0; + shiftcnt = shiftcnt & 0x0f; + + argt = (ushort)val(parg) << shiftcnt; + arg = argt & (ushort)andmask; + + if(arg != argt) { + strcpy(Errorbuf,parg); + errlog("Range of argument exceeded.", PASS2_ONLY); + } + + /* If operator detected, then invert the bit field. */ + if (aoperator) arg = (~argt) & (ushort)andmask; + + return(arg); +} + +/* + * Function: arp_val() + * + * Description: + * This applicable to TMS320 modops. + * Mask the value provided for an auxilary reg (ARP) + * + * + */ + +static ushort +arp_val(char *parg) +{ + ushort argt; + ushort arg; + extern char Part_num[]; + + argt = (ushort)val(parg); + + if(strcmp (Part_num, "3225" ) == SAME) arg = argt & 7; + else arg = argt & 1; + + if(arg != argt) { + strcpy(Errorbuf,parg); + errlog("Range of ARP argument exceeded.", PASS2_ONLY); + } + + return(arg); +} + +/* that's all folks */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/str.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/str.c new file mode 100644 index 00000000..8c112406 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/str.c @@ -0,0 +1,531 @@ +/**************************************************************************** + * $Id: str.c 1.5 1997/11/15 13:13:04 toma Exp $ + **************************************************************************** + * File: str.c + * + * Description: + * Various string functions for TASM, the table driven assembler. + * + * Copyright 1989-1995 Speech Technology Incorporated. + * Copyright 1997 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + */ + +//static char *id_str_c = "$Id: str.c 1.5 1997/11/15 13:13:04 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + + +/* EXTERNALS */ +extern ushort Debug; + +/******************************************************************/ +/* Function: search() + * Description: + * Search for a substring (unanchored). + * (Ought to change to a more efficient algorithm like BM). + */ +int +search( +char *p, /* String to search */ +char *s) /* sub string to search for in p */ + +{ + int n; + char *ss; + char *pp; + extern char Comment_char2; /* embedded comment char */ + + n = 0; + while((*p != '\0') && (*p != Comment_char2)){ + /* Only start the detail search if we are at the start of a valid + * symbol. Allow '.' in symbols so that macro expansion will + * work for stuff like: #define equ .equ + */ + if((isalpha(*p) || *p == '.') && + ( (n== 0) || + !( (isalnum(*(p-1))) || (*(p-1) == '_') ) ) ){ + + pp = p; + ss = s; + while(*ss++ == *pp++){ + if(*ss == 0){ + /* Require the string to match up to the end of a + * valid C identifier. + */ + if((isalnum(*pp)) || (*pp == '_')){ + /* The substring is found in a longer identifier */ + continue; + } + else{ + /* Match found. Return position. */ + return(n); + } + } + } + /* Gobble the rest of this identifier so we only match + * whole identifiers and not substrings within identifiers. + */ + while((isalnum(*p)) || (*p == '_') || (*p == '.') ){ + p++; + n++; + } + + } + else{ + n++; + p++; + } + } + + /* No match found */ + return(-1); + +} + +/* Function: replace() + * Description: + * Replace substring in the target string. + */ +void +replace( +char *target, +char *psearch, +char *preplace) +{ + + short pos; + ushort i; + char temp[LINESIZE]; + + while((pos = search(target,psearch)) >= 0){ + for(i = 0; i < (ushort)pos; i++)temp[i] = target[i]; + temp[i] = '\0'; + strcat(temp,preplace); + strcat(temp,&target[(ushort)pos+strlen(psearch)]); + strcpy(target,temp); + } +} + +/* Function: stouppoer() + * Description: + * Convert string to upper case (in place). + */ +void +stoupper(char *s) +{ + do{ + if(islower(*s))*s = toupper(*s); + }while(*++s); +} + +/* most libraries provide this now */ +#if 0 +/* Function: strcmpi() + * Description: + * String compare (stcmp) with case ignore. + */ +int +strcmpi( +char *s, +char *p) +{ + int c1; + int c2; + + do{ + if(islower((c1 = *s)))c1 = toupper(*s); + if(islower((c2 = *p)))c2 = toupper(*p); + s++; + p++; + + }while((c1 == c2) && (c1) && (c2)); + + return(c2 -c1); + +} +#endif + +/* Function: crush() + * Description: + * Remove spaces and tabs from string (in place). + */ +void +crush(char *s) +{ + int i,j; + char d[LINESIZE]; + + i = 0; + j = 0; + do{ + if(!isspace(s[i])){ + d[j++] = s[i]; + } + else{ + /* Copy the space if we are inside quotes, otherwise discard. */ + if(inquotes(s, i)) d[j++] = s[i]; + } + } while(s[i++] != '\0'); + d[j++] = '\0'; + + /* Copy the crushed string over the top of the source string. It + * should always be shorter. + */ + strcpy (s, d); + + return; +} + + +/* Function: remquotes() + * Description: + * Remove quotes from string and return new byte count (in place). + */ +int +remquotes(char *s) +{ + int i; + int j; + char c; + char cc; + int ascii; + int starts_with_quote = FALSE; + char t[LINESIZE]; + + extern char Errorbuf[LINESIZE]; + + i = 0; + j = 0; + /* copy the string to the error buffer in case we find something + * wrong with it later (for reporting purposes). + */ + strcpy(Errorbuf, s); + DEBUG("remquotes: #%s#\n", s); + + while((isspace(s[i])) && (s[i] != '\0'))i++; + if(s[i] == '\"'){ + starts_with_quote = TRUE; + i++; + } + + while((c = s[i++]) != '\0'){ + /* If a backslash then escape the following character */ + if(c == '\\'){ + cc = s[i++]; + switch(cc){ + case 'n': + t[j++] = '\n'; /* Newline */ + break; + case 'r': + t[j++] = '\r'; /* Carraige Return */ + break; + case 't': + t[j++] = '\t'; /* Tab */ + break; + case 'b': + t[j++] = '\b'; /* Backspace */ + break; + case 'f': + t[j++] = '\f'; /* Formfeed */ + break; + case '\"': + t[j++] = '\"'; /* Double quote */ + break; + case '0': + case '1': + case '2': + case '3': + /* if numeric then assume 3 digit octal ASCII code */ + ascii = (cc - '0')*64 + (s[i++] - '0')*8; + ascii = ascii + (s[i++] - '0'); + t[j++] = ascii; + break; + default: + t[j++] = cc; + } + } + else { /* not backslash */ + t[j++] = s[i-1]; + } + + /* Break out of the loop when we find a double quote that is + * not escaped by a backslash. + */ + if ((s[i-1] == '\"') && (s[i-2] != '\\')) break; + + } + /* Only complain about no trailing quote if there was no starting quote */ + if ((c != '\"') && (starts_with_quote == TRUE)) + errlog ("No terminating quote:", PASS2_ONLY); + + /* Remove the trailing quote */ + if (c == '\"') j--; + t[j] = '\0'; + + /* Copy the output (t) back into the source (s) */ + for (i = 0; i <= j; i++) s[i] = t[i]; + + DEBUG("remquotes: #%s#\n", s); + + return(j); + +} + +/* Function: strget() + * Description: + * Copy source string to target string until termination conditions are + * encountered. + * Used to copy labels and instructions only. + */ +int +strget( +char *ptarget, +char *psource) +{ + int cnt; + int lastc; + char *save_psource; + + extern char Errorbuf[LINESIZE]; + +/* updated to terminate following an '=' so it will properly copy over + * the '*=' part of an expression like '*=*+10' without requiring + * a space after the '='. + * Only used with labels, instructions, and directives which cannot + * be longer than LABLEN, so detect overruns. + */ + save_psource = psource; + cnt = 0; + lastc = 0; + while((*psource != ' ') && + (*psource != '\\')&& + (*psource != '\t')&& + (*psource != '\0')&& + (*psource != '\n')&& + (*psource != ':') && + (lastc != '=')){ + lastc = *psource; + *ptarget++ = *psource++; + cnt++; + if (cnt >= LABLEN) { + strcpy(Errorbuf, save_psource); + errlog ("Label or instruction too long.", PASS2_ONLY); + break; + } + } + *ptarget = '\0'; + return(cnt); +} + +/* Function: lhex_to_bin() + * Description: + * Convert hex digits (ASCII) to binary (long word) + */ + +ulong +lhex_to_bin(char *hex_string) +{ + ulong word; + char *middle; + ushort low; + ulong hi; + int l; + char buf[80]; + + l = 0; + while(isxdigit(*hex_string)){ + buf[l++] = *hex_string++; + } + buf[l] = '\0'; + + if(l > 4){ + middle = &buf[l-4]; + low = hex_to_bin(middle); + *middle= '\0'; + hi = hex_to_bin(buf); + word = (hi << 16) + low; + } + else{ + word = hex_to_bin(buf); + } + return(word); +} + +/* Function: hex_to_bin() + * Description: + * Convert hex digits to (ASCII) to binary (short word) + */ + +ushort +hex_to_bin(char *hex_string) +{ + ushort byte; + + byte = 0; + + while(isxdigit(*hex_string)){ + byte = byte << 4; + byte += hex_val(*hex_string++); + } + return(byte); +} + +/* Function: hex_val() + * Description: + * Convert ASCII hex digit to binary value (0-15). + */ + +ushort +hex_val(char hex_digit) +{ + + ushort ival; + + if(hex_digit < 'A') + ival = hex_digit & 0x0f; + else{ + if(islower(hex_digit)) + ival = (hex_digit - 'a' + 10) & 0x0f; + else + ival = (hex_digit - 'A' + 10) & 0x0f; + } + + return(ival); +} + +/* + * Function: sort_labels + * Description: Sort the label table to facilitate faster access to + * the label values on the second pass. + */ +void +sort_labels(void) +{ + int i; + int j; + int k; + int bot; + int top; + LABTAB *tmp_p; + + extern ushort Lhash[]; + extern ushort Nlab; /* number of labels */ + extern LABTAB *Labtab[]; /* label pointer table */ + + DEBUG("sort: sorting %d labels\n",Nlab); + + /* Bubble sort (shaker sort) */ + top = 0; + bot = Nlab - 2; + k = bot; + + do{ + /* shake to the top */ + for(i = bot; i >= top; i--){ + if(*(GETLABTAB(i)->lab) > *(GETLABTAB(i+1)->lab)){ + /* Swap */ + tmp_p = GETLABTAB(i); + GETLABTAB(i) = GETLABTAB(i+1); + GETLABTAB(i+1)= tmp_p; + k = i; + } + } + top = k + 1; + + /* shake to the bottom */ + for(i = top; i <= bot; i++){ + if(*(GETLABTAB(i)->lab) > *(GETLABTAB(i+1)->lab)){ + /* Swap */ + tmp_p = GETLABTAB(i); + GETLABTAB(i) = GETLABTAB(i+1); + GETLABTAB(i+1) = tmp_p; + k = i; + } + } + bot = k - 1; + DEBUG5("n=%d top=%d bot=%d Lab0=%s Labn=%s\n",Nlab,top,bot, + (GETLABTAB(0)->lab),(GETLABTAB(Nlab-1)->lab)); + }while(top < bot); + + /* Now build the label index table. + * Go backwards through the sorted table so the last assignment to + * a given index element will be the first for that character in + * in the table. + */ + for(i = Nlab-1 ; i >=0 ; i--){ + j = *(GETLABTAB(i)->lab) - 'A'; + if((j >=0 ) && (j < MAXLHASH)) Lhash[j] = i; + + } + +} + +int +find_comment(char s[]) +{ + int i; + char quote; + extern char Comment_char2; /* Embedded comment char */ + + /* Scan line for position of the start of a comment */ + + quote = '\0'; + i = 0; + + while (s[i] != '\0') { + if ((s[i]== Comment_char2) && (quote=='\0')) { + return(i); + } else { + if ((quote == '\0') && ((s[i]=='\'')||(s[i]=='\"'))) { + quote = s[i]; + } else if (quote == s[i]) { + quote = '\0'; + } + i++; + } + } + return(i); +} + + +int +inquotes( +char *s, +int pos) +{ + int j; + int quote; + + /* Check to see of the character at pos is inside quotes. */ + /* First handle the single quote case, which should only + * have a single character with quotes on either side. + */ + if (pos > 0){ + if( (s[pos-1] == '\'') && (s[pos+1] == '\'')) return(TRUE); + } + + quote = 0; + for (j=0; j < pos; j++) { + if (s[j]=='\"') quote = !quote; + } + + if (quote) return(TRUE); + return(FALSE); + +} + +/* That's all folks */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm new file mode 100755 index 00000000..2f7ef33e Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.c new file mode 100644 index 00000000..249f2462 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.c @@ -0,0 +1,2378 @@ +/**************************************************************************** + * $Id: tasm.c 1.17 2001/10/23 01:43:20 toma Exp $ + **************************************************************************** + * + * Table Driven Absolute Assembler. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997-2001 Squak Valley Software + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * 10/01/85 Version 2.0 First version with external table def files. + * + * 01/01/86 Version 2.1 Added '*=' and '=' directives as + * alternatives to .ORG and .EQU (for + * more complete MOS Technology compatibility). + * + * Also enhanced parsing algorithm so it can + * deal with more than one variable expression. + * + * 02/02/86 Added -d option + * + * 02/14/86 Version 2.2 Modified so instruction set definition + * tables don't need to be compiled in. + * Added 8051 tables. + * Increased the number of labels allowed. + * + * 03/31/87 Version 2.3 Fixed bug that prevented location 0xffff + * from being used and written to object file. + * Most changes in wrtobj() and pr_hextab(). + * + * 05/01/87 Version 2.4 Added multiple byte opcode support. + * Added shift/or operation capability to + * args from instruction set definition table. + * Converted to MS C version 3.0 + * Added hashing to instruction set table + * lookups to speed up. + * + * 11/01/87 Version 2.5 Added DB and DW directives. + * Added escape capability in TEXT strings. + * Fixed inst_lookup function to treat the + * multiple wild card case a little better + * ( non-terminal wildcards can end in '),' + * to support some of the Z80 syntax + * requirements. + * Added 8080/8085 and Z80 tables. + * Added sorting on label table. + * Increased size of read buffer. + * Speed up. + * Added DEFCONT (macro continuation) directive. + * + * 1/1/88 Version 2.6 Converted to Microsoft C 5.0 compiler. + * Added 6805 table (and related modops). + * Added Z80 bit modop. + * Minor speed up. + * Fixed bug that enters infinite loop + * when a macro invocation has no closing + * paren. + * Added some three arg MODOPs. + * + * 8/15/88 Version 2.6.1 Added CODES/NOCODES directives + * Fixed bug preventing directives in multiple + * statement lines. + * 2.6.2 Added COMB_NIBBLE and COMB_NIBBLE_SWAP MODOPS + * + * 2/1/89 Version 2.7 + * Removed ad hoc heap and now use malloc() + * Added MSFIRST and LSFIRST directives. + * Added EXPORT directive. + * Added symbol table file (-s flag). + * Added NSEG/CSEG/BSEG/DSEG/XSEG directives + * and the SYM/AVSYM directives to support + * the Avocet avsim51 simulator. + * Added support for TMS320. + * Added -r flag to set read buffer size. + * Converted expression evaluation from + * signed 16 bit to signed 32 bit (enabling + * apparent ability to use signed or unsigned + * 16 bit values). + * + * 4/20/89 Version 2.7.1 Return 0x20000 for undefined labels so that + * (label+x) type stuff won't confuse zero + * page addressing. + * Added duplicate label error message on pass 1. + * 6/20/89 Version 2.7.2 Improved macro expansion capability. + * No expansion in comments. + * Context sensitive identifiers. + * Revised exit codes. + * 6/27/89 Version 2.7.3 Added -a flag for strict error checking: + * (1) No outer parens around expressions. + * (2) Error message if unused argbytes remain + * (3) Duplicate labels + * Fixed so ']' can terminate expressions. + * Removed parse() from tasm.c + * + * 8/19/89 Version 2.7.4 Added Motorola hex object format + * Fixed bug that complained when \ immediately + * followed a opcode with no args. + * Slightly improved error reporting (Errorbuf). + * + * 10/31/89 Version 2.7.5 Added TMS7000 support. + * Fixed argv[] bug (only dimensioned to 10 in + * pass1. + * + * 12/23/89 Version 2.7.6 Improved handling of % (modulo vs + * binary prefix ambiguity) + * Fixed list so lines with more than + * 6 bytes go on second line + * + * 03/04/90 Version 2.7.7 Fixed bug that left off 2 bytes if ORG + * went backwards and all 64K was used. + * Added a command line option to ignore + * case on labels. + * Added a couple MODOP rules for TMS9900. + * Allow double quoted text strings for BYTE. + * + * 04/15/90 Version 2.7.8 Fixed expression evaluator bug (paren popping) + * and changed expression evaluator to a more + * conventional left to right evaluation + * order. + * Added TURBOC ifdef's (from Lance Jump). + * + * 08/20/90 Version 2.8 Primarily a documentation update. + * Added error check for AJMP/ACALL off of + * current 2K block (8051). + * + * 10/15/90 Version 2.8.1 Minor speed up in label searching. + * Fixed word addressing for TMS320 + * + * Version 2.8.2 Local labels. + * More label table format options (long form + * suppress local labels). + * + * 11/30/90 Version 2.8.3 Turbo C conversion + * DS directive added. + * + * 12/27/90 Version 2.8.4 Added COMMENTCHAR directive to change the + * comment indicator in the first column. + * This was done to support the assembly + * files from the small C compiler (sc11) + * for the 68CH11. + * + * 02/14/91 Version 2.8.5 Added LOCALLABELCHAR directive to + * override the default "_" as the + * prefix for local labels. + * + * 03/18/91 Version 2.8.6 Added some MODOPs in support of TMS320C25 + * + * 04/20/91 Version 2.8.7 Fixed sign extend bug in CSWAP modop. + * Increased MAXLABS to 10000 for big version. + * + * 05/05/91 Version 2.8.8 Fixed pointer bug in debug output in + * sort_labels(). + * + * 05/20/91 Version 2.9 TMS320C25 table along with some MODOP + * enhancements for it. + * TASMTABS.DOC updated (but not TASM.DOC) + * + * 08/09/91 Version 2.9.1 Nested conditionals. + * + * 04/01/92 Version 2.9.2 Fixed long label clobber problem in + * find_label() and save_label. Syntax + * errors could result in a comment line + * after an instruction being lumped together + * with a label resulting in a long label. + * The label functions were not testing for + * labels that exceed the specified size. + * Added CHK directive. + * Added REL3 MODOD to support uPD75xxx. + * Delinting and more ANSIfication. + * Modifications due to feedback from B Provo: + * Added FILL directive. + * Allow multiple labels for EXPORT directive. + * Allow address with END directive. + * TASM.DOC update + * + * 11/25/92 Version 2.9.3 Improved error reporting for mismatched quotes. + * Disallow the single quote character constants. + * Convert to BCC++ 3.1 + * Provide filename,linenum on all error messages. + * Modify format of error messages for + * compatibility with BRIEF. + * Added ECHO directive to send output to console + * Performance improvements in macro processing. + * "Type Safe" conversion (compatible with C++) + * Improved error reporting for imbalanced ifdefs. + * + * + * 01/29/93 Version 2.9.4 Windows support. + * Added rules for 8096 (I1,I2,I3,I4,I5,I6). + * Generate error message on forward reference + * in EQUate statements. + * Eliminated -a option for enabling the detection + * of branches of 2K page for 8051. This + * is now built into the table. + * Allow white space in double quotes for BYTE + * directive. This previously worked for TEXT, + * but not BYTE. + * Fixed defect with Z80 4 byte indexed instructions + * Fixed macro defect. If the macro definition has + * args but the invocation does not some garbage + * gets expanded into the source line. + * Z80 OTDR opcode was incorrect. + * Z80 IN0/OUT0/INA instructions did not require + * the parens around the args. + * + * 10/24/93 Version 3.0 Update the DOCs. TASM.EXE is functionally + * unchanged. + * + * 02/20/94 Version 3.0.1 Multiple macros on the same line + * -c with >8000h bytes used goes bonkers + * waddr correction for BLOCK/DS + * Allow escaped quotes in TEXT. + * + * 04/20/97 version 3.1 8048 conditional jump off page warning + * Define macros on both passes so ifdef + * processing will work correctly for + * both passes. + * Fixed -y (timing flag) to use total + * lines and not just lines of the + * first file. + * Allow white space before # directives. + * LINUX support. + * Provide protected mode version with + * increased maximums for most things. + * Provide logical NOT unary operator. + * Fix problems with (inwork) 8096 rules + * and make the 8096 table part of the + * official distribution. + * Fix Min_pc calc (fails if .org is missing). + * Eliminate non-ANSI I/O. + * Object format: intel hex w/ word addresses. + * + * 02/20/99 version 3.1.1 Added rules for ST7 MCU. + * Added support for TASMERRFORMAT env variable. + * + * 02/01/00 version 3.2 Increased LINESIZ to 512 to enable use of + * longer macros. + * Eliminated -r command line option (to set + * read buffer size). Obsolete. + * Improved list() function to put a max of + * six bytes per line to avoid problems with + * directives that generate large blocks of + * object code (i.e. .FILL). + * Built as a 32 bit version using MS C++ 6.0 + * + * Invoked as: + * + * tasm [-flags] source_file [object_file [list_file [exp_file [sym_file]]]] + * + * Where 'flags' can be: + * + * - Specify version -48 for 8048 + * -65 for 6502 + * -51 for 8051 + * -85 for 8080/8085 + * -80 for Z80 + * -05 for 6805 + * -3210 for TMS32010 + * -3225 for TMS320C25 + * -68 for 6800/6801 + * -70 for TMS7000 + * -96 for 8096 + * + * -t Alternate form of above. + * -a Assembly control (error checking) + * -c Cause object file to be written as a contigous block + * of code + * -d Define macro label + * -e Show source lines after macro expansion in listing. + * -f Fill entire memory space with 'xx' (in hex) + * -g Obj type (0=intel, 1=mostech, 2=motorola, 3=bin, 4=intel word) + * -h Produce a hex table of the assembled code in the listing + * -i Ignore case for labels. + * -l[al] Produce a label table in the listing + * -m Produce object in MOS Technology hex format + * -b Produce object in binary (.COM) format + * -p Page the listing file + * -q Quiet, disable the listing file + * -s Symbol table + * -o Set number of bytes per object record + * -x Enable extended instruction set (if any) + * -y Enable timing. + * -z Turn debugging on (enables DEBUG statements). + * + */ + +#include "tasm.h" +#include + +#ifdef T_MEMCHECK +#include +#endif + +#define DEFAULT_MODULE "noname" + /* Maximum number of file names on the command line */ +#define MAX_NAMED_FILES 5 + +//static char *id_tasm_c = "$Id: tasm.c 1.17 2001/10/23 01:43:20 toma Exp $"; + +/* define all legal directives */ + +char *Dirtab[NDIR] = { + "BYTE", + "ORG", + "EQU", + "END", + "TEXT", + "EJECT", + "WORD", + "LIST", + "NOLIST", + "INCLUDE", + "PAGE", + "NOPAGE", + "TITLE", + "IFDEF", + "ENDIF", + "IFNDEF", + "ELSE", + "DEFINE", + "IF", + "=", /* same as EQU */ + "*=", /* same as ORG */ + "$=", /* same as ORG */ + "ADDINSTR", + "BLOCK", /* Reserve bytes */ + "DS", /* same as BLOCK */ + "DB", /* same as BYTE */ + "DW", /* same as WORD */ + "DEFCONT", /* DEFINE CONTINUATION */ + "CODES", /* Turn on op codes in listing */ + "NOCODES", /* Turn off op codes in listing */ + "SET", /* redefine value of label */ + "EXPORT", /* Export this label and value to file */ + "LSFIRST", /* LS byte first */ + "MSFIRST", /* MS byte first */ + "NSEG", /* Null Segment */ + "CSEG", /* Code Segment */ + "BSEG", /* Bit Segment */ + "XSEG", /* Extern Segment */ + "DSEG", /* Data Segment */ + "SYM", /* Write symbol file */ + "AVSYM", /* Write symbol file in AVOCET format */ + "UNDEF", /* Undefine a macro */ + "MODULE", /* New module starts here */ + "COMMENTCHAR", /* Character to indicate start of comment */ + "LOCALLABELCHAR",/* Character prefix for local labels */ + "CHK", /* Compute checksum and deposit here */ + "FILL", /* Fill memory */ + "ECHO" /* Echo string to console (stderr) */ + }; + +/* Label tables */ +ushort Nlab; /* number of labels in table */ +LABTAB *Labtab[MAXLAB]; /* Pointers to Label data */ + +ushort Lhash[MAXLHASH]; /* label hash table */ + +OPTAB *Optab[MAXINSTR]; +REGTAB *Regtab[MAXREG]; + +ushort Ihash[MAXIHASH]; /* instruction hash table */ + +ushort Num_instr = 0; +ushort Num_reg = 0; +int Seg = NULL_SEG; + +/* last record to write into obj file. Indexed by obj format */ +/* no such record if binary format selected */ +obj_t Obj_format = INTEL_OBJ; + +static int Avsim51 = FALSE; +static int Blockobj = FALSE; +static int Conditional_level = 0; +static dir_t Directive = NOTDIR; +static char *Filenames[MAX_NAMED_FILES]; +static int Include_level = 0; +static int Listflag = TRUE; +static int Long_label_list = FALSE; +static int Nocodes = FALSE; +static int No_end = TRUE; +static ushort Nobj_bytes_per_rec= 0x18; +static int Nexport = 0; +static int Page_linenumber = 0; +static int Pagesize = PAGESIZE; +static int Page_num = 0; +static int Pageflag = FALSE; +static int Show_expanded = FALSE; +static int Total_lines = 0; +static char Title[LINESIZE] = {"Speech Technology Incorporated. "}; +static int Write_symtab; +static FILE *Fp_list; +static int Ls_first = TRUE; /* Arg LS first */ + +int AutoLabelID = 7; +int Skip = FALSE; +int Wordsize = 1; /* one byte per word default */ +int No_arg_shift = FALSE; /* Disable the shift/or on arg values */ +int Ols_first = TRUE; /* Opcodes LS first */ +int Err_check = EC_UNUSED_ARGBYTES | EC_DUP_LABELS; +char Wild_char = '*'; /* Wild character in opcode tables */ +char Local_char = '_'; /* Default first char for local labels */ +char Reg_char = '!'; /* Wild for reg set entry in table */ +char Comment_char1 = ';'; /* First char for comments */ +char Comment_char2 = ';'; /* First char for embedded comments */ +int Ignore_case = FALSE; /* Ignore case of labels */ +int Use_argvalv = FALSE; /* Use the Argvalv vector for args */ +ushort Debug = 0; +ushort Class_mask = 1; /* Default instruction class mask. + * Bit 0 on enables basic instruction set. + * Other bits enable extended instructions, + * if any */ + + +char Module_name[LABLEN] = {DEFAULT_MODULE}; + + + +char Banner[LINESIZE] = {"TASM Assembler. "}; + +char Part_num[8]; + +char *Expr; + +ubyte Argvalv[8]; + + pc_t Pc; + pc_t First_pc; +static pc_t Last_pc; +static pc_t Max_pc; +static pc_t Min_pc; + pc_t END_Pc; /* Option addr provided with END directive */ + +int Line_number; +line_t Linetype; +pass_t Pass; +error_t Errorno; +int Codegen; + +char Errorbuf[LINESIZE]; + +/* file descriptors */ +//static int Fd_object; +int Fd_object; + +FILE *Fp_object; + +/* File names */ + +int Errcnt; +static char *Errmess[] = {"", + "unrecognized directive. ", + "unrecognized instruction. ", + "unrecognized argument. ", + "label value misalligned. ", + "label table overflow ", + "heap overflow on label definition ", + "no such label yet defined. " }; + + +/* Declare pointer to the object code buffer */ +static unsigned char HUGE Opbuffer[MAXMEM+1L]; +static opbuf_t Opbuf = (opbuf_t) Opbuffer; /*lint !e643 */ + +/* Static Functions */ +static pc_t baddr ( pc_t pc ); +static void close_files ( void ); +static ubyte compute_checksum ( pc_t start_addr, pc_t end_addr ); +static void eject ( void ); +static void export ( void ); +static void list ( int linenumber , pc_t pc , ushort nbytes , char *buf ); +static int open_files ( char *files [], int filecnt ); +static void pass1 ( char *source_file ); +static void pass2 ( char *source_file ); +static void pr_hextab ( pc_t pc_lo , pc_t pc_hi ); +static void pr_labels ( int show_no_locals ); +static int process_conditional(dir_t directive, char * arg); +static pc_t waddr ( pc_t pc ); +static void write_symbols ( void ); +static void putop ( pc_t pc, ubyte op ); + +// extern unsigned _stklen = 60000U; + +int +tasm(int argc,char *margv[]) +{ + int jj; + int filecnt; + int arg; + char *files[MAX_NAMED_FILES]; + char errbuf[LINESIZE]; + char option_buf[LINESIZE]; + char *p; + char *s; + clock_t start_time; + int time_flag; + char *argv[MAXARGS]; + int objformat; + int printhextab; + int printlabels; + int show_no_locals = TRUE; /* Don't list local labels */ + + extern int Num_macros_predefined; + extern int Num_macros; + + + + start_time = clock(); + + /* Initialize the file pointer array */ + filecnt = 0; + for (jj = 0; jj < MAX_NAMED_FILES; jj++ ) files[jj] = NULL; + + /* Set defaults for options */ + printlabels = FALSE; + printhextab = FALSE; + Blockobj = FALSE; + + Codegen = FALSE; + Show_expanded = FALSE; + Nocodes = FALSE; + time_flag = FALSE; + Write_symtab = FALSE; + Skip = FALSE; + Conditional_level = 0; + + /* Copy args received from command line (in margv) to argv since + * we need to add to the end of the list and it is not + * safe to add to the end of the vector received from the startup + * routines. + */ + argv[0] = 0; /* Just to keep lint quiet */ + for(jj = 0; jj < argc; jj++) + { + argv[jj] = margv[jj]; + } + + /* Add options from TASMOPTS environment variable if it is defined */ + if((p = getenv("TASMOPTS")) != NULL) + { + s = option_buf; + while(*p) + { + argv[argc++] = s; + while((!isspace(*p)) && (*p != '\0'))*s++ = *p++; + *s++ = '\0'; + while(isspace(*p))p++; + } + } + + /* Get option flags and file names */ + for(arg = 1; arg < argc; arg++) + { + + /* if 1st character of arg is '-' then it is an option flag*/ + if (*argv[arg] == '-'){ + + switch (*(argv[arg]+1)){ + case 'z': /* Debug */ + case 'Z': + Debug = TRUE; + break; + + case 'e': /* print a label table */ + case 'E': + Show_expanded = TRUE; + break; + + case 's': /* write a symbol table */ + case 'S': + Write_symtab = TRUE; + break; + + case 'l': /* print a label table */ + case 'L': + printlabels = TRUE; + /* examine following characters for more selections */ + p = argv[arg]+2; + while(*p){ + if(*p == 'l') Long_label_list = TRUE; + if(*p == 'a') show_no_locals = FALSE; + p++; + } + break; + + case 'h': /* print a hex table of the code */ + case 'H': + printhextab = TRUE; + break; + + case 'i': /* print a hex table of the code */ + case 'I': + Ignore_case = TRUE; + break; + + case 'f': /* Set the memory fill byte */ + case 'F': + /* fill opcode array with specified byte */ + { + ubyte fillbyte; + pc_t pc; + + /* Use the hex value, if provided */ + if((*(argv[arg]+2)) != '\0') + fillbyte = (ubyte)hex_to_bin(argv[arg]+2); + else + fillbyte = 0; + + for(pc = 0; pc <= MAXMEM; pc++) putop(pc,fillbyte); + } + break; + + case 'o': /* Set the number of object bytes per */ + case 'O': /* object record */ + if((*(argv[arg]+2)) != '\0') + Nobj_bytes_per_rec = hex_to_bin(argv[arg]+2); + break; + + case 'c': + case 'C': + /* set Blockobj flag so obj file is written + as a contiguous block */ + Blockobj = TRUE; + break; + + case 'g': + case 'G': + /* set obj output to indicated format */ + if((*(argv[arg]+2)) != '\0') + { + objformat = atoi((argv[arg]+2)); + if((objformat < 0) || (objformat > 4)) + Obj_format = INTEL_OBJ; + else + Obj_format = (obj_t)objformat; + + } + break; + + case 'm': + case 'M': + /* set obj output to MOS Tech format */ + Obj_format = MOSTECH_OBJ; + break; + + case 'b': + case 'B': + /* set obj output to binary format */ + Obj_format = BINARY_OBJ; + /* implies contiguous output */ + Blockobj = TRUE; + + break; + + case 'p': + case 'P': + /* set listing file paging on */ + Pageflag = TRUE; + if((*(argv[arg]+2)) != '\0') + { + Pagesize = atoi((argv[arg]+2)); + if((Pagesize < 5) || (Pagesize > 256)) + Pagesize = PAGESIZE; + } + break; + + case 'q': + case 'Q': + /* Quite, turn listing file off */ + Listflag = FALSE; + break; + + case 'x': + case 'X': + /* Enable extended instruction set (if any). + * If there is a hex digit after the flag then + * use it to set the Class_mask. + * Bits in the class mask enable classes + * of instructions that have the same bit + * set in their class field. + */ + if((*(argv[arg]+2)) != '\0') + Class_mask = hex_val(*(argv[arg]+2)); + else + Class_mask = 0xff; + break; + + case 'a': + case 'A': + /* Turn on selected strict error checking + */ + if((*(argv[arg]+2)) != '\0'){ + Err_check = hex_to_bin(argv[arg]+2); + } + else + Err_check = 0xff; + break; + + case 'd': + case 'D': + /* define a macro */ + macro_save(argv[arg]+2); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + /* read instruction set definition table */ + strcpy(Part_num, argv[arg]+1); + read_table(argv[arg]+1); + break; + + case 't': + case 'T': + /* read instruction set definition table. This is + * an alternate form of the above case where the table + * option is always indicated by a numeric string. + * If a table for the F8 existed and was in TASMF8.TAB + * then 'tasm -tf8' could be used to invoke it. + */ + strcpy(Part_num, argv[arg]+2); + read_table(argv[arg]+2); + break; + + case 'y': + time_flag = TRUE; + break; + + default: + sprintf(errbuf, + "tasm: unknown option flag = %s\n",argv[arg]); + errprt(errbuf); + + break; + } + } + else{ + /* No '-' so take arg as a file name. + * Reject if it is shorter then 3 bytes. This is to + * protect against mistakes in the options like "- b" + * which would result in "b" being interpreted as the + * source file and then the real source file would be + * taken as the list file which would be opened and truncated. + */ + if(strlen(argv[arg]) > 2){ + files[filecnt++] = argv[arg]; + } + else{ + sprintf(errbuf, + "tasm: file name too short (possibly garbled option flag): %s\n", + argv[arg]); + errprt(errbuf); + } + } + } + + /* Show the version of the source file */ +// DEBUG("%s\n", id_tasm_c ); + + errprt(Banner); + errprt(" Version 3.2 September, 2001.\n"); + errprt( + " Copyright (C) 2001 Squak Valley Software\n"); + + /* open files */ + if (open_files(files,filecnt) != SUCCESS) + { + free_all (); + tasmexit(EXIT_FILEACCESS); + } + + + /* initialize things */ + Pc = 0; + Max_pc = 0; + Min_pc = MAXMEM; + Nlab = 0; + Errcnt = 0; + No_end = TRUE; + Num_macros_predefined = Num_macros; + + strcpy(Module_name, DEFAULT_MODULE); /* set to default */ + + /* Write header to list file */ + if(Pageflag)eject(); + + /* Do the first pass. Build the symbol table.*/ + Pass = FIRST; + pass1(SRC_FN); + + sort_labels(); + + errprt("tasm: pass 1 complete.\n"); + + + /* pass 2. Generate code. */ + Pc = 0; + First_pc = Pc; + Pass = SECOND; + Conditional_level = 0; + Skip = FALSE; /* Always start with skip off. + * This protects from an imbalanced + * conditional leaving skip + * on at the end of pass 1. + */ + /* Set the number of macros back to just the ones + * defined at invocation. */ + macro_free (FALSE); + + strcpy(Module_name, DEFAULT_MODULE); /* Reset to default */ + pass2(SRC_FN); + + /* assembly complete. Now take care of any final things like + * generating symbol table, writing last of obj file, etc. + */ + + /* If we get to this point and are still skipping or if we + * are still at a non-zero conditional level then we have a + * problem. + */ + if ((Skip == TRUE) || (Conditional_level > 0)) + { + Skip = FALSE; + strcpy(Errorbuf,""); + errlog("Imbalanced conditional.", ALWAYS); + + } + + + /* if Blockobj flag was set then write the entire obj file now + * as one big block. + */ + if(Blockobj) wrtobj( Min_pc, Max_pc+1, Nobj_bytes_per_rec); + + /* write last object record */ + wrtlastobj(Obj_format); + + /* generate label table if enabled*/ + if(printlabels) pr_labels(show_no_locals); + + /* generate hex opcode table if enabled */ + if(printhextab) pr_hextab( Min_pc, Max_pc+1); + + /* If some labels have been designated for export, then write them + * to the export file */ + if(Nexport) export(); + + /* Write a symbol table to file */ + if(Write_symtab) write_symbols(); + + + if(No_end){ + strcpy(Errorbuf,""); + errlog("No END directive before EOF. ", ALWAYS); + } + + errprt("tasm: pass 2 complete.\n"); + + sprintf(errbuf,"tasm: Number of errors = %d\n",Errcnt); + errprt(errbuf); + listprt(errbuf); + + close_files(); + +#ifdef NEVER + if(time_flag) + { + const clock_t ticksPerSec=(clock_t)CLK_TCK; + clock_t et_ticks; + clock_t et_secs; + clock_t et_hunds; + + /* Compute Elapsed time in seconds and hundredths of seconds. + * Avoid using floating point so we don't bloat TASM. + */ + et_ticks = (clock() - start_time); + et_secs = et_ticks / ticksPerSec; + et_hunds = ((et_ticks % ticksPerSec) * 100)/ticksPerSec; + + if ( et_ticks > 0 ) + { + sprintf(errbuf,"Elapsed time = %ld.%02ld secs lines = %d lines/sec = %ld\n", + et_secs, et_hunds, Total_lines,(Total_lines*ticksPerSec)/(et_ticks)); + } + else + { + sprintf(errbuf,"Elapsed time = 0 secs lines = %d\n", Total_lines); + } + errprt(errbuf); + } +#endif + + /* Free all the malloc'd memory */ + free_all(); + + if(Errcnt){ + return (EXIT_ASMERRORS); + } + + return(EXIT_NORMAL); + + +} + + +/**********************************************************************/ +/* + * Function: free_all() + * + * Description: + * Free all memory allocated for any purpose. + */ +/**********************************************************************/ + +void +free_all() +{ + unsigned int i; + extern char Emptystring[]; + + /* Free all the macros */ + macro_free (TRUE); + + /* Free all the labels */ + for(i=0; i< Nlab; i++) + { + free (GETLABTAB(i)); + } + + /* Free the instruction set table */ + for(i=0; i< Num_instr; i++) + { + free(Optab[i]->instruction); + if(Optab[i]->args != Emptystring) free(Optab[i]->args); + free(Optab[i]); + } + + for(i=0; i< Num_reg; i++) + { + if (Regtab[i] != NULL) free(Regtab[i]); + } + + /* Free the file names */ + for(i = 0; i < MAX_NAMED_FILES; i++) + { + if(Filenames[i] != NULL) free (Filenames[i]); + } +} + +/**********************************************************************/ +/* + * Function: pass1() + * + * Description: + * Do the first pass of assembly. + * Just build the label table. + */ +/**********************************************************************/ + +static void +pass1(char *source_file) +{ + ushort nbytes; /* total number of bytes */ + ushort obytes; /* number of opcode bytes */ + ushort abytes; /* number of argument bytes */ + + char label[LABLEN]; + char inst[LABLEN]; + ulong op_code; + ulong argval; + ushort argc; + char *argv[MAXARGS]; + char errbuf[LINESIZE]; + + char buf[LINESIZE]; + char sbuf[LINESIZE]; + char *pbuf; + int local_line_number; + int i; + dir_t directive; + char include_filename[PATHSIZE]; + int starting_conditional_level; + FILE *fp_source; + + extern int Num_macros; + + DEBUG ("pass1: open %s\n ",source_file); + + starting_conditional_level = Conditional_level; + + fp_source = fopen( source_file, "r"); + if(fp_source == NULL) + { + sprintf(errbuf,"tasm: source file open error on %s\n",source_file); + errprt(errbuf); + tasmexit(EXIT_FILEACCESS); + } + + fname_push( source_file ); /* Save the filename for errlog */ + + Include_level++; + Line_number = local_line_number = 0; + + while(fgets( sbuf, LINESIZE-1, fp_source) != NULL) + { + Line_number = (++local_line_number); + Total_lines++; + + if(Num_macros > 0){ + macro_expand(sbuf,buf); + pbuf = buf; + } + else{ + pbuf = sbuf; + } + + do{ + /* Parse each line to keep the PC up to date so the label + table can be built with proper values for each label */ + pbuf += parse(pbuf,label,inst,&directive,&op_code,&obytes, + &abytes,&argc,argv,&argval); + Directive = directive; /* Save global for EQU detection */ + nbytes = obytes + abytes; + + if(Errorno == ER_NOERR){ + + /* first check for 'ifdef', ifndef, else or 'endif' + and set skip flag accordingly */ + if(Linetype == DIRECTIVE){ + Skip = process_conditional(directive, argv[0]); + } + + if(Skip == FALSE){ + + /* If this line is an org directive then set + * the PC accordingly + */ + if(Linetype == DIRECTIVE){ + switch(directive){ + case ORG: + Pc = (pc_t)val(argv[0]); + break; + case TITLE: + strcpy(Title,argv[0]); + break; + case DEFINE: + macro_save(argv[0]); + break; + case DEFCONT: + macro_append(argv[0]); + break; + case ADDINSTR: + add_instruction(argv[0]); + break; + + + case BLOCK: + case DS: + case FILL: /* data assigned on pass 2 */ + break; + + case NSEG: Seg = NULL_SEG; break; + case CSEG: Seg = CODE_SEG; break; + case BSEG: Seg = BIT_SEG ; break; + case XSEG: Seg = EXTD_SEG; break; + case DSEG: Seg = DATA_SEG; break; + + case SYM: + Write_symtab = TRUE; + if(argc > 0)strcpy(SYM_FN,argv[0]); + break; + case AVSYM: + Write_symtab = TRUE; + Avsim51 = TRUE; + if(argc > 0)strcpy(SYM_FN,argv[0]); + break; + + case MODULE: + strcpy(Module_name, argv[0]); + (void)remquotes(Module_name); + break; + + case COMMENTCHAR: + /* Override default comment character. + * Assume first char of arg is a quote. + */ + Comment_char1 = argv[0][1]; + break; + + case LOCALLABELCHAR: + /* Override default local label prefix character. + * Assume first char of arg is a quote. + */ + Local_char = argv[0][1]; + break; + + default: + /* This is OK */ + break; + } + } + /* if there is a label on this line then put + * it in the table along with its value */ + if(label[0] != '\0'){ + if(Nlab < MAXLAB){ + switch(Linetype){ + case BLANK: + case INSTRUCT: + save_label(label, (expr_t)Pc); + break; + + case DIRECTIVE: + switch(directive){ + case EQU: + /* if this is an EQU directive then + * assign label value. + */ + save_label(label, val(argv[0])); + break; + + case SET: + if((i = find_label(label)) != FAILURE) + GETLABTAB(i)->val = val(argv[0]); + else{ + sprintf(errbuf, + "label must pre-exist for SET. %s", + label); + errlog(errbuf, ALWAYS); + } + break; + + default: + save_label(label, (expr_t)Pc); + break; + + } + break; + + default: + /* OK */ + break; + } + } + else{ + sprintf(Errorbuf,"MaxLab=%d",MAXLAB); + errlog(Errmess[(int)ER_TAB_OVERFLOW], ALWAYS); + } + } /* end if(label) */ + + /* increment the program counter */ + if((Linetype == DIRECTIVE) && + ((directive == BLOCK) || (directive == DS))) + Pc += waddr((pc_t)val(argv[0])); + else + Pc += waddr((pc_t)nbytes); + + /* if this is an INCLUDE directive, then switch files */ + if((Linetype == DIRECTIVE) && (directive == INCLUDE)){ + strcpy(include_filename, argv[0]); + pass1(include_filename); + DEBUG("Return from pass1 (include) %s\n",include_filename); + } + } /* end if (skip) */ + + } + }while(*pbuf); + + } + fclose(fp_source); + fname_pop(); + Include_level--; + + if ( Conditional_level != starting_conditional_level){ + strcpy( Errorbuf, ""); + errlog("Imbalanced conditional.", ALWAYS); + + } + +} + +/**********************************************************************/ +/* + * Function: pass2() + * + * Description: + * Do the second pass of assembly. + * 1. Generate code (object file). + * 2. Generate list file. + * 3. Generate label export file (if any labels indicated for export). + */ +/**********************************************************************/ + +static void +pass2(char *source_file) +{ + int i; + + ushort nbytes; /* total number of bytes */ + ushort obytes; /* number of opcode bytes */ + ushort abytes; /* number of argument bytes */ + + char label[LABLEN]; + char inst[LABLEN]; + ulong op_code; + ulong ultmp; + ulong argval; + ushort argc; + char *argv[MAXARGS]; + char errbuf[LINESIZE]; + char buf[LINESIZE]; + char sbuf[LINESIZE]; + char *pbuf; + int nchar; + ubyte fill_value; + int local_line_number; + pc_t ipc; + pc_t iipc; + ushort jj; + FILE *fp_source; + dir_t directive; + pc_t start_addr; + pc_t end_addr; + char include_filename[PATHSIZE]; + + extern int Num_macros; + extern int Err_check; + + fp_source = fopen(source_file,"r"); + if(fp_source == NULL){ + sprintf(errbuf,"tasm: source file open error on %s\n",source_file); + errprt(errbuf); + tasmexit(EXIT_FILEACCESS); + } + + fname_push( source_file ); /* Save the filename for errlog */ + + + /* increment the include level counter so we know how deep we are*/ + Include_level++; + + /* zero the line_number each time pass2 is called so the line + * number will accurately show the line in each file. + */ + Line_number = local_line_number = 0; + + while(fgets( sbuf, LINESIZE-1, fp_source) != NULL) + { + Line_number = (++local_line_number); + + if(Num_macros > 0){ + macro_expand(sbuf,buf); + pbuf = buf; + } + else{ + pbuf = sbuf; + } + + do{ + nchar = parse(pbuf,label,inst,&directive, &op_code, + &obytes,&abytes,&argc,argv,&argval); + + Directive = directive; /* Save global for EQU detection. */ + nbytes = obytes + abytes; + Last_pc = Pc; + if(nbytes > 0) Codegen = TRUE; + + /* first check for 'ifdef', ifndef, else or 'endif' and + * set skip flag accordingly. + */ + if(Linetype == DIRECTIVE){ + Skip = process_conditional(directive, argv[0]); + } + + if(Skip == FALSE){ + /* Process line according to the line type */ + switch(Linetype){ + + case COMMENT: + case BLANK: + break; + + case DIRECTIVE: + + switch(directive){ + case ORG: + Pc = (pc_t)val(argv[0]); + break; + case BLOCK: + case DS: + break; + + /* Define macros as they are encountered on Pass2 as well + * as pass1 (with a flush inbetween) so ifdef's will + * work correctly for things defined in mid stream. + */ + case DEFINE: + macro_save(argv[0]); + break; + case DEFCONT: + macro_append(argv[0]); + break; + + case FILL: + /* abytes is set by parse for FILL */ + if (argc == 2) fill_value = (ubyte)val(argv[1]); + else fill_value = FILL_DEFAULT; + for (jj = 0; jj < nbytes; jj++) + putop(baddr(Pc)+jj, fill_value); + + break; + + case BYTE: + for(jj = 0; jj < argc; jj++) + { + putop(baddr(Pc)+jj,(ubyte)val(argv[jj])); + } + break; + case WORD: + for(jj = 0; jj < argc; jj++) + { + /* Funny (int) casting here to get lint to not + * worry about the truncation of i on shift left. + */ + if(Ls_first) + { + putop(baddr(Pc)+((ulong)jj<<1) , + (ubyte)((ulong)val(argv[jj]) & 0xff)); + putop(baddr(Pc)+((ulong)jj<<1)+1, + (ubyte)((ulong)val(argv[jj]) >> 8)); + } + else + { + putop(baddr(Pc)+((ulong)jj<<1) , + (ubyte)((ulong)val(argv[jj]) >> 8)); + putop(baddr(Pc)+((ulong)jj<<1)+1, + (ubyte)((ulong)val(argv[jj]) & 0xff)); + } + } + break; + + case CHK: + start_addr = baddr(val(argv[0])); + end_addr = baddr(Pc) - 1; + putop(baddr(Pc), + compute_checksum(start_addr, end_addr)); + break; + + case ECHO: + for (jj = 0; jj < argc; jj++) + errprt( argv[jj] ); + break; + + case TEXT: + for(jj = 0; jj < abytes; jj++) + putop(baddr(Pc)+jj,argv[0][jj]); + break; + + case EQU: + case SET: + if((i = find_label(label)) != FAILURE) + GETLABTAB(i)->val = val(argv[0]); + else + { + strcpy(Errorbuf, label); + errlog("Label must pre-exist for SET:", ALWAYS); + + } + break; + + case EXPORT: + for(jj = 0; jj < argc; jj++) { + if((i = find_label(argv[jj])) != FAILURE){ + Nexport++; + GETLABTAB(i)->flags |= F_EXPORT; + } + else{ + strcpy(Errorbuf, argv[jj]); + errlog("No such label:", ALWAYS); + } + } + break; + + case MODULE: + strcpy(Module_name, argv[0]); + (void)remquotes(Module_name); + break; + + + case TITLE: strcpy(Title,argv[0]); break; + case EJECT: eject(); break; + case LIST: Listflag = TRUE; break; + case NOLIST: Listflag = FALSE; break; + case PAGE: Pageflag = TRUE; break; + case NOPAGE: Pageflag = FALSE; break; + case NOCODES: Nocodes = TRUE; break; + case CODES: Nocodes = FALSE; break; + case LSFIRST: Ls_first = TRUE; break; + case MSFIRST: Ls_first = FALSE; break; + + case END: + No_end = FALSE; + /* Save the address provided */ + /* with the END directive */ + /* to be included in last obj*/ + /* record. */ + if (argc > 0) END_Pc = (pc_t)val(argv[0]); + break; + + default: + /* OK */ + break; + } + + break; + + + case INSTRUCT: + /* instruction */ + + /* insert opcode bytes */ + ipc = baddr(Pc); + if(Ols_first) + { + while((short)(obytes--) > 0) + { + putop(ipc++,(ubyte)(op_code & 0xff)); + ultmp = op_code >> 8; + op_code = ultmp; + } + } + else{ + iipc = baddr(Pc) + obytes; + while((short)(obytes--) > 0) + { + putop(--iipc,(ubyte)(op_code & 0xff)); + ultmp = op_code >> 8; + op_code = ultmp; + ipc++; + } + } + + /* Insert arg bytes. Some (most) rules deposit the + * the args in argval (even multiple arg instructions). + * The newer (preferred) approach is to deposit the + * arg bytes in the vector Argvalv. + */ + + if ( Use_argvalv == TRUE ) + { + jj = 0; + argval = 0; + while((short)(abytes--) > 0) + { + putop(ipc++, Argvalv[jj++]); + } + } + else + { + while((short)(abytes--) > 0) + { + putop(ipc++,(ubyte)(argval & 0xff)); + ultmp = argval >> 8; + argval = ultmp; + } + } + + /* If strict error checking enabled, then complain + * if there is unused data left in argval. + */ + if(Err_check & EC_UNUSED_ARGBYTES) + { + if((argval > 0) && (argval < 0xffff)) + { + sprintf(Errorbuf,"%lx",argval); + errlog("Unused data in MS byte of argument.", + PASS2_ONLY); + } + } + + break; + + default: + break; + } + + /* Send line to list file */ + if((pbuf == buf) || (pbuf == sbuf)) + { + /* First line of this statement */ + if(Show_expanded) + list(Line_number,Pc,nbytes,pbuf); + else + list(Line_number,Pc,nbytes,sbuf); + } + else + { + list(Line_number,Pc,nbytes,"\n"); + } + + /* Make sure label (if any) is matched to this pc + * location unless it is an EQU or SET directive + */ + if(!((Linetype == DIRECTIVE) && + ((directive == EQU) || (directive == SET)))){ + + if((label[0] != '\0') && (Pc != (pc_t)val(label))) + { + strcpy(Errorbuf, label); + errlog(Errmess[(int)ER_MISALLIGN], ALWAYS); + } + } + /* generate error message if any error pending */ + if(Errorno != ER_NOERR) + errlog(Errmess[(int)Errorno], ALWAYS); + + if((Linetype == DIRECTIVE) && + ((directive == BLOCK) || (directive == DS))) + Pc += waddr((pc_t)val(argv[0])); + else + Pc += waddr((pc_t)nbytes); + + + /* if the Blockobj flag is set then suppress output + * of the object records until the end, otherwise + * output if either: + * 1. a jump in the Pc has occured (e.g. .ORG) + * 2. or an .END directive is encountered + */ + + if((Blockobj == FALSE) && + ((Last_pc != (Pc - waddr((pc_t)nbytes))) || + ((Linetype == DIRECTIVE) && (directive == END)))) + { + wrtobj( baddr(First_pc), baddr(Last_pc),Nobj_bytes_per_rec); + First_pc = Pc; + } + + /* If an include statement, then call pass2() recursively */ + if((Linetype == DIRECTIVE) && (directive == INCLUDE)) + { + /* Copy the filename into a different variable, because + * the contents of the buffer pointed to by argv[0] may + * change during the execution of pass2. + */ + strcpy(include_filename, argv[0]); + pass2(include_filename); + } + } /* end if (skip) */ + + /* Send line to list file here if skip was TRUE, but + * show no code assembled. + */ + if(Skip)list(Line_number,Pc,0,sbuf); + + }while(*(pbuf +=nchar));/*keep parsing line until null is reached */ + + } + fclose(fp_source); + fname_pop(); + Include_level--; + +} + +/**********************************************************************/ +/* + * Function: process_conditional() + * + * Description: + * Check this directive for a conditional (IF,IFDEF,IFNDEF,ELSE,ENDIF) + * and set the skip state accordingly. + * + */ +/**********************************************************************/ + +static int +process_conditional(dir_t directive, char *arg0) +{ + +/* Define a macro to set the skip variable. A skip at any + * level should cause a skip. + */ +#define SETSKIPSTATE {skip=FALSE;\ + for(i=1;i<=Conditional_level;i++)\ + if(skip_state[i]==TRUE) skip=TRUE;} + + int i; + static int skip_state[MAX_CONDITIONAL_LEVELS]; + static int skip = FALSE; + + switch(directive){ + case ENDIF: + skip_state[Conditional_level] = FALSE; + Conditional_level--; + SETSKIPSTATE; + break; + + case ELSE: + if (skip_state[Conditional_level] == FALSE) + skip_state[Conditional_level] = TRUE; + else + skip_state[Conditional_level] = FALSE; + + SETSKIPSTATE; + break; + + case IFDEF: + Conditional_level++; + skip_state[Conditional_level] = TRUE; + crush(arg0); + if(macro_get_index(arg0) >= 0) skip_state[Conditional_level] = FALSE; + SETSKIPSTATE; + break; + case IF: + Conditional_level++; + skip_state[Conditional_level] = TRUE; + crush(arg0); + if(val(arg0))skip_state[Conditional_level] = FALSE; + SETSKIPSTATE; + break; + case IFNDEF: + Conditional_level++; + skip_state[Conditional_level] = FALSE; + crush(arg0); + if(macro_get_index(arg0) >= 0) skip_state[Conditional_level] = TRUE; + SETSKIPSTATE; + break; + default: + /* Set skip appropriately for non-conditionals, too. */ + SETSKIPSTATE; + break; + + } + + if (Conditional_level >= MAX_CONDITIONAL_LEVELS) + { + sprintf(Errorbuf,"levels=%d",Conditional_level); + errlog("Max number of nested conditionals exceeded.", + PASS2_ONLY); + + } + + return(skip); +} + + +/**********************************************************************/ +/* + * Function: open_files() + * + * Description: + * Open the object and list files. + * Build file names if they were not all provided on the command + * line. + */ +/**********************************************************************/ + +static int +open_files( +char *files[], /* pointers to file names */ +int filecnt) /* Number of files given */ +{ + + char errbuf[LINESIZE]; + char basename[PATHSIZE]; + char *p; + char *q; + int i; + + /* If not all the files are specified then use the source file + * name with a new extension (.obj for object and .lst for + * listing). + */ + + if(filecnt <= 0){ + errprt("tasm: No files specified.\n"); + errprt(USAGE); + errprt("Option Flags defined as follows:\n"); + errprt(" - Table (48=8048 65=6502 51=8051 85=8085 80=z80)\n"); + errprt(" (68=6800 05=6805 70=TMS7000 96=8096)\n"); + errprt(" (3210=TMS32010 3225=TMS32025)\n"); + errprt(" -t Table (alternate form of above)\n"); + errprt(" -a Assembly control (strict error checking)\n"); + errprt(" -b Produce object in binary format\n"); + errprt(" -c Object file written as a contigous block\n"); + errprt(" -d Define macro\n"); + errprt(" -e Show source lines with macros expanded\n"); + errprt(" -f Fill entire memory space with 'xx' (hex)\n"); + errprt(" -g Obj format (0=Intel,1=MOSTech,2=Motorola,3=bin,4=IntelWord)\n"); + errprt(" -h Produce hex table of the assembled code\n"); + errprt(" -i Ignore case in labels\n"); + errprt(" -l[al] Produce a label table in the listing[l=long,a=all]\n"); + errprt(" -m Produce object in MOS Technology format\n"); + errprt(" -o Define number of bytes per obj record = \n"); + errprt(" -p Page the listing file\n"); + errprt(" -q Quiet, disable the listing file\n"); + errprt(" -s Write a symbol table file\n"); + errprt(" -x Enable extended instruction set (if any)\n"); + + return(FAILURE); + } + + /* extract the base filename from the first file name provided */ + p = files[0]; + q = basename; + while((*p != '.') && (*p != '\0'))*q++ = *p++; + *q++ = '\0'; + + for(i = 0; i < MAX_NAMED_FILES; i++) + { + if((files[i] != NULL) && (i < filecnt)) + { + Filenames[i] = (char *)malloc(strlen(files[i]) + 1); + strcpy(Filenames[i], files[i]); + } + else + { + Filenames[i] = (char *)malloc(strlen(basename) + 5); + strcpy(Filenames[i], basename); + switch(i){ + case 1: strcat(Filenames[i],".obj"); break; + case 2: strcat(Filenames[i],".lst"); break; + case 3: strcat(Filenames[i],".exp"); break; + case 4: strcat(Filenames[i],".sym"); break; + default: errprt("tasm: invalid file count\n"); break; + } + } + + } + /* don't open the source file here since it is opened for each pass */ + +#if 0 + /* open object file. O_MODE ignored in MSDOS (here for UNIX) */ + if(Obj_format == BINARY_OBJ) + Fd_object =open(OBJ_FN,(int)(O_WRONLY|O_CREAT|O_TRUNC|O_BINARY),O_MODE); + else + Fd_object =open(OBJ_FN,(O_WRONLY|O_CREAT|O_TRUNC),O_MODE); + + if(Fd_object < 0) + { + sprintf(errbuf,"tasm: object file open error on %s\n",OBJ_FN); + errprt(errbuf); + return(FAILURE); + } +#endif + + /* open the object file (in TEXT or BINARY mode, as appropriate) */ + if(Obj_format == BINARY_OBJ) + Fp_object = fopen(OBJ_FN,"wb"); + else + Fp_object = fopen(OBJ_FN,"wt"); + + if(Fp_object == NULL) + { + sprintf(errbuf,"tasm: object file open error on %s\n",OBJ_FN); + errprt(errbuf); + return(FAILURE); + } + + + /* open list file */ + Fp_list = fopen(LST_FN,"w"); + if(Fp_list == NULL) + { + sprintf(errbuf,"tasm: list file open error on %s\n",LST_FN); + errprt(errbuf); + return(FAILURE); + } + + /* Increase buffer size for list file */ + if(setvbuf(Fp_list, NULL, _IOFBF, 2048)) + { + errprt("tasm: Cannot increase list file buffer"); + /* not fatal, so just continue. */ + } + + return (SUCCESS); +} + +/**********************************************************************/ +/* + * Function: close_files + * + * Description: + * Close all open files except for the source file(s). + * The source file is closed as needed in pass1/pass2 since + * there may be multiple source files open due to recursive + * includes. + */ +/**********************************************************************/ +static void +close_files() +{ + fclose(Fp_object); + fclose(Fp_list); +} + +/**********************************************************************/ +/* + * Function: list + * + * Description: + * Format a line for the listing and send to the listing file. + * General format is: + * + * 9999 FFFF~ 01 02 03 04 SourceLine + * + * Where: + * 9999 = Line number in current source file + * FFFF = PC at the start of the line + * ~ = Shown only if the source line is skipped due to ifdef, etc. + * 01,02, etc = Opcodes in hex + * SourceLine = Source code line as read from the input file. + */ +/**********************************************************************/ + +#define OBJBYTESPERLINE (4) + +void +list( +int linenumber, /* Line number in current source file */ +pc_t pc, /* PC at start of the line (word address fmt) */ +ushort nbytes, /* Total number of object code bytes to format */ +char *srcbuf) /* Source line */ +{ + + char obuf[LINESIZE]; + char tbuf[4]; + char *p; + char skipc; + ushort bytesThisLine; + pc_t pcb; /* Byte address PC */ + pc_t pcw; /* Word address PC */ + + p = obuf; + pcb = baddr(pc); /* Byte PC */ + pcw = pc; /* Word PC (same if word size = 1 ) */ + + /* If the Nocodes flag is true then do no formatting of the + * source line, just print it as read from the source file. + */ + if(Nocodes) + { + listprt(srcbuf); + return; + } + + /* Show the depth of the include by '+' suffix to the linenumber. + * Don't show more than +++, though. + */ + switch(Include_level){ + case 0: + case 1: + sprintf(p,"%04d ",linenumber); + break; + case 2: + sprintf(p,"%04d+ ",linenumber); + break; + case 3: + sprintf(p,"%04d++ ",linenumber); + break; + default: + sprintf(p,"%04d+++",linenumber); + break; + } + + /* Put a '~' right after the pc if we are skipping this line + * (e.g. ifdef, ifndef, if invoked ). + */ + if(Skip) + skipc = '~'; + else + skipc = ' '; + + switch(nbytes){ + case 0: + sprintf(&obuf[7],"%04lx%c ",pcw,skipc); + break; + + case 1: + sprintf(&obuf[7],"%04lx %02x ",pcw,getop(pcb)); + break; + + case 2: + sprintf(&obuf[7],"%04lx %02x %02x ",pcw,getop(pcb), + getop(pcb+1)); + break; + + case 3: + sprintf(&obuf[7],"%04lx %02x %02x %02x ",pcw, + getop(pcb),getop(pcb+1),getop(pcb+2)); + break; + + case 4: + default: + sprintf(&obuf[7],"%04lx %02x %02x %02x %02x ",pcw, + getop(pcb),getop(pcb+1),getop(pcb+2),getop(pcb+3)); + pcb += 4; /* Set PC to the next byte to be printed */ + break; + + +// No longer support 5 & 6 bytes per line (for more uniformity in output) +#if 0 + case 5: + sprintf(&obuf[7],"%04lx %02x%02x%02x%02x%02x ",pcw, + getop(pcb),getop(pcb+1),getop(pcb+2),getop(pcb+3), + getop(pcb+4)); + break; + + case 6: + sprintf(&obuf[7],"%04lx %02x%02x%02x%02x%02x%02x",pcw, + getop(pcb),getop(pcb+1),getop(pcb+2),getop(pcb+3), + getop(pcb+4),getop(pcb+5)); + pcb += 6; /* Set PC to the next byte. Only needed if more bytes + * are to be printed. */ + break; +#endif +// End disabled block. + + + } + stoupper(obuf); /* Convert Hex to upper case */ + while(*(++p)) /* void */; /* Advance p to end of line thus far */ + while((*p++ = *srcbuf++) != 0) /* void */; /* Put in line just as user typed it */ + + /* Output to list file */ + listprt(obuf); + + /* If we have more bytes than we can get on one line, then + * generate additional lines, 6 bytes per line. + */ + while(nbytes > OBJBYTESPERLINE) + { + nbytes -= OBJBYTESPERLINE; + pcw += waddr(OBJBYTESPERLINE); + + sprintf(&obuf[7],"%04lx%c", pcw, skipc); + + /* Compute number of bytes to output on this line */ + if( nbytes > OBJBYTESPERLINE ) bytesThisLine = OBJBYTESPERLINE; + else bytesThisLine = nbytes; + + while(bytesThisLine--) + { + sprintf(tbuf,"%02x ",getop(pcb++)); + strcat( obuf, tbuf ); + } + + stoupper(obuf); + strcat(obuf,"\n"); + listprt(obuf); + } + + +} + +/**********************************************************************/ +/* + * Function: pr_labels + * Description: + * Format a label table and send to the listing file. + */ +/**********************************************************************/ + + +static void +pr_labels(int show_no_locals) +/* Send label table to list file */ +{ + + ushort i; + char labbuf[LINESIZE]; + char linebuf[LINESIZE]; + char ebuf[LINESIZE]; + char *p; + int type_seg; + int type_local; + int type_export; + int flags; + + listprt("\n"); + listprt("\n"); + listprt("\n"); + + if(Long_label_list){ + + listprt("Type Key: N=NULL_SEG C=CODE_SEG B=BIT_SEG X=EXTD_SEG D=DATA_SEG\n"); + listprt(" L=Local\n"); + listprt(" E=Export\n"); + + listprt("\n"); + listprt("Value Type Label\n"); + listprt("----- ---- ------------------------------\n"); + } + else{ + listprt( + "Label Value Label Value Label Value\n"); + listprt( + "------------------ ------------------ ------------------\n"); + } + + linebuf[0] = '\0'; + for(i = 0; i < Nlab; i++){ + /* Suppress local labels if requested */ + if((GETLABTAB(i)->flags & F_LOCAL) && (show_no_locals))continue; + + p = GETLABTAB(i)->lab; + if(!isprint(*p)){ + sprintf(ebuf,"Corrupt label entry. Val=%lx index=%d\n", + GETLABTAB(i)->val, i); + listprt(ebuf); + continue; + } + + /* Capital X for upper case hex */ + if(Long_label_list){ + flags = GETLABTAB(i)->flags; + type_seg = ' '; + type_local = ' '; + type_export = ' '; + + switch(flags & F_SEG){ + case NULL_SEG: type_seg = 'N'; break; + case CODE_SEG: type_seg = 'C'; break; + case BIT_SEG: type_seg = 'B'; break; + case EXTD_SEG: type_seg = 'X'; break; + case DATA_SEG: type_seg = 'D'; break; + default: /* OK */ break; + } + + if(flags & F_LOCAL) type_local = 'L'; + if(flags & F_EXPORT) type_export = 'E'; + + sprintf(linebuf,"%04lX %c%c%c %-32s\n", GETLABTAB(i)->val, + type_seg, type_local, type_export, GETLABTAB(i)->lab); + listprt(linebuf); + } + else{ + sprintf(labbuf,"%-13s %04lX ",GETLABTAB(i)->lab, GETLABTAB(i)->val); + strcat(linebuf,labbuf); + if((((i+1) % 3) == 0) || ((i+1) == Nlab)){ + strcat(linebuf,"\n"); + listprt(linebuf); + linebuf[0] = '\0'; + } + } + } + listprt("\n"); +} + + +/**********************************************************************/ +/* + * Function: pr_hextab + * Description: + * Send a hexadecimal table of the code to the list file + */ +/**********************************************************************/ + +static void +pr_hextab( +pc_t pc_lo, /* minimum address to output */ +pc_t pc_hi) /* maximum address to output (Program Counter)*/ +{ + ushort i; + int nlines; + pc_t addr; + char linebuf[LINESIZE]; + char *p; + ubyte op; + + /* decrement the max pc since it points to one location + beyond the last byte to output. (see comments + in wrtobj). */ + + /* First test a few error cases */ + if((pc_hi == pc_lo) && (pc_lo > 0))return; + if((pc_hi == pc_lo) && (Codegen == FALSE))return; + if(pc_hi == 0) return; /* No code generated */ + + pc_hi--; + nlines = ((pc_hi - pc_lo) / 16) + 1; + + listprt("\n"); + listprt("ADDR 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F\n"); + listprt("-----------------------------------------------------\n"); + + for(addr = pc_lo; nlines--; addr += 16) + { + sprintf(linebuf,"%04lx ",addr); + p = linebuf; + for(i = 0; i < 16; i++) + { + op = getop(addr+i); + while(*(++p)) /* void */; + sprintf(p," %02x",op); + } + stoupper(linebuf); + strcat(linebuf,"\n"); + listprt(linebuf); + } + listprt("\n"); + listprt("\n"); +} + +/**********************************************************************/ +/* Function : errprt() + * Description : send input buffer to stdout + */ +/**********************************************************************/ + +void +errprt(char *err_mess) +{ + char c; + + while(*err_mess) + { + c = *err_mess++; + putchar(c); + } +} + +/**********************************************************************/ +/* + * Function : lstprt() + * Description : send input buffer to the listing file + */ +/**********************************************************************/ + +void +listprt(char *buf) +{ + +/* Note that the line numbering assumes that each time listprt is + * called a single line is output (which is not necessarily the case). + */ + if(Listflag) + { + fputs(buf,Fp_list); + Page_linenumber++; + if((Pageflag) && (Page_linenumber >= Pagesize))eject(); + } +} + +/**********************************************************************/ +/* Function : eject + * Description : Go to Top-of-Page on the listing file and + * output the banner. + */ +/**********************************************************************/ + +static void +eject(void) +{ + char buf[LINESIZE]; + + Page_num++; + Page_linenumber = 0; + listprt(TOF); + sprintf(buf,"%-30s %-30s page %d\n",Banner,SRC_FN,Page_num); + listprt(buf); + sprintf(buf,"%s\n",Title); + listprt(buf); + listprt("\n"); + +} + +/**********************************************************************/ +/* Function : export + * Description : Export labels designated by the EXPORT directive so + * that they can be + * referenced in other assemblies. + */ +/**********************************************************************/ + +static void +export() +{ + + char errbuf[LINESIZE]; + ushort i; + FILE *fp; + + if((fp = fopen(EXP_FN,"w")) == NULL){ + sprintf(errbuf,"tasm: export file open error on %s\n",EXP_FN); + errprt(errbuf); + return; + + } + + for(i = 0; i < Nlab; i++) + { + if((GETLABTAB(i)->flags) & F_EXPORT) + { + fprintf(fp,"%-16s .EQU $%04x\n", + GETLABTAB(i)->lab, (ushort)GETLABTAB(i)->val); + } + } + + fclose(fp); + +} + + +/**********************************************************************/ +/* Function : write_symbols() + * Description : Write labels and values to a symbol file. + */ +/**********************************************************************/ + +static void +write_symbols(void) +{ + + char errbuf[LINESIZE]; + ushort i; + FILE *fp; + char prefix[4]; + + if((fp = fopen(SYM_FN,"w")) == NULL) + { + sprintf(errbuf,"tasm: symbol file open error on %s\n",SYM_FN); + errprt(errbuf); + return; + + } + + for(i = 0; i < Nlab; i++){ + + if(Avsim51){ + switch(GETLABTAB(i)->flags & F_SEG){ + case NULL_SEG: strcpy(prefix, "N:"); break; + case CODE_SEG: strcpy(prefix, "C:"); break; + case BIT_SEG: strcpy(prefix, "B:"); break; + case EXTD_SEG: strcpy(prefix, "X:"); break; + case DATA_SEG: strcpy(prefix, "D:"); break; + default: /* OK */ break; + } + fprintf(fp,"AS %-16s %s%04x\n", + GETLABTAB(i)->lab, prefix, (ushort)GETLABTAB(i)->val); + } + else{ + fprintf(fp,"%-16s %04x\n", + GETLABTAB(i)->lab, (ushort)GETLABTAB(i)->val); + } + + } + + fclose(fp); + +} + +/**********************************************************************/ +/* + * Function: baddr() + * Description: + * Convert word address to byte address. + * If wordsize is 1 (byte) then this is a null operation. + */ +/**********************************************************************/ + +static pc_t +baddr(pc_t pc) +{ + if(Wordsize == 1) + return(pc); /* 8 bit words */ + else + return(pc << 1); /* 16 bit words */ +} + +/**********************************************************************/ +/* + * Function: waddr() + * Description: + * Convert byte address to word address. + * If wordsize is 1 (byte) then this is a null operation. + */ +/**********************************************************************/ + +static pc_t +waddr( pc_t pc) +{ + if(Wordsize == 1) + return(pc); /* 8 bit words */ + else + /* round up */ + return((pc+1) >> 1); /* 16 bit words */ +} + +/**********************************************************************/ +/* Function: compute_checksum + * Description: + * Compute a simple single byte exclusive OR checksum over the indicated + * address range. + * Assume start_addr and end_addr are byte (not word) addresses. + */ +/**********************************************************************/ + +static ubyte +compute_checksum( pc_t start_addr, pc_t end_addr) +{ + + ubyte checksum; + pc_t i; + + checksum = 0; + + for (i = start_addr; i <= end_addr; i++) + { + checksum = checksum ^ getop ( i ); + } + + return (checksum); +} + + +/**********************************************************************/ +/* Function: isequate + * Description: + * Return TRUE of the current source line is an EQUate statement. + */ +/**********************************************************************/ + +int +isequate( void ) +{ + + if ( (Linetype == DIRECTIVE) && (Directive == EQU)) return (TRUE); + else return (FALSE); + +} + +/**********************************************************************/ +/* + * Function: putop + * Description: + * Write a byte to the memory image. + */ +/**********************************************************************/ + +static void +putop(pc_t pcb, ubyte op) +{ + Opbuf[pcb]=op; + + /* Keep track of the address range written */ + /* Note that Min_pc and Max_pc are always byte addresses. */ + Min_pc = min ( pcb, Min_pc ); + Max_pc = max ( pcb, Max_pc ); +} + +/********************************************************************** + * Function: getop + * Description: + * Fetch a byte from the memory image. + ********************************************************************** + */ + +ubyte +getop(pc_t pcb) +{ + return ( Opbuf[pcb] ); +} + +/* That's all folks. */ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.h b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.h new file mode 100644 index 00000000..4ec8ee7e --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm.h @@ -0,0 +1,417 @@ +/**************************************************************************** + * $Id: tasm.h 1.8 2001/10/23 01:39:39 toma Exp $ + **************************************************************************** + * File: tasm.h + * Description: TASM Constants. + * + * Thomas N. Anderson + * Copyright 1989-2001, Squak Valley Software + */ + +/* Local TASM types */ +typedef long expr_t; /* Expression value */ +typedef unsigned long uexpr_t; /* Unsigned Expression values */ +typedef unsigned long pc_t; /* Program Counter */ +typedef unsigned char *opbuf_t; /* Pointer to op code buffer */ +typedef unsigned char ubyte; + +#include +#include +#include +#include +#include +#include +#include +#include + +/* define unsigned data types */ + +/*********************************************/ +/* Here is the non-portable stuff. Use the right include + * files (etc.) for the appropriate environment. + * (All ifdefs are right here). + */ + +/* If we detect LINUX set the UNIX define and the unsigned types which + * are not always provided + */ +#define UNIX +#ifdef __linux__ +#define UNIX +#define HUGE +#else +typedef unsigned short ushort; +typedef unsigned long ulong; +//#define HUGE huge +#define HUGE +#endif + +#ifdef UNIX + +/* The MSDOS environments typically have io.h to handle the low level IO stuff. + * The "extern C" is appropriate only if CC is being used to build in the + * UNIX environment. + */ +#ifdef __cplusplus +extern "C" { +#endif +int close(int fd); +int read(int fd, char *buf, int nbytes); +/* int open(char * file, int flags, ...); */ +#ifdef __cplusplus +} +#endif + +//#include "sys/file.h" +//#define O_BINARY 0 + +#else + +/* MSDOS - Borland C */ +#include +#include + +#endif +/*********************************************/ + +#define O_MODE (S_IREAD | S_IWRITE) + + +#define TRUE 1 +#define FALSE 0 +#define SAME 0 +#define FAILURE -1 +#define SUCCESS 0 +#define FILL_DEFAULT 0xff /* default value to fill memory */ + /* with when the FILL directive is used. */ + +/* Bit masks for the label attribute flags */ +#define F_EXPORT 0x01 +#define F_SEG 0x0e +#define F_LOCAL 0x10 +#define UNDEF_LABVAL 0x20000L + +/* Segment constants */ +#define NULL_SEG (0 << 1) +#define CODE_SEG (1 << 1) +#define BIT_SEG (2 << 1) +#define EXTD_SEG (3 << 1) +#define DATA_SEG (4 << 1) + +/* TASM exit codes */ +#define EXIT_NORMAL 0 +#define EXIT_ASMERRORS 1 +#define EXIT_MALLOC 2 +#define EXIT_FILEACCESS 3 +#define EXIT_FATALERROR 4 + +/* Top of Form string (for EJECT directive) */ +#define TOF "\014" + +/* delimiter for multiple instruction line */ +#define DELIM '\\' + +/* size of source input line buffer ( and other misc buffers )*/ +#define LINESIZE 512 + +/* size of file names */ +#define PATHSIZE 80 + +/* File name pointers */ +#define SRC_FN Filenames[0] +#define OBJ_FN Filenames[1] +#define LST_FN Filenames[2] +#define EXP_FN Filenames[3] +#define SYM_FN Filenames[4] + +/* Access macro for the label table */ +#define GETLABTAB(index) (Labtab[index]) + +/* Maximum number of files open at one time. */ +#define MAXFILES 20 + +#define USAGE \ +"tasm - [-options] src_file [obj_file [lst_file [exp_file [sym_file]]]]\n" + +#define LOTS_OF_LABELS /* don't bother with a small version */ + +#ifdef LOTS_OF_LABELS +#define MAXLAB 15000 /* maximum number of labels in symbol table */ +#define MAXINSTR 1200 /* maximum number of instructions */ +#else +#define MAXLAB 2000 /* maximum number of labels in symbol table */ +#define MAXINSTR 600 /* maximum number of instructions */ +#endif + +#define MAXARGS 128 /* maximum number of args for inst or directive */ +#define LABLEN 32 /* maximum number of characters in label +1 */ +#define MAXREG 32 /* maximum number of register set entries */ +#define MAXMEM 0xffff /* maximum number of bytes in ROM (opbuf) */ +#define PAGESIZE 63 /* lines per page on listing file */ +#define MAX_CONDITIONAL_LEVELS 32 +#define MAXIHASH 1024 /* maximum size of instruction hash table. + Actually, just one element per letter + of the alphabet is used.*/ +#define MAXLHASH 64 /* Maximum size of label hash table. + * One element per letter (upper and lower case). + */ + +#define HASHKEY(p) (((*p & 0x1f) << 5) | (*(p+1)&0x1f)) + +/* The macros min and max (in stdlib.h) are not defined in the + * c++ case (because of the desire to minimize the side effects + * associated with macros). Here are the preferred definintions: + */ +#ifdef __cplusplus +inline int min(int i, int j) + { + return i < j ? i:j; + } + +inline int max(int i, int j) + { + return i > j ? i:j; + } +#else + +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#endif + +#endif + +/* Structure for storing instruction set definition */ +typedef struct{ + char *instruction; /* pointer to instruction mnemonic */ + char *args; /* pointer to argument description */ + ulong opcode; /* Opcode */ + ubyte obytes; /* Number of bytes of opcode */ + ubyte abytes; /* Number of bytes of args */ + ushort modop; /* Modifier operation (for special cases)*/ + ubyte iclass; /* Instruction set class (for extended instr)*/ + ubyte shift; /* bits to shift first argval */ + ulong bor; /* mask to OR first argval with */ + ubyte same_inst; /* Set to TRUE if instruction matches previous */ +}OPTAB; + +/* Structure for storing register set definitions */ +typedef struct{ + char *reg; /* pointer to instruction mnemonic */ + ulong opcode; /* Opcode mask (ORd into instruction) */ + ubyte iclass; /* Instruction set class (for extended instr)*/ +}REGTAB; + +/* Structure for storing label data */ +typedef struct{ + expr_t val; /* Label value */ + ushort flags; /* Label flags */ + char lab[2]; /* Label string (min size; + malloc may extend buffer area */ +}LABTAB; + +#define FLUSHE fflush(stderr) + +#define DEBUG(f,d) {if(Debug){fprintf(stderr,f,d); FLUSHE;}} +#define DEBUG2(f,d,e) {if(Debug){fprintf(stderr,f,d,e); FLUSHE;}} +#define DEBUG3(f,d,e,g) {if(Debug){fprintf(stderr,f,d,e,g); FLUSHE;}} +#define DEBUG4(f,d,e,g,h) {if(Debug){fprintf(stderr,f,d,e,g,h); FLUSHE;}} +#define DEBUG5(f,d,e,g,h,i) {if(Debug){fprintf(stderr,f,d,e,g,h,i);FLUSHE;}} + +/* Directive constants */ +/* Note that NDIR must be the last enumerated item (indicating + * total number of items in the list). + */ +typedef enum {NOTDIR=-1, + BYTE, ORG, EQU, END, + TEXT, EJECT, WORD, LIST, + NOLIST, INCLUDE,PAGE, NOPAGE, + TITLE, IFDEF, ENDIF, IFNDEF, + ELSE, DEFINE, IF, EQU2, + ORG2, ORG3, ADDINSTR,BLOCK, + DS, DB, DW, DEFCONT, + CODES, NOCODES,SET, EXPORT, + LSFIRST,MSFIRST,NSEG, CSEG, + BSEG, XSEG, DSEG, SYM, + AVSYM, UNDEF, MODULE, COMMENTCHAR, + LOCALLABELCHAR, CHK, FILL, ECHO, NDIR} dir_t; + +/* Error codes */ +typedef enum{ + ER_NOERR = 0, /* No error */ + ER_BADDIR = 1, /* Bad directive */ + ER_BADINST, /* Bad instruction */ + ER_BADARG, /* Bad argument */ + ER_MISALLIGN, /* Label misallign */ + ER_TAB_OVERFLOW, /* label table overflow */ + ER_HEAP_OVERFLOW, /* heap overflow */ + ER_NO_LABEL}error_t; /* No such label yet defined */ + + +/* Line type constants */ +typedef enum { + UNKNOWN = 0, /* Unknown line type */ + COMMENT, /* Comment line */ + DIRECTIVE, /* Assembler directive line */ + INSTRUCT, /* Instruction line */ + BLANK} line_t; /* Blank line */ + +/* assembler pass */ +typedef enum{ + FIRST = 1, + SECOND} pass_t; + +/* Output control modes for errlog() */ +typedef enum {ALWAYS, PASS2_ONLY} errout_t; + +/* Token Types */ +typedef enum { + TOK_VOID, + TOK_BINOP, + TOK_UNOP, + TOK_VAL, + TOK_RPAREN, + TOK_LPAREN} tok_t; + +typedef enum { + UNDEFTOKEN=-1, + EOL, + PLUS, + MINUS, + MULTIPLY, + DIVIDE, + LABEL, + LITERAL, + LPAREN, + RPAREN, + PC, + MODULO, + TILDE, + EQUAL, + LESSTHAN, + GREATERTHAN, + GEQUAL, + LEQUAL, + SHIFTR, + SHIFTL, + BINOR, + BINEOR, + BINAND, + CHAR, + SPACE, + NOTEQUAL, + LOGICALNOT} ptok_t; + +/* Error checking bit masks */ +#define EC_OUTER_PAREN 0x01 +#define EC_UNUSED_ARGBYTES 0x02 +#define EC_DUP_LABELS 0x04 +#define EC_NON_UNARY 0x08 + +/* Object file types */ +typedef enum {INTEL_OBJ=0, + MOSTECH_OBJ, + MOTOROLA_OBJ, + BINARY_OBJ, + INTELWORD_OBJ} obj_t; + + +/* Define just the NOP rule here (since it is needed by modules other than + * rules.c). The rest are local to rules.c. + */ +#define NOTOUCH (('N' << 8) | 'O') + + + +/* Prototypes */ + +/* tasmmain.c */ +int main (int argc, char **argv ); +void tasmexit (int exit_code ); + +/* tasm.c */ +int tasm ( int argc, char **argv ); +void errprt ( char *err_mess ); +void listprt ( char *buf ); +int isequate ( void ); +void free_all ( void ); +ubyte getop ( pc_t pcx); + +/* str.c */ +int search ( char *p , char *s ); +void replace ( char *target , char *psearch , char *preplace ); +void stoupper ( char *s ); +void crush ( char *s ); +int remquotes ( char *s ); +int strget ( char *ptarget , char *psource ); +ulong lhex_to_bin ( char *hex_string ); +ushort hex_to_bin ( char *hex_string ); +ushort hex_val ( char hex_digit ); +void sort_labels ( void ); +int find_comment ( char s []); +int inquotes ( char *s , int pos ); + +/* parse.c */ +int parse ( char *buf, + char *label, + char *inst, + dir_t *directive, + ulong *op_code, + ushort *obytes, + ushort *abytes, + ushort *argc, + char **argv , + ulong *argval ); + +/* macro.c */ +void macro_expand ( char *src , char *target ); +int macro_get_index ( char *macro_name); +void macro_save ( char *macro_name ); +void macro_append ( char *s ); +void macro_free ( int freeAll ); + +expr_t val ( char *expr_buf ); +void read_table ( char *pn ); +void add_instruction ( char *s ); +void errlog ( char *err_mess , errout_t output_mode ); + +/* rules.c */ +void rules( + ushort modop, + ulong *opcode, + ushort *obytes, + ushort *abytes, + ulong *argval, + pc_t pcx, + ushort argc, + char **argv, + ubyte shift, + ulong bor); + +/* lookup.c */ +dir_t dir_lookup ( char *directive ); +error_t inst_lookup(char *inst, + char *args, + ulong *op_code, + ushort *obytes, + ushort *abytes, + ushort *modop, + ubyte *shift, + ulong *bor, + ushort *argc, + char **argv); +void save_label ( char *label , expr_t val ); +int find_label ( char *label ); + +/* wrtobj.c */ +void wrtobj ( pc_t firstpc, pc_t lastpc, ushort bytes_per_rec); +void wrtlastobj ( obj_t obj_type ); + +/* fname.c */ +void fname_push ( char * fname ); +void fname_pop ( void ); +char *fname_get ( void ); + + +/* That's all folks */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm32lnx b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm32lnx new file mode 100644 index 00000000..659a9c4a Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasm32lnx differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/tasmmain.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasmmain.c new file mode 100644 index 00000000..35a11d40 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/tasmmain.c @@ -0,0 +1,68 @@ +/**************************************************************************** + * $Id: tasmmain.c 1.3 1997/11/15 13:09:09 toma Exp $ + **************************************************************************** + * File: tasmmain.c + * + * Table Driven Absolute Assembler. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997 Squak Valley Software. + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * See rlog for revision history. + * + * + */ + +//static char *id_tasmmain_c = "$Id: tasmmain.c 1.3 1997/11/15 13:09:09 toma Exp $"; + +#include "tasm.h" +#include + +static jmp_buf Jump_buffer; /* State information from return point */ + + +/* + * This is just a top level main() to call the tasm() function + * which does all the work. main was seperated from tasm() so + * that tasm() can be called by the WinMain for the windows version. + * + */ + +//void + +int main(int argc, char *argv[]) +{ + int exit_code; + + /* Setup the jump buffer for fatal exits */ + + exit_code = setjmp ( Jump_buffer ); + if ( exit_code ) { + /* A longjmp has occurred. A fatal error must have been encountered */ + exit ( exit_code ); + + } + + /* Pass all the args just as received. */ + exit_code = tasm (argc, argv); + + + exit(exit_code); + +} + +void +tasmexit ( int exit_code ) +{ + + free_all(); + longjmp ( Jump_buffer, exit_code ); + +} diff --git a/branches/dwg/LSource/src/tasm-src-3.2/Src/wrtobj.c b/branches/dwg/LSource/src/tasm-src-3.2/Src/wrtobj.c new file mode 100644 index 00000000..2a546c54 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/Src/wrtobj.c @@ -0,0 +1,226 @@ +/**************************************************************************** + * $Id: wrtobj.c 1.5 2001/09/23 15:17:25 toma Exp $ + **************************************************************************** + * File: wrtobj.c + * + * Description: + * Modules to write object records for TASM, the table driven assembler. + * + * Copyright 1985-1995 Speech Technology Incorporated. + * Copyright 1997-2001 Squak Valley Software. + * Restrictions apply to the duplication of this software. + * See the COPYRIGH.TXT file on this disk for restrictions. + * + * Thomas N. Anderson + * Squak Valley Software + * 837 Front Street South + * Issaquah, WA 98027 + * + * + * See rlog for history. + */ + +//static char *id_wrtobj_c = "$Id: wrtobj.c 1.5 2001/09/23 15:17:25 toma Exp $"; + +/* INCLUDES */ +#include "tasm.h" + +#ifdef T_MEMCHECK +#include +#endif + +/* EXTERNALS */ +extern ushort Debug; + +/* + * Function: wrtobj() + * + * Description: + * Write the object code to the object file. + * Write in the object format selected on the command line (Intel + * hex as default). + * + */ + +void +wrtobj( +pc_t firstpc, /* Byte address of the first object byte */ +pc_t lastpc, /* Byte address of the last object byte + 1 */ +ushort bytes_per_rec) /* Number of bytes per hex record */ +{ + ushort i; + ushort checksum; + ushort rec_type; + ushort nbytes; + char buf[LINESIZE]; + char *p; + ubyte op; + pc_t pc; + + extern obj_t Obj_format; + extern FILE *Fp_object; + extern pc_t First_pc; + extern int Codegen; + + DEBUG2("wrtobj: %lx %lx\n",firstpc, lastpc); + + /* Make sure we actually generated some code. */ + if((lastpc == firstpc) && (First_pc > 0))return; + if((lastpc == firstpc) && (Codegen == FALSE))return; + + pc = firstpc; + + if(Obj_format == BINARY_OBJ) + { + while(pc < lastpc) + { + op = getop(pc++); + fwrite((char *)&op,1,1,Fp_object); + } + + } + else + { + + while(pc < lastpc) + { + nbytes = (ushort)(lastpc - pc); + if(nbytes > bytes_per_rec)nbytes = bytes_per_rec; + if(nbytes == 0)return; + + rec_type = 0; + checksum = nbytes + rec_type + (ushort)(pc & 0xff) + + (ushort)((pc >> 8) & 0xff); + p = buf; + + switch (Obj_format){ + case MOSTECH_OBJ: + sprintf(buf,";%02X%04lX",nbytes,pc); + break; + + case INTEL_OBJ: + sprintf(buf,":%02X%04lX%02X",nbytes,pc,rec_type); + break; + + case INTELWORD_OBJ: + /* Same as INTEL_OBJ, but convert PC to a word address */ + sprintf(buf,":%02X%04lX%02X",nbytes,(pc>>1),rec_type); + break; + + case MOTOROLA_OBJ: + sprintf(buf,"S1%02X%04lX",(nbytes+3),pc); + break; + + /* Should not get here (handled above). Put here for lint */ + case BINARY_OBJ: + break; + + default: + errlog("Invalid Object file type.", PASS2_ONLY); + break; + + } + + for(i = 0; i < nbytes; i++) + { + op = getop(pc++); + checksum += op; + while(*(++p)) /* void */; + sprintf(p,"%02X",op); + } + + while(*(++p)) /* void */ ; + + switch (Obj_format){ + case MOSTECH_OBJ: + sprintf(p,"%04X\n",checksum); + break; + + case INTELWORD_OBJ: + case INTEL_OBJ: + /* For Intel we need to negate the checksum and mask. + * Invert and add one (instead of negate) since we are + * using unsigned types. + */ + checksum = ((~checksum)+1) & 0xff; + sprintf(p,"%02X\n",checksum); + break; + + case MOTOROLA_OBJ: + checksum = (~((ushort)checksum+3)) & 0xff; + sprintf(p,"%02X\n",checksum); + break; + + /* Just for completness */ + case BINARY_OBJ: + break; + + default: + errlog("Invalid Object file type.", PASS2_ONLY); + break; + } + /* Advance the pointer to the end */ + /* just so we can compute the size of */ + /* the buffer. */ + while(*(++p)) /* void */ ; + + fwrite(buf,1,(p-buf),Fp_object); + } + } +} + +/* + * Function: wrtlastobj() + * + * Description: + * Write the last Object record. + * If binary output then do nothing, otherwise + * generate the record suitable for the object format. + * + * S9 with address provided by B Provo + */ + +void wrtlastobj(obj_t obj_format) +{ + ushort checksum; + ushort nbytes = 3; /* Motorola S9 record has only 3 data bytes */ + char buf[LINESIZE]; + + /* last record to write into obj file. Indexed by obj format */ + /* no such record if binary format selected */ + static char *last_obj_rec[5] = + {":00000001FF\n", /* INTEL format */ + ";00\n", /* MOS Tech format */ + "S9030000FC\n", /* MOTOROLA format */ + "", /* Binary (not used) */ + ":00000001FF\n"}; /* INTEL-WORD format */ + + extern FILE *Fp_object; + extern pc_t END_Pc; + + switch (obj_format){ + /* These are a fixed format for now */ + case MOSTECH_OBJ: + case INTEL_OBJ: + case INTELWORD_OBJ: + fwrite(last_obj_rec[(int)obj_format],1, + strlen(last_obj_rec[(int)obj_format]), Fp_object); + break; + + case MOTOROLA_OBJ: + /* If an address was specified with the END */ + /* directive then apply it now */ + + checksum = nbytes + (ushort)(END_Pc >> 8) + (ushort)(END_Pc & 0xff); + checksum = (0xffff - checksum) & 0xff; + sprintf(buf,"S9%02X%04X%02X\n",nbytes,(int)END_Pc,checksum); + fwrite(buf, 1, strlen(buf), Fp_object); + break; + + case BINARY_OBJ: + default: + break; + } +} + +/* that's all folks */ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm.exe b/branches/dwg/LSource/src/tasm-src-3.2/tasm.exe new file mode 100644 index 00000000..f7c733cc Binary files /dev/null and b/branches/dwg/LSource/src/tasm-src-3.2/tasm.exe differ diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm05.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm05.tab new file mode 100644 index 00000000..61e2972c --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm3210.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm3210.tab new file mode 100644 index 00000000..88dbddd5 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm3225.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm3225.tab new file mode 100644 index 00000000..6535309a --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 ;, + +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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm48.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm48.tab new file mode 100644 index 00000000..c241a0ff --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm51.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm51.tab new file mode 100644 index 00000000..40fc3a56 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm65.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm65.tab new file mode 100644 index 00000000..b30b4d20 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm68.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm68.tab new file mode 100644 index 00000000..c3543c5a --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 */ + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm70.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm70.tab new file mode 100644 index 00000000..7f8cf218 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm80.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm80.tab new file mode 100644 index 00000000..058fa145 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm85.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm85.tab new file mode 100644 index 00000000..33a1bf5b --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + diff --git a/branches/dwg/LSource/src/tasm-src-3.2/tasm96.tab b/branches/dwg/LSource/src/tasm-src-3.2/tasm96.tab new file mode 100644 index 00000000..25268138 --- /dev/null +++ b/branches/dwg/LSource/src/tasm-src-3.2/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 + +