emu8051-2.0.1/0000755000175400017500000000000012313352716007626 500000000000000emu8051-2.0.1/doc/0000755000175400017500000000000012313352716010373 500000000000000emu8051-2.0.1/doc/Makefile.am0000644000175400017500000000026212313352657012353 00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in man1_MANS = emu8051.man EXTRA_DIST = $(man1_MANS) CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in emu8051-2.0.1/doc/Makefile.in0000644000175400017500000003436112313352710012361 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = doc DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } man1dir = $(mandir)/man1 am__installdirs = "$(DESTDIR)$(man1dir)" NROFF = nroff MANS = $(man1_MANS) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ man1_MANS = emu8051.man EXTRA_DIST = $(man1_MANS) CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu doc/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-man1: $(man1_MANS) @$(NORMAL_INSTALL) @list1='$(man1_MANS)'; \ list2=''; \ test -n "$(man1dir)" \ && test -n "`echo $$list1$$list2`" \ || exit 0; \ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \ { for i in $$list1; do echo "$$i"; done; \ if test -n "$$list2"; then \ for i in $$list2; do echo "$$i"; done \ | sed -n '/\.1[a-z]*$$/p'; \ fi; \ } | while read p; do \ if test -f $$p; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; echo "$$p"; \ done | \ sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \ sed 'N;N;s,\n, ,g' | { \ list=; while read file base inst; do \ if test "$$base" = "$$inst"; then list="$$list $$file"; else \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \ fi; \ done; \ for i in $$list; do echo "$$i"; done | $(am__base_list) | \ while read files; do \ test -z "$$files" || { \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \ done; } uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS)'; test -n "$(man1dir)" || exit 0; \ files=`{ for i in $$list; do echo "$$i"; done; \ } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \ -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(MANS) installdirs: for dir in "$(DESTDIR)$(man1dir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-man install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-man1 install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-man uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am install-info \ install-info-am install-man install-man1 install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am uninstall-man \ uninstall-man1 # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/doc/emu8051.man0000644000175400017500000000254012313352657012121 00000000000000.TH EMU8051 1 "May 2004" "emu8051" "User's Manual" .SH NAME emu8051 \- Simulator/emulator for the Intel 8051 family of microcontrollers .SH SYNOPSIS .B emu8051 [\fIOPTION\fR]... [\fIFILENAME\fR] .SH DESCRIPTION \fBemu8051\fR is a simulator/emulator for the Intel 8051 family of microcontrollers. It is available in two versions: a console (text-only) version and a graphical version (using the GTK+ toolkit). This is an Open-Source project. The program can load Intel HEX files. Once loaded, a program can be run (it will run indefinitely or until a breakpoint is encountered). You can also use the STEP button to execute only a single instruction at a time and see the effects on registers and memory. It is written in C++, and uses Perl scripts to generate automatically C++ functions corresponding to each assembly instruction of the 8051 microcontroller. .SH "OPTIONS" .TP \fB\-h\fR display usage and exit .TP \fB\-version\fR output version information and exit .SH CREDITS \fBemu8051\fR was originally written by Jonathan St-André, Hugo Villeneuve and Pascal Fecteau. .SH COPYRIGHT \fBemu8051\fR is free; anyone may redistribute it to anyone under the terms stated in the GNU General Public License. A copy of the license is included in the \fBemu8051\fR distribution. You can also browse it online at .I http://www.gnu.org/copyleft/gpl.html emu8051-2.0.1/src/0000755000175400017500000000000012313352716010415 500000000000000emu8051-2.0.1/src/cli/0000755000175400017500000000000012313352716011164 500000000000000emu8051-2.0.1/src/cli/parser.c0000644000175400017500000015546712313352716012566 00000000000000/* A Bison parser, made by GNU Bison 2.5. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 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 . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output. */ #define YYBISON 1 /* Bison version. */ #define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Using locations. */ #define YYLSP_NEEDED 0 /* Copy the first part of user declarations. */ /* Line 268 of yacc.c */ #line 1 "parser.y" #include #include #include #include #include "config.h" #include "log.h" #include "menu.h" #include "memory.h" #include "timers.h" #include "memory.h" #include "cpu8051.h" /* int yydebug = 1; */ /* To get rid of compiler warning. */ int yylex(); int yyerror(const char *str) { fprintf(stderr,"error: %s\n", str); return 0; } /* Line 268 of yacc.c */ #line 99 "parser.c" /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 #endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE # define YYERROR_VERBOSE 1 #else # define YYERROR_VERBOSE 0 #endif /* Enabling the token table. */ #ifndef YYTOKEN_TABLE # define YYTOKEN_TABLE 0 #endif /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUMBER = 258, WORD = 259, TOK_ENTER = 260, TOK_ALL = 261, TOK_SB = 262, TOK_RB = 263, TOK_DB = 264, TOK_DE = 265, TOK_DI = 266, TOK_DP = 267, TOK_DR = 268, TOK_HELP = 269, TOK_RUN = 270, TOK_RST = 271, TOK_RST_TIMER = 272, TOK_STEP = 273, TOK_UNASM = 274, TOK_MOD_EXT = 275, TOK_MOD_INT = 276, TOK_MOD_PROG = 277, TOK_MOD_REG = 278, TOK_QUIT = 279, TOK_A = 280, TOK_B = 281, TOK_C = 282, TOK_D = 283 }; #endif /* Tokens. */ #define NUMBER 258 #define WORD 259 #define TOK_ENTER 260 #define TOK_ALL 261 #define TOK_SB 262 #define TOK_RB 263 #define TOK_DB 264 #define TOK_DE 265 #define TOK_DI 266 #define TOK_DP 267 #define TOK_DR 268 #define TOK_HELP 269 #define TOK_RUN 270 #define TOK_RST 271 #define TOK_RST_TIMER 272 #define TOK_STEP 273 #define TOK_UNASM 274 #define TOK_MOD_EXT 275 #define TOK_MOD_INT 276 #define TOK_MOD_PROG 277 #define TOK_MOD_REG 278 #define TOK_QUIT 279 #define TOK_A 280 #define TOK_B 281 #define TOK_C 282 #define TOK_D 283 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 293 of yacc.c */ #line 29 "parser.y" int number; char *string; /* Line 293 of yacc.c */ #line 198 "parser.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif /* Copy the second part of user declarations. */ /* Line 343 of yacc.c */ #line 210 "parser.c" #ifdef short # undef short #endif #ifdef YYTYPE_UINT8 typedef YYTYPE_UINT8 yytype_uint8; #else typedef unsigned char yytype_uint8; #endif #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; #elif (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) typedef signed char yytype_int8; #else typedef short int yytype_int8; #endif #ifdef YYTYPE_UINT16 typedef YYTYPE_UINT16 yytype_uint16; #else typedef unsigned short int yytype_uint16; #endif #ifdef YYTYPE_INT16 typedef YYTYPE_INT16 yytype_int16; #else typedef short int yytype_int16; #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned int # endif #endif #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(msgid) dgettext ("bison-runtime", msgid) # endif # endif # ifndef YY_ # define YY_(msgid) msgid # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YYUSE(e) ((void) (e)) #else # define YYUSE(e) /* empty */ #endif /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint # define YYID(n) (n) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int YYID (int yyi) #else static int YYID (yyi) int yyi; #endif { return yyi; } #endif #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's `empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* ! defined yyoverflow || YYERROR_VERBOSE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yytype_int16 yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ while (YYID (0)) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ while (YYID (0)) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 4 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 99 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 29 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 15 /* YYNRULES -- Number of rules. */ #define YYNRULES 44 /* YYNRULES -- Number of states. */ #define YYNSTATES 88 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 283 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28 }; #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ static const yytype_uint8 yyprhs[] = { 0, 0, 3, 6, 9, 12, 13, 15, 17, 19, 21, 23, 25, 27, 29, 31, 33, 35, 37, 41, 44, 48, 51, 55, 58, 63, 68, 73, 76, 81, 86, 91, 96, 99, 102, 106, 109, 112, 116, 120, 124, 128, 131, 136, 140 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { 30, 0, -1, 30, 31, -1, 1, 5, -1, 30, 5, -1, -1, 32, -1, 33, -1, 34, -1, 35, -1, 36, -1, 40, -1, 37, -1, 38, -1, 41, -1, 39, -1, 42, -1, 43, -1, 8, 3, 5, -1, 8, 5, -1, 8, 6, 5, -1, 7, 5, -1, 7, 3, 5, -1, 9, 5, -1, 10, 3, 3, 5, -1, 11, 3, 3, 5, -1, 12, 3, 3, 5, -1, 13, 5, -1, 20, 3, 3, 5, -1, 21, 3, 3, 5, -1, 22, 3, 3, 5, -1, 23, 4, 3, 5, -1, 24, 5, -1, 15, 5, -1, 15, 3, 5, -1, 14, 5, -1, 16, 5, -1, 17, 25, 5, -1, 17, 26, 5, -1, 17, 27, 5, -1, 17, 28, 5, -1, 18, 5, -1, 19, 3, 3, 5, -1, 19, 3, 5, -1, 19, 5, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { 0, 50, 50, 51, 55, 56, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 86, 92, 98, 106, 113, 121, 129, 135, 141, 149, 157, 163, 169, 175, 182, 190, 196, 204, 211, 216, 221, 226, 231, 238, 245, 250, 256 }; #endif #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "NUMBER", "WORD", "TOK_ENTER", "TOK_ALL", "TOK_SB", "TOK_RB", "TOK_DB", "TOK_DE", "TOK_DI", "TOK_DP", "TOK_DR", "TOK_HELP", "TOK_RUN", "TOK_RST", "TOK_RST_TIMER", "TOK_STEP", "TOK_UNASM", "TOK_MOD_EXT", "TOK_MOD_INT", "TOK_MOD_PROG", "TOK_MOD_REG", "TOK_QUIT", "TOK_A", "TOK_B", "TOK_C", "TOK_D", "$accept", "start", "command", "breakpoint_clr", "breakpoint_set", "breakpoint_display", "dump_mem", "display_regs", "modify", "quit", "run", "help", "reset", "step", "unasm", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { 0, 29, 30, 30, 30, 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 32, 32, 32, 33, 33, 34, 35, 35, 35, 36, 37, 37, 37, 37, 38, 39, 39, 40, 41, 41, 41, 41, 41, 42, 43, 43, 43 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ static const yytype_uint8 yyr2[] = { 0, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 2, 3, 2, 4, 4, 4, 2, 4, 4, 4, 4, 2, 2, 3, 2, 2, 3, 3, 3, 3, 2, 4, 3, 2 }; /* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { 0, 0, 0, 3, 1, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 6, 7, 8, 9, 10, 12, 13, 15, 11, 14, 16, 17, 0, 21, 0, 19, 0, 23, 0, 0, 0, 27, 35, 0, 33, 36, 0, 0, 0, 0, 41, 0, 44, 0, 0, 0, 0, 32, 22, 18, 20, 0, 0, 0, 34, 37, 38, 39, 40, 0, 43, 0, 0, 0, 0, 24, 25, 26, 42, 28, 29, 30, 31 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { -1, 2, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -3 static const yytype_int8 yypact[] = { 0, -2, 25, -3, -3, -3, -1, 47, 26, 3, 48, 56, 57, 58, 51, 59, 1, 60, 52, 63, 64, 65, 66, 67, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, 68, -3, 69, -3, 70, -3, 73, 74, 75, -3, -3, 76, -3, -3, 77, 78, 79, 80, -3, 55, -3, 83, 84, 85, 86, -3, -3, -3, -3, 87, 88, 89, -3, -3, -3, -3, -3, 90, -3, 91, 92, 93, 94, -3, -3, -3, -3, -3, -3, -3, -3 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3, -3 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -6 static const yytype_int8 yytable[] = { -5, 1, 37, 3, 38, -5, 43, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 4, 51, 52, 53, 54, 5, 42, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 39, 44, 40, 41, 48, 56, 49, 57, 74, 45, 75, 0, 46, 47, 50, 55, 58, 59, 60, 0, 61, 0, 62, 63, 64, 65, 66, 67, 68, 0, 0, 69, 70, 71, 72, 73, 76, 77, 78, 79, 0, 0, 80, 81, 82, 83, 84, 85, 86, 87 }; #define yypact_value_is_default(yystate) \ ((yystate) == (-3)) #define yytable_value_is_error(yytable_value) \ YYID (0) static const yytype_int8 yycheck[] = { 0, 1, 3, 5, 5, 5, 3, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 0, 25, 26, 27, 28, 5, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 3, 3, 5, 6, 3, 3, 5, 5, 3, 3, 5, -1, 5, 5, 5, 5, 3, 3, 3, -1, 4, -1, 5, 5, 5, 5, 3, 3, 3, -1, -1, 5, 5, 5, 5, 5, 3, 3, 3, 3, -1, -1, 5, 5, 5, 5, 5, 5, 5, 5 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { 0, 1, 30, 5, 0, 5, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 3, 5, 3, 5, 6, 5, 3, 3, 3, 5, 5, 3, 5, 5, 25, 26, 27, 28, 5, 3, 5, 3, 3, 3, 4, 5, 5, 5, 5, 3, 3, 3, 5, 5, 5, 5, 5, 3, 5, 3, 3, 3, 3, 5, 5, 5, 5, 5, 5, 5, 5 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) #define YYEOF 0 #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. However, YYFAIL appears to be in use. Nevertheless, it is formally deprecated in Bison 2.4.2's NEWS entry, where a plan to phase it out is discussed. */ #define YYFAIL goto yyerrlab #if defined YYFAIL /* This is here to suppress warnings from the GCC cpp's -Wunused-macros. Normally we don't worry about that warning, but some users do, and we want to make it easy for users to remove YYFAIL uses, which will produce warnings from Bison 2.5. */ #endif #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (1); \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) #define YYTERROR 1 #define YYERRCODE 256 /* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. If N is 0, then set CURRENT to the empty location which ends the previous symbol: RHS[0] (always defined). */ #define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT # define YYLLOC_DEFAULT(Current, Rhs, N) \ do \ if (YYID (N)) \ { \ (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ } \ else \ { \ (Current).first_line = (Current).last_line = \ YYRHSLOC (Rhs, 0).last_line; \ (Current).first_column = (Current).last_column = \ YYRHSLOC (Rhs, 0).last_column; \ } \ while (YYID (0)) #endif /* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT # define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else # define YYLEX yylex () #endif /* Enable debugging if requested. */ #if YYDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (YYID (0)) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Type, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (YYID (0)) /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_value_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); # else YYUSE (yyoutput); # endif switch (yytype) { default: break; } } /*--------------------------------. | Print this symbol on YYOUTPUT. | `--------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) #else static void yy_symbol_print (yyoutput, yytype, yyvaluep) FILE *yyoutput; int yytype; YYSTYPE const * const yyvaluep; #endif { if (yytype < YYNTOKENS) YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); else YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void yy_stack_print (yybottom, yytop) yytype_int16 *yybottom; yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void yy_reduce_print (yyvsp, yyrule) YYSTYPE *yyvsp; int yyrule; #endif { int yynrhs = yyr2[yyrule]; int yyi; unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) ); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyvsp, Rule); \ } while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) # define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif #if YYERROR_VERBOSE # ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) #else static YYSIZE_T yystrlen (yystr) const char *yystr; #endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif # endif # ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) #else static char * yystpcpy (yydest, yysrc) char *yydest; const char *yysrc; #endif { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif # endif # ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYSIZE_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYSIZE_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; /* Fall through. */ default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (! yyres) return yystrlen (yystr); return yystpcpy (yyres, yystr) - yyres; } # endif /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return 2 if the required number of bytes is too large to store. */ static int yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken) { YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); YYSIZE_T yysize = yysize0; YYSIZE_T yysize1; enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; /* Internationalized format string. */ const char *yyformat = 0; /* Arguments of yyformat. */ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; /* Number of reported tokens (one for the "unexpected", one per "expected"). */ int yycount = 0; /* There are many possibilities here to consider: - Assume YYFAIL is not used. It's too flawed to consider. See for details. YYERROR is fine as it does not invoke this function. - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yytoken != YYEMPTY) { int yyn = yypact[*yyssp]; yyarg[yycount++] = yytname[yytoken]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR && !yytable_value_is_error (yytable[yyx + yyn])) { if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) { yycount = 1; yysize = yysize0; break; } yyarg[yycount++] = yytname[yyx]; yysize1 = yysize + yytnamerr (0, yytname[yyx]); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; } } } switch (yycount) { # define YYCASE_(N, S) \ case N: \ yyformat = S; \ break YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); # undef YYCASE_ } yysize1 = yysize + yystrlen (yyformat); if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) return 2; yysize = yysize1; if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return 1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yyarg[yyi++]); yyformat += 2; } else { yyp++; yyformat++; } } return 0; } #endif /* YYERROR_VERBOSE */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ /*ARGSUSED*/ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void yydestruct (yymsg, yytype, yyvaluep) const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { YYUSE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: break; } } /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); #else int yyparse (); #endif #else /* ! YYPARSE_PARAM */ #if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); #endif #endif /* ! YYPARSE_PARAM */ /* The lookahead symbol. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void *YYPARSE_PARAM) #else int yyparse (YYPARSE_PARAM) void *YYPARSE_PARAM; #endif #else /* ! YYPARSE_PARAM */ #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else int yyparse () #endif #endif { int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; /* The stacks and their tools: `yyss': related to states. `yyvs': related to semantic values. Refer to the stacks thru separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ yytype_int16 yyssa[YYINITDEPTH]; yytype_int16 *yyss; yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs; YYSTYPE *yyvsp; YYSIZE_T yystacksize; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ int yytoken; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; yytoken = 0; yyss = yyssa; yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ yyssp = yyss; yyvsp = yyvs; goto yysetstate; /*------------------------------------------------------------. | yynewstate -- Push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: *yyssp = yystate; if (yyss + yystacksize - 1 <= yyssp) { /* Get the current used size of the three stacks, in elements. */ YYSIZE_T yysize = yyssp - yyss + 1; #ifdef yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); yychar = YYLEX; } if (yychar <= YYEOF) { yychar = yytoken = YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); /* Discard the shifted token. */ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- Do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: `$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 3: /* Line 1806 of yacc.c */ #line 51 "parser.y" { /* In case of error, discard entire line */ yyerrok; } break; case 18: /* Line 1806 of yacc.c */ #line 87 "parser.y" { log_debug(" Remove breakpoint at $%04X", (yyvsp[(2) - (3)].number)); breakpoint_clr((yyvsp[(2) - (3)].number)); } break; case 19: /* Line 1806 of yacc.c */ #line 93 "parser.y" { log_debug(" Remove breakpoint at PC"); breakpoint_clr(cpu8051.pc); } break; case 20: /* Line 1806 of yacc.c */ #line 99 "parser.y" { log_debug(" Remove all breakpoints"); breakpoints_clr_all(); } break; case 21: /* Line 1806 of yacc.c */ #line 107 "parser.y" { log_debug(" Set breakpoint at PC"); breakpoint_set(cpu8051.pc); } break; case 22: /* Line 1806 of yacc.c */ #line 114 "parser.y" { log_debug(" Set breakpoint at $%04X", (yyvsp[(2) - (3)].number)); breakpoint_set((yyvsp[(2) - (3)].number)); } break; case 23: /* Line 1806 of yacc.c */ #line 122 "parser.y" { log_debug(" Display breakpoints"); breakpoints_show(); } break; case 24: /* Line 1806 of yacc.c */ #line 130 "parser.y" { log_debug(" Dump External Data Memory at $%04X, len %d", (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); mem_dump((yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number), EXT_MEM_ID); } break; case 25: /* Line 1806 of yacc.c */ #line 136 "parser.y" { log_debug(" Dump Internal Data Memory at $%04X, len %d", (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); mem_dump((yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number), INT_MEM_ID); } break; case 26: /* Line 1806 of yacc.c */ #line 142 "parser.y" { log_debug(" Dump Program Memory at $%04X, len %d", (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); mem_dump((yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number), PGM_MEM_ID); } break; case 27: /* Line 1806 of yacc.c */ #line 150 "parser.y" { log_debug(" Display Registers"); console_show_registers(); } break; case 28: /* Line 1806 of yacc.c */ #line 158 "parser.y" { log_debug(" Modify external memory"); mem_write8(EXT_MEM_ID, (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); } break; case 29: /* Line 1806 of yacc.c */ #line 164 "parser.y" { log_debug(" Modify internal memory"); mem_write8(INT_MEM_ID, (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); } break; case 30: /* Line 1806 of yacc.c */ #line 170 "parser.y" { log_debug(" Modify program memory"); mem_write8(PGM_MEM_ID, (yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); } break; case 31: /* Line 1806 of yacc.c */ #line 176 "parser.y" { register_set((yyvsp[(2) - (4)].string), (yyvsp[(3) - (4)].number)); } break; case 32: /* Line 1806 of yacc.c */ #line 183 "parser.y" { printf(" Quit"); YYACCEPT; } break; case 33: /* Line 1806 of yacc.c */ #line 191 "parser.y" { log_debug(" Run"); console_exec(-1); } break; case 34: /* Line 1806 of yacc.c */ #line 197 "parser.y" { log_debug(" Run %d instructions", (yyvsp[(2) - (3)].number)); console_exec((yyvsp[(2) - (3)].number)); } break; case 35: /* Line 1806 of yacc.c */ #line 205 "parser.y" { menu_display_usage(); } break; case 36: /* Line 1806 of yacc.c */ #line 212 "parser.y" { cpu8051_reset(); } break; case 37: /* Line 1806 of yacc.c */ #line 217 "parser.y" { gp_timer_reset(0); } break; case 38: /* Line 1806 of yacc.c */ #line 222 "parser.y" { gp_timer_reset(1); } break; case 39: /* Line 1806 of yacc.c */ #line 227 "parser.y" { gp_timer_reset(2); } break; case 40: /* Line 1806 of yacc.c */ #line 232 "parser.y" { gp_timer_reset(3); } break; case 41: /* Line 1806 of yacc.c */ #line 239 "parser.y" { console_trace(); } break; case 42: /* Line 1806 of yacc.c */ #line 246 "parser.y" { disassemble_num((yyvsp[(2) - (4)].number), (yyvsp[(3) - (4)].number)); } break; case 43: /* Line 1806 of yacc.c */ #line 251 "parser.y" { disassemble_num(cpu8051.pc, (yyvsp[(2) - (3)].number)); } break; case 44: /* Line 1806 of yacc.c */ #line 257 "parser.y" { disassemble_num(cpu8051.pc, 16); } break; /* Line 1806 of yacc.c */ #line 1773 "parser.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; /* Now `shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ yyn = yyr1[yyn]; yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else yystate = yydefgoto[yyn - YYNTOKENS]; goto yynewstate; /*------------------------------------. | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else # define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ yyssp, yytoken) { char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = YYSYNTAX_ERROR; if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == 1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); if (!yymsg) { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = 2; } else { yysyntax_error_status = YYSYNTAX_ERROR; yymsgp = yymsg; } } yyerror (yymsgp); if (yysyntax_error_status == 2) goto yyexhaustedlab; } # undef YYSYNTAX_ERROR #endif } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) { /* Return failure if at end of input. */ if (yychar == YYEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers like GCC when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (/*CONSTCOND*/ 0) goto yyerrorlab; /* Do not reclaim the symbols of the rule which action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } *++yyvsp = yylval; /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturn; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturn; #if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: if (yychar != YYEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif #if YYERROR_VERBOSE if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif /* Make sure YYID is used. */ return YYID (yyresult); } emu8051-2.0.1/src/cli/parser.h0000644000175400017500000000617112313352716012556 00000000000000/* A Bison parser, made by GNU Bison 2.5. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2011 Free Software Foundation, Inc. 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 . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE /* Put the tokens into the symbol table, so that GDB and other debuggers know about them. */ enum yytokentype { NUMBER = 258, WORD = 259, TOK_ENTER = 260, TOK_ALL = 261, TOK_SB = 262, TOK_RB = 263, TOK_DB = 264, TOK_DE = 265, TOK_DI = 266, TOK_DP = 267, TOK_DR = 268, TOK_HELP = 269, TOK_RUN = 270, TOK_RST = 271, TOK_RST_TIMER = 272, TOK_STEP = 273, TOK_UNASM = 274, TOK_MOD_EXT = 275, TOK_MOD_INT = 276, TOK_MOD_PROG = 277, TOK_MOD_REG = 278, TOK_QUIT = 279, TOK_A = 280, TOK_B = 281, TOK_C = 282, TOK_D = 283 }; #endif /* Tokens. */ #define NUMBER 258 #define WORD 259 #define TOK_ENTER 260 #define TOK_ALL 261 #define TOK_SB 262 #define TOK_RB 263 #define TOK_DB 264 #define TOK_DE 265 #define TOK_DI 266 #define TOK_DP 267 #define TOK_DR 268 #define TOK_HELP 269 #define TOK_RUN 270 #define TOK_RST 271 #define TOK_RST_TIMER 272 #define TOK_STEP 273 #define TOK_UNASM 274 #define TOK_MOD_EXT 275 #define TOK_MOD_INT 276 #define TOK_MOD_PROG 277 #define TOK_MOD_REG 278 #define TOK_QUIT 279 #define TOK_A 280 #define TOK_B 281 #define TOK_C 282 #define TOK_D 283 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { /* Line 2068 of yacc.c */ #line 29 "parser.y" int number; char *string; /* Line 2068 of yacc.c */ #line 113 "parser.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif extern YYSTYPE yylval; emu8051-2.0.1/src/cli/parser.y0000644000175400017500000001001112313352657012567 00000000000000%{ #include #include #include #include #include "config.h" #include "log.h" #include "menu.h" #include "memory.h" #include "timers.h" #include "memory.h" #include "cpu8051.h" /* int yydebug = 1; */ /* To get rid of compiler warning. */ int yylex(); int yyerror(const char *str) { fprintf(stderr,"error: %s\n", str); return 0; } %} %union { int number; char *string; } %token NUMBER %token WORD %token TOK_ENTER TOK_ALL %token TOK_SB TOK_RB TOK_DB %token TOK_DE TOK_DI TOK_DP TOK_DR %token TOK_HELP %token TOK_RUN %token TOK_RST TOK_RST_TIMER %token TOK_STEP %token TOK_UNASM %token TOK_MOD_EXT TOK_MOD_INT TOK_MOD_PROG TOK_MOD_REG %token TOK_QUIT %token TOK_A TOK_B TOK_C TOK_D %% start : start command | error TOK_ENTER { /* In case of error, discard entire line */ yyerrok; } | start TOK_ENTER | ; command: breakpoint_clr | breakpoint_set | breakpoint_display | dump_mem | display_regs | help | modify | quit | reset | run | step | unasm ; breakpoint_clr: TOK_RB NUMBER TOK_ENTER { log_debug(" Remove breakpoint at $%04X", $2); breakpoint_clr($2); } | TOK_RB TOK_ENTER { log_debug(" Remove breakpoint at PC"); breakpoint_clr(cpu8051.pc); } | TOK_RB TOK_ALL TOK_ENTER { log_debug(" Remove all breakpoints"); breakpoints_clr_all(); } ; breakpoint_set: TOK_SB TOK_ENTER { log_debug(" Set breakpoint at PC"); breakpoint_set(cpu8051.pc); } | TOK_SB NUMBER TOK_ENTER { log_debug(" Set breakpoint at $%04X", $2); breakpoint_set($2); } ; breakpoint_display: TOK_DB TOK_ENTER { log_debug(" Display breakpoints"); breakpoints_show(); } ; dump_mem: TOK_DE NUMBER NUMBER TOK_ENTER { log_debug(" Dump External Data Memory at $%04X, len %d", $2, $3); mem_dump($2, $3, EXT_MEM_ID); } | TOK_DI NUMBER NUMBER TOK_ENTER { log_debug(" Dump Internal Data Memory at $%04X, len %d", $2, $3); mem_dump($2, $3, INT_MEM_ID); } | TOK_DP NUMBER NUMBER TOK_ENTER { log_debug(" Dump Program Memory at $%04X, len %d", $2, $3); mem_dump($2, $3, PGM_MEM_ID); } ; display_regs: TOK_DR TOK_ENTER { log_debug(" Display Registers"); console_show_registers(); } ; modify: TOK_MOD_EXT NUMBER NUMBER TOK_ENTER { log_debug(" Modify external memory"); mem_write8(EXT_MEM_ID, $2, $3); } | TOK_MOD_INT NUMBER NUMBER TOK_ENTER { log_debug(" Modify internal memory"); mem_write8(INT_MEM_ID, $2, $3); } | TOK_MOD_PROG NUMBER NUMBER TOK_ENTER { log_debug(" Modify program memory"); mem_write8(PGM_MEM_ID, $2, $3); } | TOK_MOD_REG WORD NUMBER TOK_ENTER { register_set($2, $3); } ; quit: TOK_QUIT TOK_ENTER { printf(" Quit"); YYACCEPT; } ; run: TOK_RUN TOK_ENTER { log_debug(" Run"); console_exec(-1); } | TOK_RUN NUMBER TOK_ENTER { log_debug(" Run %d instructions", $2); console_exec($2); } ; help: TOK_HELP TOK_ENTER { menu_display_usage(); } ; reset: TOK_RST TOK_ENTER { cpu8051_reset(); } | TOK_RST_TIMER TOK_A TOK_ENTER { gp_timer_reset(0); } | TOK_RST_TIMER TOK_B TOK_ENTER { gp_timer_reset(1); } | TOK_RST_TIMER TOK_C TOK_ENTER { gp_timer_reset(2); } | TOK_RST_TIMER TOK_D TOK_ENTER { gp_timer_reset(3); } ; step: TOK_STEP TOK_ENTER { console_trace(); } ; unasm: TOK_UNASM NUMBER NUMBER TOK_ENTER { disassemble_num($2, $3); } | TOK_UNASM NUMBER TOK_ENTER { disassemble_num(cpu8051.pc, $2); } ; | TOK_UNASM TOK_ENTER { disassemble_num(cpu8051.pc, 16); } ; emu8051-2.0.1/src/cli/scanner.c0000644000175400017500000014255012313352716012710 00000000000000 #line 3 "scanner.c" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Returned upon end-of-file. */ #define YY_NULL 0 /* Promotes a possibly negative, possibly signed char to an unsigned * integer for use as an array index. If the signed char is negative, * we want to instead treat it as an 8-bit unsigned char, hence the * double cast. */ #define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) /* Enter a start condition. This macro really ought to take a parameter, * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ #define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ #define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ #define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. */ #define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) #define unput(c) yyunput( c, (yytext_ptr) ) #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process * then we mark the buffer as YY_EOF_PENDING, to indicate that we * shouldn't try reading from the input source any more. We might * still have a bunch of tokens to match, though, because of * possible backing-up. * * When we actually see the EOF, we change the status to "new" * (via yyrestart()), so that the user can continue scanning by * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ /* Stack of input buffers. */ static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". * * Returns the top of the stack, or NULL. */ #define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ : NULL) /* Same as previous macro, but useful when we know that the buffer stack is not * NULL or when we need an lvalue. For internal use only. */ #define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; static int yy_n_chars; /* number of characters read into yy_ch_buf */ int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches * instead of setting up a fresh yyin. A bit of a hack ... */ static int yy_did_buffer_switch_on_eof; void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); static void yyensure_buffer_stack (void ); static void yy_load_buffer_state (void ); static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ if ( ! YY_CURRENT_BUFFER ){ \ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ if ( ! YY_CURRENT_BUFFER ){\ yyensure_buffer_stack (); \ YY_CURRENT_BUFFER_LVALUE = \ yy_create_buffer(yyin,YY_BUF_SIZE ); \ } \ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } #define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) /* Begin user sect3 */ #define yywrap(n) 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; typedef int yy_state_type; extern int yylineno; int yylineno = 1; extern char *yytext; #define yytext_ptr yytext static yy_state_type yy_get_previous_state (void ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); static int yy_get_next_buffer (void ); static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ (yytext_ptr) = yy_bp; \ yyleng = (size_t) (yy_cp - yy_bp); \ (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 31 #define YY_END_OF_BUFFER 32 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info { flex_int32_t yy_verify; flex_int32_t yy_nxt; }; static yyconst flex_int16_t yy_accept[67] = { 0, 0, 0, 32, 30, 29, 28, 30, 3, 3, 4, 23, 24, 25, 26, 27, 4, 13, 12, 14, 15, 27, 20, 29, 2, 3, 0, 27, 27, 27, 7, 8, 9, 10, 11, 6, 5, 16, 17, 18, 19, 21, 2, 1, 1, 22, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 0 } ; static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 1, 1, 1, 1, 1, 7, 1, 8, 8, 8, 8, 8, 8, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 9, 1, 1, 1, 1, 1, 1, 1, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 16, 16, 19, 16, 16, 16, 20, 21, 22, 23, 24, 25, 16, 26, 27, 16, 28, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } ; static yyconst flex_int32_t yy_meta[29] = { 0, 1, 1, 1, 1, 2, 2, 1, 3, 4, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4 } ; static yyconst flex_int16_t yy_base[84] = { 0, 0, 0, 104, 203, 93, 203, 0, 24, 26, 203, 25, 84, 73, 43, 69, 67, 65, 27, 28, 64, 57, 31, 70, 0, 36, 0, 61, 75, 34, 60, 59, 58, 55, 53, 51, 50, 49, 47, 41, 40, 39, 0, 0, 86, 38, 0, 0, 97, 0, 0, 108, 0, 0, 119, 0, 0, 130, 0, 0, 141, 203, 0, 152, 203, 37, 203, 166, 168, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191, 193, 195, 197, 199 } ; static yyconst flex_int16_t yy_def[84] = { 0, 66, 1, 66, 66, 66, 66, 67, 68, 68, 66, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 66, 69, 68, 70, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 71, 72, 28, 68, 73, 74, 28, 75, 76, 28, 77, 78, 28, 79, 80, 28, 81, 82, 28, 66, 83, 28, 66, 68, 0, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 } ; static yyconst flex_int16_t yy_nxt[232] = { 0, 4, 5, 6, 7, 8, 9, 10, 4, 4, 11, 12, 13, 14, 15, 15, 15, 16, 15, 15, 15, 17, 18, 19, 15, 20, 21, 15, 22, 25, 25, 25, 25, 26, 66, 66, 66, 66, 35, 36, 66, 25, 25, 66, 29, 66, 66, 66, 66, 66, 66, 28, 66, 45, 30, 41, 66, 31, 66, 66, 66, 32, 66, 33, 66, 34, 66, 66, 66, 66, 66, 37, 23, 66, 66, 38, 66, 39, 66, 40, 44, 44, 66, 43, 66, 44, 44, 44, 44, 44, 44, 48, 48, 66, 47, 23, 48, 48, 48, 48, 48, 48, 51, 51, 66, 50, 66, 51, 51, 51, 51, 51, 51, 54, 54, 66, 53, 66, 54, 54, 54, 54, 54, 54, 57, 57, 66, 56, 66, 57, 57, 57, 57, 57, 57, 60, 60, 66, 59, 66, 60, 60, 60, 60, 60, 60, 63, 63, 66, 62, 66, 63, 63, 63, 63, 63, 63, 65, 65, 66, 64, 66, 65, 65, 65, 65, 65, 65, 24, 24, 27, 66, 27, 42, 42, 43, 43, 46, 46, 47, 47, 49, 49, 50, 50, 52, 52, 53, 53, 55, 55, 56, 56, 58, 58, 59, 59, 61, 61, 62, 62, 64, 64, 3, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 } ; static yyconst flex_int16_t yy_chk[232] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 8, 8, 9, 9, 8, 11, 9, 18, 19, 18, 19, 22, 25, 25, 29, 11, 25, 65, 45, 41, 40, 39, 8, 14, 29, 14, 22, 38, 14, 37, 36, 35, 14, 34, 14, 33, 14, 21, 32, 31, 30, 27, 21, 23, 20, 17, 21, 16, 21, 15, 21, 28, 28, 13, 28, 28, 28, 28, 28, 28, 28, 28, 44, 44, 12, 44, 5, 44, 44, 44, 44, 44, 44, 48, 48, 3, 48, 0, 48, 48, 48, 48, 48, 48, 51, 51, 0, 51, 0, 51, 51, 51, 51, 51, 51, 54, 54, 0, 54, 0, 54, 54, 54, 54, 54, 54, 57, 57, 0, 57, 0, 57, 57, 57, 57, 57, 57, 60, 60, 0, 60, 0, 60, 60, 60, 60, 60, 60, 63, 63, 0, 63, 0, 63, 63, 63, 63, 63, 63, 67, 67, 68, 0, 68, 69, 69, 70, 70, 71, 71, 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79, 80, 80, 81, 81, 82, 82, 83, 83, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66, 66 } ; static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; extern int yy_flex_debug; int yy_flex_debug = 0; /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ #define REJECT reject_used_but_not_detected #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "scanner.l" #define YY_NO_INPUT 1 #line 5 "scanner.l" #include "menu.h" #include "parser.h" #include "hexfile.h" #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result = menu_get_input(buf, max_size); #line 544 "scanner.c" #define INITIAL 0 #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif static int yy_init_globals (void ); /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void ); #else static int input (void ); #endif #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ #define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, * is returned in "result". */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ if ( c == '\n' ) \ buf[n++] = (char) c; \ if ( c == EOF && ferror( yyin ) ) \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ else \ { \ errno=0; \ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ { \ if( errno != EINTR) \ { \ YY_FATAL_ERROR( "input in flex scanner failed" ); \ break; \ } \ errno=0; \ clearerr(yyin); \ } \ }\ \ #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - * we don't want an extra ';' after the "return" because that will cause * some compilers to complain about unreachable statements. */ #ifndef yyterminate #define yyterminate() return YY_NULL #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Report a fatal error. */ #ifndef YY_FATAL_ERROR #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif /* end tables serialization structures and prototypes */ /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. */ #ifndef YY_USER_ACTION #define YY_USER_ACTION #endif /* Code executed at the end of each rule. */ #ifndef YY_BREAK #define YY_BREAK break; #endif #define YY_RULE_SETUP \ YY_USER_ACTION /** The main scanner function which does all the work. */ YY_DECL { register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; #line 21 "scanner.l" #line 731 "scanner.c" if ( !(yy_init) ) { (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif if ( ! (yy_start) ) (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; if ( ! yyout ) yyout = stdout; if ( ! YY_CURRENT_BUFFER ) { yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); /* Support of yytext. */ *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 67 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } while ( yy_base[yy_current_state] != 203 ); yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; do_action: /* This label is used only to access EOF actions. */ switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ *yy_cp = (yy_hold_char); yy_cp = (yy_last_accepting_cpos); yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: YY_RULE_SETUP #line 22 "scanner.l" { /* * No need to check return value of asciihex2int, because lex * always passes a valid ASCII hex string. */ yylval.number = asciihex2int(&yytext[2]); /* Skip "0x" prefix */ return NUMBER; } YY_BREAK case 2: YY_RULE_SETUP #line 30 "scanner.l" { /* * No need to check return value of asciihex2int, because lex * always passes a valid ASCII hex string. */ yylval.number = asciihex2int(&yytext[1]); /* Skip "$" prefix */ return NUMBER; } YY_BREAK case 3: YY_RULE_SETUP #line 40 "scanner.l" { yylval.number = atoi(yytext); return NUMBER; } YY_BREAK case 4: YY_RULE_SETUP #line 41 "scanner.l" return TOK_HELP; YY_BREAK case 5: YY_RULE_SETUP #line 42 "scanner.l" return TOK_SB; YY_BREAK case 6: YY_RULE_SETUP #line 43 "scanner.l" return TOK_RB; YY_BREAK case 7: YY_RULE_SETUP #line 44 "scanner.l" return TOK_DB; YY_BREAK case 8: YY_RULE_SETUP #line 45 "scanner.l" return TOK_DE; YY_BREAK case 9: YY_RULE_SETUP #line 46 "scanner.l" return TOK_DI; YY_BREAK case 10: YY_RULE_SETUP #line 47 "scanner.l" return TOK_DP; YY_BREAK case 11: YY_RULE_SETUP #line 48 "scanner.l" return TOK_DR; YY_BREAK case 12: YY_RULE_SETUP #line 49 "scanner.l" return TOK_RUN; YY_BREAK case 13: YY_RULE_SETUP #line 50 "scanner.l" return TOK_QUIT; YY_BREAK case 14: YY_RULE_SETUP #line 51 "scanner.l" return TOK_STEP; YY_BREAK case 15: YY_RULE_SETUP #line 52 "scanner.l" return TOK_UNASM; YY_BREAK case 16: YY_RULE_SETUP #line 53 "scanner.l" return TOK_MOD_EXT; YY_BREAK case 17: YY_RULE_SETUP #line 54 "scanner.l" return TOK_MOD_INT; YY_BREAK case 18: YY_RULE_SETUP #line 55 "scanner.l" return TOK_MOD_PROG; YY_BREAK case 19: YY_RULE_SETUP #line 56 "scanner.l" return TOK_MOD_REG; YY_BREAK case 20: YY_RULE_SETUP #line 57 "scanner.l" return TOK_RST; YY_BREAK case 21: YY_RULE_SETUP #line 58 "scanner.l" return TOK_RST_TIMER; YY_BREAK case 22: YY_RULE_SETUP #line 59 "scanner.l" return TOK_ALL; YY_BREAK case 23: YY_RULE_SETUP #line 60 "scanner.l" return TOK_A; YY_BREAK case 24: YY_RULE_SETUP #line 61 "scanner.l" return TOK_B; YY_BREAK case 25: YY_RULE_SETUP #line 62 "scanner.l" return TOK_C; YY_BREAK case 26: YY_RULE_SETUP #line 63 "scanner.l" return TOK_D; YY_BREAK case 27: YY_RULE_SETUP #line 64 "scanner.l" { yylval.string = strdup(yytext); return WORD; } YY_BREAK case 28: /* rule 28 can match eol */ YY_RULE_SETUP #line 65 "scanner.l" return TOK_ENTER; YY_BREAK case 29: YY_RULE_SETUP #line 66 "scanner.l" { /* ignore whitespace */ } YY_BREAK case 30: YY_RULE_SETUP #line 67 "scanner.l" { return yytext[0]; } YY_BREAK case 31: YY_RULE_SETUP #line 68 "scanner.l" ECHO; YY_BREAK #line 984 "scanner.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position * of the first EOB in the buffer, since yy_c_buf_p will * already have been incremented past the NUL character * (since all states make transitions on EOB to the * end-of-buffer state). Contrast this with the test * in input(). */ if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have * yy_get_previous_state() go ahead and do it * for us because it doesn't know how to deal * with the possibility of jamming (and we don't * want to build jamming into it because then it * will run more slowly). */ yy_next_state = yy_try_NUL_trans( yy_current_state ); yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { yy_cp = (yy_c_buf_p); goto yy_find_action; } } else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { (yy_did_buffer_switch_on_eof) = 0; if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up * yytext, we can now set up * yy_c_buf_p so that if some total * hoser (like flex itself) wants to * call the scanner after we return the * YY_NULL, it'll still work - another * YY_NULL will get returned. */ (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; } else { if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: (yy_c_buf_p) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; yy_current_state = yy_get_previous_state( ); yy_cp = (yy_c_buf_p); yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; } default: YY_FATAL_ERROR( "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ } /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * * Returns a code representing an action: * EOB_ACT_LAST_MATCH - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ static int yy_get_next_buffer (void) { register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. */ return EOB_ACT_END_OF_FILE; } else { /* We matched some text prior to the EOB, first * process it. */ return EOB_ACT_LAST_MATCH; } } /* Try to read more data. */ /* First move last chars to start of buffer. */ number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { int new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; else b->yy_buf_size *= 2; b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ b->yy_ch_buf = 0; if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), (yy_n_chars), (size_t) num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } else ret_val = EOB_ACT_CONTINUE_SCAN; if ((yy_size_t) ((yy_n_chars) + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ yy_size_t new_size = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); } (yy_n_chars) += number_to_move; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; } /* yy_get_previous_state - get the state just before the EOB char was reached */ static yy_state_type yy_get_previous_state (void) { register yy_state_type yy_current_state; register char *yy_cp; yy_current_state = (yy_start); for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 67 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; } return yy_current_state; } /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) { register int yy_is_jam; register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; if ( yy_current_state >= 67 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 66); return yy_is_jam ? 0 : yy_current_state; } #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (void) #else static int input (void) #endif { int c; *(yy_c_buf_p) = (yy_hold_char); if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ *(yy_c_buf_p) = '\0'; else { /* need more input */ int offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() * sees that we've accumulated a * token and flags that we need to * try matching the token before * proceeding. But for input(), * there's no matching to consider. * So convert the EOB_ACT_LAST_MATCH * to EOB_ACT_END_OF_FILE. */ /* Reset buffer status. */ yyrestart(yyin ); /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { if ( yywrap( ) ) return EOF; if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); #else return input(); #endif } case EOB_ACT_CONTINUE_SCAN: (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ *(yy_c_buf_p) = '\0'; /* preserve yytext */ (yy_hold_char) = *++(yy_c_buf_p); return c; } #endif /* ifndef YY_NO_INPUT */ /** Immediately switch to a different input stream. * @param input_file A readable stream. * * @note This function does not reset the start condition to @c INITIAL . */ void yyrestart (FILE * input_file ) { if ( ! YY_CURRENT_BUFFER ){ yyensure_buffer_stack (); YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin,YY_BUF_SIZE ); } yy_init_buffer(YY_CURRENT_BUFFER,input_file ); yy_load_buffer_state( ); } /** Switch to a different input buffer. * @param new_buffer The new input buffer. * */ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) { /* TODO. We should be able to replace this entire function body * with * yypop_buffer_state(); * yypush_buffer_state(new_buffer); */ yyensure_buffer_stack (); if ( YY_CURRENT_BUFFER == new_buffer ) return; if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } YY_CURRENT_BUFFER_LVALUE = new_buffer; yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ (yy_did_buffer_switch_on_eof) = 1; } static void yy_load_buffer_state (void) { (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; (yy_hold_char) = *(yy_c_buf_p); } /** Allocate and initialize an input buffer state. * @param file A readable stream. * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. * * @return the allocated buffer state. */ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) { YY_BUFFER_STATE b; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_buf_size = size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; yy_init_buffer(b,file ); return b; } /** Destroy the buffer. * @param b a buffer created with yy_create_buffer() * */ void yy_delete_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) yyfree((void *) b->yy_ch_buf ); yyfree((void *) b ); } #ifndef _UNISTD_H /* assume unistd.h has isatty() for us */ #ifdef __cplusplus extern "C" { #endif #ifdef __THROW /* this is a gnuism */ extern int isatty (int ) __THROW; #else extern int isatty (int ); #endif #ifdef __cplusplus } #endif #endif /* Initializes or reinitializes a buffer. * This function is sometimes called more than once on the same buffer, * such as during a yyrestart() or at EOF. */ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) { int oerrno = errno; yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; /* If b is the current buffer, then yy_init_buffer was _probably_ * called from yyrestart() or through yy_get_next_buffer. * In that case, we don't want to reset the lineno or column. */ if (b != YY_CURRENT_BUFFER){ b->yy_bs_lineno = 1; b->yy_bs_column = 0; } b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; errno = oerrno; } /** Discard all buffered characters. On the next scan, YY_INPUT will be called. * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. * */ void yy_flush_buffer (YY_BUFFER_STATE b ) { if ( ! b ) return; b->yy_n_chars = 0; /* We always need two end-of-buffer characters. The first causes * a transition to the end-of-buffer state. The second causes * a jam in that state. */ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; b->yy_buf_pos = &b->yy_ch_buf[0]; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; if ( b == YY_CURRENT_BUFFER ) yy_load_buffer_state( ); } /** Pushes the new state onto the stack. The new state becomes * the current state. This function will allocate the stack * if necessary. * @param new_buffer The new state. * */ void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) { if (new_buffer == NULL) return; yyensure_buffer_stack(); /* This block is copied from yy_switch_to_buffer. */ if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ *(yy_c_buf_p) = (yy_hold_char); YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } /* Only push if top exists. Otherwise, replace top. */ if (YY_CURRENT_BUFFER) (yy_buffer_stack_top)++; YY_CURRENT_BUFFER_LVALUE = new_buffer; /* copied from yy_switch_to_buffer. */ yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } /** Removes and deletes the top of the stack, if present. * The next element becomes the new top. * */ void yypop_buffer_state (void) { if (!YY_CURRENT_BUFFER) return; yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; if ((yy_buffer_stack_top) > 0) --(yy_buffer_stack_top); if (YY_CURRENT_BUFFER) { yy_load_buffer_state( ); (yy_did_buffer_switch_on_eof) = 1; } } /* Allocates the stack if it does not exist. * Guarantees space for at least one push. */ static void yyensure_buffer_stack (void) { int num_to_alloc; if (!(yy_buffer_stack)) { /* First allocation is just for 2 elements, since we don't know if this * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ num_to_alloc = 1; (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc (num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; (yy_buffer_stack_top) = 0; return; } if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ /* Increase the buffer to prepare for a possible push. */ int grow_size = 8 /* arbitrary grow size */; num_to_alloc = (yy_buffer_stack_max) + grow_size; (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc ((yy_buffer_stack), num_to_alloc * sizeof(struct yy_buffer_state*) ); if ( ! (yy_buffer_stack) ) YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); /* zero only the new slots.*/ memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); (yy_buffer_stack_max) = num_to_alloc; } } /** Setup the input buffer state to scan directly from a user-specified character buffer. * @param base the character buffer * @param size the size in bytes of the character buffer * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) { YY_BUFFER_STATE b; if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ b->yy_buf_pos = b->yy_ch_buf = base; b->yy_is_our_buffer = 0; b->yy_input_file = 0; b->yy_n_chars = b->yy_buf_size; b->yy_is_interactive = 0; b->yy_at_bol = 1; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; yy_switch_to_buffer(b ); return b; } /** Setup the input buffer state to scan a string. The next call to yylex() will * scan from a @e copy of @a str. * @param yystr a NUL-terminated string to scan * * @return the newly allocated buffer state object. * @note If you want to scan bytes that may contain NUL values, then use * yy_scan_bytes() instead. */ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) { return yy_scan_bytes(yystr,strlen(yystr) ); } /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. * @param yybytes the byte buffer to scan * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); for ( i = 0; i < _yybytes_len; ++i ) buf[i] = yybytes[i]; buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); /* It's okay to grow etc. this buffer, and we should throw it * away when we're done. */ b->yy_is_our_buffer = 1; return b; } #ifndef YY_EXIT_FAILURE #define YY_EXIT_FAILURE 2 #endif static void yy_fatal_error (yyconst char* msg ) { (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } /* Redefine yyless() so it works in section 3 code. */ #undef yyless #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ int yyless_macro_arg = (n); \ YY_LESS_LINENO(yyless_macro_arg);\ yytext[yyleng] = (yy_hold_char); \ (yy_c_buf_p) = yytext + yyless_macro_arg; \ (yy_hold_char) = *(yy_c_buf_p); \ *(yy_c_buf_p) = '\0'; \ yyleng = yyless_macro_arg; \ } \ while ( 0 ) /* Accessor methods (get/set functions) to struct members. */ /** Get the current line number. * */ int yyget_lineno (void) { return yylineno; } /** Get the input stream. * */ FILE *yyget_in (void) { return yyin; } /** Get the output stream. * */ FILE *yyget_out (void) { return yyout; } /** Get the length of the current token. * */ int yyget_leng (void) { return yyleng; } /** Get the current token. * */ char *yyget_text (void) { return yytext; } /** Set the current line number. * @param line_number * */ void yyset_lineno (int line_number ) { yylineno = line_number; } /** Set the input stream. This does not discard the current * input buffer. * @param in_str A readable stream. * * @see yy_switch_to_buffer */ void yyset_in (FILE * in_str ) { yyin = in_str ; } void yyset_out (FILE * out_str ) { yyout = out_str ; } int yyget_debug (void) { return yy_flex_debug; } void yyset_debug (int bdebug ) { yy_flex_debug = bdebug ; } static int yy_init_globals (void) { /* Initialization is the same as for the non-reentrant scanner. * This function is called from yylex_destroy(), so don't allocate here. */ (yy_buffer_stack) = 0; (yy_buffer_stack_top) = 0; (yy_buffer_stack_max) = 0; (yy_c_buf_p) = (char *) 0; (yy_init) = 0; (yy_start) = 0; /* Defined in main.c */ #ifdef YY_STDINIT yyin = stdin; yyout = stdout; #else yyin = (FILE *) 0; yyout = (FILE *) 0; #endif /* For future reference: Set errno on error, since we are called by * yylex_init() */ return 0; } /* yylex_destroy is for both reentrant and non-reentrant scanners. */ int yylex_destroy (void) { /* Pop the buffer stack, destroying each element. */ while(YY_CURRENT_BUFFER){ yy_delete_buffer(YY_CURRENT_BUFFER ); YY_CURRENT_BUFFER_LVALUE = NULL; yypop_buffer_state(); } /* Destroy the stack itself. */ yyfree((yy_buffer_stack) ); (yy_buffer_stack) = NULL; /* Reset the globals. This is important in a non-reentrant scanner so the next time * yylex() is called, initialization will occur. */ yy_init_globals( ); return 0; } /* * Internal utility routines. */ #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) { register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s ) { register int n; for ( n = 0; s[n]; ++n ) ; return n; } #endif void *yyalloc (yy_size_t size ) { return (void *) malloc( size ); } void *yyrealloc (void * ptr, yy_size_t size ) { /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter * because both ANSI C and C++ allow castless assignment from * any pointer type to void*, and deal with argument conversions * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); } void yyfree (void * ptr ) { free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" #line 68 "scanner.l" emu8051-2.0.1/src/cli/scanner.h0000644000175400017500000001615312313352716012714 00000000000000#ifndef yyHEADER_H #define yyHEADER_H 1 #define yyIN_HEADER 1 #line 6 "scanner.h" #define YY_INT_ALIGNED short int /* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 #define YY_FLEX_SUBMINOR_VERSION 35 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif /* First, we deal with platform-specific or compiler-specific issues. */ /* begin standard C headers. */ #include #include #include #include /* end standard C headers. */ /* flex integer type definitions */ #ifndef FLEXINT_H #define FLEXINT_H /* C99 systems have . Non-C99 systems may or may not. */ #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, * if you want the limit (max/min) macros for int types. */ #ifndef __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS 1 #endif #include typedef int8_t flex_int8_t; typedef uint8_t flex_uint8_t; typedef int16_t flex_int16_t; typedef uint16_t flex_uint16_t; typedef int32_t flex_int32_t; typedef uint32_t flex_uint32_t; #else typedef signed char flex_int8_t; typedef short int flex_int16_t; typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; /* Limits of integral types. */ #ifndef INT8_MIN #define INT8_MIN (-128) #endif #ifndef INT16_MIN #define INT16_MIN (-32767-1) #endif #ifndef INT32_MIN #define INT32_MIN (-2147483647-1) #endif #ifndef INT8_MAX #define INT8_MAX (127) #endif #ifndef INT16_MAX #define INT16_MAX (32767) #endif #ifndef INT32_MAX #define INT32_MAX (2147483647) #endif #ifndef UINT8_MAX #define UINT8_MAX (255U) #endif #ifndef UINT16_MAX #define UINT16_MAX (65535U) #endif #ifndef UINT32_MAX #define UINT32_MAX (4294967295U) #endif #endif /* ! C99 */ #endif /* ! FLEXINT_H */ #ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST #else /* ! __cplusplus */ /* C99 requires __STDC__ to be defined as 1. */ #if defined (__STDC__) #define YY_USE_CONST #endif /* defined (__STDC__) */ #endif /* ! __cplusplus */ #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif /* Size of default input buffer. */ #ifndef YY_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k. * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. * Ditto for the __ia64__ case accordingly. */ #define YY_BUF_SIZE 32768 #else #define YY_BUF_SIZE 16384 #endif /* __ia64__ */ #endif #ifndef YY_TYPEDEF_YY_BUFFER_STATE #define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif extern int yyleng; extern FILE *yyin, *yyout; #ifndef YY_TYPEDEF_YY_SIZE_T #define YY_TYPEDEF_YY_SIZE_T typedef size_t yy_size_t; #endif #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; char *yy_ch_buf; /* input buffer */ char *yy_buf_pos; /* current position in input buffer */ /* Size of input buffer in bytes, not including room for EOB * characters. */ yy_size_t yy_buf_size; /* Number of characters read into yy_ch_buf, not including EOB * characters. */ int yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to * delete it. */ int yy_is_our_buffer; /* Whether this is an "interactive" input source; if so, and * if we're using stdio for input, then we want to use getc() * instead of fread(), to make sure we stop fetching input after * each newline. */ int yy_is_interactive; /* Whether we're considered to be at the beginning of a line. * If so, '^' rules will be active on the next match, otherwise * not. */ int yy_at_bol; int yy_bs_lineno; /**< The line count. */ int yy_bs_column; /**< The column count. */ /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; }; #endif /* !YY_STRUCT_YY_BUFFER_STATE */ void yyrestart (FILE *input_file ); void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); void yy_delete_buffer (YY_BUFFER_STATE b ); void yy_flush_buffer (YY_BUFFER_STATE b ); void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); void yypop_buffer_state (void ); YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); void *yyalloc (yy_size_t ); void *yyrealloc (void *,yy_size_t ); void yyfree (void * ); /* Begin user sect3 */ #define yywrap(n) 1 #define YY_SKIP_YYWRAP extern int yylineno; extern char *yytext; #define yytext_ptr yytext #ifdef YY_HEADER_EXPORT_START_CONDITIONS #define INITIAL 0 #endif #ifndef YY_NO_UNISTD_H /* Special case for "unistd.h", since it is non-ANSI. We include it way * down here because we want the user's section 1 to have been scanned first. * The user has a chance to override it with an option. */ #include #endif #ifndef YY_EXTRA_TYPE #define YY_EXTRA_TYPE void * #endif /* Accessor methods to globals. These are made visible to non-reentrant scanners for convenience. */ int yylex_destroy (void ); int yyget_debug (void ); void yyset_debug (int debug_flag ); YY_EXTRA_TYPE yyget_extra (void ); void yyset_extra (YY_EXTRA_TYPE user_defined ); FILE *yyget_in (void ); void yyset_in (FILE * in_str ); FILE *yyget_out (void ); void yyset_out (FILE * out_str ); int yyget_leng (void ); char *yyget_text (void ); int yyget_lineno (void ); void yyset_lineno (int line_number ); /* Macros after this point can all be overridden by user definitions in * section 1. */ #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus extern "C" int yywrap (void ); #else extern int yywrap (void ); #endif #endif #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT #endif /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE #ifdef __ia64__ /* On IA-64, the buffer size is 16k, not 8k */ #define YY_READ_BUF_SIZE 16384 #else #define YY_READ_BUF_SIZE 8192 #endif /* __ia64__ */ #endif /* Number of entries by which start-condition stack grows. */ #ifndef YY_START_STACK_INCR #define YY_START_STACK_INCR 25 #endif /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL #define YY_DECL_IS_OURS 1 extern int yylex (void); #define YY_DECL int yylex (void) #endif /* !YY_DECL */ /* yy_get_previous_state - get the state just before the EOB char was reached */ #undef YY_NEW_FILE #undef YY_FLUSH_BUFFER #undef yy_set_bol #undef yy_new_buffer #undef yy_set_interactive #undef YY_DO_BEFORE_ACTION #ifdef YY_DECL_IS_OURS #undef YY_DECL_IS_OURS #undef YY_DECL #endif #line 68 "scanner.l" #line 332 "scanner.h" #undef yyIN_HEADER #endif /* yyHEADER_H */ emu8051-2.0.1/src/cli/scanner.l0000644000175400017500000000346012313352657012721 00000000000000%option noyywrap %option noinput %option nounput %{ #include "menu.h" #include "parser.h" #include "hexfile.h" #undef YY_INPUT #define YY_INPUT(buf,result,max_size) result = menu_get_input(buf, max_size); %} digit [0-9] alpha [a-fA-F] hextail ({digit}|{alpha}){1,8} hex1 0[xX]{hextail} hex2 ${hextail} %% {hex1} { /* * No need to check return value of asciihex2int, because lex * always passes a valid ASCII hex string. */ yylval.number = asciihex2int(&yytext[2]); /* Skip "0x" prefix */ return NUMBER; } {hex2} { /* * No need to check return value of asciihex2int, because lex * always passes a valid ASCII hex string. */ yylval.number = asciihex2int(&yytext[1]); /* Skip "$" prefix */ return NUMBER; } [0-9]+ { yylval.number = atoi(yytext); return NUMBER; } [h?] return TOK_HELP; sb return TOK_SB; rb return TOK_RB; db return TOK_DB; de return TOK_DE; di return TOK_DI; dp return TOK_DP; dr return TOK_DR; r return TOK_RUN; q return TOK_QUIT; s return TOK_STEP; u return TOK_UNASM; we return TOK_MOD_EXT; wi return TOK_MOD_INT; wp return TOK_MOD_PROG; wr return TOK_MOD_REG; z return TOK_RST; zt return TOK_RST_TIMER; all return TOK_ALL; a return TOK_A; b return TOK_B; c return TOK_C; d return TOK_D; [a-z0-9]+ { yylval.string = strdup(yytext); return WORD; } [\n] return TOK_ENTER; [ \t]+ { /* ignore whitespace */ } . { return yytext[0]; } %% emu8051-2.0.1/src/cli/Makefile.am0000644000175400017500000000124412313352657013145 00000000000000# This file is processed by GNU automake to generate Makefile.in AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I@top_srcdir@ \ -I@top_srcdir@/src/common # Option -d: produce header file scanner.h AM_LFLAGS = --header-file=scanner.h # Option -d: produce header file parser.h AM_YFLAGS = -d LDADD = \ $(LIBREADLINE) \ $(top_builddir)/src/common/libemu8051.a bin_PROGRAMS = emu8051-cli emu8051_cli_SOURCES = \ parser.y scanner.l \ main.c \ menu.c menu.h \ keyboard.c keyboard.h # We want these in the dist tarball EXTRA_DIST = scanner.h CLEANFILES = *~ MAINTAINERCLEANFILES = \ Makefile.in \ scanner.h scanner.c \ parser.h parser.c emu8051-2.0.1/src/cli/Makefile.in0000644000175400017500000004766512313352710013165 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # This file is processed by GNU automake to generate Makefile.in VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = emu8051-cli$(EXEEXT) subdir = src/cli DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am parser.h \ parser.c scanner.c $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/ylwrap ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_emu8051_cli_OBJECTS = parser.$(OBJEXT) scanner.$(OBJEXT) \ main.$(OBJEXT) menu.$(OBJEXT) keyboard.$(OBJEXT) emu8051_cli_OBJECTS = $(am_emu8051_cli_OBJECTS) emu8051_cli_LDADD = $(LDADD) am__DEPENDENCIES_1 = emu8051_cli_DEPENDENCIES = $(am__DEPENDENCIES_1) \ $(top_builddir)/src/common/libemu8051.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = LEXCOMPILE = $(LEX) $(AM_LFLAGS) $(LFLAGS) AM_V_LEX = $(am__v_LEX_@AM_V@) am__v_LEX_ = $(am__v_LEX_@AM_DEFAULT_V@) am__v_LEX_0 = @echo " LEX " $@; am__v_LEX_1 = YLWRAP = $(top_srcdir)/build-aux/ylwrap am__yacc_c2h = sed -e s/cc$$/hh/ -e s/cpp$$/hpp/ -e s/cxx$$/hxx/ \ -e s/c++$$/h++/ -e s/c$$/h/ YACCCOMPILE = $(YACC) $(AM_YFLAGS) $(YFLAGS) AM_V_YACC = $(am__v_YACC_@AM_V@) am__v_YACC_ = $(am__v_YACC_@AM_DEFAULT_V@) am__v_YACC_0 = @echo " YACC " $@; am__v_YACC_1 = SOURCES = $(emu8051_cli_SOURCES) DIST_SOURCES = $(emu8051_cli_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I@top_srcdir@ \ -I@top_srcdir@/src/common # Option -d: produce header file scanner.h AM_LFLAGS = --header-file=scanner.h # Option -d: produce header file parser.h AM_YFLAGS = -d LDADD = \ $(LIBREADLINE) \ $(top_builddir)/src/common/libemu8051.a emu8051_cli_SOURCES = \ parser.y scanner.l \ main.c \ menu.c menu.h \ keyboard.c keyboard.h # We want these in the dist tarball EXTRA_DIST = scanner.h CLEANFILES = *~ MAINTAINERCLEANFILES = \ Makefile.in \ scanner.h scanner.c \ parser.h parser.c all: all-am .SUFFIXES: .SUFFIXES: .c .l .o .obj .y $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cli/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/cli/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad parser.h: parser.c @if test ! -f $@; then rm -f parser.c; else :; fi @if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) parser.c; else :; fi emu8051-cli$(EXEEXT): $(emu8051_cli_OBJECTS) $(emu8051_cli_DEPENDENCIES) $(EXTRA_emu8051_cli_DEPENDENCIES) @rm -f emu8051-cli$(EXEEXT) $(AM_V_CCLD)$(LINK) $(emu8051_cli_OBJECTS) $(emu8051_cli_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/keyboard.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/menu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanner.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .l.c: $(AM_V_LEX)$(am__skiplex) $(SHELL) $(YLWRAP) $< $(LEX_OUTPUT_ROOT).c $@ -- $(LEXCOMPILE) .y.c: $(AM_V_YACC)$(am__skipyacc) $(SHELL) $(YLWRAP) $< y.tab.c $@ y.tab.h `echo $@ | $(am__yacc_c2h)` y.output $*.output -- $(YACCCOMPILE) ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -rm -f parser.c -rm -f parser.h -rm -f scanner.c -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-binPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/src/cli/main.c0000644000175400017500000000145612313352657012206 00000000000000/* * main.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include "config.h" #include #include #include "common.h" #include "cpu8051.h" #include "options.h" #include "hexfile.h" #include "menu.h" #include "parser.h" extern struct options_t options; int main(int argc, char **argv) { int rc; parse_command_line_options(argc, argv); cpu8051_init(); if (options.filename != NULL) { rc = hexfile_load(options.filename); if (!rc) exit(EXIT_FAILURE); } console_reset(); if (options.stop_address != 0) { /* Automatically run program and stop at specified address. */ console_exec(-1); } else { menu_display_usage(); (void) yyparse(); } exit(EXIT_SUCCESS); } emu8051-2.0.1/src/cli/menu.c0000644000175400017500000001557712313352657012237 00000000000000/* * menu.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include "config.h" #include #include #include #include #ifdef HAVE_LIBREADLINE #include #include #endif /* HAVE_LIBREADLINE */ #include "common.h" #include "cpu8051.h" #include "reg8051.h" #include "sfr.h" #include "memory.h" #include "timers.h" #include "options.h" #include "hexfile.h" #include "keyboard.h" #include "scanner.h" #include "menu.h" extern struct options_t options; #define YY_NULL 0 #define MENU_PROMPT "-> " int menu_get_input(char *buf, ssize_t size) { char *line; int max_len; max_len = size - 2; if (feof(yyin)) return YY_NULL; #ifdef HAVE_LIBREADLINE /* Get the input line, and if non-empty, place it in the history. */ line = readline(MENU_PROMPT); if (!line) return YY_NULL; if (line && *line) add_history(line); if ((int) strlen(line) > max_len) { printf("input line too long"); free(line); return YY_NULL; } strcpy(buf, line); /* Readline never gives you the last '\n', so add it back for Lex. */ strcat(buf, "\n"); free(line); #else /* It's okay to print a prompt if we are redirecting stdout, * as long as stdin is still a tty. Otherwise, don't print * a prompt at all if stdin is redirected. */ (void) fputs(MENU_PROMPT, stdout); (void) fflush(stdout); /* for svr4 */ line = fgets(buf, max_len, stdin); if (!line) return YY_NULL; #endif return strlen(buf); } void menu_display_usage(void) { int id; printf(" " PACKAGE_NAME " commands, [] = options:\n" "\n" " sb [ADDRESS] Set breakpoint at PC or ADDRESS\n" " rb [ADDRESS] Remove breakpoint at PC or ADDRESS\n" " ADDRESS = all: clear all breakpoints\n" " db Display breakpoints\n" " de ADDRESS NUM Dump NUM bytes from ADDRESS in external data" " memory\n" " di ADDRESS NUM Dump NUM bytes from ADDRESS in internal data" " memory\n" " dp ADDRESS NUM Dump NUM bytes from ADDRESS in program" " memory\n" " dr Display registers\n" " h or ? Display this help menu\n" " q Quit\n" " r [NUM] Run until breakpoint or for NUM " "instructions\n" " s Step (execute 1 instruction)\n" " u [ADDRESS] [NUM] Unassemble NUM instructions at ADDRESS\n" " we ADDRESS VAL Write VAL at ADDRESS in external data memory\n" " wi ADDRESS VAL Write VAL at ADDRESS in internal data memory\n" " wp ADDRESS VAL Write VAL at ADDRESS in program memory\n" " wr REGISTER VAL Write VAL at REGISTER (REGISTER is name of" " register)\n" " z Reset processor\n" " zt ID Reset emulator timer ID ("); for (id = 0; id < GP_TIMERS_COUNT; id++) { printf("%c", 'A' + id); if (id < (GP_TIMERS_COUNT - 1)) printf(", "); } printf(")\n"); } /* Disassemble num instructions at address */ void disassemble_num(unsigned int address, int num) { char str[255]; int row; for (row = 0; row < num; row++) { address += cpu8051_disasm(address, str); printf("%s\n", str); if (address > 0xFFFF) return; } } /* Capitalize all letters in buffer */ static void uppercase(char *buffer) { size_t k; for (k = 0; k < strlen(buffer); k++) buffer[k] = toupper(buffer[k]); } /* Set NewValue to Register */ void register_set(char *name, int value) { struct regwin_infos_t *regwin_infos; uppercase(name); log_debug(" Modify register %s to $%04X", name, value); regwin_infos = sfr_get_infos(name); if (regwin_infos == NULL) { printf("Invalid register name\n"); return; } regwin_write(regwin_infos, value); } /* CPU reset and Console UI update */ void console_reset(void) { log_info("Resetting..."); cpu8051_reset(); log_info("Done"); } /* * CPU exec and Console UI update * num = number of instructions to execute. * set to -1: run to infinity */ void console_exec(int num) { keyboard_init(); log_info("Program executing..."); (void) cpu8051_run(num, kbhit); if (kbhit()) { (void) getch(); /* Flush key */ log_info("Caught break signal!"); } keyboard_reset(); console_show_registers(); disassemble_num(cpu8051.pc, 1); } /* CPU trace and Console UI update */ void console_trace(void) { (void) cpu8051_exec(); console_show_registers(); disassemble_num(cpu8051.pc, 1); } /* Show CPU registers, one per line */ static void console_dump_sfr_registers_detailed(void) { int k; for (k = 0; k < SFR_REGS; k++) { struct regwin_infos_t *regwin_infos; int val; regwin_infos = sfr_get_infos_from_row(k); printf("%s = ", regwin_infos->name); val = regwin_read(k); if (regwin_infos->w == 2) printf("$%02X", val); else if (regwin_infos->w == 4) printf("$%04X", val); printf("\n"); } } /* Show CPU registers, compact format */ static void console_dump_sfr_registers_compact(void) { int id; unsigned char PSW = mem_read_direct(_PSW_); int bank_sel = (PSW & 0x18); printf("----------------------------------------------------------------------\n"); printf("| PC | SP | DPTR | ACC | B | PSW: CY AC F0 RS1 RS0 OV - P |\n"); printf("| %.4X | %.2X | %.4X | %.2X | %.2X |", cpu8051.pc, mem_read_direct(_SP_), mem_sfr_read_dptr(), mem_read_direct(_ACC_), mem_read_direct(_B_)); printf(" %d %d %d %d %d %d %d %d |", (PSW >> 7) & 1, (PSW >> 6) & 1, (PSW >> 5) & 1, (PSW >> 4) & 1, (PSW >> 3) & 1, (PSW >> 2) & 1, (PSW >> 1) & 1, PSW & 1); printf("\n"); printf("----------------------------------------------------------------------\n"); printf("| TCON | TMOD | IE | IP | R0 | R1 | R2 | R3 | R4 | R5 | R6 | R7 | |\n"); printf("| %.2X | %.2X | %.2X | %.2X ", mem_read_direct(_TCON_), mem_read_direct(_TMOD_), mem_read_direct(_IE_), mem_read_direct(_IP_)); printf("| %.2X | %.2X | %.2X | %.2X ", mem_read_direct(bank_sel + _R0_), mem_read_direct(bank_sel + _R1_), mem_read_direct(bank_sel + _R2_), mem_read_direct(bank_sel + _R3_)); printf("| %.2X | %.2X | %.2X | %.2X ", mem_read_direct(bank_sel + _R4_), mem_read_direct(bank_sel + _R5_), mem_read_direct(bank_sel + _R6_), mem_read_direct(bank_sel + _R7_)); printf("| |\n"); printf("----------------------------------------------------------------------\n"); for (id = 0; id < GP_TIMERS_COUNT; id++) printf("| Emulator timer %c: %08d |\n", 'A' + id, gp_timer_read(id)); printf("------------------------------\n"); } /* Show CPU registers */ void console_show_registers(void) { if (options.stop_address != 0) console_dump_sfr_registers_detailed(); else console_dump_sfr_registers_compact(); } emu8051-2.0.1/src/cli/menu.h0000644000175400017500000000102612313352657012224 00000000000000/* * menu.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef _MENU_H_ #define _MENU_H_ int yyparse(void); int menu_get_input(char *buf, ssize_t size); void menu_display_usage(void); void console_show_registers(void); void register_set(char *name, int value); void console_reset(void); void console_exec(int num); void console_trace(void); void disassemble_num(unsigned int address, int num); #endif /* _MENU_H_ */ emu8051-2.0.1/src/cli/keyboard.c0000644000175400017500000000167612313352657013066 00000000000000/* * keyboard.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include #include static struct termios orig, newtio; static int peek = -1; int kbhit(void) { char ch; int nread; if (peek != -1) return 1; newtio.c_cc[VMIN] = 0; tcsetattr(0, TCSANOW, &newtio); nread = read(0, &ch, 1); newtio.c_cc[VMIN] = 1; tcsetattr(0, TCSANOW, &newtio); if (nread == 1) { peek = ch; return 1; } return 0; } int getch(void) { char ch; if (peek != -1) { ch = peek; peek = -1; return ch; } read(0, &ch, 1); return ch; } void keyboard_init(void) { tcgetattr(0, &orig); newtio = orig; newtio.c_lflag &= ~ICANON; newtio.c_lflag &= ~ECHO; newtio.c_lflag &= ~ISIG; newtio.c_cc[VMIN] = 1; newtio.c_cc[VTIME] = 0; tcsetattr(0, TCSANOW, &newtio); } void keyboard_reset(void) { tcsetattr(0, TCSANOW, &orig); } emu8051-2.0.1/src/cli/keyboard.h0000644000175400017500000000050712313352657013063 00000000000000/* * keyboard.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef _KEYBOARD_H_ #define _KEYBOARD_H_ int kbhit(void); int getch(void); void keyboard_init(void); void keyboard_reset(void); #endif /* _KEYBOARD_H_ */ emu8051-2.0.1/src/gtk/0000755000175400017500000000000012313352716011202 500000000000000emu8051-2.0.1/src/gtk/memwin.c0000644000175400017500000002311512313352657012570 00000000000000/* * memwin.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include /* For isprint */ #include /* For crc32 routine */ #include "common.h" #include "memory.h" #include "hexfile.h" #include "cpu8051.h" #include "regwin.h" #include "memwin.h" #include "main.h" #include "options.h" #include "log.h" #include "app-config.h" extern struct app_config_t *cfg; extern struct options_t options; static int COL_ASCII; static int N_COLUMNS; enum { COL_ADDRESS = 0, COL_DATA0, }; /* Contains informations for the two different memory window types. */ struct memwin_infos_t { GtkWidget *memlist; int data_rows; uint32_t *crc; int crc_init; }; static struct memwin_infos_t memwin_infos_internal; static struct memwin_infos_t memwin_infos_external; static struct memwin_infos_t *memwin_infos; /* Creating a model */ static GtkListStore * memwin_init_store(int data_rows) { GtkTreeIter iter; int row; int col; GtkListStore *store; GType col_types[N_COLUMNS]; /* No need for static array, all our columns are of the same type. */ for (col = 0; col < N_COLUMNS; col++) col_types[col] = G_TYPE_STRING; store = gtk_list_store_newv(N_COLUMNS, col_types); /* Add rows. */ for (row = 0; row < data_rows; row++) gtk_list_store_append(store, &iter); return store; } static void memwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, gchar *new_str, gpointer model) { guint column; enum mem_id_t memory_id; gpointer columnptr; gpointer memory_id_ptr; GtkTreeIter iter; int address; uint8_t old; int new; char *str; if (!model) log_err("Unable to get model from cell renderer"); /* Column number is passed as renderer object data */ columnptr = g_object_get_data(G_OBJECT(cell), "column"); column = GPOINTER_TO_UINT(columnptr); /* Memory ID is passed as renderer object data */ memory_id_ptr = g_object_get_data(G_OBJECT(cell), "memory_id"); memory_id = GPOINTER_TO_UINT(memory_id_ptr); /* Get the iterator */ gtk_tree_model_get_iter_from_string(model, &iter, path_string); /* Get base address. */ gtk_tree_model_get(model, &iter, COL_ADDRESS, &str, -1); /* No need to check error, has already been validated. */ address = asciihex2int(str); /* Convert column number (1, 2, 3...) to index (0, 1, 2...) */ address += (column - COL_DATA0); old = mem_read8(memory_id, address); log_info("Address: $%02X", address); log_info(" old value: $%02X", old); /* Convert new value (asciihex) to integer. */ new = asciihex2int(new_str); if (asciihex2int_get_error()) { log_warn(" new value: invalid"); return; } else if ((new < 0) || (new > 255)) { log_warn(" new value: out of range"); return; } else { log_info(" new value: $%02X", new); } /* Store new value in emulator memory. */ mem_write8(memory_id, address, new); /* Convert to text. */ int2asciihex(new, str, 2); /* Store new value in gtk model. */ gtk_list_store_set(GTK_LIST_STORE(model), &iter, column, str, -1); /* * Make sure to update all registers and memory. * For example, BANKed registers depends on internal memory. */ emugtk_update_display(); }; static void memwin_init_columns(GtkWidget *listview, enum mem_id_t memory_id) { int i; GtkCellRenderer *renderer; GtkTreeViewColumn *column; /* Columns and cell renderers */ renderer = gtk_cell_renderer_text_new(); /* Add address column */ column = gtk_tree_view_column_new_with_attributes( "Address", renderer, "text", COL_ADDRESS, NULL); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); for (i = COL_DATA0; i < (COL_DATA0 + cfg->bytes_per_row); i++) { char col_name[8]; /* Create new renderer for each editable cell. */ renderer = gtk_cell_renderer_text_new(); /* Allow edition, align to left side. */ g_object_set(renderer, "editable", TRUE, "xalign", 0, NULL); g_signal_connect(renderer, "edited", G_CALLBACK(memwin_cell_edited), gtk_tree_view_get_model( GTK_TREE_VIEW(listview))); /* Add column index and memory_id, used when editing the cell */ g_object_set_data(G_OBJECT(renderer), "column", GUINT_TO_POINTER(i)); g_object_set_data(G_OBJECT(renderer), "memory_id", GUINT_TO_POINTER(memory_id)); /* Use two digits only if DATA_ROWS > 10 */ if (cfg->bytes_per_row < 10) sprintf(col_name, "B%1d", i - COL_DATA0); else sprintf(col_name, "B%02d", i - COL_DATA0); column = gtk_tree_view_column_new_with_attributes( col_name, renderer, "text", i, NULL); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); } /* Add ASCII column, using fixed-font. */ renderer = gtk_cell_renderer_text_new(); g_object_set(renderer, "family", "Monospace", NULL); column = gtk_tree_view_column_new_with_attributes( "ASCII", renderer, "text", COL_ASCII, NULL); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column); } static void memwin_infos_select(enum mem_id_t memory_id) { if (memory_id == INT_MEM_ID) { log_debug("memory ID = INTERNAL"); memwin_infos = &memwin_infos_internal; } else if (memory_id == EXT_MEM_ID) { log_debug("memory ID = EXTERNAL"); memwin_infos = &memwin_infos_external; } else { log_fail("Invalid memory type"); exit(1); } } static void compute_data_rows(int memory_id) { if (memory_id == INT_MEM_ID) memwin_infos->data_rows = options.iram_size / cfg->bytes_per_row; else if (memory_id == EXT_MEM_ID) memwin_infos->data_rows = options.xram_size / cfg->bytes_per_row; if (memwin_infos->crc) free(memwin_infos->crc); memwin_infos->crc = malloc(memwin_infos->data_rows * sizeof(uint32_t)); memwin_infos->crc_init = false; } GtkWidget * memwin_init(char *title, enum mem_id_t memory_id) { GtkWidget *frame; GtkWidget *scrollwin; GtkListStore *store; log_debug("memwin_init"); COL_ASCII = cfg->bytes_per_row + 1; N_COLUMNS = COL_ASCII + 1; frame = gtk_frame_new(title); scrollwin = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), GTK_SHADOW_ETCHED_OUT); /* Automatically add scrollbars when necessary. */ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(frame), scrollwin); memwin_infos_select(memory_id); compute_data_rows(memory_id); /* Creating a model */ store = memwin_init_store(memwin_infos->data_rows); /* Creating the view component */ memwin_infos->memlist = gtk_tree_view_new_with_model( GTK_TREE_MODEL(store)); gtk_tree_view_set_headers_visible( GTK_TREE_VIEW(memwin_infos->memlist), TRUE); gtk_container_add(GTK_CONTAINER(scrollwin), memwin_infos->memlist); memwin_init_columns(memwin_infos->memlist, memory_id); /* * The tree view has acquired its own reference to the model, so we can * drop ours. That way the model will be freed automatically when the * tree view is destroyed. */ g_object_unref(store); return frame; } /* * Use CRC to detect which rows have changed. This is only to * improve performance when using stepping mode, as we then only update * rows which have been modified. */ static int memwin_row_changed(enum mem_id_t memory_id, int row, unsigned int address) { int row_changed; uint32_t crc_new = 0; uint8_t *buf8; buf8 = mem_getbuf(memory_id, address); crc_new = crc32(0L, Z_NULL, 0); crc_new = crc32(crc_new, buf8, cfg->bytes_per_row); if ((memwin_infos->crc_init) && (crc_new == memwin_infos->crc[row])) { row_changed = false; } else { memwin_infos->crc[row] = crc_new; log_debug(" Row %02d value(s) change", row); row_changed = true; } return row_changed; } /* Dump internal or external memory. */ void memwin_refresh(enum mem_id_t memory_id) { int row; unsigned int address = 0; GtkListStore *store; log_debug("memwin_refresh"); memwin_infos_select(memory_id); store = GTK_LIST_STORE(gtk_tree_view_get_model( GTK_TREE_VIEW(memwin_infos->memlist))); for (row = 0; row < memwin_infos->data_rows; row++, address += cfg->bytes_per_row) { int valid; GtkTreeIter iter; char str[4+1]; /* Max. str len for address column (4 digits) */ char ascii_str[16+1]; /* Maximum 16 data columns. */ int col; if (row == 0) { /* Get first row in list store */ valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(store), &iter); } else { /* Get next row in list store */ valid = gtk_tree_model_iter_next( GTK_TREE_MODEL(store), &iter); } if (!valid) { log_err("Tree model: invalid iter"); return; } /* Only update row if it has been modified. */ if (memwin_row_changed(memory_id, row, address)) { /* Display base address. */ int2asciihex(address, str, 4); gtk_list_store_set(store, &iter, COL_ADDRESS, str, -1); for (col = 0; col < cfg->bytes_per_row; col++) { uint8_t data; data = mem_read8(memory_id, address + col); /* Display hex data */ int2asciihex(data, str, 2); gtk_list_store_set(store, &iter, col + 1, str, -1); /* Append to ASCII string (if applicable). */ if (!isprint(data)) data = '.'; sprintf(&ascii_str[col], "%c", data); } /* Display ASCII characters. */ gtk_list_store_set(store, &iter, COL_ASCII, ascii_str, -1); } } /* At this point we know all rows crc have been initialized. */ memwin_infos->crc_init = true; } emu8051-2.0.1/src/gtk/memwin.h0000644000175400017500000000054512313352657012577 00000000000000/* * memwin.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef MEMWIN_H #define MEMWIN_H 1 #include GtkWidget * memwin_init(char *title, enum mem_id_t memory_id); void memwin_refresh(enum mem_id_t memory_id); #endif /* MEMWIN_H */ emu8051-2.0.1/src/gtk/regwin.c0000644000175400017500000001257412313352657012576 00000000000000/* * regwin.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "sfr.h" #include "memory.h" #include "regwin.h" #include "memwin.h" #include "pgmwin.h" #include "instructions_8051.h" #include "hexfile.h" #include "main.h" static GtkWidget *reglist; #define LIST_VIEW_NAME "Registers" #define DATA_ROWS SFR_REGS enum { COL_NAME = 0, COL_VAL, N_COLUMNS, }; /* Creating a model */ static GtkListStore * regwin_init_store(void) { GtkTreeIter iter; int row; int col; GtkListStore *store; GType col_types[N_COLUMNS]; /* No need for static array, all our columns are of the same type. */ for (col = 0; col < N_COLUMNS; col++) col_types[col] = G_TYPE_STRING; store = gtk_list_store_newv(N_COLUMNS, col_types); /* Add rows. */ for (row = 0; row < DATA_ROWS; row++) gtk_list_store_append(store, &iter); return store; } static void regwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, gchar *new_str, gpointer model) { GtkTreeIter iter; int old; int new; char *str; int rc; struct regwin_infos_t *regwin_infos; (void) cell; /* Remove compiler warning about unused variables. */ if (!model) log_err("Unable to get model from cell renderer"); /* Get the iterator */ gtk_tree_model_get_iter_from_string(model, &iter, path_string); /* Get register name. */ gtk_tree_model_get(model, &iter, COL_NAME, &str, -1); log_info("Register: %s", str); regwin_infos = sfr_get_infos(str); log_info(" width: %d bits", 4 * regwin_infos->w); /* Read current (old) value. */ gtk_tree_model_get(model, &iter, COL_VAL, &str, -1); /* No need to check error, has already been validated. */ old = asciihex2int(str); log_info(" old value: $%04X", old); new = asciihex2int(new_str); if (asciihex2int_get_error()) { log_warn(" new value: invalid"); return; } log_info(" new value: $%04X", new); /* Store new value in emulator register (if in range). */ rc = regwin_write(regwin_infos, new); if (rc == 0) { /* Store new value in gtk model. */ int2asciihex(new, str, regwin_infos->w); gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_VAL, str, -1); /* * Make sure to update all windows. * For example, R0-R7 values depends on internal memory values. */ emugtk_update_display(); } }; static void regwin_init_columns(void) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; /* Columns and cell renderers */ renderer = gtk_cell_renderer_text_new(); /* Add Register column */ column = gtk_tree_view_column_new_with_attributes( "Name", renderer, "text", COL_NAME, NULL); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(reglist), column); /* Add Value column */ /* Create new renderer for value column (editable). */ renderer = gtk_cell_renderer_text_new(); /* Allow edition, align to right side. */ g_object_set(renderer, "editable", TRUE, "xalign", 1.0, NULL); g_signal_connect(renderer, "edited", G_CALLBACK(regwin_cell_edited), gtk_tree_view_get_model(GTK_TREE_VIEW(reglist))); column = gtk_tree_view_column_new_with_attributes( "Value", renderer, "text", COL_VAL, NULL); gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(reglist), column); } GtkWidget * regwin_init(void) { GtkWidget *frame; GtkWidget *scrollwin; GtkListStore *store; frame = gtk_frame_new(LIST_VIEW_NAME); scrollwin = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), GTK_SHADOW_ETCHED_OUT); /* Automatically add scrollbars when necessary. */ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(frame), scrollwin); /* Creating a model */ store = regwin_init_store(); /* Creating the view component */ reglist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(reglist), TRUE); gtk_container_add(GTK_CONTAINER(scrollwin), reglist); regwin_init_columns(); /* * The tree view has acquired its own reference to the model, so we can * drop ours. That way the model will be freed automatically when the * tree view is destroyed. */ g_object_unref(store); return frame; } /* Show registers. */ void regwin_refresh(void) { int row; GtkListStore *store; store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(reglist))); for (row = 0; row < DATA_ROWS; row++) { int valid; GtkTreeIter iter; int val; char str[8]; struct regwin_infos_t *regwin_infos; if (row == 0) { /* Get first row in list store */ valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(store), &iter); } else { /* Get next row in list store */ valid = gtk_tree_model_iter_next( GTK_TREE_MODEL(store), &iter); } if (!valid) { log_err("Tree model: invalid iter"); return; } regwin_infos = sfr_get_infos_from_row(row); val = regwin_read(row); /* Convert to specified number of hex digits. */ int2asciihex(val, str, regwin_infos->w); gtk_list_store_set(store, &iter, COL_NAME, regwin_infos->name, COL_VAL, str, -1); } } emu8051-2.0.1/src/gtk/regwin.h0000644000175400017500000000046212313352657012574 00000000000000/* * regwin.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef REGWIN_H #define REGWIN_H 1 #include GtkWidget * regwin_init(void); void regwin_refresh(void); #endif /* REGWIN_H */ emu8051-2.0.1/src/gtk/pswwin.c0000644000175400017500000001155512313352657012630 00000000000000/* * pswwin.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "memory.h" #include "pswwin.h" #include "memwin.h" #include "pgmwin.h" #include "psw.h" #include "instructions_8051.h" #include "hexfile.h" #include "main.h" static GtkWidget *pswlist; #define DATA_ROWS 1 #define LIST_VIEW_NAME "PSW" enum { COL_CY = 0, COL_AC, COL_F0, COL_RS1, COL_RS0, COL_OV, COL_RESERVED, COL_P, N_COLUMNS, }; static char *col_names[N_COLUMNS] = { "CY", "AC", "F0", "RS1", "RS0", "OV", "-", "P", }; /* Creating a model */ static GtkListStore * pswwin_init_store(void) { GtkTreeIter iter; int row; int col; GtkListStore *store; GType col_types[N_COLUMNS]; /* No need for static array, all our columns are of the same type. */ for (col = 0; col < N_COLUMNS; col++) col_types[col] = G_TYPE_STRING; store = gtk_list_store_newv(N_COLUMNS, col_types); /* Add rows. */ for (row = 0; row < DATA_ROWS; row++) gtk_list_store_append(store, &iter); return store; } static void pswwin_cell_edited(GtkCellRendererText *cell, gchar *path_string, gchar *new_str, gpointer model) { guint column; gpointer columnptr; GtkTreeIter iter; uint8_t old; int new; char str[10]; int bit_index; if (!model) log_err("Unable to get model from cell renderer"); /* Column number is passed as renderer object data */ columnptr = g_object_get_data(G_OBJECT(cell), "column"); column = GPOINTER_TO_UINT(columnptr); log_info("column = $%02X", column); /* Get the iterator */ gtk_tree_model_get_iter_from_string(model, &iter, path_string); bit_index = 7 - column; old = psw_read_bit(bit_index); log_info(" old value: %d", old); /* Convert new value (asciihex) to integer. */ new = asciihex2int(new_str); if (asciihex2int_get_error()) { log_warn(" new value: invalid"); return; } else if ((new != 0) && (new != 1)) { log_warn(" new value: out of range"); return; } else { log_info(" new value: %d", new); } /* Store new value in emulator memory. */ psw_write_bit(bit_index, new); /* Convert to text. */ int2asciihex(new, str, 1); /* Store new value in gtk model. */ gtk_list_store_set(GTK_LIST_STORE(model), &iter, column, str, -1); /* * Make sure to update all registers and memory. * For example, BANKed registers depends on internal memory. */ emugtk_update_display(); }; static void pswwin_init_columns(void) { int k; /* Add column for each bit in PSW. */ for (k = 0; k < N_COLUMNS; k++) { GtkCellRenderer *renderer; GtkTreeViewColumn *column; /* Create new renderer for value column (editable). */ renderer = gtk_cell_renderer_text_new(); /* Allow edition, align to center. */ g_object_set(renderer, "editable", TRUE, "xalign", 0.5, NULL); g_signal_connect(renderer, "edited", G_CALLBACK(pswwin_cell_edited), gtk_tree_view_get_model( GTK_TREE_VIEW(pswlist))); /* Add column index, used when editing the cell. */ g_object_set_data(G_OBJECT(renderer), "column", GUINT_TO_POINTER(k)); column = gtk_tree_view_column_new_with_attributes( col_names[k], renderer, "text", k, NULL); /* Center column name */ g_object_set(column, "alignment", 0.5, NULL); /* Hardcoded width... */ gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_FIXED); gtk_tree_view_column_set_fixed_width(column, 35); gtk_tree_view_append_column(GTK_TREE_VIEW(pswlist), column); } } GtkWidget * pswwin_init(void) { GtkWidget *frame; GtkListStore *store; frame = gtk_frame_new(LIST_VIEW_NAME); /* Creating a model */ store = pswwin_init_store(); /* Creating the view component */ pswlist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_view_set_grid_lines(GTK_TREE_VIEW(pswlist), GTK_TREE_VIEW_GRID_LINES_BOTH); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(pswlist), TRUE); gtk_container_add(GTK_CONTAINER(frame), pswlist); pswwin_init_columns(); /* * The tree view has acquired its own reference to the model, so we can * drop ours. That way the model will be freed automatically when the * tree view is destroyed. */ g_object_unref(store); return frame; } /* Show registers. */ void pswwin_refresh(void) { GtkListStore *store; int valid; GtkTreeIter iter; int k; store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pswlist))); /* Get first row in list store */ valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(store), &iter); if (!valid) { log_err("Tree model: invalid iter"); return; } /* Display bit values. */ for (k = 0; k < N_COLUMNS; k++) { char str[4]; int bit_index; bit_index = 7 - k; int2asciihex(psw_read_bit(bit_index), str, 1); gtk_list_store_set(store, &iter, k, str, -1); } } emu8051-2.0.1/src/gtk/pswwin.h0000644000175400017500000000046212313352657012630 00000000000000/* * pswwin.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef PSWWIN_H #define PSWWIN_H 1 #include GtkWidget * pswwin_init(void); void pswwin_refresh(void); #endif /* PSWWIN_H */ emu8051-2.0.1/src/gtk/pgmwin.c0000644000175400017500000001501512313352657012575 00000000000000/* * pgmwin.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include "common.h" #include "memory.h" #include "cpu8051.h" #include "opcodes.h" #include "pgmwin.h" #include "hexfile.h" static GtkWidget *pgmlist; #define LIST_VIEW_NAME "Program" #define DATA_ROWS 100 enum { COL_BREAKPT = 0, COL_ADDR, COL_B0, COL_B1, COL_B2, COL_INST, COL_ARGS, COL_COLOR, N_COLUMNS, }; static char *col_names[N_COLUMNS] = { "BPT", "Address", "B0", "B1", "B2", "Mnemonic", "Arguments", "COLOR", /* Not displayed, used to set foreground color of cell. */ }; /* Creating a model */ static GtkListStore * pgmwin_init_store(void) { GtkTreeIter iter; int row; int col; GtkListStore *store; GType col_types[N_COLUMNS]; /* No need for static array, all our columns are of the same type. */ for (col = 0; col < N_COLUMNS; col++) col_types[col] = G_TYPE_STRING; store = gtk_list_store_newv(N_COLUMNS, col_types); /* Add rows. */ for (row = 0; row < DATA_ROWS; row++) { gtk_list_store_append(store, &iter); /* Color first row in red (current instruction). */ if (row == 0) gtk_list_store_set(store, &iter, COL_COLOR, "red", -1); else gtk_list_store_set(store, &iter, COL_COLOR, "black", -1); } return store; } static void pgmwin_init_columns(void) { int k; GtkCellRenderer *renderer; /* Create renderer */ renderer = gtk_cell_renderer_text_new(); /* Add columns, except for last one (COL_COLOR). */ for (k = 0; k < COL_COLOR; k++) { GtkTreeViewColumn *col; /* Create tree view column */ col = gtk_tree_view_column_new(); gtk_tree_view_column_set_title(col, col_names[k]); gtk_tree_view_column_set_sizing(col, GTK_TREE_VIEW_COLUMN_AUTOSIZE); gtk_tree_view_append_column(GTK_TREE_VIEW(pgmlist), col); /* Pack cell renderer into column */ gtk_tree_view_column_pack_start(col, renderer, TRUE); /* Establish connection between cell renderer and data store. */ gtk_tree_view_column_set_attributes(col, renderer, "text", k, "foreground", COL_COLOR, NULL); } } /* Mouse button pressed in the window. */ static gint pgmwin_sel_changed_event(GtkWidget *widget, GdkEvent *event, gpointer data) { GtkTreeSelection *selection; GtkTreeModel *model; GtkTreeIter iter; /* Remove compiler warning about unused variables. */ (void) widget; (void) event; (void) data; log_debug("pgmwin_sel_changed_event()"); /* This will only work in single or browse selection mode! */ selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pgmlist)); if (gtk_tree_selection_get_selected(selection, &model, &iter)) { char *str_addr; int val; gtk_tree_model_get(model, &iter, COL_ADDR, &str_addr, -1); /* Convert hex address in ASCII to integer. */ /* No need to check error, has already been validated. */ val = asciihex2int(str_addr); log_debug(" row address is: $%04X", val); breakpoint_toggle(val); pgmwin_refresh(); g_free(str_addr); } else { log_debug(" no row selected"); } return FALSE; } GtkWidget * pgmwin_init(void) { GtkWidget *frame; GtkWidget *scrollwin; GtkListStore *store; GtkTreeSelection *selection; frame = gtk_frame_new(LIST_VIEW_NAME); scrollwin = gtk_scrolled_window_new(NULL, NULL); gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrollwin), GTK_SHADOW_ETCHED_OUT); /* Automatically add scrollbars when necessary. */ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollwin), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_container_add(GTK_CONTAINER(frame), scrollwin); /* Creating a model */ store = pgmwin_init_store(); /* Creating the view component */ pgmlist = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(pgmlist), TRUE); gtk_container_add(GTK_CONTAINER(scrollwin), pgmlist); selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(pgmlist)); /* Only one row can be selected at a time. */ gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE); g_signal_connect(selection, "changed", G_CALLBACK(pgmwin_sel_changed_event), NULL); pgmwin_init_columns(); /* * The tree view has acquired its own reference to the model, so we can * drop ours. That way the model will be freed automatically when the * tree view is destroyed. */ g_object_unref(store); return frame; } /* Show disassembled program. */ void pgmwin_refresh(void) { int row; GtkListStore *store; unsigned int address; address = cpu8051.pc; store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(pgmlist))); for (row = 0; row < DATA_ROWS; row++) { int valid; GtkTreeIter iter; char str[128]; int k; int col_id; int inst_size; unsigned char opcode; if (row == 0) { /* Get first row in list store */ valid = gtk_tree_model_get_iter_first( GTK_TREE_MODEL(store), &iter); } else { /* Get next row in list store */ valid = gtk_tree_model_iter_next( GTK_TREE_MODEL(store), &iter); } if (!valid) { log_err("Tree model: invalid iter"); return; } if (address > 0xFFFF) { /* * Not the most elegant solution, but it works to not * display instructions past last address, 0xFFFF. */ gtk_list_store_set(store, &iter, COL_BREAKPT, NULL, COL_ADDR, NULL, COL_B0, NULL, COL_B1, NULL, COL_B2, NULL, COL_INST, NULL, COL_ARGS, NULL, COL_COLOR, NULL, -1); } else { /* Display breakpoints. */ if (breakpoint_is_defined(address)) sprintf(str, "*"); else str[0] = '\0'; gtk_list_store_set(store, &iter, COL_BREAKPT, str, -1); /* Display base address. */ int2asciihex(address, str, 4); gtk_list_store_set(store, &iter, COL_ADDR, str, -1); opcode = mem_read8(PGM_MEM_ID, address); inst_size = opcodes_get_instr_size(opcode); /* Display instruction hex bytes. */ for (k = 0, col_id = COL_B0; k < 3; k++, col_id++) { if (k < inst_size) int2asciihex(mem_read8(PGM_MEM_ID, address + k), str, 2); else str[0] = '\0'; gtk_list_store_set(store, &iter, col_id, str, -1); } /* Display instruction menmonic. */ (void) cpu8051_disasm_mnemonic(opcode, str); gtk_list_store_set(store, &iter, COL_INST, str, -1); /* Display instruction arguments (if applicable). */ cpu8051_disasm_args(address, str); gtk_list_store_set(store, &iter, COL_ARGS, str, -1); address += inst_size; } } } emu8051-2.0.1/src/gtk/pgmwin.h0000644000175400017500000000046212313352657012602 00000000000000/* * pgmwin.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef PGMWIN_H #define PGMWIN_H 1 #include GtkWidget * pgmwin_init(void); void pgmwin_refresh(void); #endif /* PGMWIN_H */ emu8051-2.0.1/src/gtk/helpmenu.c0000644000175400017500000000447212313352657013116 00000000000000/* * helpmenu.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #if STDC_HEADERS # include #elif HAVE_STRINGS_H # include #endif #include #include "common.h" #include "options.h" #include "main.h" #include "messagebox.h" #include "helpmenu.h" static void help_about_event(GtkWidget *widget, gpointer data) { /* Remove compiler warning about unused variables. */ (void) widget; (void) data; const char *authors[] = { "Hugo Villeneuve ", "Jonathan St-André", "Pascal Fecteau", "Jimmy Ringuette", NULL, }; const char *license = "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 of the License, or (at your option) any later" " version.\n\n" "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.\n\n" "You should have received a copy of the GNU General Public" " License along with this program. If not, see\n" " "; gtk_show_about_dialog( NULL, "name", PACKAGE_NAME, "title", "About Dialog", "version", PACKAGE_VERSION, "logo-icon-name", PACKAGE_TARNAME, "comments", PACKAGE_DESCRIPTION, "authors", authors, "website", PACKAGE_URL, "copyright", PACKAGE_COPYRIGHT, "license", license, "wrap-license", true, NULL); } void help_add_menu(GtkWidget *menu_bar) { GtkWidget *item; GtkWidget *menu; menu = gtk_menu_new(); /* Create the 'Help About' item. */ item = gtk_menu_item_new_with_label("About " PACKAGE); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Attach the callback functions to the activate signal. */ g_signal_connect(item, "activate", G_CALLBACK(help_about_event), NULL); /* Adding submenu title. */ item = gtk_menu_item_new_with_label("Help"); gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu); gtk_menu_shell_append((GtkMenuShell *) menu_bar, item); } emu8051-2.0.1/src/gtk/helpmenu.h0000644000175400017500000000045012313352657013113 00000000000000/* * helpmenu.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef HELPMENU_H #define HELPMENU_H 1 #include void help_add_menu(GtkWidget *menu_bar); #endif /* HELPMENU_H */ emu8051-2.0.1/src/gtk/filemenu.c0000644000175400017500000000614212313352657013101 00000000000000/* * filemenu.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include /* UNIX standard function definitions */ #include #include #include "common.h" #include "main.h" #include "messagebox.h" #include "filemenu.h" #define FILENAME_DESCRIPTION "Open Intel Hex file" static char previous_folder[MAX_FILENAME_LENGTH + 1]; static void remember_current_folder(GtkFileChooser *chooser) { char *folder; folder = gtk_file_chooser_get_current_folder(chooser); if (folder != NULL) { if (strlen(folder) >= MAX_FILENAME_LENGTH) { /* Non-critical error */ log_warn("current folder name too long for buffer"); } else { log_info("current folder = %s", folder); strncpy(previous_folder, folder, MAX_FILENAME_LENGTH); } g_free(folder); } } static void file_open_event(GtkObject *object, gpointer data) { GtkWidget *file_dialog; char *dir; char *cwd = NULL; /* Remove compiler warning about unused variables. */ (void) object; (void) data; log_info("file_open_event()"); /* Create a new file selection widget. */ file_dialog = gtk_file_chooser_dialog_new( FILENAME_DESCRIPTION, NULL, GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); if (strlen(previous_folder) == 0) { /* Opening file chooser to current working directory. */ cwd = g_get_current_dir(); dir = cwd; } else { /* Opening file chooser to previous opened directory. */ dir = previous_folder; } gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(file_dialog), dir); if (cwd) g_free(cwd); if (gtk_dialog_run(GTK_DIALOG(file_dialog)) == GTK_RESPONSE_ACCEPT) { char *selected_file; selected_file = gtk_file_chooser_get_filename( GTK_FILE_CHOOSER(file_dialog)); if (selected_file != NULL) { log_info("emugtk_File = %s", selected_file); remember_current_folder(GTK_FILE_CHOOSER(file_dialog)); emugtk_new_file(selected_file); g_free(selected_file); } } gtk_widget_destroy(file_dialog); } static void file_quit_event(gchar *string) { /* Remove compiler warning about unused variables. */ (void) string; emugtk_quit_gui(); } void file_add_menu(GtkWidget *menu_bar) { GtkWidget *item; GtkWidget *menu; menu = gtk_menu_new(); /* Create the 'open' item. */ item = gtk_menu_item_new_with_label(FILENAME_DESCRIPTION); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* Attach the callback functions to the activate signal. */ g_signal_connect(item, "activate", G_CALLBACK(file_open_event), NULL); add_menu_separator(menu); item = gtk_menu_item_new_with_label("Exit"); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); /* We can attach the Quit menu item to our exit function */ g_signal_connect(item, "activate", G_CALLBACK(file_quit_event), (gpointer) "file.quit"); /* Adding submenu title. */ item = gtk_menu_item_new_with_label("File"); gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), menu); gtk_menu_shell_append((GtkMenuShell *) menu_bar, item); } emu8051-2.0.1/src/gtk/filemenu.h0000644000175400017500000000045012313352657013102 00000000000000/* * filemenu.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef FILEMENU_H #define FILEMENU_H 1 #include void file_add_menu(GtkWidget *menu_bar); #endif /* FILEMENU_H */ emu8051-2.0.1/src/gtk/Makefile.am0000644000175400017500000000155212313352657013165 00000000000000# This file is processed by GNU automake to generate Makefile.in AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I@top_srcdir@ \ -I@top_srcdir@/src/common \ -I$(top_srcdir)/pixmaps \ @GTK_CFLAGS@ \ @GLIB_CFLAGS@ \ -DDATADIR=\"$(datadir)\" \ -DGDK_PIXBUF_DISABLE_DEPRECATED \ -DGDK_DISABLE_DEPRECATED \ -DGTK_DISABLE_DEPRECATED LDADD = \ $(top_builddir)/src/common/libemu8051.a \ @GTK_LIBS@ \ @ZLIB_LIBS@ \ @GLIB_LIBS@ bin_PROGRAMS = emu8051-gtk emu8051_gtk_SOURCES = \ main.c main.h \ app-config.c app-config.h \ memwin.c memwin.h \ pgmwin.c pgmwin.h \ regwin.c regwin.h \ pswwin.c pswwin.h \ timerwin.c timerwin.h \ filemenu.c filemenu.h \ viewmenu.c viewmenu.h \ helpmenu.c helpmenu.h \ messagebox.c messagebox.h EXTRA_DIST = CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in emu8051-2.0.1/src/gtk/Makefile.in0000644000175400017500000004724612313352710013176 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # This file is processed by GNU automake to generate Makefile.in VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : bin_PROGRAMS = emu8051-gtk$(EXEEXT) subdir = src/gtk DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_emu8051_gtk_OBJECTS = main.$(OBJEXT) app-config.$(OBJEXT) \ memwin.$(OBJEXT) pgmwin.$(OBJEXT) regwin.$(OBJEXT) \ pswwin.$(OBJEXT) timerwin.$(OBJEXT) filemenu.$(OBJEXT) \ viewmenu.$(OBJEXT) helpmenu.$(OBJEXT) messagebox.$(OBJEXT) emu8051_gtk_OBJECTS = $(am_emu8051_gtk_OBJECTS) emu8051_gtk_LDADD = $(LDADD) emu8051_gtk_DEPENDENCIES = $(top_builddir)/src/common/libemu8051.a AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(emu8051_gtk_SOURCES) DIST_SOURCES = $(emu8051_gtk_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I@top_srcdir@ \ -I@top_srcdir@/src/common \ -I$(top_srcdir)/pixmaps \ @GTK_CFLAGS@ \ @GLIB_CFLAGS@ \ -DDATADIR=\"$(datadir)\" \ -DGDK_PIXBUF_DISABLE_DEPRECATED \ -DGDK_DISABLE_DEPRECATED \ -DGTK_DISABLE_DEPRECATED LDADD = \ $(top_builddir)/src/common/libemu8051.a \ @GTK_LIBS@ \ @ZLIB_LIBS@ \ @GLIB_LIBS@ emu8051_gtk_SOURCES = \ main.c main.h \ app-config.c app-config.h \ memwin.c memwin.h \ pgmwin.c pgmwin.h \ regwin.c regwin.h \ pswwin.c pswwin.h \ timerwin.c timerwin.h \ filemenu.c filemenu.h \ viewmenu.c viewmenu.h \ helpmenu.c helpmenu.h \ messagebox.c messagebox.h EXTRA_DIST = CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gtk/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/gtk/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad emu8051-gtk$(EXEEXT): $(emu8051_gtk_OBJECTS) $(emu8051_gtk_DEPENDENCIES) $(EXTRA_emu8051_gtk_DEPENDENCIES) @rm -f emu8051-gtk$(EXEEXT) $(AM_V_CCLD)$(LINK) $(emu8051_gtk_OBJECTS) $(emu8051_gtk_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/app-config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filemenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/helpmenu.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/messagebox.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pgmwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pswwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/regwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timerwin.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/viewmenu.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installcheck-binPROGRAMS installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/src/gtk/main.c0000644000175400017500000003735512313352657012233 00000000000000/* * main.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include #include "config.h" #include #include #include #include "common.h" #include "cpu8051.h" #include "memory.h" #include "options.h" #include "hexfile.h" #include "timers.h" #include "main.h" #include "reset.xpm" #include "run.xpm" #include "stop.xpm" #include "step.xpm" #include "filemenu.h" #include "viewmenu.h" #include "helpmenu.h" #include "messagebox.h" #include "regwin.h" #include "pgmwin.h" #include "memwin.h" #include "pswwin.h" #include "timerwin.h" #include "app-config.h" #define BUTTONS_BORDER 2 static int running; static int running_function_tag; static int emugtk_window_init_complete; static GtkWidget *vpaned1; static GtkWidget *scrollwin_int; static GtkWidget *scrollwin_ext; GtkWidget *mainwin; extern struct app_config_t *cfg; extern struct options_t options; void emugtk_update_display(void) { log_debug("update display"); regwin_refresh(); pgmwin_refresh(); pswwin_refresh(); timerwin_update(); if (cfg->view_int_memory && scrollwin_int) memwin_refresh(INT_MEM_ID); if (cfg->view_ext_memory && scrollwin_ext) memwin_refresh(EXT_MEM_ID); } /* Step out of running state */ static void emugtk_stop_running() { if (running) { log_info("stop running"); g_source_remove(running_function_tag); running = 0; emugtk_update_display(); } } /* Running function called when idle from gtk_main */ static gboolean emugtk_running(gpointer data) { int breakpoint_hit; (void) data; /* Remove compiler warning about unused variable. */ breakpoint_hit = cpu8051_run(1, NULL); if (breakpoint_hit) emugtk_stop_running(); return TRUE; } /* Get in the running state */ static void emugtk_start_running(void) { if (!running) { log_info("start running"); running_function_tag = g_idle_add(emugtk_running, 0); running = 1; } } /* Taken from the Gxine source code. */ static GtkWidget * button_add_pix(GtkWidget *box, char **xpm) { GtkWidget *button, *icon; button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NORMAL); icon = gtk_image_new_from_pixbuf( gdk_pixbuf_new_from_xpm_data((const char **) xpm)); gtk_container_add(GTK_CONTAINER(button), icon); gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, BUTTONS_BORDER); return button; } /* CPU reset and Gtk UI update */ static void emugtk_reset(void) { cpu8051_reset(); emugtk_update_display(); } /* Signal ResetEvent (ResetButton) */ static void emugtk_reset_event(GtkWidget *widget, GdkEvent *event, gpointer data) { /* Remove compiler warning about unused variables. */ (void) widget; (void) event; (void) data; log_info("ResetEvent()"); emugtk_stop_running(); emugtk_reset(); } /* CPU Step and Gtk UI update */ static void emugtk_step(void) { cpu8051_exec(); emugtk_update_display(); } /* Signal RunEvent (RunButton) */ static void emugtk_run_event(GtkWidget *widget, GdkEvent *event, gpointer data) { /* Remove compiler warning about unused variables. */ (void) widget; (void) event; (void) data; log_info("RunEvent()"); if (running) emugtk_stop_running(); else emugtk_start_running(); } /* Signal StopEvent (StopButton) */ static void emugtk_stop_event(GtkWidget *widget, GdkEvent *event, gpointer data) { /* Remove compiler warning about unused variables. */ (void) widget; (void) event; (void) data; log_info("StopEvent()"); emugtk_stop_running(); } /* Signal StepEvent (StepButton) */ static void emugtk_step_event(GtkWidget *widget, GdkEvent *event, gpointer data) { /* Remove compiler warning about unused variables. */ (void) widget; (void) event; (void) data; log_info("StepEvent()"); emugtk_stop_running(); emugtk_step(); } /* Creates the Reset, Run, Stop and Step buttons. */ static GtkWidget * add_buttons(void) { GtkWidget *button_hbox; GtkWidget *button; /* The buttons of the hbox are NOT given equal space in the box. */ button_hbox = gtk_hbox_new(FALSE, 0); /* Creating the RESET button. */ button = button_add_pix(button_hbox, reset_xpm); g_signal_connect(button, "clicked", G_CALLBACK(emugtk_reset_event), NULL); /* Creating the RUN button. */ button = button_add_pix(button_hbox, run_xpm); g_signal_connect(button, "clicked", G_CALLBACK(emugtk_run_event), NULL); /* Creating STOP button. */ button = button_add_pix(button_hbox, stop_xpm); g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(emugtk_stop_event), NULL); /* Creating STEP button. */ button = button_add_pix(button_hbox, step_xpm); g_signal_connect(GTK_OBJECT(button), "clicked", G_CALLBACK(emugtk_step_event), NULL); return button_hbox; } static GtkWidget * add_menu(void) { GtkWidget *menu_bar; /* Creating menu item. */ menu_bar = gtk_menu_bar_new(); /* Adding the 'File' submenu */ file_add_menu(menu_bar); /* Adding the 'View' submenu */ view_add_menu(menu_bar); /* Adding the 'Help' submenu */ help_add_menu(menu_bar); return menu_bar; } static int mainwin_configure_event(GtkWindow *window, GdkEvent *event, gpointer data) { /* Remove compiler warning about unused variables. */ (void) window; (void) data; cfg->win_width = event->configure.width; cfg->win_height = event->configure.height; /* * Important: * Returning false allows event to propagate to children. If not, they * will not be resized when we resize the main window. */ return FALSE; } static void hpaned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; /* Remove compiler warning about unused variables. */ (void) window; (void) event; cfg->hpane_pos = gtk_paned_get_position(GTK_PANED(paned)); } static void vpaned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; /* Remove compiler warning about unused variables. */ (void) window; (void) event; cfg->vpane_pos = gtk_paned_get_position(GTK_PANED(paned)); } static void main_paned_notify_event(GtkWindow *window, GdkEvent *event, gpointer data) { GtkWidget *paned = data; /* Remove compiler warning about unused variables. */ (void) window; (void) event; cfg->main_pane_pos = gtk_paned_get_position(GTK_PANED(paned)); } void emugtk_quit_gui(void) { gtk_main_quit(); } static void emugtk_show_memory_paned(void) { gtk_widget_show_all(mainwin); emugtk_update_display(); } void emugtk_create_int_memory_paned(void) { scrollwin_int = memwin_init("Internal memory (IRAM)", INT_MEM_ID); gtk_paned_pack1(GTK_PANED(vpaned1), scrollwin_int, FALSE, FALSE); if (emugtk_window_init_complete) emugtk_show_memory_paned(); } void emugtk_destroy_int_memory_paned(void) { if (scrollwin_int == NULL) return; gtk_widget_destroy(scrollwin_int); scrollwin_int = NULL; } void emugtk_create_ext_memory_paned(void) { scrollwin_ext = memwin_init("External memory (XRAM)", EXT_MEM_ID); gtk_paned_pack2(GTK_PANED(vpaned1), scrollwin_ext, TRUE, FALSE); if (emugtk_window_init_complete) emugtk_show_memory_paned(); } void emugtk_destroy_ext_memory_paned(void) { if (scrollwin_ext == NULL) return; gtk_widget_destroy(scrollwin_ext); scrollwin_ext = NULL; } void emugtk_recreate_memory_paned(void) { if (cfg->view_int_memory) { emugtk_destroy_int_memory_paned(); emugtk_create_int_memory_paned(); } if (cfg->view_ext_memory) { emugtk_destroy_ext_memory_paned(); emugtk_create_ext_memory_paned(); } if (emugtk_window_init_complete) emugtk_show_memory_paned(); } static GtkWidget * emugtk_create_memory_paned(void) { /* Create vpaned (memory windows) only if necessary. */ if (cfg->view_int_memory || cfg->view_ext_memory) { vpaned1 = gtk_vpaned_new(); gtk_paned_set_position(GTK_PANED(vpaned1), cfg->vpane_pos); g_signal_connect(G_OBJECT(vpaned1), "notify::position", G_CALLBACK(vpaned_notify_event), vpaned1); emugtk_recreate_memory_paned(); return vpaned1; } else { return NULL; } } /* * mainwin * +---------------------------------------------------------------------+ * | | * | vbox | * | +---------------------------------------------------------------+ | * | | | | * | | menu_bar | | * | | +----------------------+ | | * | | | File View Help | | | * | | +----------------------+ | | * | | | | * | |---------------------------------------------------------------| | * | | | | * | | buttons_bar | | * | | +-----------------------+ | | * | | | RST RUN STOP STEP | | | * | | +-----------------------+ | | * | | | | * | |---------------------------------------------------------------| | * | | | | * | | main_paned | | * | | +---------------------------------------------------------+ | | * | | | | | | * | | | hpaned | | | * | | | +---------------------------------------------------+ | | | * | | | | | | | | | * | | | | scrollwin | scrollwin | | | | * | | | | +------------------+ * +--------------------+ | | | | * | | | | | REGISTERS window | * | Disassembly window | | | | | * | | | | +------------------+ | +--------------------+ | | | | * | | | | | | | | | * | | | +---------------------------------------------------+ | | | * | | | | | | * | | |--------------------------***----------------------------- | | * | | | | | | * | | | vpaned | | | * | | | +---------------------------------------------------+ | | | * | | | | | | | | * | | | | scrollwin | | | | * | | | | +---------------------------------------------+ | | | | * | | | | | Internal memory window | | | | | * | | | | +---------------------------------------------+ | | | | * | | | | | | | | * | | | +-----------------------***-------------------------| | | | * | | | | | | | | * | | | | scrollwin | | | | * | | | | +---------------------------------------------+ | | | | * | | | | | External memory window | | | | | * | | | | +---------------------------------------------+ | | | | * | | | | | | | | * | | | +---------------------------------------------------+ | | | * | | | | | | * | | +---------------------------------------------------------+ | | * | | | | * | | | | * | +---------------------------------------------------------------+ | * | | * | | * +---------------------------------------------------------------------+ */ static void emugtk_window_init(void) { int id; GtkWidget *vbox; GtkWidget *menu_bar; GtkWidget *buttons_bar; GtkWidget *scrollwin; GtkWidget *hpaned; GtkWidget *vpaned; GtkWidget *main_paned; emugtk_window_init_complete = false; mainwin = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(mainwin), PACKAGE); gtk_window_set_default_size(GTK_WINDOW(mainwin), cfg->win_width, cfg->win_height); gtk_container_set_border_width(GTK_CONTAINER(mainwin), 0); /* Window DESTROY event. */ g_signal_connect(mainwin, "destroy", G_CALLBACK(gtk_main_quit), NULL); g_signal_connect(G_OBJECT(mainwin), "configure-event", G_CALLBACK(mainwin_configure_event), NULL); /* Creating the menu bar. */ menu_bar = add_menu(); /* Creating the buttons bar. */ buttons_bar = add_buttons(); scrollwin = pswwin_init(); gtk_box_pack_start(GTK_BOX(buttons_bar), scrollwin, FALSE, FALSE, 50); for (id = 0; id < GP_TIMERS_COUNT; id++) { scrollwin = timerwin_init(id); gtk_box_pack_start(GTK_BOX(buttons_bar), scrollwin, FALSE, FALSE, 15); } /* hpaned will contain registers and disassembly windows. */ hpaned = gtk_hpaned_new(); gtk_paned_set_position(GTK_PANED(hpaned), cfg->hpane_pos); g_signal_connect(G_OBJECT(hpaned), "notify::position", G_CALLBACK(hpaned_notify_event), hpaned); /* 8051 registers frame. */ scrollwin = regwin_init(); gtk_paned_pack1(GTK_PANED(hpaned), scrollwin, FALSE, FALSE); /* Program disassembly frame. */ scrollwin = pgmwin_init(); gtk_paned_pack2(GTK_PANED(hpaned), scrollwin, TRUE, FALSE); /* * main_paned will contain two groups: * group1: registers and disassembly windows. * group2: memory windows */ if (cfg->layout == UI_LAYOUT1) main_paned = gtk_vpaned_new(); else main_paned = gtk_hpaned_new(); gtk_paned_set_position(GTK_PANED(main_paned), cfg->main_pane_pos); g_signal_connect(G_OBJECT(main_paned), "notify::position", G_CALLBACK(main_paned_notify_event), main_paned); gtk_paned_pack1(GTK_PANED(main_paned), hpaned, FALSE, FALSE); vpaned = emugtk_create_memory_paned(); if (vpaned != NULL) gtk_paned_pack2(GTK_PANED(main_paned), vpaned, TRUE, FALSE); /* * vbox contains the menu bar and body_vbox (for all remaining * items). */ vbox = gtk_vbox_new(FALSE, 1); gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(vbox), buttons_bar, FALSE, FALSE, 1); gtk_box_pack_start(GTK_BOX(vbox), main_paned, true, true, 1); /* Adding the vbox to the main window. */ gtk_container_add(GTK_CONTAINER(mainwin), vbox); g_signal_connect(mainwin, "destroy", G_CALLBACK(emugtk_quit_gui), NULL); gtk_widget_show_all(mainwin); emugtk_window_init_complete = true; } void add_menu_separator(GtkWidget *menu) { GtkWidget *item; item = gtk_menu_item_new(); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); } void emugtk_new_file(char *file) { int rc; emugtk_stop_running(); rc = hexfile_load(file); if (!rc) { message_show_error("Error parsing hex file"); } else { if (cfg->clear_ram_on_file_load) emugtk_reset(); emugtk_update_display(); } } int main(int argc, char **argv) { int rc_load_hexfile = true; parse_command_line_options(argc, argv); app_config_load(); cpu8051_init(); running = 0; gtk_init(&argc, &argv); if (options.filename != NULL) rc_load_hexfile = hexfile_load(options.filename); cpu8051_reset(); log_info("Init GUI"); emugtk_window_init(); emugtk_update_display(); if (!rc_load_hexfile) message_show_error("Error parsing hex file"); gtk_main(); log_info("Terminate"); app_config_save(); return EXIT_SUCCESS; } emu8051-2.0.1/src/gtk/main.h0000644000175400017500000000113012313352657012216 00000000000000/* * main.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef MAIN_H #define MAIN_H 1 #include void add_menu_separator(GtkWidget *menu); void emugtk_new_file(char *file); void emugtk_update_display(void); void emugtk_quit_gui(void); void emugtk_create_int_memory_paned(void); void emugtk_destroy_int_memory_paned(void); void emugtk_create_ext_memory_paned(void); void emugtk_destroy_ext_memory_paned(void); void emugtk_recreate_memory_paned(void); #endif /* MAIN_H */ emu8051-2.0.1/src/gtk/timerwin.c0000644000175400017500000000501312313352657013127 00000000000000/* * timerwin.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include "common.h" #include "timers.h" #include "main.h" static GtkWidget *label[GP_TIMERS_COUNT]; static GtkWidget * button_add_stock(GtkWidget *box, gchar *stock_id, int display_label) { GtkWidget *button; /* Create the button. */ if (display_label) { /* By default, a label is appended to stock buttons. */ button = gtk_button_new_from_stock(stock_id); } else { GtkWidget *icon; button = gtk_button_new(); gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NORMAL); icon = gtk_image_new_from_stock(stock_id, GTK_ICON_SIZE_SMALL_TOOLBAR); gtk_container_add(GTK_CONTAINER(button), icon); } gtk_box_pack_start(GTK_BOX(box), button, false, false, 2); return button; } void timerwin_update(void) { int id; char buf[128]; for (id = 0; id < GP_TIMERS_COUNT; id++) { /* Display textin bold, with big font size. */ sprintf(buf , "%08d cycles", gp_timer_read(id)); gtk_label_set_markup(GTK_LABEL(label[id]), buf); } } static void timer_reset_callback(GtkWidget *widget, gpointer data) { int id = GPOINTER_TO_INT(data); /* Remove compiler warning about unused variables. */ (void) widget; log_info("timer_reset_callback ID = %d", id); gp_timer_reset(id); timerwin_update(); } GtkWidget * timerwin_init(int id) { GtkWidget *frame; GtkWidget *hbox; GtkWidget *vbox; GtkWidget *timer_reset_button; char title[100]; log_debug("timer window init"); sprintf(title, "Emulator timer %c", 'A' + id); frame = gtk_frame_new(title); /* The items of the hbox are NOT given equal space in the box. */ hbox = gtk_hbox_new(false, 0); /* * If the button was added directly to the hbox, it would be as high * as the frame widget (ugly). Adding it first to a vbox makes it have * a box shape. */ vbox = gtk_vbox_new(true, 0); timer_reset_button = button_add_stock(vbox, GTK_STOCK_REFRESH, false); g_signal_connect(G_OBJECT(timer_reset_button), "clicked", G_CALLBACK(timer_reset_callback), GINT_TO_POINTER(id)); gtk_box_pack_start(GTK_BOX(hbox), vbox, false, false, 3); label[id] = gtk_label_new(NULL); gtk_label_set_markup(GTK_LABEL(label[id]), "Small text"); gtk_box_pack_start(GTK_BOX(hbox), label[id], false, false, 10); gtk_container_add(GTK_CONTAINER(frame), hbox); return frame; } emu8051-2.0.1/src/gtk/timerwin.h0000644000175400017500000000047712313352657013145 00000000000000/* * timerwin.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef TIMERWIN_H #define TIMERWIN_H 1 #include GtkWidget * timerwin_init(int id); void timerwin_update(void); #endif /* TIMERWIN_H */ emu8051-2.0.1/src/gtk/messagebox.c0000644000175400017500000000160212313352657013426 00000000000000/* * messagebox.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include "common.h" #include "messagebox.h" extern GtkWidget *mainwin; void message_show_error(char *message) { GtkWidget *dialog; dialog = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, message, NULL); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } void message_show_information(char *message) { GtkWidget *dialog; dialog = gtk_message_dialog_new(GTK_WINDOW(mainwin), GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_INFO, GTK_BUTTONS_CLOSE, message, NULL); gtk_dialog_run(GTK_DIALOG(dialog)); gtk_widget_destroy(dialog); } emu8051-2.0.1/src/gtk/messagebox.h0000644000175400017500000000053612313352657013440 00000000000000/* * messagebox.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef MESSAGEBOX_H #define MESSAGEBOX_H 1 #include void message_show_error(char *message); void message_show_information(char *message); #endif /* MESSAGEBOX_H */ emu8051-2.0.1/src/gtk/app-config.c0000644000175400017500000001067512313352657013326 00000000000000/* * Handle loading and saving of application configuration settings * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #if STDC_HEADERS # include #elif HAVE_STRINGS_H # include #endif #include #include "common.h" #include "app-config.h" static const char profile_name[] = "default"; static struct app_config_t app_config; struct app_config_t *cfg = &app_config; static void app_config_init(void) { /* Emulation options */ cfg->clear_ram_on_file_load = false; /* UI settings */ cfg->win_width = 640; cfg->win_height = 480; cfg->hpane_pos = 100; cfg->vpane_pos = 200; cfg->main_pane_pos = 200; /* View menu options */ cfg->layout = UI_LAYOUT1; cfg->view_int_memory = 1; cfg->view_ext_memory = 1; cfg->bytes_per_row = 16; /* 8 or 16 */ } static int app_config_key_file_get_int(GKeyFile *kf, const char *grp, const char *key, int *value) { char *str = g_key_file_get_value(kf, grp, key, NULL); log_debug("key: %s", key); if (G_LIKELY(str)) { *value = atoi(str); log_debug(" value = %d", *value); g_free(str); } return str != NULL; } static void app_config_load_from_key_file(GKeyFile *kf) { /* Emulation options */ app_config_key_file_get_int(kf, "emulation", "clear_ram_on_file_load", &cfg->clear_ram_on_file_load); /* ui */ app_config_key_file_get_int(kf, "ui", "win_width", &cfg->win_width); app_config_key_file_get_int(kf, "ui", "win_height", &cfg->win_height); app_config_key_file_get_int(kf, "ui", "hpane_pos", &cfg->hpane_pos); app_config_key_file_get_int(kf, "ui", "vpane_pos", &cfg->vpane_pos); app_config_key_file_get_int(kf, "ui", "main_pane_pos", &cfg->main_pane_pos); /* View */ app_config_key_file_get_int(kf, "view", "layout", &cfg->layout); if ((cfg->layout != UI_LAYOUT1) && (cfg->layout != UI_LAYOUT2)) { log_err("Invalid layout, defaulting to layout 1"); cfg->layout = UI_LAYOUT1; } app_config_key_file_get_int(kf, "view", "int_memory", &cfg->view_int_memory); app_config_key_file_get_int(kf, "view", "ext_memory", &cfg->view_ext_memory); app_config_key_file_get_int(kf, "view", "bytes_per_row", &cfg->bytes_per_row); } static char * app_config_get_dir_path(void) { char *dir_path; dir_path = g_build_filename(g_get_user_config_dir(), PACKAGE, profile_name, NULL); return dir_path; } static char * app_config_get_file_path(void) { char *file_path; char *dir_path; char file[MAX_FILENAME_LENGTH]; sprintf(file, "%s.conf", PACKAGE); dir_path = app_config_get_dir_path(); file_path = g_build_filename(dir_path, file, NULL); log_info("app. config file = %s", file_path); g_free(dir_path); return file_path; } int app_config_load(void) { char *file_path; GKeyFile *kf; /* Load default values before config file */ app_config_init(); kf = g_key_file_new(); file_path = app_config_get_file_path(); if (g_key_file_load_from_file(kf, file_path, 0, NULL)) app_config_load_from_key_file(kf); g_free(file_path); g_key_file_free(kf); /* ??? */ return 0; } int app_config_save(void) { char *dir_path; dir_path = app_config_get_dir_path(); if (g_mkdir_with_parents(dir_path, 0700) != -1) { char *file_path; GString *buf = g_string_sized_new(1024); g_string_append(buf, "\n[emulation]\n"); g_string_append_printf(buf, "clear_ram_on_file_load=%d\n", cfg->clear_ram_on_file_load); g_string_append(buf, "\n[ui]\n"); g_string_append_printf(buf, "win_width=%d\n", cfg->win_width); g_string_append_printf(buf, "win_height=%d\n", cfg->win_height); g_string_append_printf(buf, "hpane_pos=%d\n", cfg->hpane_pos); g_string_append_printf(buf, "vpane_pos=%d\n", cfg->vpane_pos); g_string_append_printf(buf, "main_pane_pos=%d\n", cfg->main_pane_pos); g_string_append(buf, "\n[view]\n"); g_string_append_printf(buf, "layout=%d\n", cfg->layout); g_string_append_printf(buf, "int_memory=%d\n", cfg->view_int_memory); g_string_append_printf(buf, "ext_memory=%d\n", cfg->view_ext_memory); g_string_append_printf(buf, "bytes_per_row=%d\n", cfg->bytes_per_row); file_path = app_config_get_file_path(); g_file_set_contents(file_path, buf->str, buf->len, NULL); g_string_free(buf, TRUE); g_free(file_path); } g_free(dir_path); /* ??? */ return 0; } emu8051-2.0.1/src/gtk/app-config.h0000644000175400017500000000170612313352657013326 00000000000000/* * app_config.h * * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef APP_CONFIG_H #define APP_CONFIG_H 1 /* * Layout1: Layout2: * * REGS | PROGRAM | | IRAM * -------------- REGS | PROGRAM | ---- * IRAM | | XRAM * -------------- * XRAM */ enum layout_t { UI_LAYOUT1 = 1, UI_LAYOUT2, }; struct app_config_t { /* Emulation options */ int clear_ram_on_file_load; /* UI settings */ int win_width; int win_height; int hpane_pos; /* For registers and program windows. */ int vpane_pos; /* For internal and external memory windows. */ int main_pane_pos; /* Between hpane and vpane. */ /* View menu options */ int layout; /* UI Layout 1 or 2 */ int view_int_memory; int view_ext_memory; int bytes_per_row; /* 8 or 16 */ }; int app_config_load(void); int app_config_save(void); #endif /* APP_CONFIG_H */ emu8051-2.0.1/src/gtk/viewmenu.c0000644000175400017500000001174512313352657013141 00000000000000/* * viewmenu.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include "common.h" #include "main.h" /* For AddMenuSeparator() function. */ #include "messagebox.h" #include "viewmenu.h" #include "app-config.h" extern struct app_config_t *cfg; void toggle_layout(GtkWidget *widget, gpointer data) { int id; id = GPOINTER_TO_UINT(data); if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" Switching to layout %d", id); cfg->layout = id; message_show_information( "You must restart for the changes to take effect"); } } void toggle_bytes_per_row(GtkWidget *widget, gpointer data) { int bytes_per_row; bytes_per_row = GPOINTER_TO_UINT(data); if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" Bytes per row = %d", bytes_per_row); cfg->bytes_per_row = bytes_per_row; emugtk_destroy_int_memory_paned(); emugtk_destroy_ext_memory_paned(); emugtk_recreate_memory_paned(); } } void toggle_int_memory(GtkWidget *widget, gpointer data) { (void) data; /* Remove compiler warning about unused variables. */ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" View internal memory"); cfg->view_int_memory = 1; emugtk_create_int_memory_paned(); } else { cfg->view_int_memory = 0; emugtk_destroy_int_memory_paned(); } } void toggle_ext_memory(GtkWidget *widget, gpointer data) { (void) data; /* Remove compiler warning about unused variables. */ if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(widget))) { log_info(" View external memory"); cfg->view_ext_memory = 1; emugtk_create_ext_memory_paned(); } else { cfg->view_ext_memory = 0; emugtk_destroy_ext_memory_paned(); } } void view_add_layout_submenu(GtkWidget *parent) { GtkWidget *submenu; GtkWidget *layout; GtkWidget *layout1; GtkWidget *layout2; GSList *group = NULL; submenu = gtk_menu_new(); layout = gtk_menu_item_new_with_label("Layout"); layout1 = gtk_radio_menu_item_new_with_label(group, "Layout1"); group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(layout1)); layout2 = gtk_radio_menu_item_new_with_label(group, "Layout2"); if (cfg->layout == UI_LAYOUT1) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(layout1), TRUE); else gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(layout2), TRUE); g_signal_connect(G_OBJECT(layout1), "activate", G_CALLBACK(toggle_layout), (gpointer) UI_LAYOUT1); g_signal_connect(G_OBJECT(layout2), "activate", G_CALLBACK(toggle_layout), (gpointer) UI_LAYOUT2); gtk_menu_item_set_submenu(GTK_MENU_ITEM(layout), submenu); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), layout1); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), layout2); gtk_menu_shell_append(GTK_MENU_SHELL(parent), layout); } void view_add_bytes_per_row_submenu(GtkWidget *parent) { GtkWidget *submenu; GtkWidget *item; GtkWidget *item1; GtkWidget *item2; GSList *group = NULL; submenu = gtk_menu_new(); item = gtk_menu_item_new_with_label("Bytes per row"); item1 = gtk_radio_menu_item_new_with_label(group, "8"); group = gtk_radio_menu_item_get_group(GTK_RADIO_MENU_ITEM(item1)); item2 = gtk_radio_menu_item_new_with_label(group, "16"); if (cfg->bytes_per_row == 8) gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item1), TRUE); else gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item2), TRUE); g_signal_connect(G_OBJECT(item1), "activate", G_CALLBACK(toggle_bytes_per_row), (gpointer) 8); g_signal_connect(G_OBJECT(item2), "activate", G_CALLBACK(toggle_bytes_per_row), (gpointer) 16); gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item1); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item2); gtk_menu_shell_append(GTK_MENU_SHELL(parent), item); } void view_add_menu(GtkWidget *menu_bar) { GtkWidget *item; GtkWidget *menu; GtkWidget *view; menu = gtk_menu_new(); view = gtk_menu_item_new_with_label("View"); item = gtk_check_menu_item_new_with_label("Internal Memory"); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), cfg->view_int_memory); g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(toggle_int_memory), NULL); item = gtk_check_menu_item_new_with_label("External Memory"); gtk_menu_shell_append(GTK_MENU_SHELL(menu), item); gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item), cfg->view_ext_memory); g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(toggle_ext_memory), NULL); add_menu_separator(menu); /* Add layout submenu */ view_add_layout_submenu(menu); add_menu_separator(menu); /* Add bytes per row submenu */ view_add_bytes_per_row_submenu(menu); gtk_menu_item_set_submenu(GTK_MENU_ITEM(view), menu); gtk_menu_shell_append(GTK_MENU_SHELL(menu_bar), view); } emu8051-2.0.1/src/gtk/viewmenu.h0000644000175400017500000000045012313352657013135 00000000000000/* * viewmenu.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef VIEWMENU_H #define VIEWMENU_H 1 #include void view_add_menu(GtkWidget *menu_bar); #endif /* VIEWMENU_H */ emu8051-2.0.1/src/common/0000755000175400017500000000000012313352716011705 500000000000000emu8051-2.0.1/src/common/log.c0000644000175400017500000000410612313352657012557 00000000000000/* * log.c -- debug functions for logging. * * Copyright (C) 2011 Hugo Villeneuve * * This file is released under the GPLv2 */ #include "config.h" #include #include #include #include #include "common.h" #include "options.h" #define PREFIX_PACKAGE_NAME 1 #define ADD_LINEFEED 1 extern struct options_t options; static void log_prefix_package_name(FILE *stream, const char *severity) { #if PREFIX_PACKAGE_NAME /* Printing the name of the program first if desired. */ fprintf(stream, "%s %s: ", PACKAGE_NAME, severity); #endif /* PREFIX_PACKAGE_NAME */ } static void log_suffix_newline(FILE *stream) { #if ADD_LINEFEED fprintf(stream, "\n"); #endif /* ADD_LINEFEED */ } void log_debug(const char *format, ...) { FILE *stream = stdout; if (options.log >= LOG_LEVEL_DEBUG) { va_list ap; log_prefix_package_name(stream, "debug"); va_start(ap, format); (void) vfprintf(stream, format, ap); va_end(ap); log_suffix_newline(stream); } } void log_info(const char *format, ...) { FILE *stream = stdout; if (options.log >= LOG_LEVEL_INFO) { va_list ap; log_prefix_package_name(stream, "info"); va_start(ap, format); (void) vfprintf(stream, format, ap); va_end(ap); log_suffix_newline(stream); } } void log_warn(const char *format, ...) { FILE *stream = stderr; if (options.log >= LOG_LEVEL_WARN) { va_list ap; log_prefix_package_name(stream, "warn"); va_start(ap, format); (void) vfprintf(stream, format, ap); va_end(ap); log_suffix_newline(stream); } } void log_err(const char *format, ...) { FILE *stream = stderr; va_list ap; log_prefix_package_name(stream, "error"); va_start(ap, format); (void) vfprintf(stream, format, ap); va_end(ap); log_suffix_newline(stream); } /* Log error message and exits with error code. */ void log_fail(const char *format, ...) { FILE *stream = stderr; va_list ap; log_prefix_package_name(stream, "error"); va_start(ap, format); (void) vfprintf(stream, format, ap); va_end(ap); log_suffix_newline(stream); exit(EXIT_FAILURE); } emu8051-2.0.1/src/common/log.h0000644000175400017500000000136712313352657012572 00000000000000/* * log.h * * Copyright (C) 2011 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef LOG_H #define LOG_H 1 #include #include #include #include #include #include "common.h" enum LOG_LEVEL { LOG_LEVEL_ERR = 0, /* Display only errors */ LOG_LEVEL_WARN, /* Display warnings */ LOG_LEVEL_INFO, /* Display information messages */ LOG_LEVEL_DEBUG, /* Display all messages */ }; void log_debug(const char *format, ...); void log_info(const char *format, ...); void log_warn(const char *format, ...); void log_err(const char *format, ...); /* Log error message and exits with error code. */ void log_fail(const char *format, ...); #endif /* LOG_H */ emu8051-2.0.1/src/common/psw.c0000644000175400017500000000321412313352657012606 00000000000000/* * psw.c * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #include "common.h" #include "reg8051.h" #include "memory.h" /* Returns 0 or 1 */ int psw_read_bit(unsigned int bit) { return (mem_read8(INT_MEM_ID, _PSW_) >> bit) & 0x01; } void psw_write_bit(unsigned int bit, int val) { uint8_t psw = mem_read8(INT_MEM_ID, _PSW_); if (val) psw |= (1 << bit); /* Set */ else psw &= ~(1 << bit); /* Clear */ mem_write8(INT_MEM_ID, _PSW_, psw); /* Save updated value */ } /* Returns 0 or 1 */ int psw_read_cy(void) { return psw_read_bit(PSW_BIT_CY); } void psw_write_cy(int cy) { psw_write_bit(PSW_BIT_CY, cy); } void psw_set_cy(void) { psw_write_bit(PSW_BIT_CY, 1); } void psw_clr_cy(void) { psw_write_bit(PSW_BIT_CY, 0); } /* Returns 0 or 1 */ int psw_read_ac(void) { return psw_read_bit(PSW_BIT_AC); } void psw_write_ac(int ac) { psw_write_bit(PSW_BIT_AC, ac); } void psw_set_ac(void) { psw_write_bit(PSW_BIT_AC, 1); } void psw_clr_ac(void) { psw_write_bit(PSW_BIT_AC, 0); } /* Returns 0 or 1 */ int psw_read_ov(void) { return psw_read_bit(PSW_BIT_OV); } void psw_write_ov(int ov) { psw_write_bit(PSW_BIT_OV, ov); } void psw_set_ov(void) { psw_write_bit(PSW_BIT_OV, 1); } void psw_clr_ov(void) { psw_write_bit(PSW_BIT_OV, 0); } /* * Compute parity of bits in accumulator: * parity = 0: even number of ones in accumulator * parity = 1: odd number of ones in accumulator */ void psw_compute_parity_bit(void) { int parity = 0; uint8_t acc = mem_read8(INT_MEM_ID, _ACC_); while (acc) { parity = !parity; acc = acc & (acc - 1); } psw_write_bit(PSW_BIT_P, parity); } emu8051-2.0.1/src/common/psw.h0000644000175400017500000000112012313352657012605 00000000000000/* * psw.h * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef PSW_H #define PSW_H 1 int psw_read_bit(unsigned int bit); void psw_write_bit(unsigned int bit, int val); int psw_read_cy(void); void psw_write_cy(int cy); void psw_clr_cy(void); void psw_set_cy(void); int psw_read_ac(void); void psw_write_ac(int ac); void psw_clr_ac(void); void psw_set_ac(void); int psw_read_ov(void); void psw_write_ov(int ov); void psw_clr_ov(void); void psw_set_ov(void); void psw_compute_parity_bit(void); #endif /* PSW_H */ emu8051-2.0.1/src/common/sfr.c0000644000175400017500000001336212313352657012574 00000000000000/* * sfr.c * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "sfr.h" #include "memory.h" #include "instructions_8051.h" #define HEX_DIGITS_2 2 #define HEX_DIGITS_4 4 /* Specific read/write functions for special registers. */ static unsigned int regwin_read_pc(int dummy) { (void) dummy; /* Remove compiler warning about unused variable. */ return cpu8051.pc; } static void regwin_write_pc(int param, int val) { (void) param; /* Remove compiler warning about unused variable. */ cpu8051.pc = (uint16_t) val; } static unsigned int regwin_read_timer(int timer_low_addr) { return (mem_sfr_read8(timer_low_addr + 2) << 8) | mem_sfr_read8(timer_low_addr); } static void regwin_write_timer(int timer_low_addr, int val) { mem_sfr_write8(timer_low_addr + 2, (uint8_t) ((val & 0x0000FFFF) >> 8)); mem_sfr_write8(timer_low_addr, (uint8_t) val); } static uint8_t regwin_read_bank_offset(void) { return mem_sfr_read8(_PSW_) & 0x18; } static unsigned int regwin_read_bank(int dummy) { (void) dummy; /* Remove compiler warning about unused variable. */ return regwin_read_bank_offset() >> 3; } static void regwin_write_bank(int param, int bank_number) { uint8_t psw = mem_sfr_read8(_PSW_); (void) param; /* Remove compiler warning about unused variable. */ if ((bank_number < 0) || (bank_number > 3)) { log_info("Error: invalid bank number: %d", bank_number); bank_number = 0; } mem_sfr_write8(_PSW_, (psw & ~0x18) | (bank_number << 3)); } /* Indirect read of R0 - R7 in current bank from internal memory. */ static unsigned int regwin_read_rx(int offset) { return mem_read8(INT_MEM_ID, regwin_read_bank_offset() + offset); } /* Indirect write to R0 - R7 in current bank to internal memory. */ static void regwin_write_rx(int offset, int val) { mem_write8(INT_MEM_ID, regwin_read_bank_offset() + offset, (uint8_t) val); } /* This array defines how to read value for each register. */ static struct regwin_infos_t regwin_infos[SFR_REGS] = { { "PC", HEX_DIGITS_4, regwin_read_pc, regwin_write_pc, 0, /* Dummy */ }, { "SP", HEX_DIGITS_2, NULL, NULL, _SP_, }, { "PSW", HEX_DIGITS_2, NULL, NULL, _PSW_, }, { "A", HEX_DIGITS_2, NULL, NULL, _ACC_, }, { "B", HEX_DIGITS_2, NULL, NULL, _B_, }, { "DPTR", HEX_DIGITS_4, NULL, NULL, _DPL_, }, { "P0", HEX_DIGITS_2, NULL, NULL, _P0_, }, { "P1", HEX_DIGITS_2, NULL, NULL, _P1_, }, { "P2", HEX_DIGITS_2, NULL, NULL, _P2_, }, { "P3", HEX_DIGITS_2, NULL, NULL, _P3_, }, { "TCON", HEX_DIGITS_2, NULL, NULL, _TCON_, }, { "TMOD", HEX_DIGITS_2, NULL, NULL, _TMOD_, }, { "TIMER0", HEX_DIGITS_4, regwin_read_timer, regwin_write_timer, _TL0_, }, { "TIMER1", HEX_DIGITS_4, regwin_read_timer, regwin_write_timer, _TL1_, }, { "SCON", HEX_DIGITS_2, NULL, NULL, _SCON_, }, { "IE", HEX_DIGITS_2, NULL, NULL, _IE_, }, { "IP", HEX_DIGITS_2, NULL, NULL, _IP_, }, { "BANK", HEX_DIGITS_2, regwin_read_bank, regwin_write_bank, 0, /* Dummy */ }, /* R0-R7 Registers in current Bank */ { "R0", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R0_, }, { "R1", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R1_, }, { "R2", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R2_, }, { "R3", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R3_, }, { "R4", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R4_, }, { "R5", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R5_, }, { "R6", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R6_, }, { "R7", HEX_DIGITS_2, regwin_read_rx, regwin_write_rx, _R7_, }, }; /* Generic read/write functions */ static unsigned int regwin_read_generic(int addr, int width) { if (width == 2) { return mem_sfr_read8(addr); } else if (width == 4) { /* Address is low address. */ return (mem_sfr_read8(addr + 1) << 8) | mem_sfr_read8(addr); } else { return 0xFFFFFFFF; } } static void regwin_write_generic(int addr, int val, int width) { if (width == 2) { mem_sfr_write8(addr, (uint8_t) val); } else if (width == 4) { /* Address is low address. */ mem_sfr_write8(addr + 1, (uint8_t) ((val & 0x0000FFFF) >> 8)); mem_sfr_write8(addr, (uint8_t) val); } } int regwin_read(int row) { int val; if (regwin_infos[row].read_func == NULL) { /* * Read register value using generic 8 or 16 bits read * function, depending on width. */ val = regwin_read_generic(regwin_infos[row].param, regwin_infos[row].w); } else { /* Read register value using custom function pointer. */ val = regwin_infos[row].read_func( regwin_infos[row].param); } return val; } int regwin_write(struct regwin_infos_t *p, int new) { int max_value; max_value = (1 << (4 * p->w)) - 1; /* 16^w - 1 */ /* Check that the new value is not too large for the register type. */ if (new > max_value) { /* Display message for CLI version */ printf("Value out of range\n"); return -1; } if (p->write_func == NULL) { /* * Write register value using generic 8 or 16 bits write * function, depending on width. */ regwin_write_generic(p->param, new, p->w); } else { /* Write register value using custom function pointer. */ p->write_func(p->param, new); } return 0; } struct regwin_infos_t * sfr_get_infos(const char *regname) { int row; for (row = 0; row < SFR_REGS; row++) { if (strcmp(regwin_infos[row].name, regname) == 0) return ®win_infos[row]; } return NULL; /* Register not found. */ } struct regwin_infos_t * sfr_get_infos_from_row(int row) { return ®win_infos[row]; } emu8051-2.0.1/src/common/sfr.h0000644000175400017500000000127412313352657012600 00000000000000/* * sfr.h * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef SFR_H #define SFR_H 1 #define SFR_REGS 26 struct regwin_infos_t { char *name; /* Register name */ int w; /* Number of hex digits to display */ unsigned int (*read_func)(int addr); /* Function to read value */ void (*write_func)(int param, int val); /* Function to write value */ int param; /* Optional parameter to pass to read function. */ }; int regwin_read(int row); int regwin_write(struct regwin_infos_t *p, int new); struct regwin_infos_t * sfr_get_infos(const char *regname); struct regwin_infos_t * sfr_get_infos_from_row(int row); #endif /* SFR_H */ emu8051-2.0.1/src/common/reg8051.h0000644000175400017500000000257412313352657013105 00000000000000/* * reg8051.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef REG8051_H #define REG8051_H 1 /* SFR Registers ( $80 - $FF ) */ #define _ACC_ 0xE0 #define _B_ 0xF0 #define _PSW_ 0xD0 #define _SP_ 0x81 #define _DPTRLOW_ _DPL_ #define _DPTRHIGH_ _DPH_ #define _DPL_ 0x82 #define _DPH_ 0x83 #define _P0_ 0x80 #define _P1_ 0x90 #define _P2_ 0xA0 #define _P3_ 0xB0 #define _IP_ 0xB8 #define _IE_ 0xA8 #define _TMOD_ 0x89 #define _TCON_ 0x88 #define _TH0_ 0x8C #define _TL0_ 0x8A #define _TH1_ 0x8D #define _TL1_ 0x8B #define _SCON_ 0x98 #define _SBUF_ 0x99 #define _PCON_ 0x87 #define _T2CON_ 0xC8 #define _R0_ 0x00 #define _R1_ 0x01 #define _R2_ 0x02 #define _R3_ 0x03 #define _R4_ 0x04 #define _R5_ 0x05 #define _R6_ 0x06 #define _R7_ 0x07 #define _BANK0_ 0x00 #define _BANK1_ 0x08 #define _BANK2_ 0x10 #define _BANK3_ 0x18 #define PSW_BIT_CY 7 #define PSW_BIT_AC 6 #define PSW_BIT_OV 2 #define PSW_BIT_P 0 #define PSW_FLAG_CY (1 << PSW_BIT_CY) #define PSW_FLAG_AC (1 << PSW_BIT_AC) #define PSW_FLAG_OV (1 << PSW_BIT_OV) #define PSW_FLAG_P (1 << PSW_BIT_P) #endif /* REG8051_H */ emu8051-2.0.1/src/common/opcodes.lst0000644000175400017500000001175412313352657014021 00000000000000Opcode Instruction Bytes Cycles ---------------------------------------------- 00 NOP 1 1 01 AJMP addr11 2 2 02 LJMP addr16 3 2 03 RR A 1 1 04 INC A 1 1 05 INC direct 2 1 06 INC @R0 1 1 07 INC @R1 1 1 08 INC R0 1 1 09 INC R1 1 1 0A INC R2 1 1 0B INC R3 1 1 0C INC R4 1 1 0D INC R5 1 1 0E INC R6 1 1 0F INC R7 1 1 10 JBC bitaddr,reladdr 3 2 11 ACALL addr11 2 2 12 LCALL addr16 3 2 13 RRC A 1 1 14 DEC A 1 1 15 DEC direct 2 1 16 DEC @R0 1 1 17 DEC @R1 1 1 18 DEC R0 1 1 19 DEC R1 1 1 1A DEC R2 1 1 1B DEC R3 1 1 1C DEC R4 1 1 1D DEC R5 1 1 1E DEC R6 1 1 1F DEC R7 1 1 20 JB bitaddr,reladdr 3 2 21 AJMP addr11 2 2 22 RET 1 2 23 RL A 1 1 24 ADD A,#data 2 1 25 ADD A,direct 2 1 26 ADD A,@R0 1 1 27 ADD A,@R1 1 1 28 ADD A,R0 1 1 29 ADD A,R1 1 1 2A ADD A,R2 1 1 2B ADD A,R3 1 1 2C ADD A,R4 1 1 2D ADD A,R5 1 1 2E ADD A,R6 1 1 2F ADD A,R7 1 1 30 JNB bitaddr,reladdr 3 2 31 ACALL addr11 2 2 32 RETI 1 2 33 RLC A 1 1 34 ADDC A,#data 2 1 35 ADDC A,direct 2 1 36 ADDC A,@R0 1 1 37 ADDC A,@R1 1 1 38 ADDC A,R0 1 1 39 ADDC A,R1 1 1 3A ADDC A,R2 1 1 3B ADDC A,R3 1 1 3C ADDC A,R4 1 1 3D ADDC A,R5 1 1 3E ADDC A,R6 1 1 3F ADDC A,R7 1 1 40 JC reladdr 2 2 41 AJMP addr11 2 2 42 ORL direct,A 2 1 43 ORL direct,#data 3 2 44 ORL A,#data 2 1 45 ORL A,direct 2 1 46 ORL A,@R0 1 1 47 ORL A,@R1 1 1 48 ORL A,R0 1 1 49 ORL A,R1 1 1 4A ORL A,R2 1 1 4B ORL A,R3 1 1 4C ORL A,R4 1 1 4D ORL A,R5 1 1 4E ORL A,R6 1 1 4F ORL A,R7 1 1 50 JNC reladdr 2 2 51 ACALL addr11 2 2 52 ANL direct,A 2 1 53 ANL direct,#data 3 2 54 ANL A,#data 2 1 55 ANL A,direct 2 1 56 ANL A,@R0 1 1 57 ANL A,@R1 1 1 58 ANL A,R0 1 1 59 ANL A,R1 1 1 5A ANL A,R2 1 1 5B ANL A,R3 1 1 5C ANL A,R4 1 1 5D ANL A,R5 1 1 5E ANL A,R6 1 1 5F ANL A,R7 1 1 60 JZ reladdr 2 2 61 AJMP addr11 2 2 62 XRL direct,A 2 1 63 XRL direct,#data 3 2 64 XRL A,#data 2 1 65 XRL A,direct 2 1 66 XRL A,@R0 1 1 67 XRL A,@R1 1 1 68 XRL A,R0 1 1 69 XRL A,R1 1 1 6A XRL A,R2 1 1 6B XRL A,R3 1 1 6C XRL A,R4 1 1 6D XRL A,R5 1 1 6E XRL A,R6 1 1 6F XRL A,R7 1 1 70 JNZ reladdr 2 2 71 ACALL addr11 2 2 72 ORL C,bitaddr 2 2 73 JMP @A+DPTR 1 2 74 MOV A,#data 2 1 75 MOV direct,#data 3 2 76 MOV @R0,#data 2 1 77 MOV @R1,#data 2 1 78 MOV R0,#data 2 1 79 MOV R1,#data 2 1 7A MOV R2,#data 2 1 7B MOV R3,#data 2 1 7C MOV R4,#data 2 1 7D MOV R5,#data 2 1 7E MOV R6,#data 2 1 7F MOV R7,#data 2 1 80 SJMP reladdr 2 2 81 AJMP addr11 2 2 82 ANL C,bitaddr 2 1 83 MOVC A,@A+PC 1 1 84 DIV AB 1 4 85 MOV direct,direct 3 1 86 MOV direct,@R0 2 2 87 MOV direct,@R1 2 2 88 MOV direct,R0 2 2 89 MOV direct,R1 2 2 8A MOV direct,R2 2 2 8B MOV direct,R3 2 2 8C MOV direct,R4 2 2 8D MOV direct,R5 2 2 8E MOV direct,R6 2 2 8F MOV direct,R7 2 2 90 MOV DPTR,#data16 3 2 91 ACALL addr11 2 2 92 MOV bitaddr,C 2 2 93 MOVC A,@A+DPTR 1 2 94 SUBB A,#data 2 1 95 SUBB A,direct 2 1 96 SUBB A,@R0 1 1 97 SUBB A,@R1 1 1 98 SUBB A,R0 1 1 99 SUBB A,R1 1 1 9A SUBB A,R2 1 1 9B SUBB A,R3 1 1 9C SUBB A,R4 1 1 9D SUBB A,R5 1 1 9E SUBB A,R6 1 1 9F SUBB A,R7 1 1 A0 ORL C,/bitaddr 2 1 A1 AJMP addr11 2 2 A2 MOV C,bitaddr 2 1 A3 INC DPTR 1 2 A4 MUL AB 1 4 A5 INVALID 1 1 A6 MOV @R0,direct 2 2 A7 MOV @R1,direct 2 2 A8 MOV R0,direct 2 2 A9 MOV R1,direct 2 2 AA MOV R2,direct 2 2 AB MOV R3,direct 2 2 AC MOV R4,direct 2 2 AD MOV R5,direct 2 2 AE MOV R6,direct 2 2 AF MOV R7,direct 2 2 B0 ANL C,/bitaddr 2 1 B1 ACALL addr11 2 2 B2 CPL bitaddr 2 1 B3 CPL C 1 1 B4 CJNE A,#data,reladdr 3 2 B5 CJNE A,direct,reladdr 3 2 B6 CJNE @R0,#data,reladdr 3 2 B7 CJNE @R1,#data,reladdr 3 2 B8 CJNE R0,#data,reladdr 3 2 B9 CJNE R1,#data,reladdr 3 2 BA CJNE R2,#data,reladdr 3 2 BB CJNE R3,#data,reladdr 3 2 BC CJNE R4,#data,reladdr 3 2 BD CJNE R5,#data,reladdr 3 2 BE CJNE R6,#data,reladdr 3 2 BF CJNE R7,#data,reladdr 3 2 C0 PUSH direct 2 2 C1 AJMP addr11 2 2 C2 CLR bitaddr 2 1 C3 CLR C 1 1 C4 SWAP A 1 1 C5 XCH A,direct 2 1 C6 XCH A,@R0 1 1 C7 XCH A,@R1 1 1 C8 XCH A,R0 1 1 C9 XCH A,R1 1 1 CA XCH A,R2 1 1 CB XCH A,R3 1 1 CC XCH A,R4 1 1 CD XCH A,R5 1 1 CE XCH A,R6 1 1 CF XCH A,R7 1 1 D0 POP direct 2 2 D1 ACALL addr11 2 2 D2 SETB bitaddr 2 1 D3 SETB C 1 1 D4 DA A 1 1 D5 DJNZ direct,reladdr 3 2 D6 XCHD A,@R0 1 1 D7 XCHD A,@R1 1 1 D8 DJNZ R0,reladdr 2 2 D9 DJNZ R1,reladdr 2 2 DA DJNZ R2,reladdr 2 2 DB DJNZ R3,reladdr 2 2 DC DJNZ R4,reladdr 2 2 DD DJNZ R5,reladdr 2 2 DE DJNZ R6,reladdr 2 2 DF DJNZ R7,reladdr 2 2 E0 MOVX A,@DPTR 1 2 E1 AJMP addr11 2 2 E2 MOVX A,@R0 1 2 E3 MOVX A,@R1 1 2 E4 CLR A 1 1 E5 MOV A,direct 2 1 E6 MOV A,@R0 1 1 E7 MOV A,@R1 1 1 E8 MOV A,R0 1 1 E9 MOV A,R1 1 1 EA MOV A,R2 1 1 EB MOV A,R3 1 1 EC MOV A,R4 1 1 ED MOV A,R5 1 1 EE MOV A,R6 1 1 EF MOV A,R7 1 1 F0 MOVX @DPTR,A 1 2 F1 ACALL addr11 2 2 F2 MOVX @R0,A 1 2 F3 MOVX @R1,A 1 2 F4 CPL A 1 1 F5 MOV direct,A 2 1 F6 MOV @R0,A 1 1 F7 MOV @R1,A 1 1 F8 MOV R0,A 1 1 F9 MOV R1,A 1 1 FA MOV R2,A 1 1 FB MOV R3,A 1 1 FC MOV R4,A 1 1 FD MOV R5,A 1 1 FE MOV R6,A 1 1 FF MOV R7,A 1 1 emu8051-2.0.1/src/common/opcodes.c0000644000175400017500000001636112313352715013433 00000000000000/* * opcodes.c * * Do not modify this file directly, as it was created by opcodes2c.pl * Any modifications made directly to this file will be lost. * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include /* Size(in bytes) of each instruction (offset in table is instruction opcode) */ static int instr_size[256] = { 1, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 3, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 2, 1, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 3, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 1, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 1, 1, 3, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; /* * For all 256 opcodes, the value in this table gives the instruction type * ex.: MOV, INC, CLR, CPL,... * To know what is the instruction type, use * the number as an offset in instr_type_str[] */ static int instr_type_id[256] = { 0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 6, 7, 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 10, 1, 11, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 6, 15, 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 18, 1, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 20, 6, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 1, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 6, 19, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 1, 21, 28, 29, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 6, 26, 28, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 19, 1, 26, 4, 31, 32, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 21, 6, 33, 33, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 35, 1, 36, 36, 37, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 38, 39, 6, 40, 40, 41, 42, 43, 43, 42, 42, 42, 42, 42, 42, 42, 42, 44, 1, 44, 44, 36, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 44, 6, 44, 44, 33, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, }; /* List of instructions types referenced by instr_type_id[] */ static char *instr_type_str[45] = { "NOP", "AJMP", "LJMP", "RR", "INC", "JBC", "ACALL", "LCALL", "RRC", "DEC", "JB", "RET", "RL", "ADD", "JNB", "RETI", "RLC", "ADDC", "JC", "ORL", "JNC", "ANL", "JZ", "XRL", "JNZ", "JMP", "MOV", "SJMP", "MOVC", "DIV", "SUBB", "MUL", "INVALID", "CPL", "CJNE", "PUSH", "CLR", "SWAP", "XCH", "POP", "SETB", "DA", "DJNZ", "XCHD", "MOVX" }; /* * Table describing all arguments types of an instruction * The table is indexed instr_arg_type_id[ opcode * 4] * instr_arg_type_id[opcode*4 + 1] gives number of instruction arguments * instr_arg_type_id[opcode*4 + i] for i=1,2 and 3 gives type of each argument * for most instructions, the 3rd argument isn't used * the argument type is referenced to instr_arg_type_str[] */ static int instr_arg_type_id[1024] = { 0, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 3, 0, 0, 1, 4, 0, 0, 1, 5, 0, 0, 1, 6, 0, 0, 1, 7, 0, 0, 1, 8, 0, 0, 1, 9, 0, 0, 1, 10, 0, 0, 1, 11, 0, 0, 1, 12, 0, 0, 1, 13, 0, 0, 2, 14, 15, 0, 1, 0, 0, 0, 1, 1, 0, 0, 1, 2, 0, 0, 1, 2, 0, 0, 1, 3, 0, 0, 1, 4, 0, 0, 1, 5, 0, 0, 1, 6, 0, 0, 1, 7, 0, 0, 1, 8, 0, 0, 1, 9, 0, 0, 1, 10, 0, 0, 1, 11, 0, 0, 1, 12, 0, 0, 1, 13, 0, 0, 2, 14, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 2, 14, 15, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 1, 15, 0, 0, 1, 0, 0, 0, 2, 3, 2, 0, 2, 3, 16, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 1, 15, 0, 0, 1, 0, 0, 0, 2, 3, 2, 0, 2, 3, 16, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 1, 15, 0, 0, 1, 0, 0, 0, 2, 3, 2, 0, 2, 3, 16, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 1, 15, 0, 0, 1, 0, 0, 0, 2, 17, 14, 0, 1, 18, 0, 0, 2, 2, 16, 0, 2, 3, 16, 0, 2, 4, 16, 0, 2, 5, 16, 0, 2, 6, 16, 0, 2, 7, 16, 0, 2, 8, 16, 0, 2, 9, 16, 0, 2, 10, 16, 0, 2, 11, 16, 0, 2, 12, 16, 0, 2, 13, 16, 0, 1, 15, 0, 0, 1, 0, 0, 0, 2, 17, 14, 0, 2, 2, 19, 0, 1, 20, 0, 0, 2, 3, 3, 0, 2, 3, 4, 0, 2, 3, 5, 0, 2, 3, 6, 0, 2, 3, 7, 0, 2, 3, 8, 0, 2, 3, 9, 0, 2, 3, 10, 0, 2, 3, 11, 0, 2, 3, 12, 0, 2, 3, 13, 0, 2, 21, 22, 0, 1, 0, 0, 0, 2, 14, 17, 0, 2, 2, 18, 0, 2, 2, 16, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 2, 17, 23, 0, 1, 0, 0, 0, 2, 17, 14, 0, 1, 21, 0, 0, 1, 20, 0, 0, 0, 0, 0, 0, 2, 4, 3, 0, 2, 5, 3, 0, 2, 6, 3, 0, 2, 7, 3, 0, 2, 8, 3, 0, 2, 9, 3, 0, 2, 10, 3, 0, 2, 11, 3, 0, 2, 12, 3, 0, 2, 13, 3, 0, 2, 17, 23, 0, 1, 0, 0, 0, 1, 14, 0, 0, 1, 17, 0, 0, 3, 2, 16, 15, 3, 2, 3, 15, 3, 4, 16, 15, 3, 5, 16, 15, 3, 6, 16, 15, 3, 7, 16, 15, 3, 8, 16, 15, 3, 9, 16, 15, 3, 10, 16, 15, 3, 11, 16, 15, 3, 12, 16, 15, 3, 13, 16, 15, 1, 3, 0, 0, 1, 0, 0, 0, 1, 14, 0, 0, 1, 17, 0, 0, 1, 2, 0, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 1, 3, 0, 0, 1, 0, 0, 0, 1, 14, 0, 0, 1, 17, 0, 0, 1, 2, 0, 0, 2, 3, 15, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 6, 15, 0, 2, 7, 15, 0, 2, 8, 15, 0, 2, 9, 15, 0, 2, 10, 15, 0, 2, 11, 15, 0, 2, 12, 15, 0, 2, 13, 15, 0, 2, 2, 24, 0, 1, 0, 0, 0, 2, 2, 4, 0, 2, 2, 5, 0, 1, 2, 0, 0, 2, 2, 3, 0, 2, 2, 4, 0, 2, 2, 5, 0, 2, 2, 6, 0, 2, 2, 7, 0, 2, 2, 8, 0, 2, 2, 9, 0, 2, 2, 10, 0, 2, 2, 11, 0, 2, 2, 12, 0, 2, 2, 13, 0, 2, 24, 2, 0, 1, 0, 0, 0, 2, 4, 2, 0, 2, 5, 2, 0, 1, 2, 0, 0, 2, 3, 2, 0, 2, 4, 2, 0, 2, 5, 2, 0, 2, 6, 2, 0, 2, 7, 2, 0, 2, 8, 2, 0, 2, 9, 2, 0, 2, 10, 2, 0, 2, 11, 2, 0, 2, 12, 2, 0, 2, 13, 2, 0, }; /* * List all types of arguments available to instructions * Referenced by instr_arg_type_id[] */ static char *instr_arg_type_str[25] = { "addr11", "addr16", "A", "direct", "@R0", "@R1", "R0", "R1", "R2", "R3", "R4", "R5", "R6", "R7", "bitaddr", "reladdr", "#data", "C", "@A+DPTR", "@A+PC", "AB", "DPTR", "#data16", "/bitaddr", "@DPTR" }; int opcodes_get_instr_size(uint8_t opcode) { return instr_size[opcode]; } char * opcodes_get_instr_type_str(uint8_t opcode) { return instr_type_str[instr_type_id[opcode]]; } int opcodes_get_instr_arg_type_id(unsigned int offset) { return instr_arg_type_id[offset]; } char * opcodes_get_instr_arg_type_str(unsigned int offset) { return instr_arg_type_str[instr_arg_type_id[offset]]; } emu8051-2.0.1/src/common/opcodes.h0000644000175400017500000000107112313352715013430 00000000000000/* * opcodes.h * * Do not modify this file directly, as it was created by opcodes2c.pl * Any modifications made directly to this file will be lost. * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef OPCODES_H #define OPCODES_H 1 int opcodes_get_instr_size(uint8_t opcode); char * opcodes_get_instr_type_str(uint8_t opcode); int opcodes_get_instr_arg_type_id(unsigned int offset); char * opcodes_get_instr_arg_type_str(unsigned int offset); #endif /* OPCODES_IMP */ emu8051-2.0.1/src/common/cpu8051.c0000644000175400017500000003215212313352657013105 00000000000000/* * cpu8051.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ /* Define only here, for not having extern scope on local variables. */ #define CPU8051_M 1 #include #include #include #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "memory.h" #include "psw.h" #include "timers.h" #include "opcodes.h" #include "options.h" #include "instructions_8051.h" extern struct options_t options; /* Check if the address is a breakpoint */ int breakpoint_is_defined(unsigned int address) { int k; for (k = 0; k < cpu8051.bp_count; k++) { if (cpu8051.bp[k] == address) return true; } /* The address was not found in the list of breakpoints */ return false; } /* Show Breakpoints list */ void breakpoints_show(void) { int k; if (cpu8051.bp_count) { printf("Breakpoints:\n"); for (k = 0; k < cpu8051.bp_count; k++) printf(" $%.4X\n", cpu8051.bp[k]); } else { printf("No breakpoints defined\n"); } } /* Set Breakpoint at address at the end of the breakpoint list */ void breakpoint_set(unsigned int address) { int rc; rc = mem_check_address(PGM_MEM_ID, address, DISPLAY_ERROR_YES); if (!rc) return; /* Error */ /* Check if breakpoint is already defined. */ if ((breakpoint_is_defined(address) == false) && (cpu8051.bp_count < MAXBP)) cpu8051.bp[cpu8051.bp_count++] = address; } /* Clear Breakpoint at Address from list */ void breakpoint_clr(unsigned int address) { int k; int rc; rc = mem_check_address(PGM_MEM_ID, address, DISPLAY_ERROR_YES); if (!rc) return; /* Error */ /* Check if breakpoint is defined. */ if (breakpoint_is_defined(address) == false) { log_err("No breakpoint defined at address $%X", address); return; } for (k = 0; k < cpu8051.bp_count; k++) { if (cpu8051.bp[k] == address) { /* Fill removed breakpoint slot with last entry */ cpu8051.bp[k] = cpu8051.bp[cpu8051.bp_count - 1]; cpu8051.bp_count--; } } } /* Clear all breakpoints */ void breakpoints_clr_all(void) { cpu8051.bp_count = 0; } /* Toggle the breakpoint at Address. */ void breakpoint_toggle(unsigned int address) { if (breakpoint_is_defined(address)) breakpoint_clr(address); else breakpoint_set(address); } /* Check if the address is a stop point */ static int stop_point_is_defined(unsigned int address) { if ((options.stop_address != 0) && (options.stop_address == address)) return true; else return false; } void cpu8051_init(void) { int id; mem_init(); for (id = 0; id < GP_TIMERS_COUNT; id++) gp_timer_reset(id); cpu8051.pc = 0; cpu8051.clock = 0; cpu8051.active_priority = -1; cpu8051.bp_count = 0; } /* Reset the registers and CPU state */ void cpu8051_reset(void) { cpu8051.pc = 0; cpu8051.clock = 0; cpu8051.active_priority = -1; /* Clear IRAM and SFR. */ mem_clear(INT_MEM_ID); mem_sfr_write8(_P0_, 0xFF); mem_sfr_write8(_P1_, 0xFF); mem_sfr_write8(_P2_, 0xFF); mem_sfr_write8(_P3_, 0xFF); /* The default value of SP (after system reset) is 07 */ mem_sfr_write8(_SP_, 0x07); } static int cpu8051_interrupt_fire(int interrupt_no, int priority) { if (mem_read_direct(_IP_) & INTERRUPT_MASK(interrupt_no)) return priority; else return !priority; } static int cpu8051_interrupt_enabled(int interrupt_no) { return (mem_read_direct(_IE_) & INTERRUPT_MASK(interrupt_no)) ? 1 : 0; } static void cpu8051_process_interrupt(int pc, int pri) { stack_push16(cpu8051.pc); cpu8051.pc = pc; cpu8051.active_priority = pri; } /* Check interrupts state and process them as needed */ static void cpu8051_check_interrupts(void) { int i; if ((mem_read_direct(_IE_) & 0x80) == 0) return; for (i = INTERRUPT_PRIORITY_HIGH; i >= INTERRUPT_PRIORITY_LOW; i--) { if (cpu8051.active_priority < i) { /* Interrupt timer 0 */ if (cpu8051_interrupt_enabled(INTERRUPT_1) && cpu8051_interrupt_fire(INTERRUPT_1, i) && (mem_read_direct(_TCON_) & 0x20)) { mem_write_direct( _TCON_, mem_read_direct(_TCON_) & 0xDF); cpu8051_process_interrupt(0x0B, i); return; } /* Interrupt timer 1 */ if (cpu8051_interrupt_enabled(INTERRUPT_3) && cpu8051_interrupt_fire(INTERRUPT_3, i) && (mem_read_direct(_TCON_) & 0x80)) { mem_write_direct( _TCON_, mem_read_direct(_TCON_) & 0x7F); cpu8051_process_interrupt(0x1B, i); return; } /* Serial Interrupts */ if (cpu8051_interrupt_enabled(INTERRUPT_4) && cpu8051_interrupt_fire(INTERRUPT_4, i) && (mem_read_direct(_SCON_) & 0x03)) { cpu8051_process_interrupt(0x23, i); return; } /* Interrupt timer 2 */ if (cpu8051_interrupt_enabled(INTERRUPT_5) && cpu8051_interrupt_fire(INTERRUPT_5, i) && (mem_read_direct(_T2CON_) & 0x80)) { cpu8051_process_interrupt(0x2B, i); return; } } } } /* Execute at address cpu8051.pc from PGMMem */ int cpu8051_exec(void) { int i; int rc; unsigned char opcode; int insttiming; /* Basic address check (may fail later if opcode has operands). */ rc = mem_check_address(PGM_MEM_ID, cpu8051.pc, DISPLAY_ERROR_NO); if (!rc) { log_err("Trying to run past program memory limit"); return false; /* Error */ } opcode = mem_read8(PGM_MEM_ID, cpu8051.pc); cpu8051.pc++; insttiming = (*opcode_table[opcode])(); /* Function callback. */ /* * Parity bit (p): is automatically set or cleared in each machine * cycle to establish even parity in the accumulator. */ psw_compute_parity_bit(); gp_timers_increment(insttiming); for (i = 0; i < insttiming; i++) { cpu8051_check_interrupts(); timers_check(); cpu8051.clock++; } return true; } /* * Run specified number of instructions, or when encountering a * breakpoint or a stop point. * Set instr_count to -1 to disable running for a specific number * of instructions. * * Returns TRUE when a breakpoint is encountered. */ int cpu8051_run(int instr_count, int (*interface_stop)(void)) { int rc; int run = true; int breakpoint_hit = false; while (run) { rc = cpu8051_exec(); if (!rc) { run = false; } else { if (instr_count > 0) instr_count--; if (instr_count == 0) { run = false; log_info("Number of instructions reached"); } if (breakpoint_is_defined(cpu8051.pc)) { run = false; breakpoint_hit = true; log_info("Breakpoint hit at %.4X", cpu8051.pc); } if (stop_point_is_defined(cpu8051.pc)) { run = false; log_info("Stoppoint hit at %.4X", cpu8051.pc); } if (interface_stop != NULL) { if (interface_stop()) { run = false; log_info("Caught break signal"); } } } } return breakpoint_hit; } /* * Addressing modes defined in the order as they appear in disasm.h * from table argstext[] */ #define ADDR11 0 #define ADDR16 1 #define DIRECT 3 #define BITADDR 14 #define RELADDR 15 #define DATAIMM 16 #define DATA16 22 #define CBITADDR 23 /* * SFR Memory map [80h - FFh] * --------------------------------------------------------------- * F8 | | | | | | | | | FF * F0 | B | | | | | | | | F7 * E8 | | | | | | | | | EF * E0 | ACC | | | | | | | | E7 * D8 | | | | | | | | | DF * D0 | PSW | | | | | | | | D7 * C8 | T2CON| |RCAP2L|RCAP2H| TL2 | TH2 | | | CF * C0 | | | | | | | | | C7 * B8 | IP | | | | | | | | BF * B0 | P3 | | | | | | | | B7 * A8 | IE | | | | | | | | AF * A0 | P2 | | | | | | | | A7 * 98 | SCON | SBUF | | | | | | | 9F * 90 | P1 | | | | | | | | 97 * 88 | TCON | TMOD | TL0 | TL1 | TH0 | TH1 | | | 8F * 80 | P0 | SP | DPL | DPH | | | | PCON | 87 * --------------------------------------------------------------- */ /* Return as Text the name of the SFR register at Address if any */ static int cpu8051_sfr_mem_info(unsigned int address, char *text) { switch (address) { case 0x80: return sprintf(text, "P0"); case 0x81: return sprintf(text, "SP"); case 0x82: return sprintf(text, "DPL"); case 0x83: return sprintf(text, "DPH"); case 0x87: return sprintf(text, "PCON"); case 0x88: return sprintf(text, "TCON"); case 0x89: return sprintf(text, "TMOD"); case 0x8A: return sprintf(text, "TL0"); case 0x8B: return sprintf(text, "TL1"); case 0x8C: return sprintf(text, "TH0"); case 0x8D: return sprintf(text, "TH1"); case 0x90: return sprintf(text, "P1"); case 0x98: return sprintf(text, "SCON"); case 0x99: return sprintf(text, "SBUF"); case 0xA0: return sprintf(text, "P2"); case 0xA8: return sprintf(text, "IE"); case 0xB0: return sprintf(text, "P3"); case 0xB8: return sprintf(text, "IP"); case 0xC8: return sprintf(text, "T2CON"); case 0xCA: return sprintf(text, "RCAP2L"); case 0xCB: return sprintf(text, "RCAP2H"); case 0xCC: return sprintf(text, "TL2"); case 0xCD: return sprintf(text, "TH2"); case 0xD0: return sprintf(text, "PSW"); case 0xE0: return sprintf(text, "ACC"); case 0xF0: return sprintf(text, "B"); default: return sprintf(text, "%.2XH", address); } } /* Return as text the decoded bit address */ static void cpu8051_int_mem_bit_info(uint8_t bit_address, char *text) { uint8_t byte_address; uint8_t bit_number; int len; mem_convert_bit_address(bit_address, &byte_address, &bit_number); len = cpu8051_sfr_mem_info(byte_address, text); sprintf(&text[len], ".%X", bit_address); } /* Display instruction mnemonic. */ int cpu8051_disasm_mnemonic(unsigned char opcode, char *buf) { return sprintf(buf, "%s", opcodes_get_instr_type_str(opcode)); } /* Disasm instruction arguments starting at address into a text string */ void cpu8051_disasm_args(unsigned int address, char *buf) { int len = 0; char str[20]; unsigned char opcode; int args_table_offset; int i; buf[0] = '\0'; opcode = mem_read8(PGM_MEM_ID, address); args_table_offset = opcode << 2; address++; /* * MOV direct, direct (opcode 85h) is peculiar, the operands * are inverted */ if (opcode == 0x85) { cpu8051_sfr_mem_info(mem_read8(PGM_MEM_ID, address + 1), str); len += sprintf(&buf[len], "%s,", str); cpu8051_sfr_mem_info(mem_read8(PGM_MEM_ID, address), str); len += sprintf(&buf[len], "%s", str); address += 2; return; } for (i = 1; i <= opcodes_get_instr_arg_type_id(args_table_offset); i++) { switch (opcodes_get_instr_arg_type_id(args_table_offset + i)) { case ADDR11: { len += sprintf(&buf[len], "%.4XH", ((opcode << 3) & 0xF00) + (mem_read8(PGM_MEM_ID, address))); address++; break; } case ADDR16: { len += sprintf( &buf[len], "%.4XH", ((mem_read8(PGM_MEM_ID, address) << 8) + mem_read8(PGM_MEM_ID, address + 1))); address += 2; break; } case DIRECT: { cpu8051_sfr_mem_info(mem_read8(PGM_MEM_ID, address), str); len += sprintf(&buf[len], "%s", str); address++; break; } case BITADDR: { cpu8051_int_mem_bit_info( (mem_read8(PGM_MEM_ID, address) & 0xF8), str); len += sprintf(&buf[len], "%s.%X" , str, (mem_read8(PGM_MEM_ID, address) & 7)); address++; break; } case RELADDR: { address++; len += sprintf(&buf[len], "%.4XH", (address & 0xFF00) + (((address & 0xFF) + mem_read8(PGM_MEM_ID, address - 1)) & 0xFF)); break; } case DATAIMM: { len += sprintf(&buf[len], "#%.2XH", mem_read8(PGM_MEM_ID, address)); address++; break; } case DATA16: { len += sprintf(&buf[len], "#%.4XH", ((mem_read8(PGM_MEM_ID, address) << 8) + mem_read8(PGM_MEM_ID, address+1))); address += 2; break; } case CBITADDR: { cpu8051_int_mem_bit_info((mem_read8(PGM_MEM_ID, address) & 0xF8), str); len += sprintf(&buf[len], "/%s.%X", str, (mem_read8(PGM_MEM_ID, address) & 7)); address++; break; } default: { len += sprintf(&buf[len], "%s", opcodes_get_instr_arg_type_str( args_table_offset + i)); } } if (i < opcodes_get_instr_arg_type_id(args_table_offset)) len += sprintf(&buf[len], ","); } } /* Disasm one instruction at address into a Text string */ int cpu8051_disasm(unsigned int address, char *text) { int len = 0; unsigned char opcode; int inst_size; int i; /* Display address. */ len += sprintf(text, " %.4X ", address); opcode = mem_read8(PGM_MEM_ID, address); inst_size = opcodes_get_instr_size(opcode); /* Display hex bytes. */ for (i = 0; i < inst_size; i++) len += sprintf(&text[len], " %.2X", mem_read8(PGM_MEM_ID, address + i)); /* Padd remaining area with spaces. */ for (; len < 17;) len += sprintf(&text[len], " "); /* Display instruction mnemonic. */ len += cpu8051_disasm_mnemonic(opcode, &text[len]); /* Padd remaining area with spaces. */ for (; len < 25;) len += sprintf(&text[len], " "); /* Display instruction arguments. */ cpu8051_disasm_args(address, &text[len]); return inst_size; } emu8051-2.0.1/src/common/cpu8051.h0000644000175400017500000000266312313352657013116 00000000000000/* * cpu8051.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef CPU8051_H #define CPU8051_H 1 #include /* Maximum number of BreakPoints */ #define MAXBP 32 #define INTERRUPT_0 (0) #define INTERRUPT_1 (1) #define INTERRUPT_2 (2) #define INTERRUPT_3 (3) #define INTERRUPT_4 (4) #define INTERRUPT_5 (5) #define INTERRUPT_MASK(n) (1 << n) #define INTERRUPT_PRIORITY_HIGH (1) #define INTERRUPT_PRIORITY_LOW (0) struct cpu8051_t { unsigned int pc; /* Program counter */ unsigned long clock; int active_priority; int bp_count; unsigned int bp[MAXBP]; /* List of breakpoints */ }; /* Exported variables */ #undef _SCOPE_ #ifdef CPU8051_M # define _SCOPE_ /**/ #else # define _SCOPE_ extern #endif _SCOPE_ struct cpu8051_t cpu8051; int breakpoint_is_defined(unsigned int address); void breakpoints_show(void); void breakpoint_set(unsigned int address); void breakpoint_clr(unsigned int address); void breakpoints_clr_all(void); void breakpoint_toggle(unsigned int address); void cpu8051_init(void); int cpu8051_exec(void); int cpu8051_run(int instr_count, int (*interface_stop)(void)); void cpu8051_reset(void); int cpu8051_disasm_mnemonic(unsigned char opcode, char *buf); void cpu8051_disasm_args(unsigned int address, char *buf); int cpu8051_disasm(unsigned int address, char *text); #endif /* CPU8051_H */ emu8051-2.0.1/src/common/opcodes2c.pl0000755000175400017500000006647012313352657014067 00000000000000#!/usr/bin/perl # # Copyright (C) 1999 Jonathan St-André # Copyright (C) 1999 Hugo Villeneuve # # This file is released under the GPLv2 open INST_DEF, ">instructions_8051.h" or die "Error creating : $!\n"; open INST_IMP, ">instructions_8051.c" or die "Error creating : $!\n"; open OPCODELST, "opcodes.lst" or die "Error opening : $!\n"; open OPCODES_DEF, ">opcodes.h" or die "Error creating : $!\n"; open OPCODES_IMP, ">opcodes.c" or die "Error creating : $!\n"; # Write GPL license # Argument 0 is file descriptor sub write_header { my $fd = $_[0]; print $fd " *\n"; print $fd " * Do not modify this file directly, as it was created by opcodes2c.pl\n"; print $fd " * Any modifications made directly to this file will be lost.\n"; print $fd " *\n"; print $fd " * Copyright (C) 1999 Jonathan St-André\n"; print $fd " * Copyright (C) 1999 Hugo Villeneuve \n"; print $fd " *\n"; print $fd " * This file is released under the GPLv2\n"; print $fd " */\n\n"; } # Write C function source code line to INST_IMP file. # Prefix each line with a tab (indentation) and add newline character at the end. sub cfw { print INST_IMP "\t",$_[0],"\n"; } # Header for instructions_8051.c print INST_IMP "/*\n"; print INST_IMP " * instructions_8051.c\n"; write_header(INST_IMP); print INST_IMP "/* Define only here, for not having extern scope on local variables. */\n"; print INST_IMP "#define INSTRUCTIONS_8051_M 1\n\n\n"; print INST_IMP "#include \"reg8051.h\"\n"; print INST_IMP "#include \"cpu8051.h\"\n"; print INST_IMP "#include \"memory.h\"\n"; print INST_IMP "#include \"psw.h\"\n"; print INST_IMP "#include \"operations.h\"\n"; print INST_IMP "#include \"instructions_8051.h\"\n\n\n"; # Header for opcodes.h print OPCODES_DEF "/*\n"; print OPCODES_DEF " * opcodes.h\n"; write_header(OPCODES_DEF); print OPCODES_DEF "#ifndef OPCODES_H\n"; print OPCODES_DEF "#define OPCODES_H 1\n\n"; print OPCODES_DEF "int\n"; print OPCODES_DEF "opcodes_get_instr_size(uint8_t opcode);\n"; print OPCODES_DEF "char *\n"; print OPCODES_DEF "opcodes_get_instr_type_str(uint8_t opcode);\n"; print OPCODES_DEF "int\n"; print OPCODES_DEF "opcodes_get_instr_arg_type_id(unsigned int offset);\n"; print OPCODES_DEF "char *\n"; print OPCODES_DEF "opcodes_get_instr_arg_type_str(unsigned int offset);\n"; # opcodes.c print OPCODES_IMP "/*\n"; print OPCODES_IMP " * opcodes.c\n"; write_header(OPCODES_IMP); print OPCODES_IMP "#include \n\n"; # Column indexes in opcodes.lst table use constant COL_OPCODE => 0; use constant COL_INSTR => 1; use constant COL_ARGS => 2; use constant COL_COUNT_NO_ARGS => 4; $nbinst=0; $nbaddr=0; $nbargs=0; $instnumb=0; # Read file describing each instruction/opcode # Discard first two lines, which are comments $ligne = ; $ligne = ; while($ligne=) { chop $ligne; if (length $ligne < 2) { next; } @wordlist = split ' ',$ligne; $nbword = @wordlist; $instruction = $wordlist[COL_INSTR]; for ($i = (COL_INSTR + 1); $i < ($nbword - 2); $i++) { $instruction = "$instruction $wordlist[$i]"; } $a_instruction[$instnumb] = $instruction; $a_bytes[$instnumb] = $wordlist[$nbword - 2]; $a_cycles[$instnumb] = $wordlist[$nbword - 1]; $a_opcodehex[$instnumb] = $wordlist[COL_OPCODE]; $instfunction[$instnumb] = "CPU8051::OP_$wordlist[COL_OPCODE]"; $instargs[$instnumb << 2] = $instargs[($instnumb << 2) + 1] = $instargs[($instnumb << 2) + 2] = $instargs[($instnumb << 2) + 3] = 0; if ($nbword > COL_COUNT_NO_ARGS) { @argslist = split /\,/,$wordlist[COL_ARGS]; $argslistsize = @argslist; $instargs[$instnumb << 2] = $argslistsize; for ($i = 0; $i < $argslistsize; $i++) { if (not exists $argstypes{$argslist[$i]}) { $argstypes[$nbargs] = $argslist[$i]; $argstypes{$argslist[$i]} = $nbargs++; } $instargs[($instnumb << 2) + $i + 1] = $argstypes{$argslist[$i]}; } } if (not exists $insttext{$wordlist[COL_INSTR]}) { $insttext[$nbinst] = $wordlist[COL_INSTR]; $insttext{$wordlist[COL_INSTR]} = $nbinst++; } $insttype[$instnumb] = $insttext{$wordlist[COL_INSTR]}; if (not exists $addrmode{$wordlist[COL_ARGS]}) { $addrmode[$nbaddr] = $wordlist[COL_ARGS]; $addrmode{$wordlist[COL_ARGS]} = $nbaddr++; } $nbbytes[$instnumb] = $wordlist[$nbword - 2]; $instaddr[$instnumb] = $addrmode{$wordlist[COL_ARGS]}; $instnumb++; } # ------------------------------------------------------------------------------ print OPCODES_IMP "/* Size(in bytes) of each instruction (offset in table is instruction opcode) */\n"; $nbelement = @nbbytes; print OPCODES_IMP "static int instr_size[$nbelement] = {"; for ($i = 0; $i < $nbelement; $i++) { if ($i % 16 == 0) { print OPCODES_IMP "\n\t"; } else { print OPCODES_IMP " "; } print OPCODES_IMP "$nbbytes[$i],"; } print OPCODES_IMP "\n"; print OPCODES_IMP "};\n"; print OPCODES_IMP "\n"; # ------------------------------------------------------------------------------ print OPCODES_IMP "/*\n"; print OPCODES_IMP " * For all 256 opcodes, the value in this table gives the instruction type\n"; print OPCODES_IMP " * ex.: MOV, INC, CLR, CPL,...\n"; print OPCODES_IMP " * To know what is the instruction type, use\n"; print OPCODES_IMP " * the number as an offset in instr_type_str[]\n"; print OPCODES_IMP " */\n"; $nbelement = @insttype; print OPCODES_IMP "static int instr_type_id[$nbelement] = {"; for ($i = 0; $i < $nbelement; $i++) { if ($i % 16 == 0) { print OPCODES_IMP "\n\t"; } else { print OPCODES_IMP " "; } print OPCODES_IMP "$insttype[$i],"; } print OPCODES_IMP "\n"; print OPCODES_IMP "};\n"; print OPCODES_IMP "\n"; # ------------------------------------------------------------------------------ print OPCODES_IMP "/* List of instructions types referenced by instr_type_id[] */\n"; $nbelement = @insttext; $elementnb = 0; print OPCODES_IMP "static char *instr_type_str[$nbelement] = {\n"; foreach $instruc (@insttext) { print OPCODES_IMP "\t\"$instruc\""; if ($elementnb++ < ($nbelement - 1)) { print OPCODES_IMP ","; } print OPCODES_IMP "\n"; } print OPCODES_IMP "};\n"; print OPCODES_IMP "\n"; # ------------------------------------------------------------------------------ print OPCODES_IMP "/*\n"; print OPCODES_IMP " * Table describing all arguments types of an instruction\n"; print OPCODES_IMP " * The table is indexed instr_arg_type_id[ opcode * 4]\n"; print OPCODES_IMP " * instr_arg_type_id[opcode*4 + 1] gives number of instruction arguments\n"; print OPCODES_IMP " * instr_arg_type_id[opcode*4 + i] for i=1,2 and 3 gives type of each argument\n"; print OPCODES_IMP " * for most instructions, the 3rd argument isn't used\n"; print OPCODES_IMP " * the argument type is referenced to instr_arg_type_str[]\n"; print OPCODES_IMP " */\n"; $nbelement = @instargs; print OPCODES_IMP "static int instr_arg_type_id[$nbelement] = {"; for ($i = 0; $i < $nbelement; $i++) { if ($i % 16 == 0) { print OPCODES_IMP "\n\t"; } else { print OPCODES_IMP " "; } print OPCODES_IMP "$instargs[$i],"; } print OPCODES_IMP "\n"; print OPCODES_IMP "};\n"; print OPCODES_IMP "\n"; # ------------------------------------------------------------------------------ print OPCODES_IMP "/*\n"; print OPCODES_IMP " * List all types of arguments available to instructions\n"; print OPCODES_IMP " * Referenced by instr_arg_type_id[]\n"; print OPCODES_IMP " */\n"; $nbelement = @argstypes; $elementnb = 0; print OPCODES_IMP "static char *instr_arg_type_str[$nbelement] = {\n"; foreach $args (@argstypes) { print OPCODES_IMP "\t\"$args\""; if ($elementnb++ < $nbelement-1) { print OPCODES_IMP ","; } print OPCODES_IMP "\n"; } print OPCODES_IMP "};\n"; print OPCODES_IMP "\n"; print OPCODES_IMP "int\n"; print OPCODES_IMP "opcodes_get_instr_size(uint8_t opcode)\n"; print OPCODES_IMP "{\n"; print OPCODES_IMP "\treturn instr_size[opcode];\n"; print OPCODES_IMP "}\n"; print OPCODES_IMP "\n"; print OPCODES_IMP "char *\n"; print OPCODES_IMP "opcodes_get_instr_type_str(uint8_t opcode)\n"; print OPCODES_IMP "{\n"; print OPCODES_IMP "\treturn instr_type_str[instr_type_id[opcode]];\n"; print OPCODES_IMP "}\n"; print OPCODES_IMP "\n"; print OPCODES_IMP "int\n"; print OPCODES_IMP "opcodes_get_instr_arg_type_id(unsigned int offset)\n"; print OPCODES_IMP "{\n"; print OPCODES_IMP "\treturn instr_arg_type_id[offset];\n"; print OPCODES_IMP "}\n"; print OPCODES_IMP "\n"; print OPCODES_IMP "char *\n"; print OPCODES_IMP "opcodes_get_instr_arg_type_str(unsigned int offset)\n"; print OPCODES_IMP "{\n"; print OPCODES_IMP "\treturn instr_arg_type_str[instr_arg_type_id[offset]];\n"; print OPCODES_IMP "}\n"; print OPCODES_IMP "\n"; # ------------------------------------------------------------------------------ for ($i = 0 ; $i < 256; $i++) { print INST_IMP "/*","*"x76,"\n"; print INST_IMP " * Instruction \"$a_instruction[$i]\" takes $a_cycles[$i] cycle(s) and $a_bytes[$i] byte(s).\n"; print INST_IMP " ","*"x76,"/\n"; print INST_IMP "int\n"; print INST_IMP "cpu8051_OP_$a_opcodehex[$i](void)\n"; print INST_IMP "{\n"; if( $i == 0x85 ) { # Cas particulier pour MOV direct,direct -> src et dest sont inverses dans la memoire print INST_IMP " unsigned char srcaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ );\n"; print INST_IMP " unsigned char source = mem_read_direct( srcaddr );\n"; print INST_IMP " unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ );\n"; print INST_IMP " unsigned char destination = mem_read_direct( destaddr );\n"; print INST_IMP " destination = source;\n"; print INST_IMP " mem_write_direct( destaddr, destination );\n"; } else { if ($instargs[$i*4] > 0) { $op_destination=$instargs[$i*4+1]; if ($op_destination == 0) { # addr11 cfw("unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc );"); cfw("cpu8051.pc++;"); } if ($op_destination == 1) { # addr16 cfw("uint16_t addr16 = pgm_read_addr16(cpu8051.pc);"); cfw("cpu8051.pc += 2;"); } if ($op_destination == 2) { # A cfw("unsigned char destination = mem_read_direct( _ACC_ );"); } if ($op_destination == 3) { # direct cfw("unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ );"); cfw("unsigned char destination = mem_read_direct( destaddr );"); } if ($op_destination == 4) { # @R0 cfw("unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) );"); } if ($op_destination == 5) { # @R1 cfw("unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) );"); } if ($op_destination == 6) { # R0 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R0_ );"); } if ($op_destination == 7) { # R1 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R1_ );"); } if ($op_destination == 8) { # R2 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R2_ );"); } if ($op_destination == 9) { # R3 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R3_ );"); } if ($op_destination == 10) { # R4 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R4_ );"); } if ($op_destination == 11) { # R5 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R5_ );"); } if ($op_destination == 12) { # R6 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R6_ );"); } if ($op_destination == 13) { # R7 cfw("unsigned char destination = mem_read_direct( BANKPSW + _R7_ );"); } if ($op_destination == 14) { # bitaddr cfw("unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ );"); cfw("destination = mem_read_bit( dstbitaddr );"); } if ($op_destination == 15) { # reladdr cfw("cpu8051.pc++;"); cfw("unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc;"); } if ($op_destination == 16) { # #data cfw("unsigned char destination = mem_read8( PGM_MEM_ID, cpu8051.pc++ );"); } if ($op_destination == 17) { # C cfw("unsigned char destination = psw_read_cy();"); } if ($op_destination == 18) { # @A+DPTR cfw("unsigned int destination = mem_read_direct( _ACC_ ) + mem_sfr_read_dptr();"); } if ($op_destination == 20) { # AB cfw("unsigned char destination = mem_read_direct( _ACC_ );"); cfw("unsigned char source = mem_read_direct( _B_ );"); } if ($op_destination == 21) { # DPTR cfw("unsigned int destination = mem_sfr_read_dptr();"); } if ($op_destination == 23) { # /bitaddr cfw("unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); cfw("destination = ( mem_read_bit( dstbitaddr ) ^ 1 );"); } if ($op_destination == 24) { # @DPTR cfw("unsigned char destination = mem_read_indirect(mem_sfr_read_dptr());"); } } if ($instargs[$i*4] > 1) { $op_source=$instargs[$i*4+2]; if ($op_source == 0) { # addr11 cfw("unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); } if ($op_source == 1) { # addr16 cfw("uint16_t addr16 = pgm_read_addr16(cpu8051.pc);"); cfw("cpu8051.pc += 2;"); } if ($op_source == 2) { # A cfw("unsigned char source = mem_read_direct( _ACC_ );"); } if ($op_source == 3) { # direct cfw("unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); cfw("unsigned char source = mem_read_direct( srcaddr );"); } if ($op_source == 4) { # @R0 cfw("unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) );"); } if ($op_source == 5) { # @R1 cfw("unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) );"); } if ($op_source == 6) { # R0 cfw("unsigned char source = mem_read_direct( BANKPSW + _R0_ );"); } if ($op_source == 7) { # R1 cfw("unsigned char source = mem_read_direct( BANKPSW + _R1_ );"); } if ($op_source == 8) { # R2 cfw("unsigned char source = mem_read_direct( BANKPSW + _R2_ );"); } if ($op_source == 9) { # R3 cfw("unsigned char source = mem_read_direct( BANKPSW + _R3_ );"); } if ($op_source == 10) { # R4 cfw("unsigned char source = mem_read_direct( BANKPSW + _R4_ );"); } if ($op_source == 11) { # R5 cfw("unsigned char source = mem_read_direct( BANKPSW + _R5_ );"); } if ($op_source == 12) { # R6 cfw("unsigned char source = mem_read_direct( BANKPSW + _R6_ );"); } if ($op_source == 13) { # R7 cfw("unsigned char source = mem_read_direct( BANKPSW + _R7_ );"); } if ($op_source == 14) { # bitaddr cfw("unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); cfw("source = mem_read_bit( srcbitaddr );"); } if ($op_source == 15) { # reladdr cfw("(cpu8051.pc)++;"); cfw("unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc;"); } if ($op_source == 16) { # #data cfw("unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); } if ($op_source == 17) { # C cfw("unsigned char source = psw_read_cy();"); } if ($op_source == 18) { # @A+DPTR cfw("unsigned char source = mem_read8( PGM_MEM_ID, mem_read_direct( _ACC_ ) + mem_sfr_read_dptr());"); } if ($op_source == 19) { # @A+PC cfw("unsigned char source = mem_read8( PGM_MEM_ID, mem_read_direct( _ACC_ ) + ( ++cpu8051.pc ) );"); } if ($op_source == 21) { # DPTR cfw("unsigned int source = mem_sfr_read_dptr();"); } if ($op_source == 22) { # #data16 cfw("uint16_t source = pgm_read_addr16(cpu8051.pc);"); cfw("cpu8051.pc += 2;"); } if ($op_source == 23) { # /bitaddr cfw("unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ );"); cfw("source = ( mem_read_bit( srcbitaddr ) ^ 1 );"); } if ($op_source == 24) { # @DPTR cfw("unsigned char source = mem_read_indirect(mem_sfr_read_dptr());"); } } ############################################################################## $modifysrc=0; # RR if ($insttype[$i] == 3) { cfw("destination = ( destination >> 1 ) | ( destination << 7 );"); } # INC if ($insttype[$i] == 4) { cfw("destination++;"); } # JBC if ($insttype[$i] == 5) { cfw("if ( destination == 1 ) { cpu8051.pc = source; destination = 0; }"); } # ACALL if ($insttype[$i] == 6) { cfw("stack_push16(cpu8051.pc);"); } # LCALL if ($insttype[$i] == 7) { cfw("stack_push16(cpu8051.pc);"); } # RRC if ($insttype[$i] == 8) { cfw("unsigned char new_cy = destination & 0x01;"); cfw("destination = ( destination >> 1 ) | (psw_read_cy() << 7);"); cfw("psw_write_cy(new_cy);"); } # DEC if ($insttype[$i] == 9) { cfw("destination--;"); } # JB if ($insttype[$i] == 10) { cfw("if ( destination == 1 ) { cpu8051.pc = source; }"); } # RET if ($insttype[$i] == 11) { cfw("cpu8051.pc = stack_pop16();"); } # RL if ($insttype[$i] == 12) { cfw("destination = ( destination << 1 ) | ( destination >> 7 );"); } # ADD if ($insttype[$i] == 13) { cfw("destination = addition(destination, source, 0);"); } # JNB if ($insttype[$i] == 14) { cfw("if ( destination == 0 ) { cpu8051.pc = source; }"); } # RETI if ($insttype[$i] == 15) { cfw("cpu8051.active_priority = -1;"); cfw("cpu8051.pc = stack_pop16();"); } # RLC if ($insttype[$i] == 16) { cfw("unsigned char new_cy = destination & 0x80;"); cfw("destination = ( destination << 1 ) | psw_read_cy();"); cfw("psw_write_cy(new_cy);"); } # ADDC # ADD and ADDC function identically except that ADDC adds the value of # operand as well as the value of the Carry flag whereas ADD does not # add the Carry flag to the result. if ($insttype[$i] == 17) { cfw("unsigned char carryflag = psw_read_cy();"); cfw("destination = addition(destination, source, carryflag);"); } # JC if ($insttype[$i] == 18) { cfw("if (psw_read_cy()) { cpu8051.pc = destination; }"); } # ORL if ($insttype[$i] == 19) { cfw("destination |= source;"); } # JNC if ($insttype[$i] == 20) { cfw("if (psw_read_cy() == 0) { cpu8051.pc = destination; }"); } # ANL if ($insttype[$i] == 21) { cfw("destination &= source;"); } # JZ if ($insttype[$i] == 22) { cfw("if ( mem_read_direct( _ACC_ ) == 0 ) { cpu8051.pc = destination; }"); } # XRL if ($insttype[$i] == 23) { cfw("destination ^= source;"); } # JNZ if ($insttype[$i] == 24) { cfw("if ( mem_read_direct( _ACC_ ) != 0 ) { cpu8051.pc = destination; }"); } # JMP if ($insttype[$i] == 25) { cfw("cpu8051.pc = destination;"); } # MOV if ($insttype[$i] == 26) { cfw("destination = source;"); } # SJMP if ($insttype[$i] == 27) { cfw("cpu8051.pc = destination;"); } # MOVC if ($insttype[$i] == 28) { cfw("destination = source;"); } # DIV if ($insttype[$i] == 29) { # A = destination # B = source cfw("psw_clr_cy();"); # If B is zero, the OV flag will be set indicating a # division-by-zero error cfw("if (source != 0) {"); cfw(" mem_write_direct(_ACC_, destination/source);"); cfw(" mem_write_direct( _B_, destination%source);"); cfw(" psw_clr_ov();"); cfw("} else {"); cfw(" psw_set_ov();"); cfw("}"); } # SUBB if ($insttype[$i] == 30) { cfw("unsigned char carryflag = psw_read_cy();"); cfw("psw_clr_cy();"); cfw("psw_clr_ac();"); cfw("psw_clr_ov();"); cfw("if ( destination < ( source + carryflag ) ) {"); cfw(" psw_set_cy();"); cfw(" if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov();"); cfw("} else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov();"); cfw("if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac();"); cfw("destination -= source + carryflag;"); } # MUL if ($insttype[$i] == 31) { # A = destination # B = source cfw("psw_clr_cy();"); cfw("mem_write_direct(_ACC_, destination * source);"); cfw("mem_write_direct(_B_, (destination * source) / 0x100);"); cfw("if (mem_read_direct(_B_) > 0)"); cfw(" psw_set_ov();"); cfw("else"); cfw(" psw_clr_ov();"); } # CPL if ($insttype[$i] == 33) { if ($instargs[$i*4+1] == 2) { cfw("destination ^= 0xFF;"); } else { cfw("destination ^= 0x01;"); } } # CJNE if ($insttype[$i] == 34) { cfw("unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1);"); cfw("psw_clr_cy();"); cfw("if ( destination < source ) psw_set_cy();"); cfw("if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++;"); } # PUSH if ($insttype[$i] == 35) { cfw("stack_push8(destination);"); } # CLR if ($insttype[$i] == 36) { cfw("destination = 0;"); } # SWAP if ($insttype[$i] == 37) { cfw("destination = ( destination << 4 ) + ( destination >> 4 );"); } # XCH if ($insttype[$i] == 38) { cfw("unsigned char tmpval = destination;"); cfw("destination = source; source = tmpval;"); $modifysrc=1; } # POP if ($insttype[$i] == 39) { cfw("destination = stack_pop8();"); } # SETB if ($insttype[$i] == 40) { cfw("destination = 1;"); } # DA if ($insttype[$i] == 41) { cfw("if (((destination & 0x0F) > 9) || psw_read_ac()) {"); cfw(" if ( ( destination + 6 ) > 0xFF) psw_set_cy();"); cfw(" destination += 6;"); cfw("}"); cfw("if ( psw_read_cy() || ( ( destination & 0xF0 ) > 0x90 ) ) {"); cfw(" if ( ( destination + 0x60 ) > 0xFF ) psw_set_cy();"); cfw(" destination += 0x60;"); cfw("}"); } # DJNZ if ($insttype[$i] == 42) { cfw("destination--;"); cfw("if ( destination != 0 ) cpu8051.pc = source;"); } # XCHD if ($insttype[$i] == 43) { cfw("unsigned char tmpval = ( destination & 0x0F );"); cfw("destination = ( destination & 0xF0 ) + ( source & 0x0F );"); cfw("source = ( source & 0xF0 ) + tmpval;"); $modifysrc=1; } # MOVX if ($insttype[$i] == 44) { cfw("destination = source;"); } ############################################################################## if ($instargs[$i*4] > 0) { $op_destination=$instargs[$i*4+1]; if ($op_destination == 0) { # addr11 cfw("cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11;"); } if ($op_destination == 1) { # addr16 cfw("cpu8051.pc = addr16;"); } if ($op_destination == 2) { # A cfw("mem_write_direct( _ACC_, destination );"); } if ($op_destination == 3) { # direct cfw("mem_write_direct( destaddr, destination );"); } if ($op_destination == 4) { # @R0 cfw("mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination );"); } if ($op_destination == 5) { # @R1 cfw("mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination );"); } if ($op_destination == 6) { # R0 cfw("mem_write_direct( BANKPSW + _R0_, destination );"); } if ($op_destination == 7) { # R1 cfw("mem_write_direct( BANKPSW + _R1_, destination );"); } if ($op_destination == 8) { # R2 cfw("mem_write_direct( BANKPSW + _R2_, destination );"); } if ($op_destination == 9) { # R3 cfw("mem_write_direct( BANKPSW + _R3_, destination );"); } if ($op_destination == 10) { # R4 cfw("mem_write_direct( BANKPSW + _R4_, destination );"); } if ($op_destination == 11) { # R5 cfw("mem_write_direct( BANKPSW + _R5_, destination );"); } if ($op_destination == 12) { # R6 cfw("mem_write_direct( BANKPSW + _R6_, destination );"); } if ($op_destination == 13) { # R7 cfw("mem_write_direct( BANKPSW + _R7_, destination );"); } if ($op_destination == 14) { # bitaddr cfw("mem_write_bit( dstbitaddr, destination );"); } if ($op_destination == 17) { # C cfw("psw_write_cy(destination);"); } if ($op_destination == 21) { # DPTR cfw("mem_sfr_write_dptr(destination);"); } if ($op_destination == 23) { # /bitaddr cfw("mem_write_bit( dstbitaddr, destination );"); } if ($op_destination == 24) { # @DPTR cfw("mem_write_indirect(mem_sfr_read_dptr(), destination);"); } } if ($modifysrc == 1) { if ($instargs[$i*4] > 1) { $op_source=$instargs[$i*4+2]; if ($op_source == 0) { # addr11 cfw("cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11;"); } if ($op_source == 1) { # addr16 cfw("cpu8051.pc = addr16;"); } if ($op_source == 2) { # A cfw("mem_write_direct( _ACC_, source );"); } if ($op_source == 3) { # direct cfw("mem_write_direct( srcaddr, source );"); } if ($op_source == 4) { # @R0 cfw("mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), source );"); } if ($op_source == 5) { # @R1 cfw("mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), source );"); } if ($op_source == 6) { # R0 cfw("mem_write_direct( BANKPSW + _R0_, source );"); } if ($op_source == 7) { # R1 cfw("mem_write_direct( BANKPSW + _R1_, source );"); } if ($op_source == 8) { # R2 cfw("mem_write_direct( BANKPSW + _R2_, source );"); } if ($op_source == 9) { # R3 cfw("mem_write_direct( BANKPSW + _R3_, source );"); } if ($op_source == 10) { # R4 cfw("mem_write_direct( BANKPSW + _R4_, source );"); } if ($op_source == 11) { # R5 cfw("mem_write_direct( BANKPSW + _R5_, source );"); } if ($op_source == 12) { # R6 cfw("mem_write_direct( BANKPSW + _R6_, source );"); } if ($op_source == 13) { # R7 cfw("mem_write_direct( BANKPSW + _R7_, source );"); } if ($op_source == 14) { # bitaddr cfw("mem_write_bit( srcbitaddr, source );"); } if ($op_source == 17) { # C cfw("psw_write_cy(source);"); } if ($op_source == 21) { # DPTR cfw("mem_sfr_write_dptr(source);"); } if ($op_source == 23) { # /bitaddr cfw("mem_write_bit( srcbitaddr, source );"); } if ($op_source == 24) { # @DPTR cfw("mem_write_indirect(mem_sfr_read_dptr(), source);"); } } } } cfw("return $a_cycles[$i];"); print INST_IMP "}\n"; print INST_IMP "\n"; } # ------------------------------------------------------------------------------ # Header for instructions_8051.h print INST_DEF "/*\n"; print INST_DEF " * instructions_8051.h\n"; write_header(INST_DEF); print INST_DEF "#ifndef INSTRUCTIONS_8051_H\n"; print INST_DEF "#define INSTRUCTIONS_8051_H 1\n\n\n"; print INST_DEF "#define BANKPSW (mem_read_direct(_PSW_) & 0x18)\n\n"; print INST_DEF "typedef int (*OPCODE_FP)(void);\n\n\n"; for( $i=0; $i<256; $i++ ) { print INST_DEF "int\n"; print INST_DEF "cpu8051_OP_$a_opcodehex[$i](void);\n\n"; } print INST_DEF "\n"; print INST_DEF "/* Exported variables. */\n"; print INST_DEF "#ifdef INSTRUCTIONS_8051_M\n"; print INST_DEF "OPCODE_FP opcode_table[256] = {\n"; for ($i = 0; $i < 256; $i++) { $ifunc = substr($instfunction[$i], 9); print INST_DEF "\tcpu8051_$ifunc,\n"; } print INST_DEF "};\n"; print INST_DEF "#else\n"; print INST_DEF "OPCODE_FP opcode_table[256];\n"; print INST_DEF "#endif\n\n\n"; print INST_DEF "#endif /* INSTRUCTIONS_8051_H */\n"; print OPCODES_DEF "#endif /* OPCODES_IMP */\n"; close OPCODES_DEF; close OPCODES_IMP; close OPCODELST; close INST_DEF; close INST_IMP; emu8051-2.0.1/src/common/common.h0000644000175400017500000000156212313352657013276 00000000000000/* * common.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef COMMON_H #define COMMON_H 1 #include #include #include #if STDC_HEADERS # include #elif HAVE_STRINGS_H # include #endif #include "log.h" #define FIXED_FONT "monospace 12" #define MAX_FILENAME_LENGTH 1024 /* Common constants. */ #ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # define EXIT_FAILURE 1 #endif /* Returns TRUE if the strings 'a' and 'b' are equal. */ #define STREQ(a, b) (strcasecmp((a), (b)) == 0) /* Returns TRUE if the first 'c' characters of strings 'a' and 'b' are equal. */ #define STREQ_LEN(a, b, c) (strncasecmp((a), (b), (c)) == 0) void * xmalloc(size_t size, const char *filename, int line_number); #endif /* COMMON_H */ emu8051-2.0.1/src/common/Makefile.am0000644000175400017500000000146712313352657013675 00000000000000# This file is processed by GNU automake to generate Makefile.in AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I$(top_srcdir) noinst_LIBRARIES = libemu8051.a libemu8051_a_SOURCES = \ instructions_8051.c instructions_8051.h \ opcodes.c opcodes.h \ options.c options.h \ log.c log.h \ hexfile.c hexfile.h \ cpu8051.c cpu8051.h \ memory.c memory.h \ psw.c psw.h \ sfr.c sfr.h \ operations.c operations.h \ timers.c timers.h \ common.h \ reg8051.h # These files are generated automatically by a perl script. instructions_8051.c instructions_8051.h opcodes.h opcodes.c : opcodes2c.pl opcodes.lst @echo " PERL opcodes2c.pl" @./opcodes2c.pl CLEANFILES = *~ MAINTAINERCLEANFILES = \ Makefile.in \ instructions_8051.c \ instructions_8051.h \ opcodes.h \ opcodes.c EXTRA_DIST = \ opcodes2c.pl \ opcodes.lst emu8051-2.0.1/src/common/Makefile.in0000644000175400017500000004261012313352710013667 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # This file is processed by GNU automake to generate Makefile.in VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = src/common DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/depcomp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = LIBRARIES = $(noinst_LIBRARIES) ARFLAGS = cru AM_V_AR = $(am__v_AR_@AM_V@) am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@) am__v_AR_0 = @echo " AR " $@; am__v_AR_1 = libemu8051_a_AR = $(AR) $(ARFLAGS) libemu8051_a_LIBADD = am_libemu8051_a_OBJECTS = instructions_8051.$(OBJEXT) \ opcodes.$(OBJEXT) options.$(OBJEXT) log.$(OBJEXT) \ hexfile.$(OBJEXT) cpu8051.$(OBJEXT) memory.$(OBJEXT) \ psw.$(OBJEXT) sfr.$(OBJEXT) operations.$(OBJEXT) \ timers.$(OBJEXT) libemu8051_a_OBJECTS = $(am_libemu8051_a_OBJECTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(libemu8051_a_SOURCES) DIST_SOURCES = $(libemu8051_a_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AM_CPPFLAGS = \ $(WARNINGCFLAGS) \ -I$(top_srcdir) noinst_LIBRARIES = libemu8051.a libemu8051_a_SOURCES = \ instructions_8051.c instructions_8051.h \ opcodes.c opcodes.h \ options.c options.h \ log.c log.h \ hexfile.c hexfile.h \ cpu8051.c cpu8051.h \ memory.c memory.h \ psw.c psw.h \ sfr.c sfr.h \ operations.c operations.h \ timers.c timers.h \ common.h \ reg8051.h CLEANFILES = *~ MAINTAINERCLEANFILES = \ Makefile.in \ instructions_8051.c \ instructions_8051.h \ opcodes.h \ opcodes.c EXTRA_DIST = \ opcodes2c.pl \ opcodes.lst all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/common/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu src/common/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): clean-noinstLIBRARIES: -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) libemu8051.a: $(libemu8051_a_OBJECTS) $(libemu8051_a_DEPENDENCIES) $(EXTRA_libemu8051_a_DEPENDENCIES) $(AM_V_at)-rm -f libemu8051.a $(AM_V_AR)$(libemu8051_a_AR) libemu8051.a $(libemu8051_a_OBJECTS) $(libemu8051_a_LIBADD) $(AM_V_at)$(RANLIB) libemu8051.a mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cpu8051.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hexfile.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/instructions_8051.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/log.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/memory.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/opcodes.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/operations.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psw.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sfr.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/timers.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LIBRARIES) installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \ clean-noinstLIBRARIES cscopelist-am ctags ctags-am distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am # These files are generated automatically by a perl script. instructions_8051.c instructions_8051.h opcodes.h opcodes.c : opcodes2c.pl opcodes.lst @echo " PERL opcodes2c.pl" @./opcodes2c.pl # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/src/common/hexfile.c0000644000175400017500000001037412313352657013426 00000000000000/* * Functions for loading an Intel HEX file. * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include #if STDC_HEADERS # include #elif HAVE_STRINGS_H # include #endif #include "common.h" #include "memory.h" /* Maximum of 75 digits with 32-bytes data records. */ #define HEXFILE_LINE_BUFFER_LEN 128 static int asciihex2int_error; int asciihex2int_get_error(void) { return asciihex2int_error; } /* Convert integer to ASCII hex string. */ void int2asciihex(int val, char *str, int width) { if (width == 1) sprintf(str , "%.1X", (uint8_t) val); else if (width == 2) sprintf(str , "%.2X", (uint8_t) val); else if (width == 4) sprintf(str , "%.4X", (uint16_t) val); else sprintf(str , "Err"); } /* * Convert ASCII string in hexadecimal notation to integer, up to length * characters. * The string contains only [0-9] and [a-f] characters (no "0x" prefix). */ static unsigned int asciihex2int_len(char *str, int length) { unsigned int result = 0; int i, ascii_code; asciihex2int_error = false; if (!length || (length > (int) strlen(str))) length = strlen(str); for (i = 0; i < length; i++) { ascii_code = str[i]; if (ascii_code > 0x39) ascii_code &= 0xDF; if ((ascii_code >= 0x30 && ascii_code <= 0x39) || (ascii_code >= 0x41 && ascii_code <= 0x46)) { ascii_code -= 0x30; if (ascii_code > 9) ascii_code -= 7; result <<= 4; result += ascii_code; } else { log_err("ASCII to hex conversion failure"); asciihex2int_error = true; return 0; } } return result; } /* * Convert ASCII string in hexadecimal notation to integer, up to \0 end character. * The string must not contain prefix "0x", only [0-9] and [a-f] characters. */ unsigned int asciihex2int(char *str) { /* Set length to zero to use full length of string. */ return asciihex2int_len(str, 0); } /* * Return value: * true: success * false: failure */ int hexfile_load(const char *filename) { int i, j, rec_len, load_offset, rec_type, data, checksum; FILE *fp; int status; char line[HEXFILE_LINE_BUFFER_LEN]; int valid = false; int line_num = 1; log_debug("LoadHexFile"); if (filename == NULL) { log_err("No file specified"); return false; } /* Trying to open the file. */ fp = fopen(filename, "r"); if (fp == NULL) { log_err("Error opening hex file <%s>: %s", filename, strerror(errno)); return false; } /* Reading one line of data from the hex file. */ /* char *fgets(char *s, int size, FILE *stream); Reading stops after an EOF or a newline. If a newline is read, it is stored into the buffer. A '\0' is stored after the last character in the buffer. */ while (fgets(line, HEXFILE_LINE_BUFFER_LEN, fp) != NULL) { i = 0; checksum = 0; if (line[i++] != ':') { log_err("hexfile line not beginning with \":\""); goto close_file; } rec_len = asciihex2int_len(&line[i], 2); i += 2; checksum += rec_len; load_offset = asciihex2int_len(&line[i], 4); checksum += load_offset / 256; checksum += load_offset % 256; i += 4; rec_type = asciihex2int_len(&line[i], 2); i += 2; checksum += rec_type; if (rec_type == 0) { for (j = 0; j < rec_len; j++) { data = asciihex2int_len(&line[i], 2); mem_write8(PGM_MEM_ID, (unsigned int) (load_offset + j), (unsigned char) data); i += 2; checksum += data; } } /* Read and add checksum value */ checksum += asciihex2int_len(&line[i], 2); checksum &= 0x000000FF; if (asciihex2int_error) { log_err("hexfile parse error at line %d", line_num); goto close_file; } else if (checksum) { log_err("hexfile checksum mismatch"); goto close_file; } if (rec_type == 0) { log_debug("hex record: data"); } else if (rec_type == 1) { log_debug("hex record: End Of File"); valid = true; goto close_file; } else { log_warn("hex record: Unsupported ($%02X)", rec_type); } line_num++; } close_file: status = fclose(fp); if (status != EXIT_SUCCESS) { log_err("Error closing hex file"); valid = false; } else if (!valid) { log_err("Error parsing hex file"); } return valid; } emu8051-2.0.1/src/common/hexfile.h0000644000175400017500000000061212313352657013425 00000000000000/* * hexfile.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef HEXFILE_H #define HEXFILE_H 1 int asciihex2int_get_error(void); void int2asciihex(int val, char *str, int width); unsigned int asciihex2int(char *str); int hexfile_load(const char *filename); #endif /* HEXFILE_H */ emu8051-2.0.1/src/common/options.c0000644000175400017500000000757512313352657013506 00000000000000/* * options.c -- functions for processing command-line options and arguments * * Copyright (C) 2011 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include #include #include #if STDC_HEADERS # include #elif HAVE_STRINGS_H # include #endif #include "common.h" #include "options.h" #include "memory.h" const char *argp_program_version = PACKAGE_VERSION; const char *argp_program_bug_address = PACKAGE_BUGREPORT; /* * Program documentation. * Adjacent string constants are concatenated as one string constant. */ static const char str_doc[] = PACKAGE_NAME " -- " PACKAGE_DESCRIPTION; /* How many non-option arguments we accept. */ #define ARGS_COUNT 1 /* A description of the non-option arguments we accept. */ static const char args_doc[] = "[FILENAME]"; /* The options we understand. */ static struct argp_option argp_options[] = { {"debug", 'd', "level", 0, "Produce debugging output", 0}, {"pram", 'p', "size", 0, "Set program memory size", 0}, {"xram", 'x', "size", 0, "Set external ram size (default is 1024)", 0}, {"stop", 's', "addr", 0, "Automatically run program and stop at address", 0}, {NULL, 0, NULL, 0, NULL, 0} }; struct options_t options; static void decode_debug_option(char *arg, struct argp_state *state) { char *endptr; int log_level; log_level = (int) strtol(arg, &endptr, 0); if (*endptr != '\0') { log_err("Invalid log level"); argp_usage(state); } if (log_level > LOG_LEVEL_DEBUG) { log_err("Invalid log level (0 to 3)"); argp_usage(state); } options.log = log_level; } static void decode_memory_size(char *arg, struct argp_state *state, int memid) { char *endptr; int *dest; if (memid == PGM_MEM_ID) dest = &options.pram_size; else if (memid == INT_MEM_ID) dest = &options.iram_size; else if (memid == EXT_MEM_ID) dest = &options.xram_size; else exit(EXIT_FAILURE); /* Programming error. */ /* * Sizes versus max memory sizes will be checked when calling * memory_init(). */ *dest = (int) strtol(arg, &endptr, 0); if (*endptr != '\0') { log_err("Invalid memory size"); argp_usage(state); } } static void decode_address(char *arg, struct argp_state *state, uint16_t *dest) { char *endptr; *dest = (uint16_t) strtol(arg, &endptr, 0); if (*endptr != '\0') { log_err("Invalid address"); argp_usage(state); } } /* Parse a single option. */ static error_t parse_opt(int key, char *arg, struct argp_state *state) { switch (key) { case 'd': decode_debug_option(arg, state); break; case 'i': decode_memory_size(arg, state, INT_MEM_ID); break; case 'p': decode_memory_size(arg, state, PGM_MEM_ID); break; case 's': decode_address(arg, state, &options.stop_address); break; case 'x': decode_memory_size(arg, state, EXT_MEM_ID); break; case ARGP_KEY_ARG: if (state->arg_num >= ARGS_COUNT) { /* Too many arguments. */ argp_usage(state); } options.filename = arg; break; case ARGP_KEY_END: if (state->arg_num < ARGS_COUNT) { /* Not enough arguments, but the filename is optional. So no error. */ } break; default: return ARGP_ERR_UNKNOWN; } return 0; } /* Our argp parser. */ static struct argp argp = {argp_options, parse_opt, args_doc, str_doc, NULL, NULL, NULL}; /* Initializes the different options passed as arguments on the command line. */ void parse_command_line_options(int argc, char *argv[]) { error_t rc; /* Setting default values. */ options.filename = NULL; options.pram_size = PGM_MEM_DEFAULT_SIZE; options.iram_size = INT_MEM_MAX_SIZE; options.xram_size = EXT_MEM_DEFAULT_SIZE; options.log = LOG_LEVEL_ERR; options.stop_address = 0; /* 0 means stop address is disabled. */ /* Parse our arguments. */ rc = argp_parse(&argp, argc, argv, 0, 0, NULL); if (rc != 0) log_fail("Failure to parse command line arguments"); } emu8051-2.0.1/src/common/options.h0000644000175400017500000000120612313352657013474 00000000000000/* * options.h * * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef OPTIONS_H #define OPTIONS_H 1 #define PACKAGE_COPYRIGHT "(c) Hugo Villeneuve" #define PACKAGE_DESCRIPTION "Emulator for 8051 family microcontrollers" struct options_t { int pram_size; /* Maximum program memory size. */ int iram_size; /* Maximum internal ram size. */ int xram_size; /* Maximum external ram size. */ char *filename; int log; uint16_t stop_address; /* Run program up to that adress and exit. */ } options_t; void parse_command_line_options(int argc, char *argv[]); #endif /* OPTIONS_H */ emu8051-2.0.1/src/common/timers.c0000644000175400017500000000647412313352657013313 00000000000000/* * timers.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include #include #include #include "config.h" #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "memory.h" #include "psw.h" #include "options.h" #include "instructions_8051.h" #include "timers.h" static int gp_timer_value[GP_TIMERS_COUNT]; extern struct options_t options; void gp_timer_reset(int id) { log_debug("gp timer %d reset", id); gp_timer_value[id] = 0; } void gp_timers_increment(int count) { int id; log_debug("gp timers increment"); for (id = 0; id < GP_TIMERS_COUNT; id++) gp_timer_value[id] += count; } int gp_timer_read(int id) { return gp_timer_value[id]; } static void timer_increment_check_overflow(uint8_t counter_address, uint8_t tf_mask) { unsigned int tmp; tmp = mem_read_direct(counter_address); tmp++; tmp &= 0xFF; if (tmp == 0) { /* If overflow set TFx */ mem_write_direct(_TCON_, mem_read_direct(_TCON_) | tf_mask); } mem_write_direct(counter_address, tmp); /* Save new value. */ } static void timer_with_prescaler(uint8_t tl, uint8_t th, uint8_t tf_mask, int prescaler_width) { unsigned int prescaler; prescaler = mem_read_direct(tl); prescaler++; prescaler &= (1 << prescaler_width) - 1; /* Keep only required bits */ mem_write_direct(tl, prescaler); if (prescaler == 0) timer_increment_check_overflow(th, tf_mask); } static void process_timer(uint8_t tl, uint8_t th, uint8_t tf_mask, uint8_t TR, uint8_t mode, uint8_t gate, uint32_t timer_counter) { unsigned int tmp; switch (mode) { case 0: /* Mode 0, 8-bit timer "TH" with "TL" as 5-bit prescaler. */ timer_with_prescaler(tl, th, tf_mask, 5); break; case 1: /* Mode 1, 16-bits counter */ timer_with_prescaler(tl, th, tf_mask, 8); break; case 2: /* Mode 2, 8-bits counter with Auto-Reload */ tmp = mem_read_direct(tl); tmp++; tmp &= 0xFF; if (tmp == 0) { /* If overflow -> reload and set TF0 */ mem_write_direct( _TCON_, mem_read_direct(_TCON_) | tf_mask); mem_write_direct(tl, mem_read_direct(th)); } else { mem_write_direct(tl, tmp); } break; case 3: /* * Mode 3: * inactive mode for timer 1 * 2 independents 8-bits timers for timer 0. */ if (tl == _TL1_) break; if (TR && !gate && !timer_counter) timer_increment_check_overflow(tl, tf_mask); /* TH0 uses TR1 et TF1. */ TR = mem_read_direct(_TCON_) & 0x40; if (TR) timer_increment_check_overflow(th, 0x80); break; } } /* Run 8051 timers */ void timers_check(void) { unsigned int tr; unsigned int mode; unsigned int gate; unsigned int timer_counter; /* Timer 0 */ tr = mem_read_direct(_TCON_) & 0x10; mode = mem_read_direct(_TMOD_) & 0x03; gate = mem_read_direct(_TMOD_) & 0x08; timer_counter = mem_read_direct(_TMOD_) & 0x04; if ((tr && !gate && !timer_counter) || (mode == 3)) process_timer(_TL0_, _TH0_, 0x20, tr, mode, gate, timer_counter); /* Timer 1 */ tr = mem_read_direct(_TCON_) & 0x40; mode = (mem_read_direct(_TMOD_) & 0x30) >> 4; gate = mem_read_direct(_TMOD_) & 0x80; timer_counter = mem_read_direct(_TMOD_) & 0x40; if (tr && !gate && !timer_counter) process_timer(_TL1_, _TH1_, 0x80, tr, mode, gate, timer_counter); } emu8051-2.0.1/src/common/timers.h0000644000175400017500000000060412313352657013305 00000000000000/* * timers.h * * Copyright (C) 2013 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef TIMERS_H #define TIMERS_H 1 #include /* Maximum of 4 for CLI version */ #define GP_TIMERS_COUNT 2 void gp_timer_reset(int id); void gp_timers_increment(int count); int gp_timer_read(int id); void timers_check(void); #endif /* TIMERS_H */ emu8051-2.0.1/src/common/operations.c0000644000175400017500000000261012313352657014157 00000000000000/* * operations.c * * Copyright (C) 2014 Hugo Villeneuve * * This file is released under the GPLv2 */ #if HAVE_CONFIG_H # include "config.h" #endif #include "common.h" #include "reg8051.h" #include "cpu8051.h" #include "sfr.h" #include "psw.h" #include "memory.h" #include "operations.h" /* * ADD and ADDC function identically except that ADDC adds the value of operand * as well as the value of the Carry flag whereas ADD does not add the Carry * flag to the result. */ int addition(int dst, int src, int carry) { psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); /* * The Overflow (OV) bit is set if there is a carry-out of bit 6 or * out of bit 7, but not both. In other words, if the addition of the * Accumulator, operand and (in the case of ADDC) the Carry flag * treated as signed values results in a value that is out of the * range of a signed byte (-128 through +127) the Overflow flag is * set. Otherwise, the Overflow flag is cleared. */ if (dst + src + carry > 0xFF) { /* Carry from bit 7. */ psw_set_cy(); if (((dst & 0x7F) + (src & 0x7F) + carry) < 0x80) psw_set_ov(); /* If no carry from bit 6, set OV. */ } else if (((dst & 0x7F) + (src & 0x7F) + carry) > 0x7F) { /* If no carry from bit 7, but carry from bit 6, set OV. */ psw_set_ov(); } if (((dst & 0x0F) + (src & 0x0F) + carry) > 0x0F) psw_set_ac(); return dst + src + carry; } emu8051-2.0.1/src/common/operations.h0000644000175400017500000000036412313352657014170 00000000000000/* * operations.h * * Copyright (C) 2014 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef OPERATIONS_H #define OPERATIONS_H 1 int addition(int dest, int src, int carry); #endif /* OPERATIONS_H */ emu8051-2.0.1/src/common/instructions_8051.c0000644000175400017500000036716612313352715015234 00000000000000/* * instructions_8051.c * * Do not modify this file directly, as it was created by opcodes2c.pl * Any modifications made directly to this file will be lost. * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ /* Define only here, for not having extern scope on local variables. */ #define INSTRUCTIONS_8051_M 1 #include "reg8051.h" #include "cpu8051.h" #include "memory.h" #include "psw.h" #include "operations.h" #include "instructions_8051.h" /***************************************************************************** * Instruction "NOP" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_00(void) { return 1; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_01(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "LJMP addr16" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_02(void) { uint16_t addr16 = pgm_read_addr16(cpu8051.pc); cpu8051.pc += 2; cpu8051.pc = addr16; return 2; } /***************************************************************************** * Instruction "RR A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_03(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination = ( destination >> 1 ) | ( destination << 7 ); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "INC A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_04(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination++; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "INC direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_05(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); destination++; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "INC @R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_06(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination++; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 1; } /***************************************************************************** * Instruction "INC @R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_07(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination++; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 1; } /***************************************************************************** * Instruction "INC R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_08(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); destination++; mem_write_direct( BANKPSW + _R0_, destination ); return 1; } /***************************************************************************** * Instruction "INC R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_09(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); destination++; mem_write_direct( BANKPSW + _R1_, destination ); return 1; } /***************************************************************************** * Instruction "INC R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0A(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); destination++; mem_write_direct( BANKPSW + _R2_, destination ); return 1; } /***************************************************************************** * Instruction "INC R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0B(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); destination++; mem_write_direct( BANKPSW + _R3_, destination ); return 1; } /***************************************************************************** * Instruction "INC R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0C(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); destination++; mem_write_direct( BANKPSW + _R4_, destination ); return 1; } /***************************************************************************** * Instruction "INC R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0D(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); destination++; mem_write_direct( BANKPSW + _R5_, destination ); return 1; } /***************************************************************************** * Instruction "INC R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0E(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); destination++; mem_write_direct( BANKPSW + _R6_, destination ); return 1; } /***************************************************************************** * Instruction "INC R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_0F(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); destination++; mem_write_direct( BANKPSW + _R7_, destination ); return 1; } /***************************************************************************** * Instruction "JBC bitaddr,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_10(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if ( destination == 1 ) { cpu8051.pc = source; destination = 0; } mem_write_bit( dstbitaddr, destination ); return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_11(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "LCALL addr16" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_12(void) { uint16_t addr16 = pgm_read_addr16(cpu8051.pc); cpu8051.pc += 2; stack_push16(cpu8051.pc); cpu8051.pc = addr16; return 2; } /***************************************************************************** * Instruction "RRC A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_13(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char new_cy = destination & 0x01; destination = ( destination >> 1 ) | (psw_read_cy() << 7); psw_write_cy(new_cy); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "DEC A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_14(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination--; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "DEC direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_15(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); destination--; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "DEC @R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_16(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination--; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 1; } /***************************************************************************** * Instruction "DEC @R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_17(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination--; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 1; } /***************************************************************************** * Instruction "DEC R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_18(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); destination--; mem_write_direct( BANKPSW + _R0_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_19(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); destination--; mem_write_direct( BANKPSW + _R1_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1A(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); destination--; mem_write_direct( BANKPSW + _R2_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1B(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); destination--; mem_write_direct( BANKPSW + _R3_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1C(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); destination--; mem_write_direct( BANKPSW + _R4_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1D(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); destination--; mem_write_direct( BANKPSW + _R5_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1E(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); destination--; mem_write_direct( BANKPSW + _R6_, destination ); return 1; } /***************************************************************************** * Instruction "DEC R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_1F(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); destination--; mem_write_direct( BANKPSW + _R7_, destination ); return 1; } /***************************************************************************** * Instruction "JB bitaddr,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_20(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if ( destination == 1 ) { cpu8051.pc = source; } mem_write_bit( dstbitaddr, destination ); return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_21(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "RET" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_22(void) { cpu8051.pc = stack_pop16(); return 2; } /***************************************************************************** * Instruction "RL A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_23(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination = ( destination << 1 ) | ( destination >> 7 ); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_24(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_25(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_26(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_27(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_28(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_29(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADD A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_2F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination = addition(destination, source, 0); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "JNB bitaddr,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_30(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if ( destination == 0 ) { cpu8051.pc = source; } mem_write_bit( dstbitaddr, destination ); return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_31(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "RETI" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_32(void) { cpu8051.active_priority = -1; cpu8051.pc = stack_pop16(); return 2; } /***************************************************************************** * Instruction "RLC A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_33(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char new_cy = destination & 0x80; destination = ( destination << 1 ) | psw_read_cy(); psw_write_cy(new_cy); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_34(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_35(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_36(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_37(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_38(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_39(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ADDC A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_3F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); unsigned char carryflag = psw_read_cy(); destination = addition(destination, source, carryflag); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "JC reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_40(void) { cpu8051.pc++; unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if (psw_read_cy()) { cpu8051.pc = destination; } return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_41(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "ORL direct,A" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_42(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( _ACC_ ); destination |= source; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "ORL direct,#data" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_43(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination |= source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "ORL A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_44(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_45(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_46(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_47(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_48(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_49(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_4F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination |= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "JNC reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_50(void) { cpu8051.pc++; unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if (psw_read_cy() == 0) { cpu8051.pc = destination; } return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_51(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "ANL direct,A" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_52(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( _ACC_ ); destination &= source; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "ANL direct,#data" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_53(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination &= source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "ANL A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_54(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_55(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_56(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_57(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_58(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_59(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ANL A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_5F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination &= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "JZ reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_60(void) { cpu8051.pc++; unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if ( mem_read_direct( _ACC_ ) == 0 ) { cpu8051.pc = destination; } return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_61(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "XRL direct,A" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_62(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( _ACC_ ); destination ^= source; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "XRL direct,#data" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_63(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination ^= source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "XRL A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_64(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_65(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_66(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_67(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_68(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_69(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XRL A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_6F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination ^= source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "JNZ reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_70(void) { cpu8051.pc++; unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; if ( mem_read_direct( _ACC_ ) != 0 ) { cpu8051.pc = destination; } return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_71(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "ORL C,bitaddr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_72(void) { unsigned char destination = psw_read_cy(); unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); source = mem_read_bit( srcbitaddr ); destination |= source; psw_write_cy(destination); return 2; } /***************************************************************************** * Instruction "JMP @A+DPTR" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_73(void) { unsigned int destination = mem_read_direct( _ACC_ ) + mem_sfr_read_dptr(); cpu8051.pc = destination; return 2; } /***************************************************************************** * Instruction "MOV A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_74(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV direct,#data" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_75(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV @R0,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_76(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 1; } /***************************************************************************** * Instruction "MOV @R1,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_77(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 1; } /***************************************************************************** * Instruction "MOV R0,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_78(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R0_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R1,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_79(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R1_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R2,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7A(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R2_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R3,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7B(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R3_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R4,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7C(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R4_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R5,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7D(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R5_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R6,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7E(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R6_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R7,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_7F(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); destination = source; mem_write_direct( BANKPSW + _R7_, destination ); return 1; } /***************************************************************************** * Instruction "SJMP reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_80(void) { cpu8051.pc++; unsigned int destination = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; cpu8051.pc = destination; return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_81(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "ANL C,bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_82(void) { unsigned char destination = psw_read_cy(); unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); source = mem_read_bit( srcbitaddr ); destination &= source; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "MOVC A,@A+PC" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_83(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, mem_read_direct( _ACC_ ) + ( ++cpu8051.pc ) ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "DIV AB" takes 4 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_84(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( _B_ ); psw_clr_cy(); if (source != 0) { mem_write_direct(_ACC_, destination/source); mem_write_direct( _B_, destination%source); psw_clr_ov(); } else { psw_set_ov(); } return 4; } /***************************************************************************** * Instruction "MOV direct,direct" takes 1 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_85(void) { unsigned char srcaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char source = mem_read_direct( srcaddr ); unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); destination = source; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "MOV direct,@R0" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_86(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,@R1" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_87(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R0" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_88(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R1" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_89(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R2" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8A(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R3" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8B(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R4" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8C(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R5" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8D(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R6" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8E(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV direct,R7" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_8F(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOV DPTR,#data16" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_90(void) { unsigned int destination = mem_sfr_read_dptr(); uint16_t source = pgm_read_addr16(cpu8051.pc); cpu8051.pc += 2; destination = source; mem_sfr_write_dptr(destination); return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_91(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "MOV bitaddr,C" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_92(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); unsigned char source = psw_read_cy(); destination = source; mem_write_bit( dstbitaddr, destination ); return 2; } /***************************************************************************** * Instruction "MOVC A,@A+DPTR" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_93(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, mem_read_direct( _ACC_ ) + mem_sfr_read_dptr()); destination = source; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "SUBB A,#data" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_94(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_95(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_96(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_97(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_98(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_99(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9A(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9B(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9C(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9D(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9E(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "SUBB A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_9F(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); unsigned char carryflag = psw_read_cy(); psw_clr_cy(); psw_clr_ac(); psw_clr_ov(); if ( destination < ( source + carryflag ) ) { psw_set_cy(); if ((destination & 0x7F) > ((source + carryflag) & 0x7F)) psw_set_ov(); } else if ((destination & 0x7F) < ((source + carryflag) & 0x7F)) psw_set_ov(); if ((destination & 0x0F) < ((source + carryflag) & 0x0F)) psw_set_ac(); destination -= source + carryflag; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "ORL C,/bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A0(void) { unsigned char destination = psw_read_cy(); unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); source = ( mem_read_bit( srcbitaddr ) ^ 1 ); destination |= source; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "MOV C,bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A2(void) { unsigned char destination = psw_read_cy(); unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); source = mem_read_bit( srcbitaddr ); destination = source; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "INC DPTR" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_A3(void) { unsigned int destination = mem_sfr_read_dptr(); destination++; mem_sfr_write_dptr(destination); return 2; } /***************************************************************************** * Instruction "MUL AB" takes 4 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_A4(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( _B_ ); psw_clr_cy(); mem_write_direct(_ACC_, destination * source); mem_write_direct(_B_, (destination * source) / 0x100); if (mem_read_direct(_B_) > 0) psw_set_ov(); else psw_clr_ov(); return 4; } /***************************************************************************** * Instruction "INVALID" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_A5(void) { return 1; } /***************************************************************************** * Instruction "MOV @R0,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A6(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 2; } /***************************************************************************** * Instruction "MOV @R1,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A7(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 2; } /***************************************************************************** * Instruction "MOV R0,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A8(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R0_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R1,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_A9(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R1_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R2,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AA(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R2_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R3,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AB(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R3_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R4,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AC(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R4_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R5,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AD(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R5_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R6,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AE(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R6_, destination ); return 2; } /***************************************************************************** * Instruction "MOV R7,direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_AF(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( BANKPSW + _R7_, destination ); return 2; } /***************************************************************************** * Instruction "ANL C,/bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_B0(void) { unsigned char destination = psw_read_cy(); unsigned char source, srcbitaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); source = ( mem_read_bit( srcbitaddr ) ^ 1 ); destination &= source; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_B1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "CPL bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_B2(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); destination ^= 0x01; mem_write_bit( dstbitaddr, destination ); return 1; } /***************************************************************************** * Instruction "CPL C" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_B3(void) { unsigned char destination = psw_read_cy(); destination ^= 0x01; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "CJNE A,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B4(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE A,direct,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B5(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE @R0,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B6(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 2; } /***************************************************************************** * Instruction "CJNE @R1,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B7(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 2; } /***************************************************************************** * Instruction "CJNE R0,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B8(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R0_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R1,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_B9(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R1_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R2,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BA(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R2_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R3,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BB(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R3_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R4,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BC(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R4_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R5,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BD(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R5_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R6,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BE(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R6_, destination ); return 2; } /***************************************************************************** * Instruction "CJNE R7,#data,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_BF(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); unsigned char source = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned int reladdr = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc)) + (cpu8051.pc + 1); psw_clr_cy(); if ( destination < source ) psw_set_cy(); if ( destination != source ) cpu8051.pc = reladdr; else cpu8051.pc++; mem_write_direct( BANKPSW + _R7_, destination ); return 2; } /***************************************************************************** * Instruction "PUSH direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_C0(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); stack_push8(destination); mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_C1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "CLR bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_C2(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); destination = 0; mem_write_bit( dstbitaddr, destination ); return 1; } /***************************************************************************** * Instruction "CLR C" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C3(void) { unsigned char destination = psw_read_cy(); destination = 0; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "SWAP A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C4(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination = ( destination << 4 ) + ( destination >> 4 ); mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "XCH A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_C5(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( srcaddr, source ); return 1; } /***************************************************************************** * Instruction "XCH A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C6(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), source ); return 1; } /***************************************************************************** * Instruction "XCH A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C7(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), source ); return 1; } /***************************************************************************** * Instruction "XCH A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C8(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R0_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_C9(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R1_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CA(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R2_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CB(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R3_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CC(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R4_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CD(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R5_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CE(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R6_, source ); return 1; } /***************************************************************************** * Instruction "XCH A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_CF(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); unsigned char tmpval = destination; destination = source; source = tmpval; mem_write_direct( _ACC_, destination ); mem_write_direct( BANKPSW + _R7_, source ); return 1; } /***************************************************************************** * Instruction "POP direct" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_D0(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); destination = stack_pop8(); mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_D1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "SETB bitaddr" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_D2(void) { unsigned char destination, dstbitaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); destination = mem_read_bit( dstbitaddr ); destination = 1; mem_write_bit( dstbitaddr, destination ); return 1; } /***************************************************************************** * Instruction "SETB C" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_D3(void) { unsigned char destination = psw_read_cy(); destination = 1; psw_write_cy(destination); return 1; } /***************************************************************************** * Instruction "DA A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_D4(void) { unsigned char destination = mem_read_direct( _ACC_ ); if (((destination & 0x0F) > 9) || psw_read_ac()) { if ( ( destination + 6 ) > 0xFF) psw_set_cy(); destination += 6; } if ( psw_read_cy() || ( ( destination & 0xF0 ) > 0x90 ) ) { if ( ( destination + 0x60 ) > 0xFF ) psw_set_cy(); destination += 0x60; } mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "DJNZ direct,reladdr" takes 2 cycle(s) and 3 byte(s). ****************************************************************************/ int cpu8051_OP_D5(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( destaddr, destination ); return 2; } /***************************************************************************** * Instruction "XCHD A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_D6(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char tmpval = ( destination & 0x0F ); destination = ( destination & 0xF0 ) + ( source & 0x0F ); source = ( source & 0xF0 ) + tmpval; mem_write_direct( _ACC_, destination ); mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), source ); return 1; } /***************************************************************************** * Instruction "XCHD A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_D7(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char tmpval = ( destination & 0x0F ); destination = ( destination & 0xF0 ) + ( source & 0x0F ); source = ( source & 0xF0 ) + tmpval; mem_write_direct( _ACC_, destination ); mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), source ); return 1; } /***************************************************************************** * Instruction "DJNZ R0,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_D8(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R0_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R1,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_D9(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R1_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R2,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DA(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R2_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R3,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DB(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R3_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R4,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DC(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R4_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R5,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DD(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R5_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R6,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DE(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R6_, destination ); return 2; } /***************************************************************************** * Instruction "DJNZ R7,reladdr" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_DF(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); (cpu8051.pc)++; unsigned int source = ((char) mem_read8(PGM_MEM_ID, cpu8051.pc - 1)) + cpu8051.pc; destination--; if ( destination != 0 ) cpu8051.pc = source; mem_write_direct( BANKPSW + _R7_, destination ); return 2; } /***************************************************************************** * Instruction "MOVX A,@DPTR" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E0(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect(mem_sfr_read_dptr()); destination = source; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "AJMP addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_E1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "MOVX A,@R0" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E2(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination = source; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "MOVX A,@R1" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E3(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination = source; mem_write_direct( _ACC_, destination ); return 2; } /***************************************************************************** * Instruction "CLR A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E4(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination = 0; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,direct" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_E5(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char srcaddr = mem_read8( PGM_MEM_ID, (cpu8051.pc)++ ); unsigned char source = mem_read_direct( srcaddr ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,@R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E6(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,@R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E7(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R0" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E8(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R0_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R1" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_E9(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R1_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R2" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_EA(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R2_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R3" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_EB(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R3_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R4" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_EC(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R4_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R5" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_ED(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R5_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R6" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_EE(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R6_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV A,R7" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_EF(void) { unsigned char destination = mem_read_direct( _ACC_ ); unsigned char source = mem_read_direct( BANKPSW + _R7_ ); destination = source; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOVX @DPTR,A" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F0(void) { unsigned char destination = mem_read_indirect(mem_sfr_read_dptr()); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_indirect(mem_sfr_read_dptr(), destination); return 2; } /***************************************************************************** * Instruction "ACALL addr11" takes 2 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_F1(void) { unsigned int addr11 = ( ( mem_read8( PGM_MEM_ID, cpu8051.pc - 1 ) << 3 ) & 0xF00 ) + mem_read8( PGM_MEM_ID, cpu8051.pc ); cpu8051.pc++; stack_push16(cpu8051.pc); cpu8051.pc = ( cpu8051.pc & 0xF800 ) | addr11; return 2; } /***************************************************************************** * Instruction "MOVX @R0,A" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F2(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 2; } /***************************************************************************** * Instruction "MOVX @R1,A" takes 2 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F3(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 2; } /***************************************************************************** * Instruction "CPL A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F4(void) { unsigned char destination = mem_read_direct( _ACC_ ); destination ^= 0xFF; mem_write_direct( _ACC_, destination ); return 1; } /***************************************************************************** * Instruction "MOV direct,A" takes 1 cycle(s) and 2 byte(s). ****************************************************************************/ int cpu8051_OP_F5(void) { unsigned char destaddr = mem_read8( PGM_MEM_ID, cpu8051.pc++ ); unsigned char destination = mem_read_direct( destaddr ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( destaddr, destination ); return 1; } /***************************************************************************** * Instruction "MOV @R0,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F6(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R0_ ) ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R0_ ), destination ); return 1; } /***************************************************************************** * Instruction "MOV @R1,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F7(void) { unsigned char destination = mem_read_indirect ( mem_read_direct( BANKPSW + _R1_ ) ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_indirect( mem_read_direct( BANKPSW + _R1_ ), destination ); return 1; } /***************************************************************************** * Instruction "MOV R0,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F8(void) { unsigned char destination = mem_read_direct( BANKPSW + _R0_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R0_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R1,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_F9(void) { unsigned char destination = mem_read_direct( BANKPSW + _R1_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R1_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R2,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FA(void) { unsigned char destination = mem_read_direct( BANKPSW + _R2_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R2_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R3,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FB(void) { unsigned char destination = mem_read_direct( BANKPSW + _R3_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R3_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R4,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FC(void) { unsigned char destination = mem_read_direct( BANKPSW + _R4_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R4_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R5,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FD(void) { unsigned char destination = mem_read_direct( BANKPSW + _R5_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R5_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R6,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FE(void) { unsigned char destination = mem_read_direct( BANKPSW + _R6_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R6_, destination ); return 1; } /***************************************************************************** * Instruction "MOV R7,A" takes 1 cycle(s) and 1 byte(s). ****************************************************************************/ int cpu8051_OP_FF(void) { unsigned char destination = mem_read_direct( BANKPSW + _R7_ ); unsigned char source = mem_read_direct( _ACC_ ); destination = source; mem_write_direct( BANKPSW + _R7_, destination ); return 1; } emu8051-2.0.1/src/common/instructions_8051.h0000644000175400017500000002614512313352715015226 00000000000000/* * instructions_8051.h * * Do not modify this file directly, as it was created by opcodes2c.pl * Any modifications made directly to this file will be lost. * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef INSTRUCTIONS_8051_H #define INSTRUCTIONS_8051_H 1 #define BANKPSW (mem_read_direct(_PSW_) & 0x18) typedef int (*OPCODE_FP)(void); int cpu8051_OP_00(void); int cpu8051_OP_01(void); int cpu8051_OP_02(void); int cpu8051_OP_03(void); int cpu8051_OP_04(void); int cpu8051_OP_05(void); int cpu8051_OP_06(void); int cpu8051_OP_07(void); int cpu8051_OP_08(void); int cpu8051_OP_09(void); int cpu8051_OP_0A(void); int cpu8051_OP_0B(void); int cpu8051_OP_0C(void); int cpu8051_OP_0D(void); int cpu8051_OP_0E(void); int cpu8051_OP_0F(void); int cpu8051_OP_10(void); int cpu8051_OP_11(void); int cpu8051_OP_12(void); int cpu8051_OP_13(void); int cpu8051_OP_14(void); int cpu8051_OP_15(void); int cpu8051_OP_16(void); int cpu8051_OP_17(void); int cpu8051_OP_18(void); int cpu8051_OP_19(void); int cpu8051_OP_1A(void); int cpu8051_OP_1B(void); int cpu8051_OP_1C(void); int cpu8051_OP_1D(void); int cpu8051_OP_1E(void); int cpu8051_OP_1F(void); int cpu8051_OP_20(void); int cpu8051_OP_21(void); int cpu8051_OP_22(void); int cpu8051_OP_23(void); int cpu8051_OP_24(void); int cpu8051_OP_25(void); int cpu8051_OP_26(void); int cpu8051_OP_27(void); int cpu8051_OP_28(void); int cpu8051_OP_29(void); int cpu8051_OP_2A(void); int cpu8051_OP_2B(void); int cpu8051_OP_2C(void); int cpu8051_OP_2D(void); int cpu8051_OP_2E(void); int cpu8051_OP_2F(void); int cpu8051_OP_30(void); int cpu8051_OP_31(void); int cpu8051_OP_32(void); int cpu8051_OP_33(void); int cpu8051_OP_34(void); int cpu8051_OP_35(void); int cpu8051_OP_36(void); int cpu8051_OP_37(void); int cpu8051_OP_38(void); int cpu8051_OP_39(void); int cpu8051_OP_3A(void); int cpu8051_OP_3B(void); int cpu8051_OP_3C(void); int cpu8051_OP_3D(void); int cpu8051_OP_3E(void); int cpu8051_OP_3F(void); int cpu8051_OP_40(void); int cpu8051_OP_41(void); int cpu8051_OP_42(void); int cpu8051_OP_43(void); int cpu8051_OP_44(void); int cpu8051_OP_45(void); int cpu8051_OP_46(void); int cpu8051_OP_47(void); int cpu8051_OP_48(void); int cpu8051_OP_49(void); int cpu8051_OP_4A(void); int cpu8051_OP_4B(void); int cpu8051_OP_4C(void); int cpu8051_OP_4D(void); int cpu8051_OP_4E(void); int cpu8051_OP_4F(void); int cpu8051_OP_50(void); int cpu8051_OP_51(void); int cpu8051_OP_52(void); int cpu8051_OP_53(void); int cpu8051_OP_54(void); int cpu8051_OP_55(void); int cpu8051_OP_56(void); int cpu8051_OP_57(void); int cpu8051_OP_58(void); int cpu8051_OP_59(void); int cpu8051_OP_5A(void); int cpu8051_OP_5B(void); int cpu8051_OP_5C(void); int cpu8051_OP_5D(void); int cpu8051_OP_5E(void); int cpu8051_OP_5F(void); int cpu8051_OP_60(void); int cpu8051_OP_61(void); int cpu8051_OP_62(void); int cpu8051_OP_63(void); int cpu8051_OP_64(void); int cpu8051_OP_65(void); int cpu8051_OP_66(void); int cpu8051_OP_67(void); int cpu8051_OP_68(void); int cpu8051_OP_69(void); int cpu8051_OP_6A(void); int cpu8051_OP_6B(void); int cpu8051_OP_6C(void); int cpu8051_OP_6D(void); int cpu8051_OP_6E(void); int cpu8051_OP_6F(void); int cpu8051_OP_70(void); int cpu8051_OP_71(void); int cpu8051_OP_72(void); int cpu8051_OP_73(void); int cpu8051_OP_74(void); int cpu8051_OP_75(void); int cpu8051_OP_76(void); int cpu8051_OP_77(void); int cpu8051_OP_78(void); int cpu8051_OP_79(void); int cpu8051_OP_7A(void); int cpu8051_OP_7B(void); int cpu8051_OP_7C(void); int cpu8051_OP_7D(void); int cpu8051_OP_7E(void); int cpu8051_OP_7F(void); int cpu8051_OP_80(void); int cpu8051_OP_81(void); int cpu8051_OP_82(void); int cpu8051_OP_83(void); int cpu8051_OP_84(void); int cpu8051_OP_85(void); int cpu8051_OP_86(void); int cpu8051_OP_87(void); int cpu8051_OP_88(void); int cpu8051_OP_89(void); int cpu8051_OP_8A(void); int cpu8051_OP_8B(void); int cpu8051_OP_8C(void); int cpu8051_OP_8D(void); int cpu8051_OP_8E(void); int cpu8051_OP_8F(void); int cpu8051_OP_90(void); int cpu8051_OP_91(void); int cpu8051_OP_92(void); int cpu8051_OP_93(void); int cpu8051_OP_94(void); int cpu8051_OP_95(void); int cpu8051_OP_96(void); int cpu8051_OP_97(void); int cpu8051_OP_98(void); int cpu8051_OP_99(void); int cpu8051_OP_9A(void); int cpu8051_OP_9B(void); int cpu8051_OP_9C(void); int cpu8051_OP_9D(void); int cpu8051_OP_9E(void); int cpu8051_OP_9F(void); int cpu8051_OP_A0(void); int cpu8051_OP_A1(void); int cpu8051_OP_A2(void); int cpu8051_OP_A3(void); int cpu8051_OP_A4(void); int cpu8051_OP_A5(void); int cpu8051_OP_A6(void); int cpu8051_OP_A7(void); int cpu8051_OP_A8(void); int cpu8051_OP_A9(void); int cpu8051_OP_AA(void); int cpu8051_OP_AB(void); int cpu8051_OP_AC(void); int cpu8051_OP_AD(void); int cpu8051_OP_AE(void); int cpu8051_OP_AF(void); int cpu8051_OP_B0(void); int cpu8051_OP_B1(void); int cpu8051_OP_B2(void); int cpu8051_OP_B3(void); int cpu8051_OP_B4(void); int cpu8051_OP_B5(void); int cpu8051_OP_B6(void); int cpu8051_OP_B7(void); int cpu8051_OP_B8(void); int cpu8051_OP_B9(void); int cpu8051_OP_BA(void); int cpu8051_OP_BB(void); int cpu8051_OP_BC(void); int cpu8051_OP_BD(void); int cpu8051_OP_BE(void); int cpu8051_OP_BF(void); int cpu8051_OP_C0(void); int cpu8051_OP_C1(void); int cpu8051_OP_C2(void); int cpu8051_OP_C3(void); int cpu8051_OP_C4(void); int cpu8051_OP_C5(void); int cpu8051_OP_C6(void); int cpu8051_OP_C7(void); int cpu8051_OP_C8(void); int cpu8051_OP_C9(void); int cpu8051_OP_CA(void); int cpu8051_OP_CB(void); int cpu8051_OP_CC(void); int cpu8051_OP_CD(void); int cpu8051_OP_CE(void); int cpu8051_OP_CF(void); int cpu8051_OP_D0(void); int cpu8051_OP_D1(void); int cpu8051_OP_D2(void); int cpu8051_OP_D3(void); int cpu8051_OP_D4(void); int cpu8051_OP_D5(void); int cpu8051_OP_D6(void); int cpu8051_OP_D7(void); int cpu8051_OP_D8(void); int cpu8051_OP_D9(void); int cpu8051_OP_DA(void); int cpu8051_OP_DB(void); int cpu8051_OP_DC(void); int cpu8051_OP_DD(void); int cpu8051_OP_DE(void); int cpu8051_OP_DF(void); int cpu8051_OP_E0(void); int cpu8051_OP_E1(void); int cpu8051_OP_E2(void); int cpu8051_OP_E3(void); int cpu8051_OP_E4(void); int cpu8051_OP_E5(void); int cpu8051_OP_E6(void); int cpu8051_OP_E7(void); int cpu8051_OP_E8(void); int cpu8051_OP_E9(void); int cpu8051_OP_EA(void); int cpu8051_OP_EB(void); int cpu8051_OP_EC(void); int cpu8051_OP_ED(void); int cpu8051_OP_EE(void); int cpu8051_OP_EF(void); int cpu8051_OP_F0(void); int cpu8051_OP_F1(void); int cpu8051_OP_F2(void); int cpu8051_OP_F3(void); int cpu8051_OP_F4(void); int cpu8051_OP_F5(void); int cpu8051_OP_F6(void); int cpu8051_OP_F7(void); int cpu8051_OP_F8(void); int cpu8051_OP_F9(void); int cpu8051_OP_FA(void); int cpu8051_OP_FB(void); int cpu8051_OP_FC(void); int cpu8051_OP_FD(void); int cpu8051_OP_FE(void); int cpu8051_OP_FF(void); /* Exported variables. */ #ifdef INSTRUCTIONS_8051_M OPCODE_FP opcode_table[256] = { cpu8051_OP_00, cpu8051_OP_01, cpu8051_OP_02, cpu8051_OP_03, cpu8051_OP_04, cpu8051_OP_05, cpu8051_OP_06, cpu8051_OP_07, cpu8051_OP_08, cpu8051_OP_09, cpu8051_OP_0A, cpu8051_OP_0B, cpu8051_OP_0C, cpu8051_OP_0D, cpu8051_OP_0E, cpu8051_OP_0F, cpu8051_OP_10, cpu8051_OP_11, cpu8051_OP_12, cpu8051_OP_13, cpu8051_OP_14, cpu8051_OP_15, cpu8051_OP_16, cpu8051_OP_17, cpu8051_OP_18, cpu8051_OP_19, cpu8051_OP_1A, cpu8051_OP_1B, cpu8051_OP_1C, cpu8051_OP_1D, cpu8051_OP_1E, cpu8051_OP_1F, cpu8051_OP_20, cpu8051_OP_21, cpu8051_OP_22, cpu8051_OP_23, cpu8051_OP_24, cpu8051_OP_25, cpu8051_OP_26, cpu8051_OP_27, cpu8051_OP_28, cpu8051_OP_29, cpu8051_OP_2A, cpu8051_OP_2B, cpu8051_OP_2C, cpu8051_OP_2D, cpu8051_OP_2E, cpu8051_OP_2F, cpu8051_OP_30, cpu8051_OP_31, cpu8051_OP_32, cpu8051_OP_33, cpu8051_OP_34, cpu8051_OP_35, cpu8051_OP_36, cpu8051_OP_37, cpu8051_OP_38, cpu8051_OP_39, cpu8051_OP_3A, cpu8051_OP_3B, cpu8051_OP_3C, cpu8051_OP_3D, cpu8051_OP_3E, cpu8051_OP_3F, cpu8051_OP_40, cpu8051_OP_41, cpu8051_OP_42, cpu8051_OP_43, cpu8051_OP_44, cpu8051_OP_45, cpu8051_OP_46, cpu8051_OP_47, cpu8051_OP_48, cpu8051_OP_49, cpu8051_OP_4A, cpu8051_OP_4B, cpu8051_OP_4C, cpu8051_OP_4D, cpu8051_OP_4E, cpu8051_OP_4F, cpu8051_OP_50, cpu8051_OP_51, cpu8051_OP_52, cpu8051_OP_53, cpu8051_OP_54, cpu8051_OP_55, cpu8051_OP_56, cpu8051_OP_57, cpu8051_OP_58, cpu8051_OP_59, cpu8051_OP_5A, cpu8051_OP_5B, cpu8051_OP_5C, cpu8051_OP_5D, cpu8051_OP_5E, cpu8051_OP_5F, cpu8051_OP_60, cpu8051_OP_61, cpu8051_OP_62, cpu8051_OP_63, cpu8051_OP_64, cpu8051_OP_65, cpu8051_OP_66, cpu8051_OP_67, cpu8051_OP_68, cpu8051_OP_69, cpu8051_OP_6A, cpu8051_OP_6B, cpu8051_OP_6C, cpu8051_OP_6D, cpu8051_OP_6E, cpu8051_OP_6F, cpu8051_OP_70, cpu8051_OP_71, cpu8051_OP_72, cpu8051_OP_73, cpu8051_OP_74, cpu8051_OP_75, cpu8051_OP_76, cpu8051_OP_77, cpu8051_OP_78, cpu8051_OP_79, cpu8051_OP_7A, cpu8051_OP_7B, cpu8051_OP_7C, cpu8051_OP_7D, cpu8051_OP_7E, cpu8051_OP_7F, cpu8051_OP_80, cpu8051_OP_81, cpu8051_OP_82, cpu8051_OP_83, cpu8051_OP_84, cpu8051_OP_85, cpu8051_OP_86, cpu8051_OP_87, cpu8051_OP_88, cpu8051_OP_89, cpu8051_OP_8A, cpu8051_OP_8B, cpu8051_OP_8C, cpu8051_OP_8D, cpu8051_OP_8E, cpu8051_OP_8F, cpu8051_OP_90, cpu8051_OP_91, cpu8051_OP_92, cpu8051_OP_93, cpu8051_OP_94, cpu8051_OP_95, cpu8051_OP_96, cpu8051_OP_97, cpu8051_OP_98, cpu8051_OP_99, cpu8051_OP_9A, cpu8051_OP_9B, cpu8051_OP_9C, cpu8051_OP_9D, cpu8051_OP_9E, cpu8051_OP_9F, cpu8051_OP_A0, cpu8051_OP_A1, cpu8051_OP_A2, cpu8051_OP_A3, cpu8051_OP_A4, cpu8051_OP_A5, cpu8051_OP_A6, cpu8051_OP_A7, cpu8051_OP_A8, cpu8051_OP_A9, cpu8051_OP_AA, cpu8051_OP_AB, cpu8051_OP_AC, cpu8051_OP_AD, cpu8051_OP_AE, cpu8051_OP_AF, cpu8051_OP_B0, cpu8051_OP_B1, cpu8051_OP_B2, cpu8051_OP_B3, cpu8051_OP_B4, cpu8051_OP_B5, cpu8051_OP_B6, cpu8051_OP_B7, cpu8051_OP_B8, cpu8051_OP_B9, cpu8051_OP_BA, cpu8051_OP_BB, cpu8051_OP_BC, cpu8051_OP_BD, cpu8051_OP_BE, cpu8051_OP_BF, cpu8051_OP_C0, cpu8051_OP_C1, cpu8051_OP_C2, cpu8051_OP_C3, cpu8051_OP_C4, cpu8051_OP_C5, cpu8051_OP_C6, cpu8051_OP_C7, cpu8051_OP_C8, cpu8051_OP_C9, cpu8051_OP_CA, cpu8051_OP_CB, cpu8051_OP_CC, cpu8051_OP_CD, cpu8051_OP_CE, cpu8051_OP_CF, cpu8051_OP_D0, cpu8051_OP_D1, cpu8051_OP_D2, cpu8051_OP_D3, cpu8051_OP_D4, cpu8051_OP_D5, cpu8051_OP_D6, cpu8051_OP_D7, cpu8051_OP_D8, cpu8051_OP_D9, cpu8051_OP_DA, cpu8051_OP_DB, cpu8051_OP_DC, cpu8051_OP_DD, cpu8051_OP_DE, cpu8051_OP_DF, cpu8051_OP_E0, cpu8051_OP_E1, cpu8051_OP_E2, cpu8051_OP_E3, cpu8051_OP_E4, cpu8051_OP_E5, cpu8051_OP_E6, cpu8051_OP_E7, cpu8051_OP_E8, cpu8051_OP_E9, cpu8051_OP_EA, cpu8051_OP_EB, cpu8051_OP_EC, cpu8051_OP_ED, cpu8051_OP_EE, cpu8051_OP_EF, cpu8051_OP_F0, cpu8051_OP_F1, cpu8051_OP_F2, cpu8051_OP_F3, cpu8051_OP_F4, cpu8051_OP_F5, cpu8051_OP_F6, cpu8051_OP_F7, cpu8051_OP_F8, cpu8051_OP_F9, cpu8051_OP_FA, cpu8051_OP_FB, cpu8051_OP_FC, cpu8051_OP_FD, cpu8051_OP_FE, cpu8051_OP_FF, }; #else OPCODE_FP opcode_table[256]; #endif #endif /* INSTRUCTIONS_8051_H */ emu8051-2.0.1/src/common/memory.c0000644000175400017500000001611712313352657013313 00000000000000/* * memory.c * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #include #include #include #include "common.h" #include "cpu8051.h" #include "reg8051.h" #include "hexfile.h" #include "memory.h" #include "options.h" struct mem_infos_t { int size; int max_size; uint8_t *buf; }; struct mem_infos_t mem_infos[MEM_ID_COUNT]; extern struct options_t options; /* Init each 8051 memory sections. */ void mem_init(void) { int k; struct mem_infos_t *m; /* Set desired and maximum allowable sizes for each memory type. */ mem_infos[PGM_MEM_ID].size = options.pram_size; mem_infos[PGM_MEM_ID].max_size = PGM_MEM_MAX_SIZE; mem_infos[INT_MEM_ID].size = options.iram_size; mem_infos[INT_MEM_ID].max_size = INT_MEM_MAX_SIZE; mem_infos[EXT_MEM_ID].size = options.xram_size; mem_infos[EXT_MEM_ID].max_size = EXT_MEM_MAX_SIZE; /* Verify if desired sizes are valid, and if so allocate memory. */ for (k = 0; k < MEM_ID_COUNT; k++) { m = &mem_infos[k]; if (m->size > m->max_size) { log_fail("Memory size invalid (max = %d)", m->max_size); } m->buf = malloc(m->size); if (m->buf == NULL) { log_fail("%s", strerror(errno)); } memset(m->buf, 0x00, m->size); } } /* Return true if address is valid, false otherwise. */ int mem_check_address(enum mem_id_t id, unsigned long address, int display_error) { if (address >= (unsigned long) mem_infos[id].max_size) { if (display_error == DISPLAY_ERROR_YES) log_err("Address out of range ($%X >= $%X", address, mem_infos[id].max_size - 1); return false; } else { return true; } } void mem_convert_bit_address(uint8_t bit_address, uint8_t *byte_address, uint8_t *bit_number) { if (bit_address > 0x7F) { /* SFR 80-FF */ *byte_address = bit_address & 0xF8; *bit_number = bit_address & 0x07; } else { /* 20-2F */ *byte_address = (bit_address >> 3) + 0x20; *bit_number = bit_address & 0x07; } } uint8_t * mem_getbuf(enum mem_id_t id, unsigned long address) { return &mem_infos[id].buf[address]; } void mem_clear(enum mem_id_t id) { memset(mem_infos[id].buf, 0, mem_infos[id].size); } void mem_write8(enum mem_id_t id, unsigned long address, uint8_t value) { if (address >= (unsigned long) mem_infos[id].max_size) { log_err("Error writing to memory ID: %d\n" " Address (%lu) greater than maximum memory size", id, address); return; } else { mem_infos[id].buf[address] = value; } } /* Write with a direct addressing mode at Address the new Value */ void mem_write_direct(unsigned int address, unsigned char value) { mem_write8(INT_MEM_ID, address, value); } /* Write with an indirect addressing mode at Address the new Value */ void mem_write_indirect(unsigned int address, unsigned char value) { if (address > 0x7F) { mem_write8(EXT_MEM_ID, address, value); return; } mem_write8(INT_MEM_ID, address, value); } /* Write with a bit addressing mode at BitAddress the new Value */ void mem_write_bit(uint8_t bit_address, uint8_t value) { uint8_t byte_address; uint8_t bit_number; unsigned char byte_val, byte_mask; mem_convert_bit_address(bit_address, &byte_address, &bit_number); byte_mask = ((1 << bit_number) ^ 0xFF); byte_val = mem_read_direct(byte_address) & byte_mask; byte_val += value << bit_number; mem_write_direct(byte_address, byte_val); } void mem_sfr_write8(unsigned long address, uint8_t value) { /* SFR registers are from addresses $80 to $FF. */ mem_write8(INT_MEM_ID, address, value); } void mem_sfr_write_dptr(uint16_t value) { mem_write8(INT_MEM_ID, _DPTRHIGH_, value >> 8); mem_write8(INT_MEM_ID, _DPTRLOW_, (uint8_t) value); } uint8_t mem_read8(enum mem_id_t id, unsigned long address) { if (address >= (unsigned long) mem_infos[id].max_size) { log_err("Error reading from memory ID: %d\n" " Address (%lu) greater than maximum memory size", id, address); return 0; } else { return mem_infos[id].buf[address]; } } /* Read with a direct addressing mode at Address */ unsigned char mem_read_direct(unsigned int address) { if (address > 0xFF) return mem_read8(EXT_MEM_ID, address); else return mem_read8(INT_MEM_ID, address); } /* Read with a indirect addressing mode at Address */ unsigned char mem_read_indirect(unsigned int address) { if (address > 0x7F) return mem_read8(EXT_MEM_ID, address); else return mem_read8(INT_MEM_ID, address); } /* Read with a bit addressing mode at bit_address */ unsigned char mem_read_bit(uint8_t bit_address) { uint8_t byte_address; uint8_t bit_number; unsigned char bit_value; mem_convert_bit_address(bit_address, &byte_address, &bit_number); bit_value = (mem_read_direct(byte_address) >> bit_number); bit_value &= 1; return bit_value; } uint8_t mem_sfr_read8(unsigned long address) { /* SFR registers are from addresses $80 to $FF. */ return mem_read8(INT_MEM_ID, address); } uint16_t mem_sfr_read_dptr(void) { return (mem_read8(INT_MEM_ID, _DPTRHIGH_) << 8) + mem_read8(INT_MEM_ID, _DPTRLOW_); } void stack_push8(uint8_t value) { uint8_t sp; sp = mem_read8(INT_MEM_ID, _SP_); mem_write8(INT_MEM_ID, ++sp, value); mem_write8(INT_MEM_ID, _SP_, sp); /* Save new stack pointer */ } void stack_push16(uint16_t value) { uint8_t sp; sp = mem_read8(INT_MEM_ID, _SP_); mem_write8(INT_MEM_ID, ++sp, (uint8_t) value); /* Write LSB */ mem_write8(INT_MEM_ID, ++sp, value >> 8); /* Write MSB */ mem_write8(INT_MEM_ID, _SP_, sp); /* Save new stack pointer */ } uint8_t stack_pop8(void) { uint8_t sp; uint8_t value; sp = mem_read8(INT_MEM_ID, _SP_); value = mem_read8(INT_MEM_ID, sp--); mem_write8(INT_MEM_ID, _SP_, sp); /* Save new stack pointer */ return value; } uint16_t stack_pop16(void) { uint8_t sp; uint16_t value; sp = mem_read8(INT_MEM_ID, _SP_); value = mem_read8(INT_MEM_ID, sp--) << 8; /* Read MSB */ value |= mem_read8(INT_MEM_ID, sp--); /* Read LSB */ mem_write8(INT_MEM_ID, _SP_, sp); /* Save new stack pointer */ return value; } /* Read a 16-bit address from PGM memory, starting at offset */ uint16_t pgm_read_addr16(uint16_t base) { uint16_t addr; addr = mem_read8(PGM_MEM_ID, base) << 8; /* MSB */ addr |= mem_read8(PGM_MEM_ID, base + 1); /* LSB */ return addr; } /* Dump memory */ void mem_dump(unsigned int address, int size, enum mem_id_t id) { int rc; int offset, col; if (size == 0) { log_err("invalid size: 0"); return; } /* Validate start address. */ rc = mem_check_address(id, address, DISPLAY_ERROR_YES); if (!rc) { /* Validate end address. */ rc = mem_check_address(id, address + (size - 1), DISPLAY_ERROR_NO); if (!rc) log_err("Trying to read beyond memory limit"); } if (!rc) return; for (offset = 0; offset < size; offset += 16) { uint8_t data[16]; printf("%.4X ", address + offset); for (col = 0; col < 16; col++) { data[col] = mem_read8(id, address + offset + col); printf(" %.2X", data[col]); } printf(" "); /* Display any ASCII characters */ for (col = 0; col < 16; col++) { if ((int) data[col] >= 32 && (int) data[col] <= 126) printf("%c", (char) data[col]); else printf("."); } printf("\n"); } } emu8051-2.0.1/src/common/memory.h0000644000175400017500000000356612313352657013324 00000000000000/* * memory.h * * Copyright (C) 1999 Jonathan St-André * Copyright (C) 1999 Hugo Villeneuve * * This file is released under the GPLv2 */ #ifndef MEMORY_H #define MEMORY_H 1 #include #define PGM_MEM_MAX_SIZE 65536 /* * Direct addressing $00 to $7F = IRAM (8051) * Direct addressing $80 to $FF = SFR (8051) * Indirect addressing $80 to $FF = IRAM (8052) */ #define INT_MEM_MAX_SIZE 256 #define EXT_MEM_MAX_SIZE 65536 #define PGM_MEM_DEFAULT_SIZE PGM_MEM_MAX_SIZE #define EXT_MEM_DEFAULT_SIZE 256 enum mem_id_t { PGM_MEM_ID, INT_MEM_ID, EXT_MEM_ID, MEM_ID_COUNT }; #define DISPLAY_ERROR_NO 0 #define DISPLAY_ERROR_YES 1 void mem_init(void); int mem_check_address(enum mem_id_t id, unsigned long address, int display_error); void mem_convert_bit_address(uint8_t bit_address, uint8_t *byte_address, uint8_t *bit_number); uint8_t * mem_getbuf(enum mem_id_t id, unsigned long address); void mem_clear(enum mem_id_t id); void mem_write8(enum mem_id_t id, unsigned long address, uint8_t value); void mem_write_direct(unsigned int address, unsigned char value); void mem_write_indirect(unsigned int address, unsigned char value); void mem_write_bit(uint8_t bit_address, uint8_t value); void mem_sfr_write8(unsigned long address, uint8_t value); void mem_sfr_write_dptr(uint16_t value); uint8_t mem_read8(enum mem_id_t id, unsigned long address); unsigned char mem_read_direct(unsigned int address); unsigned char mem_read_indirect(unsigned int address); unsigned char mem_read_bit(uint8_t bit_address); uint8_t mem_sfr_read8(unsigned long address); uint16_t mem_sfr_read_dptr(void); void stack_push8(uint8_t value); void stack_push16(uint16_t value); uint8_t stack_pop8(void); uint16_t stack_pop16(void); uint16_t pgm_read_addr16(uint16_t base); void mem_dump(unsigned int address, int size, enum mem_id_t id); #endif /* MEMORY_H */ emu8051-2.0.1/NEWS0000644000175400017500000000632212313352657010254 000000000000002014-01-14: emu8051-2.0.1 has been released Convert manpage to UTF-8 Do not display registers at CLI version startup Dont exit application in case of hexfile reading failure Fix C99 standard types uintN_t Fix test script to work in external build directory Add support for GNU readline (adds commands history). Allow hex numbers to begin with 0x or $ prefix in CLI version Allow to set all SFR registers in CLI version Convert CLI version input parsing to Lex/Yacc Remove address parameter from RUN and TRACE CLI commands Add better error checking when loading invalid hex files Allow EM command to be specified without arguments Add two timers (independent of internal 8051 timers) See the file 'ChangeLog' for further details. 2014-01-14: emu8051-2.0.0 has been released Fix error with ADDC instruction: the carry flag was not added to the result. Fix bug when processing interrupts Fix bug with timers mode 0 (8 bits with 5-bit prescaler) Fix error with timer1 being written to timer0 Fix error with EM command in CLI mode Add option to automatically run and stop CLI emulator for regression testing Add parity bit update each instruction cycle Fix bug with MOV DPTR,#data16 instruction Fix bugs with ORL and ANL instructions Fix error with ADD instruction and AC bit Fix error with JMP @A,DPTR instruction Fix error with RETI instruction Add Timers 0 and 1 to SFR window Add option to specify memory sizes Add live option to change windows layout (8 or 16 bytes width) Add external memory window Memory and register windows values can now be edited Save paned positions and main window size to config file Add support for saving UI settings to config file Replace fixed frames with scrollable and resizable windows Update code to compile with GTK3 See the file 'ChangeLog' for further details. 2013-09-07: emu8051-1.1.2 has been released Fix error with CJNE instruction. 2011-12-11: emu8051-1.1.1 has been released (from emu8051-1.1.1-rc2). 2011-11-20: emu8051-1.1.1-rc2 has been released. Added optional size parameter when dumping memory. Created two separate executables, emu8051-cli (default) and optional emu8051-gtk if Gtk+ is detected. See the file 'ChangeLog' for further details. 2011-10-29: emu8051-1.1.1-rc1 has been released. Fixed SJMP error and improved columns and rows sizing 2010-03-19: emu8051-1.1.0 has been released. Reintroduced the console mode if no GTK+ librairies are detected. 2009-02-09: emu8051-1.0.2 has been released. Updated Free Software Foundation address. 2008-11-05: emu8051-1.0.1 has been released. See the file 'ChangeLog' for further details. 2008-04-28: emu8051-1.0.0 has been released. Removed gtk+-1.0 support, now requires gtk+-2 2005-05-07: emu8051-0.1.0 has been released. Fixed bug with CJNE instruction and autoconf files cleanup. See the file 'ChangeLog' for further details. emu8051-2.0.1/TODO0000644000175400017500000000064312313352657010245 00000000000000 TODO ---- -Add visual indication when emulated program is running -Gtk tree view: Switch from G_TYPE_STRING to G_TYPE_UINT for numbers, and create custom renderer to display as hex numbers. -Compile only one program for both graphical and console modes. -Add new breakpoint menu: ->show breakpoints ->remove all breakpoints -Create config menu: -> Do not reset emulator on hex file load enable/disable emu8051-2.0.1/data/0000755000175400017500000000000012313352716010537 500000000000000emu8051-2.0.1/data/Makefile.am0000644000175400017500000000024212313352657012515 00000000000000 defconfdir=$(sysconfdir)/xdg/emu8051/default defconf_DATA = \ emu8051.conf EXTRA_DIST= \ $(defconf_DATA) CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in emu8051-2.0.1/data/Makefile.in0000644000175400017500000003302412313352710012520 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = data DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__installdirs = "$(DESTDIR)$(defconfdir)" DATA = $(defconf_DATA) am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ defconfdir = $(sysconfdir)/xdg/emu8051/default defconf_DATA = \ emu8051.conf EXTRA_DIST = \ $(defconf_DATA) CLEANFILES = *~ MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu data/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-defconfDATA: $(defconf_DATA) @$(NORMAL_INSTALL) @list='$(defconf_DATA)'; test -n "$(defconfdir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(defconfdir)'"; \ $(MKDIR_P) "$(DESTDIR)$(defconfdir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ echo "$$d$$p"; \ done | $(am__base_list) | \ while read files; do \ echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(defconfdir)'"; \ $(INSTALL_DATA) $$files "$(DESTDIR)$(defconfdir)" || exit $$?; \ done uninstall-defconfDATA: @$(NORMAL_UNINSTALL) @list='$(defconf_DATA)'; test -n "$(defconfdir)" || list=; \ files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ dir='$(DESTDIR)$(defconfdir)'; $(am__uninstall_files_from_dir) tags TAGS: ctags CTAGS: cscope cscopelist: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(DATA) installdirs: for dir in "$(DESTDIR)$(defconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-defconfDATA install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-defconfDATA .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic cscopelist-am \ ctags-am distclean distclean-generic distdir dvi dvi-am html \ html-am info info-am install install-am install-data \ install-data-am install-defconfDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am tags-am uninstall uninstall-am \ uninstall-defconfDATA # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/data/emu8051.conf0000644000175400017500000000015112313352657012433 00000000000000 [emulation] clear_ram_on_file_load=false [ui] win_width=500 win_height=300 hpane_pos=100 vpane_pos=200 emu8051-2.0.1/aclocal.m40000644000175400017500000014261412313352706011415 00000000000000# generated automatically by aclocal 1.14 -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # serial 1 (pkg-config-0.24) # # Copyright © 2004 Scott James Remnant . # # 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 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. # # 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. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) # only at the first occurence in configure.ac, so if the first place # it's called might be skipped (such as if it is within an "if", you # have to call PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_default([$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes ], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then AC_MSG_RESULT([no]) _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD m4_default([$4], [AC_MSG_ERROR( [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT])[]dnl ]) elif test $pkg_failed = untried; then AC_MSG_RESULT([no]) m4_default([$4], [AC_MSG_FAILURE( [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])[]dnl ]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) $3 fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.14' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.14], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.14])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_AR([ACT-IF-FAIL]) # ------------------------- # Try to determine the archiver interface, and trigger the ar-lib wrapper # if it is needed. If the detection of archiver interface fails, run # ACT-IF-FAIL (default is to abort configure with a proper error message). AC_DEFUN([AM_PROG_AR], [AC_BEFORE([$0], [LT_INIT])dnl AC_BEFORE([$0], [AC_PROG_LIBTOOL])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([ar-lib])dnl AC_CHECK_TOOLS([AR], [ar lib "link -lib"], [false]) : ${AR=ar} AC_CACHE_CHECK([the archiver ($AR) interface], [am_cv_ar_interface], [AC_LANG_PUSH([C]) am_cv_ar_interface=ar AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int some_variable = 0;]])], [am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([am_ar_try]) if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a ]) AC_LANG_POP([C])]) case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) m4_default([$1], [AC_MSG_ERROR([could not determine $AR interface])]) ;; esac AC_SUBST([AR])dnl ]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # -*- Autoconf -*- # Obsolete and "removed" macros, that must however still report explicit # error messages when used, to smooth transition. # # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. AC_DEFUN([AM_CONFIG_HEADER], [AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should use the 'AC][_CONFIG_HEADERS' macro instead.])dnl AC_CONFIG_HEADERS($@)]) AC_DEFUN([AM_PROG_CC_STDC], [AC_PROG_CC am_cv_prog_cc_stdc=$ac_cv_prog_cc_stdc AC_DIAGNOSE([obsolete], ['$0': this macro is obsolete. You should simply use the 'AC][_PROG_CC' macro instead. Also, your code should no longer depend upon 'am_cv_prog_cc_stdc', but upon 'ac_cv_prog_cc_stdc'.])]) AC_DEFUN([AM_C_PROTOTYPES], [AC_FATAL([automatic de-ANSI-fication support has been removed])]) AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2013 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR emu8051-2.0.1/tests/0000755000175400017500000000000012313352717010771 500000000000000emu8051-2.0.1/tests/div.asm0000644000175400017500000000114412313352657012200 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: DIV AB ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $3C ; Test output: B = $00 ; Test output: PSW = $00 ORG 0000h ; Reset vector MOV A, #0FFh MOV B, #00h DIV AB ; CY should be cleared, OV should be set ; PSW = $04 MOV A, #240 ; 240d MOV B, PSW ; 4d DIV AB ; CY should be cleared, OV should be cleared, result = 10 LJMP 0FFF0h END emu8051-2.0.1/tests/mul1.asm0000644000175400017500000000064412313352657012300 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: MUL AB (no overflow) ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $C2 ; Test output: B = $00 ; Test output: PSW = $01 ORG 0000h ; Reset vector MOV A, #061h MOV B, #002h MUL AB ; CY should be cleared, OV should be cleared LJMP 0FFF0h END emu8051-2.0.1/tests/mul2.asm0000644000175400017500000000064112313352657012276 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: MUL AB (overflow) ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $5B ; Test output: B = $0B ; Test output: PSW = $05 ORG 0000h ; Reset vector MOV A, #099h MOV B, #013h MUL AB ; CY should be cleared, OV should be cleared LJMP 0FFF0h END emu8051-2.0.1/tests/cmd.sh0000644000175400017500000000106412313352657012014 00000000000000#!/bin/sh # Get the symlink name (how we were called): test_name=`basename $0` lf=${test_name}.log name=$(basename ${test_name} .sh) echo "Testing command ${CMD_NAME}" > ${lf} echo "${CMD}" | ../src/cli/emu8051-cli -d 2 >> ${lf} if test $? -ne 0 ; then return 1 fi # Verify syntax errors if grep -q "syntax" ${lf}; then echo "Failed test: ${CMD_NAME} (syntax error)" >> ${lf} exit 1 fi # Verify for valid test values if ! grep -q "${TEST_OUTPUT}" ${lf}; then echo "Failed test: ${CMD_NAME} (values not found)" >> ${lf} exit 1 fi exit 0 emu8051-2.0.1/tests/cmd_de.sh0000755000175400017500000000022712313352657012467 00000000000000#!/bin/sh CMD_NAME="de" CMD=$'de 0x00 16\x0a' TEST_OUTPUT="0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................" . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_di.sh0000755000175400017500000000022712313352657012473 00000000000000#!/bin/sh CMD_NAME="di" CMD=$'di 0x80 16\x0a' TEST_OUTPUT="0080 FF 07 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................" . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_dp.sh0000755000175400017500000000022712313352657012502 00000000000000#!/bin/sh CMD_NAME="dp" CMD=$'dp 0x00 16\x0a' TEST_OUTPUT="0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................" . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_dr.sh0000755000175400017500000000012512313352657012501 00000000000000#!/bin/sh CMD_NAME="dr" CMD=$'dr\x0a' TEST_OUTPUT="| 0000 | 07 |" . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_we.sh0000755000175400017500000000030612313352657012510 00000000000000#!/bin/sh CMD_NAME="we" CMD=$'we 0x80 0x30\x0a we 0x81 0x31\x0a we 0x82 0x32\x0a de 0x80 16' TEST_OUTPUT="0080 30 31 32 00 00 00 00 00 00 00 00 00 00 00 00 00 012............." . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_wi.sh0000755000175400017500000000030612313352657012514 00000000000000#!/bin/sh CMD_NAME="wi" CMD=$'wi 0x40 0x30\x0a wi 0x41 0x31\x0a wi 0x42 0x32\x0a di 0x40 16' TEST_OUTPUT="0040 30 31 32 00 00 00 00 00 00 00 00 00 00 00 00 00 012............." . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_wp.sh0000755000175400017500000000031612313352657012524 00000000000000#!/bin/sh CMD_NAME="wp" CMD=$'wp 0x1000 0x41\x0a wp 0x1001 0x42\x0a wp 0x1002 0x43\x0a dp 0x1000 16' TEST_OUTPUT="1000 41 42 43 00 00 00 00 00 00 00 00 00 00 00 00 00 ABC............." . $srcdir/cmd.sh emu8051-2.0.1/tests/cmd_wr.sh0000755000175400017500000000015012313352657012522 00000000000000#!/bin/sh CMD_NAME="wr" CMD=$'wr pc 0x5555 \x0a dr \x0a' TEST_OUTPUT="| 5555 | 07 |" . $srcdir/cmd.sh emu8051-2.0.1/tests/mov.asm0000644000175400017500000000072412313352657012222 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: MOV ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $66 ; Test output: B = $98 ; Test output: PSW = $00 ; Test output: DPTR = $9876 ; Test output: R0 = $66 ORG 0000h ; Reset vector MOV A, #099h MOV B, A DEC B MOV R0, #066h MOV A, R0 MOV DPTR,#9876h LJMP 0FFF0h END emu8051-2.0.1/tests/Makefile.am0000644000175400017500000000265312313352657012756 00000000000000# Regression tests for emu8051 AS504 = as504 AS51 = asem SUFFIXES = .hex .asm .sh # Do not remove intermediate .hex files .SECONDARY: ASM_SRC = \ add.asm \ mul1.asm mul2.asm \ div.asm div32u.asm \ orl.asm anl.asm \ mov.asm \ sqroot.asm \ timer0.asm timer1.asm timer2.asm if RUN_TESTS TESTS_ASM = \ add.sh \ mul1.sh mul2.sh \ div.sh div32u.sh \ orl.sh anl.sh \ mov.sh \ sqroot.sh \ timer0.sh timer1.sh timer2.sh TESTS_CMD = \ cmd_dr.sh \ cmd_de.sh \ cmd_di.sh \ cmd_dp.sh \ cmd_we.sh \ cmd_wi.sh \ cmd_wp.sh \ cmd_wr.sh TESTS = \ $(TESTS_CMD) \ $(TESTS_ASM) # If you do not want an implicit rule to be used for a target that has no # commands, you can give that target empty commands by writing a semicolon. cli.sh: ; # Tell make how to generate a .sh file after a .hex file is generated: .hex.sh: @ln -sf $(srcdir)/opcodes.sh $@ # Tell make how to generate a .hex file from a .asm source file. # Warning: make distcheck will fail because asem nor as504 have option to # specify output filename (and path), except patched version of as504: .asm.hex: if USE_AS504HV $(AS504) -Fhex -O$@ $< else if USE_AS504 $(AS504) -Fhex $< else if USE_AS51 $(AS51) $< else echo error endif endif endif else TESTS = endif EXTRA_DIST = $(TESTS_CMD) cmd.sh opcodes.sh $(ASM_SRC) CLEANFILES = *~ *.lst *.hex $(TESTS_ASM) MAINTAINERCLEANFILES = Makefile.in emu8051-2.0.1/tests/Makefile.in0000644000175400017500000007712612313352711012765 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Regression tests for emu8051 VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : @RUN_TESTS_TRUE@TESTS = $(TESTS_CMD) $(TESTS_ASM) subdir = tests DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/build-aux/test-driver ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) am__tty_colors_dummy = \ mgn= red= grn= lgn= blu= brg= std=; \ am__color_tests=no am__tty_colors = { \ $(am__tty_colors_dummy); \ if test "X$(AM_COLOR_TESTS)" = Xno; then \ am__color_tests=no; \ elif test "X$(AM_COLOR_TESTS)" = Xalways; then \ am__color_tests=yes; \ elif test "X$$TERM" != Xdumb && { test -t 1; } 2>/dev/null; then \ am__color_tests=yes; \ fi; \ if test $$am__color_tests = yes; then \ red=''; \ grn=''; \ lgn=''; \ blu=''; \ mgn=''; \ brg=''; \ std=''; \ fi; \ } am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } am__recheck_rx = ^[ ]*:recheck:[ ]* am__global_test_result_rx = ^[ ]*:global-test-result:[ ]* am__copy_in_global_log_rx = ^[ ]*:copy-in-global-log:[ ]* # A command that, given a newline-separated list of test names on the # standard input, print the name of the tests that are to be re-run # upon "make recheck". am__list_recheck_tests = $(AWK) '{ \ recheck = 1; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ { \ if ((getline line2 < ($$0 ".log")) < 0) \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[nN][Oo]/) \ { \ recheck = 0; \ break; \ } \ else if (line ~ /$(am__recheck_rx)[yY][eE][sS]/) \ { \ break; \ } \ }; \ if (recheck) \ print $$0; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # A command that, given a newline-separated list of test names on the # standard input, create the global log from their .trs and .log files. am__create_global_log = $(AWK) ' \ function fatal(msg) \ { \ print "fatal: making $@: " msg | "cat >&2"; \ exit 1; \ } \ function rst_section(header) \ { \ print header; \ len = length(header); \ for (i = 1; i <= len; i = i + 1) \ printf "="; \ printf "\n\n"; \ } \ { \ copy_in_global_log = 1; \ global_test_result = "RUN"; \ while ((rc = (getline line < ($$0 ".trs"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".trs"); \ if (line ~ /$(am__global_test_result_rx)/) \ { \ sub("$(am__global_test_result_rx)", "", line); \ sub("[ ]*$$", "", line); \ global_test_result = line; \ } \ else if (line ~ /$(am__copy_in_global_log_rx)[nN][oO]/) \ copy_in_global_log = 0; \ }; \ if (copy_in_global_log) \ { \ rst_section(global_test_result ": " $$0); \ while ((rc = (getline line < ($$0 ".log"))) != 0) \ { \ if (rc < 0) \ fatal("failed to read from " $$0 ".log"); \ print line; \ }; \ printf "\n"; \ }; \ close ($$0 ".trs"); \ close ($$0 ".log"); \ }' # Restructured Text title. am__rst_title = { sed 's/.*/ & /;h;s/./=/g;p;x;s/ *$$//;p;g' && echo; } # Solaris 10 'make', and several other traditional 'make' implementations, # pass "-e" to $(SHELL), and POSIX 2008 even requires this. Work around it # by disabling -e (using the XSI extension "set +e") if it's set. am__sh_e_setup = case $$- in *e*) set +e;; esac # Default flags passed to test drivers. am__common_driver_flags = \ --color-tests "$$am__color_tests" \ --enable-hard-errors "$$am__enable_hard_errors" \ --expect-failure "$$am__expect_failure" # To be inserted before the command running the test. Creates the # directory for the log if needed. Stores in $dir the directory # containing $f, in $tst the test, in $log the log. Executes the # developer- defined test setup AM_TESTS_ENVIRONMENT (if any), and # passes TESTS_ENVIRONMENT. Set up options for the wrapper that # will run the test scripts (or their associated LOG_COMPILER, if # thy have one). am__check_pre = \ $(am__sh_e_setup); \ $(am__vpath_adj_setup) $(am__vpath_adj) \ $(am__tty_colors); \ srcdir=$(srcdir); export srcdir; \ case "$@" in \ */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;; \ *) am__odir=.;; \ esac; \ test "x$$am__odir" = x"." || test -d "$$am__odir" \ || $(MKDIR_P) "$$am__odir" || exit $$?; \ if test -f "./$$f"; then dir=./; \ elif test -f "$$f"; then dir=; \ else dir="$(srcdir)/"; fi; \ tst=$$dir$$f; log='$@'; \ if test -n '$(DISABLE_HARD_ERRORS)'; then \ am__enable_hard_errors=no; \ else \ am__enable_hard_errors=yes; \ fi; \ case " $(XFAIL_TESTS) " in \ *[\ \ ]$$f[\ \ ]* | *[\ \ ]$$dir$$f[\ \ ]*) \ am__expect_failure=yes;; \ *) \ am__expect_failure=no;; \ esac; \ $(AM_TESTS_ENVIRONMENT) $(TESTS_ENVIRONMENT) # A shell command to get the names of the tests scripts with any registered # extension removed (i.e., equivalently, the names of the test logs, with # the '.log' extension removed). The result is saved in the shell variable # '$bases'. This honors runtime overriding of TESTS and TEST_LOGS. Sadly, # we cannot use something simpler, involving e.g., "$(TEST_LOGS:.log=)", # since that might cause problem with VPATH rewrites for suffix-less tests. # See also 'test-harness-vpath-rewrite.sh' and 'test-trs-basic.sh'. am__set_TESTS_bases = \ bases='$(TEST_LOGS)'; \ bases=`for i in $$bases; do echo $$i; done | sed 's/\.log$$//'`; \ bases=`echo $$bases` RECHECK_LOGS = $(TEST_LOGS) AM_RECURSIVE_TARGETS = check recheck TEST_SUITE_LOG = test-suite.log TEST_EXTENSIONS = @EXEEXT@ .test LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver LOG_COMPILE = $(LOG_COMPILER) $(AM_LOG_FLAGS) $(LOG_FLAGS) am__set_b = \ case '$@' in \ */*) \ case '$*' in \ */*) b='$*';; \ *) b=`echo '$@' | sed 's/\.log$$//'`; \ esac;; \ *) \ b='$*';; \ esac am__test_logs1 = $(TESTS:=.log) am__test_logs2 = $(am__test_logs1:@EXEEXT@.log=.log) TEST_LOGS = $(am__test_logs2:.test.log=.log) TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/build-aux/test-driver TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \ $(TEST_LOG_FLAGS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AS504 = as504 AS51 = asem SUFFIXES = .hex .asm .sh ASM_SRC = \ add.asm \ mul1.asm mul2.asm \ div.asm div32u.asm \ orl.asm anl.asm \ mov.asm \ sqroot.asm \ timer0.asm timer1.asm timer2.asm @RUN_TESTS_TRUE@TESTS_ASM = \ @RUN_TESTS_TRUE@ add.sh \ @RUN_TESTS_TRUE@ mul1.sh mul2.sh \ @RUN_TESTS_TRUE@ div.sh div32u.sh \ @RUN_TESTS_TRUE@ orl.sh anl.sh \ @RUN_TESTS_TRUE@ mov.sh \ @RUN_TESTS_TRUE@ sqroot.sh \ @RUN_TESTS_TRUE@ timer0.sh timer1.sh timer2.sh @RUN_TESTS_TRUE@TESTS_CMD = \ @RUN_TESTS_TRUE@ cmd_dr.sh \ @RUN_TESTS_TRUE@ cmd_de.sh \ @RUN_TESTS_TRUE@ cmd_di.sh \ @RUN_TESTS_TRUE@ cmd_dp.sh \ @RUN_TESTS_TRUE@ cmd_we.sh \ @RUN_TESTS_TRUE@ cmd_wi.sh \ @RUN_TESTS_TRUE@ cmd_wp.sh \ @RUN_TESTS_TRUE@ cmd_wr.sh EXTRA_DIST = $(TESTS_CMD) cmd.sh opcodes.sh $(ASM_SRC) CLEANFILES = *~ *.lst *.hex $(TESTS_ASM) MAINTAINERCLEANFILES = Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .hex .asm .sh .log .test .test$(EXEEXT) .trs $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu tests/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): tags TAGS: ctags CTAGS: cscope cscopelist: # Recover from deleted '.trs' file; this should ensure that # "rm -f foo.log; make foo.trs" re-run 'foo.test', and re-create # both 'foo.log' and 'foo.trs'. Break the recipe in two subshells # to avoid problems with "make -n". .log.trs: rm -f $< $@ $(MAKE) $(AM_MAKEFLAGS) $< # Leading 'am--fnord' is there to ensure the list of targets does not # expand to empty, as could happen e.g. with make check TESTS=''. am--fnord $(TEST_LOGS) $(TEST_LOGS:.log=.trs): $(am__force_recheck) am--force-recheck: @: $(TEST_SUITE_LOG): $(TEST_LOGS) @$(am__set_TESTS_bases); \ am__f_ok () { test -f "$$1" && test -r "$$1"; }; \ redo_bases=`for i in $$bases; do \ am__f_ok $$i.trs && am__f_ok $$i.log || echo $$i; \ done`; \ if test -n "$$redo_bases"; then \ redo_logs=`for i in $$redo_bases; do echo $$i.log; done`; \ redo_results=`for i in $$redo_bases; do echo $$i.trs; done`; \ if $(am__make_dryrun); then :; else \ rm -f $$redo_logs && rm -f $$redo_results || exit 1; \ fi; \ fi; \ if test -n "$$am__remaking_logs"; then \ echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \ "recursion detected" >&2; \ else \ am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \ fi; \ if $(am__make_dryrun); then :; else \ st=0; \ errmsg="fatal: making $(TEST_SUITE_LOG): failed to create"; \ for i in $$redo_bases; do \ test -f $$i.trs && test -r $$i.trs \ || { echo "$$errmsg $$i.trs" >&2; st=1; }; \ test -f $$i.log && test -r $$i.log \ || { echo "$$errmsg $$i.log" >&2; st=1; }; \ done; \ test $$st -eq 0 || exit 1; \ fi @$(am__sh_e_setup); $(am__tty_colors); $(am__set_TESTS_bases); \ ws='[ ]'; \ results=`for b in $$bases; do echo $$b.trs; done`; \ test -n "$$results" || results=/dev/null; \ all=` grep "^$$ws*:test-result:" $$results | wc -l`; \ pass=` grep "^$$ws*:test-result:$$ws*PASS" $$results | wc -l`; \ fail=` grep "^$$ws*:test-result:$$ws*FAIL" $$results | wc -l`; \ skip=` grep "^$$ws*:test-result:$$ws*SKIP" $$results | wc -l`; \ xfail=`grep "^$$ws*:test-result:$$ws*XFAIL" $$results | wc -l`; \ xpass=`grep "^$$ws*:test-result:$$ws*XPASS" $$results | wc -l`; \ error=`grep "^$$ws*:test-result:$$ws*ERROR" $$results | wc -l`; \ if test `expr $$fail + $$xpass + $$error` -eq 0; then \ success=true; \ else \ success=false; \ fi; \ br='==================='; br=$$br$$br$$br$$br; \ result_count () \ { \ if test x"$$1" = x"--maybe-color"; then \ maybe_colorize=yes; \ elif test x"$$1" = x"--no-color"; then \ maybe_colorize=no; \ else \ echo "$@: invalid 'result_count' usage" >&2; exit 4; \ fi; \ shift; \ desc=$$1 count=$$2; \ if test $$maybe_colorize = yes && test $$count -gt 0; then \ color_start=$$3 color_end=$$std; \ else \ color_start= color_end=; \ fi; \ echo "$${color_start}# $$desc $$count$${color_end}"; \ }; \ create_testsuite_report () \ { \ result_count $$1 "TOTAL:" $$all "$$brg"; \ result_count $$1 "PASS: " $$pass "$$grn"; \ result_count $$1 "SKIP: " $$skip "$$blu"; \ result_count $$1 "XFAIL:" $$xfail "$$lgn"; \ result_count $$1 "FAIL: " $$fail "$$red"; \ result_count $$1 "XPASS:" $$xpass "$$red"; \ result_count $$1 "ERROR:" $$error "$$mgn"; \ }; \ { \ echo "$(PACKAGE_STRING): $(subdir)/$(TEST_SUITE_LOG)" | \ $(am__rst_title); \ create_testsuite_report --no-color; \ echo; \ echo ".. contents:: :depth: 2"; \ echo; \ for b in $$bases; do echo $$b; done \ | $(am__create_global_log); \ } >$(TEST_SUITE_LOG).tmp || exit 1; \ mv $(TEST_SUITE_LOG).tmp $(TEST_SUITE_LOG); \ if $$success; then \ col="$$grn"; \ else \ col="$$red"; \ test x"$$VERBOSE" = x || cat $(TEST_SUITE_LOG); \ fi; \ echo "$${col}$$br$${std}"; \ echo "$${col}Testsuite summary for $(PACKAGE_STRING)$${std}"; \ echo "$${col}$$br$${std}"; \ create_testsuite_report --maybe-color; \ echo "$$col$$br$$std"; \ if $$success; then :; else \ echo "$${col}See $(subdir)/$(TEST_SUITE_LOG)$${std}"; \ if test -n "$(PACKAGE_BUGREPORT)"; then \ echo "$${col}Please report to $(PACKAGE_BUGREPORT)$${std}"; \ fi; \ echo "$$col$$br$$std"; \ fi; \ $$success || exit 1 check-TESTS: @list='$(RECHECK_LOGS)'; test -z "$$list" || rm -f $$list @list='$(RECHECK_LOGS:.log=.trs)'; test -z "$$list" || rm -f $$list @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ log_list=`for i in $$bases; do echo $$i.log; done`; \ trs_list=`for i in $$bases; do echo $$i.trs; done`; \ log_list=`echo $$log_list`; trs_list=`echo $$trs_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) TEST_LOGS="$$log_list"; \ exit $$?; recheck: all @test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) @set +e; $(am__set_TESTS_bases); \ bases=`for i in $$bases; do echo $$i; done \ | $(am__list_recheck_tests)` || exit 1; \ log_list=`for i in $$bases; do echo $$i.log; done`; \ log_list=`echo $$log_list`; \ $(MAKE) $(AM_MAKEFLAGS) $(TEST_SUITE_LOG) \ am__force_recheck=am--force-recheck \ TEST_LOGS="$$log_list"; \ exit $$? cmd_dr.sh.log: cmd_dr.sh @p='cmd_dr.sh'; \ b='cmd_dr.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_de.sh.log: cmd_de.sh @p='cmd_de.sh'; \ b='cmd_de.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_di.sh.log: cmd_di.sh @p='cmd_di.sh'; \ b='cmd_di.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_dp.sh.log: cmd_dp.sh @p='cmd_dp.sh'; \ b='cmd_dp.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_we.sh.log: cmd_we.sh @p='cmd_we.sh'; \ b='cmd_we.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_wi.sh.log: cmd_wi.sh @p='cmd_wi.sh'; \ b='cmd_wi.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_wp.sh.log: cmd_wp.sh @p='cmd_wp.sh'; \ b='cmd_wp.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) cmd_wr.sh.log: cmd_wr.sh @p='cmd_wr.sh'; \ b='cmd_wr.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) add.sh.log: add.sh @p='add.sh'; \ b='add.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) mul1.sh.log: mul1.sh @p='mul1.sh'; \ b='mul1.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) mul2.sh.log: mul2.sh @p='mul2.sh'; \ b='mul2.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) div.sh.log: div.sh @p='div.sh'; \ b='div.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) div32u.sh.log: div32u.sh @p='div32u.sh'; \ b='div32u.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) orl.sh.log: orl.sh @p='orl.sh'; \ b='orl.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) anl.sh.log: anl.sh @p='anl.sh'; \ b='anl.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) mov.sh.log: mov.sh @p='mov.sh'; \ b='mov.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) sqroot.sh.log: sqroot.sh @p='sqroot.sh'; \ b='sqroot.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) timer0.sh.log: timer0.sh @p='timer0.sh'; \ b='timer0.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) timer1.sh.log: timer1.sh @p='timer1.sh'; \ b='timer1.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) timer2.sh.log: timer2.sh @p='timer2.sh'; \ b='timer2.sh'; \ $(am__check_pre) $(LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_LOG_DRIVER_FLAGS) $(LOG_DRIVER_FLAGS) -- $(LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) .test.log: @p='$<'; \ $(am__set_b); \ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ --log-file $$b.log --trs-file $$b.trs \ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ "$$tst" $(AM_TESTS_FD_REDIRECT) @am__EXEEXT_TRUE@.test$(EXEEXT).log: @am__EXEEXT_TRUE@ @p='$<'; \ @am__EXEEXT_TRUE@ $(am__set_b); \ @am__EXEEXT_TRUE@ $(am__check_pre) $(TEST_LOG_DRIVER) --test-name "$$f" \ @am__EXEEXT_TRUE@ --log-file $$b.log --trs-file $$b.trs \ @am__EXEEXT_TRUE@ $(am__common_driver_flags) $(AM_TEST_LOG_DRIVER_FLAGS) $(TEST_LOG_DRIVER_FLAGS) -- $(TEST_LOG_COMPILE) \ @am__EXEEXT_TRUE@ "$$tst" $(AM_TESTS_FD_REDIRECT) distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: -test -z "$(TEST_LOGS)" || rm -f $(TEST_LOGS) -test -z "$(TEST_LOGS:.log=.trs)" || rm -f $(TEST_LOGS:.log=.trs) -test -z "$(TEST_SUITE_LOG)" || rm -f $(TEST_SUITE_LOG) clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-generic mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: check-am install-am install-strip .PHONY: all all-am check check-TESTS check-am clean clean-generic \ cscopelist-am ctags-am distclean distclean-generic distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ pdf-am ps ps-am recheck tags-am uninstall uninstall-am # Do not remove intermediate .hex files .SECONDARY: # If you do not want an implicit rule to be used for a target that has no # commands, you can give that target empty commands by writing a semicolon. @RUN_TESTS_TRUE@cli.sh: ; # Tell make how to generate a .sh file after a .hex file is generated: @RUN_TESTS_TRUE@.hex.sh: @RUN_TESTS_TRUE@ @ln -sf $(srcdir)/opcodes.sh $@ # Tell make how to generate a .hex file from a .asm source file. # Warning: make distcheck will fail because asem nor as504 have option to # specify output filename (and path), except patched version of as504: @RUN_TESTS_TRUE@.asm.hex: @RUN_TESTS_TRUE@@USE_AS504HV_TRUE@ $(AS504) -Fhex -O$@ $< @RUN_TESTS_TRUE@@USE_AS504HV_FALSE@@USE_AS504_TRUE@ $(AS504) -Fhex $< @RUN_TESTS_TRUE@@USE_AS504HV_FALSE@@USE_AS504_FALSE@@USE_AS51_TRUE@ $(AS51) $< @RUN_TESTS_TRUE@@USE_AS504HV_FALSE@@USE_AS504_FALSE@@USE_AS51_FALSE@ echo error # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/tests/add.asm0000644000175400017500000000164412313352657012153 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: ADD ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $20 ; Test output: B = $00 ; Test output: PSW = $01 ; Test output: R0 = $0F ; Test output: R1 = $11 ; Test output: R2 = $10 ; Test output: R3 = $1F ; Test output: R4 = $20 ORG 0000h ; Reset vector ;; ADDC CLR C MOV A, #0FFh ADDC A, #10h ; CY=1, A=$0F MOV R0, A MOV A, #00h ADDC A, #10h ; CY=0, A=$11 MOV R1, A SETB C MOV A, #0FFh ADDC A, #10h ; CY=1, A=$10 MOV R2, A ;; ADD MOV A, #0FFh ADD A, #20h ; CY=1, A=$1F MOV R3, A MOV A, #00h ADD A, #20h ; CY=0, A=$20 MOV R4, A LJMP 0FFF0h END emu8051-2.0.1/tests/sqroot.asm0000644000175400017500000002021112313352657012741 00000000000000; Test program to verify correct emu8051 operation ; Taken from http://www.vzsite.us/8051/ ; ; Test desc: 32-bit division ; Test output: PC = $FFF0 ; Test output: SP = $30 ; Test output: PSW = $04 ; Test output: A = $44 ; Test output: B = $44 ;17 Jan 00 re-written for consistency with assembler/compiler byte order ;21 May 99 8051 source code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;SQROOT1 is called to calculate the square root of a 32-bit number. ; ;Call: ; ; r0 => MSB of 32-bit input ; lcall SQROOT1 ; ;Return: ; ; computed square root is in acc(LSB's) and b(MSB's) ; (root is also in est(MSB's) and est+1(LSB's)) ; ;SQROOT1 uses the formula ; ; estimate = (last_estimate + input/last_estimate)/2 ; ;Method is described as Newton's, Newton-Raphson, and Babylonian method. ;DIV32U is called to do the 32/16-bit division. ;SQROOT1 perfoms a fixed number of iterations to converge to the root. ; ;SQROOT1 will destroy all registers except r0, dptr. ; ;Original Author: John Veazey, Ridgecrest, CA, 18 Apr 99 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; q0 EQU 70h q1 EQU 71h est EQU 72h ; 2 bytes: The estimated value being developed sqrcnt EQU 74h ; Counts iterations square EQU 75h TOS EQU 30h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer ;; Set 32-bit input value MOV square+0,#012h MOV square+1,#034h MOV square+2,#032h MOV square+3,#010h ;; Set pointer to square mov r0,#square LCALL SQROOT LJMP 0FFF0h SQROOT: ; ;Save r0 on the stack ; mov a,r0 push acc ; ;Initialize the iteration counter ; mov sqrcnt,#7 ;There will be seven calculations ; ;Find the MSB set in input, call it n as in 2**n. Calculate ; r = ceiling(n+1)/2, then set up the first estimate to ; be (2**r)-1. ; mov a,@r0 ;Is MS byte of input not-zero? jz sqr112 mov r1,#33 ; Yes, set r1 to the bit number+2 sjmp sqr140 sqr112: inc r0 ; No, mov a,@r0 ;Is 2nd MS byte of input not-zero? jz sqr114 mov r1,#25 ; Yes sjmp sqr140 sqr114: inc r0 mov a,@r0 ;Is 3rd MS byte of input not-zero? jz sqr116 mov r1,#17 ; Yes sjmp sqr140 sqr116: inc r0 mov est,#0 mov a,@r0 ;Is LS byte of input zero? jnz sqr122 mov est+1,#0 ; Yes, return with a zero ljmp sqr900 ; because input is zero sqr122: mov est+1,#1 dec a ;Is LS byte of input = 1? jz sqr900 ; Yes, return with a one inc a ; No mov r1,#9 sqr140: dec r1 rlc a jnc sqr140 mov a,r1 ;Form ceiling[(n+1)/2] clr c rrc a ; (divide by 2, add remainder) jnc sqr142 inc a sqr142: mov r1,a clr a mov est,a sqr144: setb c ;Get the 1 to shift in rlc a mov b,a mov a,est rlc a mov est,a mov a,b dec r1 cjne r1,#0,sqr144 mov est+1,a ; ;Load input into DIV32U dividend register ; sqr200: pop acc push acc mov r0,a mov a,@r0 ;Set MSB's mov r7,a inc r0 mov a,@r0 mov r6,a inc r0 mov a,@r0 mov r5,a inc r0 mov a,@r0 mov r4,a ; ;Load last estimate into DIV32U divisor registers ; mov a,est+1 ;Set LSB's mov r0,a mov a,est ;Set MSB's mov r1,a ; ;Call DIV32U to do the 32/16-bit division (input/est) ; lcall DIV32U ;(r7,r6,r5,r4)/(r1,r0) = (r5,r4) jnc sqr310 ;If overflow, set to maximum number mov r4,#-1 mov r5,#-1 ; ;Add the last estimate to the quotient ; sqr310: mov a,r4 add a,est+1 ;sets c mov est+1,a mov a,est addc a,r5 ;sets c ; ;Divide sum by 2 and save as new estimate ; rrc a ;sets c mov est,a mov a,est+1 rrc a ;c discarded mov est+1,a ; ;Decrement the iteration counter and repeat if not zero ; djnz sqrcnt,sqr200 ; ;Make the normal return ; sqr900: pop acc ;Restore caller's pointer mov r0,a mov b,est ;Get answer in (b,a) mov a,est+1 ret DIV32U: ; ;Clear the working quotient ; clr a mov q1,a mov q0,a ; ;Clear the msb's of a 32-bit working divisor (r3,r2,r1,r0) ; mov r3,a mov r2,a ; ;b counts the number of places+1 the divisor was initially ; shifted left to align its ms bit set with the ms bit set ; in the dividend ; mov b,#1 ; ;Make an error return if trying to divide by zero ; mov a,r1 orl a,r0 jnz du100 ljmp du920 ;Make the error return ; ;Just return with quotient and remainder zero if dividend is zero ; du100: mov a,r7 orl a,r6 orl a,r5 orl a,r4 jnz du200 mov r7,a mov r6,a ljmp du910 ;Make a normal return ; ;Align the msb set in the demoninator with the msb set in the ; numerator. Increment the shift count in b each time a shift left ; is performed. ; du200: mov a,r3 ;Stop if msb set clr c rlc a jc du600 subb a,r7 ;Compare r3 & r7, (c clear) jz du210 ; jump if r3=r7 jnc du600 ; jump if r3>r7 sjmp du240 ; r3r6 jnz du240 ; jump if r2r5 jnz du240 ; jump if r1r4 du240: clr c ;Now shift the denominator mov a,r0 ; left 1 bit position rlc a mov r0,a mov a,r1 rlc a mov r1,a mov a,r2 rlc a mov r2,a mov a,r3 rlc a mov r3,a inc b ;Increment b counter and sjmp du200 ; continue ; ;Compare the shifted divisor with the remainder (what's ; left of the dividend) ; du600: mov a,r7 clr c subb a,r3 jc du720 ;jump if r3>r7 jnz du700 ;jump if r3r6 jnz du700 ;jump if r2r5 jnz du700 ;jump if r1r4 ; ;Divisor is equal or smaller, so subtract it off and ; get a 1 for the quotient ; du700: mov a,r4 clr c subb a,r0 mov r4,a mov a,r5 subb a,r1 mov r5,a mov a,r6 subb a,r2 mov r6,a mov a,r7 subb a,r3 mov r7,a clr c cpl c ;Get a 1 for the quotient sjmp du730 ; ;Divisor is greater, get a 0 for the quotient ; du720: clr c ; ;Shift 0 or 1 into quotient ; du730: mov a,q0 rlc a mov q0,a mov a,q1 rlc a mov q1,a jc du920 ;overflow - make the error return ; ;Now shift the denominator right 1, decrement the counter ; in b until b = 0 ; du740: clr c mov a,r3 rrc a mov r3,a mov a,r2 rrc a mov r2,a mov a,r1 rrc a mov r1,a mov a,r0 rrc a mov r0,a djnz b,du600 ; ;Move quotient and remainder ; mov a,r5 mov r7,a mov a,r4 mov r6,a mov a,q1 mov r5,a mov a,q0 mov r4,a ; ;Make the normal return ; du910: clr c ret ; ;Make the error return ; du920: clr c cpl c ret emu8051-2.0.1/tests/timer0.asm0000644000175400017500000000273212313352657012622 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: timers ; Test output: PC = $FFF0 ; Test output: SP = $60 ; Test output: R0 = $83 ; Test output: R1 = $17 ; Test output: R2 = $81 ; Test output: R3 = $02 ; Test output: TIMER0 = $7103 ; Test output: TIMER1 = $8005 ; Test output: TCON = $A0 ; Test output: TMOD = $00 ; Test output: PSW = $00 TOS EQU 60h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer MOV TMOD,#00h ; Init timers 0 and 1 as: ; 8-bit timer "TH" with "TL" as 5-bit prescaler ; incremented by the internal clock ;; First test: no overflow MOV TH0,#2 MOV TL0,#55h ; Set initial value of timer0 to $0255 LCALL DELAY MOV 00h, TH0 ; Save value of timer 0 MOV 01h, TL0 MOV 02h, TH1 ; Save value of timer 1 MOV 03h, TL1 MOV 04h, TCON ;; Second test: overflow MOV TH0,#0F0h MOV TL0,#01h ; Set initial value of timer0 to $F001 MOV Th1,#0FFh MOV TL1,#03h ; Set initial value of timer1 to $FF03 LCALL DELAY LJMP 0FFF0h ;; Loop of $1020 cycles DELAY: MOV A,#08h ORL TCON,#50h ; Timer 0 and timer 1 ON. B2: MOV B,#0 B1: DJNZ B,B1 DJNZ ACC,B2 ANL TCON,#0AFh ; Stop both timers RET END emu8051-2.0.1/tests/timer1.asm0000644000175400017500000000262612313352657012625 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: timers ; Test output: PC = $FFF0 ; Test output: SP = $60 ; Test output: R0 = $22 ; Test output: R1 = $97 ; Test output: R2 = $20 ; Test output: R3 = $42 ; Test output: TIMER0 = $10DA ; Test output: TIMER1 = $1F42 ; Test output: TCON = $A0 ; Test output: TMOD = $11 ; Test output: PSW = $00 TOS EQU 60h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer MOV TMOD,#00010001B ; Init timers 0 and 1 as 16-bit timers, ; incremented by the internal clock ;; First test: no overflow MOV TH0,#2 MOV TL0,#55h ; Set initial value of timer0 to $0255 LCALL DELAY MOV 00h, TH0 ; Save value of timer 0 MOV 01h, TL0 MOV 02h, TH1 ; Save value of timer 1 MOV 03h, TL1 MOV 04h, TCON ;; Second test: overflow MOV TH0,#0F0h MOV TL0,#98h ; Set initial value of timer0 to $F098 MOV Th1,#0FFh MOV TL1,#00h ; Set initial value of timer1 to $FF00 LCALL DELAY LJMP 0FFF0h ;; Loop of $2040 cycles DELAY: MOV A,#10h ORL TCON,#50h ; Timer 0 and timer 1 ON. B2: MOV B,#0 B1: DJNZ B,B1 DJNZ ACC,B2 ANL TCON,#0AFh ; Stop both timers RET END emu8051-2.0.1/tests/timer2.asm0000644000175400017500000000270012313352657012617 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: timers ; Test output: PC = $FFF0 ; Test output: SP = $60 ; Test output: R0 = $80 ; Test output: R1 = $16 ; Test output: R2 = $F4 ; Test output: R3 = $3E ; Test output: TIMER0 = $8086 ; Test output: TIMER1 = $F4F9 ; Test output: TCON = $A0 ; Test output: TMOD = $22 ; Test output: PSW = $00 TOS EQU 60h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer MOV TMOD,#00100010B ; Init timers 0 and 1 as 8-bit timers (TL), ; reloaded with TH when overflow occurs. ;; First test: no overflow MOV TH0,#080h ; Reload value MOV TH1,#0F4h ; Reload value MOV TL0,#00h ; Set initial value of timer0 MOV TL1,#28h ; Set initial value of timer1 LCALL DELAY MOV 00h, TH0 ; Save value of timer 0 MOV 01h, TL0 MOV 02h, TH1 ; Save value of timer 1 MOV 03h, TL1 MOV 04h, TCON ;; Second test: overflow MOV TL0,#0F0h ; Set initial value of timer0 MOV TL1,#0EFh ; Set initial value of timer1 LCALL DELAY LJMP 0FFF0h ;; Loop of ~25 cycles DELAY: MOV B,#10 ORL TCON,#50h ; Timer 0 and timer 1 ON. B1: DJNZ B,B1 ANL TCON,#0AFh ; Stop both timers RET END emu8051-2.0.1/tests/anl.asm0000644000175400017500000000113512313352657012170 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: ANL ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $60 ; Test output: B = $60 ; Test output: PSW = $E0 ; Test output: TCON = $01 ORG 0000h ; Reset vector MOV PSW, #0E0h CLR TCON.0 CLR C ANL C, TCON.0 ; CY Should be 0 MOV A, PSW SETB TCON.0 ANL C, TCON.0 ; CY Should be 0 MOV B, PSW SETB C ANL C, TCON.0 ; CY Should be 1 LJMP 0FFF0h END emu8051-2.0.1/tests/opcodes.sh0000755000175400017500000000152112313352657012706 00000000000000#!/bin/sh # Get the symlink name (how we were called): test_name=`basename $0` lf=${test_name}.log STOP_ADDRESS="0xFFF0" XRAM_SIZE="256" name=$(basename ${test_name} .sh) hexfile=${name}.hex echo "Testing ${name}.hex" > ${lf} ../src/cli/emu8051-cli -d 2 --xram=${XRAM_SIZE} -s ${STOP_ADDRESS} ${hexfile} >> ${lf} if test $? -ne 0 ; then return 1 fi test_output_found=0 while read line; do if echo ${line} | grep -q "; Test output"; then test_output_found=1 test_str=$(echo ${line} | sed "s/^; Test output: //") if ! grep -q "${test_str}" ${lf}; then echo "Failed test: ${test_str}" >> ${lf} exit 1 fi fi done < $srcdir/${name}.asm if [ x"${test_output_found}" == x0 ]; then # Need at least one test output condition to verify correct operation exit 1 fi exit 0 emu8051-2.0.1/tests/orl.asm0000644000175400017500000000075312313352657012217 00000000000000; Test program to verify correct emu8051 operation ; ; Test desc: ORL ; Test output: PC = $FFF0 ; Test output: SP = $07 ; Test output: A = $60 ; Test output: PSW = $E0 ; Test output: TCON = $01 ORG 0000h ; Reset vector MOV PSW, #0E0h CLR TCON.0 CLR C ORL C, TCON.0 ; CY Should be 0 MOV A, PSW SETB TCON.0 ORL C, TCON.0 ; CY Should be 1 LJMP 0FFF0h END emu8051-2.0.1/tests/div32u.asm0000644000175400017500000001313012313352657012530 00000000000000; Test program to verify correct emu8051 operation ; Taken from http://www.vzsite.us/8051/ ; ; Test desc: 32-bit division ; Test output: PC = $FFF0 ; Test output: SP = $60 ; Test output: R0 = $E6 ; Test output: R1 = $55 ; Test output: R2 = $00 ; Test output: R3 = $00 ; Test output: R4 = $20 ; Test output: R5 = $1B ; Test output: PSW = $05 ;26 Oct 00 added code to zero remainder when dividend is zero ;19 Dec 99 corrected comments, removed unnecessary instruction ;16 May 99 8051 source code ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ;DIV32U is called to divide (unsigned) a 32-bit dividend using a ; 16-bit divisor. ; ;DIV32U solves for quotient and remainder the equation: ; ; dividend = divisor*quotient + remainder ; ;Call: ; r7,r6,r5,r4 = dividend ; r1,r0 = divisor ; lcall DIV32U ; ;Return: ; r5,r4 = quotient ; r7,r6 = remainder ; c flag set to 1 if overflow occured ; All registers, acc, b and two caller-assigned direct memory bytes ; (q0 and q1)have been changed. ; Data pointer has not been disturbed ; ;Note: ; (1)Overflow is a divide by zero or any value that will cause ; the quotient to be greater than 16 bits. ; (2)Most significant (ms) register always listed first when comma separates ; two in a comment. Example: r3,r2 (r3 contains the ms bits) ; (3) The algorithm used in this code borrows heavily from work posted ; by John C. Wren who said he got it from a C complier. ; ;Original author: John Veazey, Ridgecrest, CA, 18 APR 99 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; q0 EQU 70h q1 EQU 71h TOS EQU 60h ; Adresse du dessus de la pile. ORG 0000h ; Reset vector MOV SP,#TOS ; Init stack pointer ;; Set dividend MOV R7,#012h MOV R6,#034h MOV R5,#056h MOV R4,#078h ;; Set divisor MOV R1,#0ABh MOV R0,#0CDh LCALL DIV32U LJMP 0FFF0h DIV32U: ; ;Clear the working quotient ; clr a mov q1,a mov q0,a ; ;Clear the msb's of a 32-bit working divisor (r3,r2,r1,r0) ; mov r3,a mov r2,a ; ;b counts the number of places+1 the divisor was initially ; shifted left to align its ms bit set with the ms bit set ; in the dividend ; mov b,#1 ; ;Make an error return if trying to divide by zero ; mov a,r1 orl a,r0 jnz du100 ljmp du920 ;Make the error return ; ;Just return with quotient and remainder zero if dividend is zero ; du100: mov a,r7 orl a,r6 orl a,r5 orl a,r4 jnz du200 mov r7,a mov r6,a ljmp du910 ;Make a normal return ; ;Align the msb set in the demoninator with the msb set in the ; numerator. Increment the shift count in b each time a shift left ; is performed. ; du200: mov a,r3 ;Stop if msb set clr c rlc a jc du600 subb a,r7 ;Compare r3 & r7, (c clear) jz du210 ; jump if r3=r7 jnc du600 ; jump if r3>r7 sjmp du240 ; r3r6 jnz du240 ; jump if r2r5 jnz du240 ; jump if r1r4 du240: clr c ;Now shift the denominator mov a,r0 ; left 1 bit position rlc a mov r0,a mov a,r1 rlc a mov r1,a mov a,r2 rlc a mov r2,a mov a,r3 rlc a mov r3,a inc b ;Increment b counter and sjmp du200 ; continue ; ;Compare the shifted divisor with the remainder (what's ; left of the dividend) ; du600: mov a,r7 clr c subb a,r3 jc du720 ;jump if r3>r7 jnz du700 ;jump if r3r6 jnz du700 ;jump if r2r5 jnz du700 ;jump if r1r4 ; ;Divisor is equal or smaller, so subtract it off and ; get a 1 for the quotient ; du700: mov a,r4 clr c subb a,r0 mov r4,a mov a,r5 subb a,r1 mov r5,a mov a,r6 subb a,r2 mov r6,a mov a,r7 subb a,r3 mov r7,a clr c cpl c ;Get a 1 for the quotient sjmp du730 ; ;Divisor is greater, get a 0 for the quotient ; du720: clr c ; ;Shift 0 or 1 into quotient ; du730: mov a,q0 rlc a mov q0,a mov a,q1 rlc a mov q1,a jc du920 ;overflow - make the error return ; ;Now shift the denominator right 1, decrement the counter ; in b until b = 0 ; du740: clr c mov a,r3 rrc a mov r3,a mov a,r2 rrc a mov r2,a mov a,r1 rrc a mov r1,a mov a,r0 rrc a mov r0,a djnz b,du600 ; ;Move quotient and remainder ; mov a,r5 mov r7,a mov a,r4 mov r6,a mov a,q1 mov r5,a mov a,q0 mov r4,a ; ;Make the normal return ; du910: clr c ret ; ;Make the error return ; du920: clr c cpl c ret emu8051-2.0.1/README0000644000175400017500000000367212313352657010442 00000000000000 Emu8051 Emu8051 is a simulator/emulator for the Intel 8051 family of microcontrollers. It is available in two versions: a console (text-only) version and a graphical version (using the GTK+ toolkit). This is an Open-Source project. The program can load Intel HEX files. Once loaded, a program can be run (it will run indefinitely or until a breakpoint is encountered). You can also use the STEP button to execute only a single instruction at a time and see the effects on registers and memory. It is written in C, and uses Perl scripts to generate automatically C functions corresponding to each assembly instruction of the 8051 microcontroller. For recent project news, see the NEWS file. Project website: http://www.hugovil.com/en/emu8051 Installation: For installation instructions, see the INSTALL file. Regression testing: Emu8051 now supports automatic regression tests. This feature is mainly for developers who want to make sure that whatever features they implement or whatever bug they fix don't create additional or new problems. To support that feature, you must have a compatible 8051 assembler installed. At the moment, these two assemblers are supported: as504 -- http://www.vanwal.nl/as504 ASEM-51 -- http://plit.de/asem-51 I recommend to compile as504 with this patch to support option "-O": http://www.hugovil.com/repository/hvlinux/patches/as504-add-output-file-option.patch as504 doesn't come with an installation script so compile and install it with: $> make $> sudo install as504 /usr/local/bin Then reconfigure emu8051 so that as504 can be detected and regression testing enabled. You can run regression testing by issuing: $> make check Adding a new test case implies adding a new asm source file inside the tests subdirectory and adding its name to two variables in tests/Makefile.am. This program was tested on the following systems: "Linux From Scratch 4.0" emu8051-2.0.1/configure0000755000175400017500000061343012313352707011464 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for emu8051 2.0.1. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 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. as_myself= 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 # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} 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 test -x / || 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 : export CONFIG_SHELL # 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. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 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 and hugo@hugovil.com $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: 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_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_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 STATUS 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=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&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; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # 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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 as_test_x='test -x' as_executable_p=as_fn_executable_p # 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, old GNU/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='emu8051' PACKAGE_TARNAME='emu8051' PACKAGE_VERSION='2.0.1' PACKAGE_STRING='emu8051 2.0.1' PACKAGE_BUGREPORT='hugo@hugovil.com' PACKAGE_URL='http://www.hugovil.com/fr/emu8051/' ac_unique_file="src/common/cpu8051.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='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS ac_aux_dir WARNINGCFLAGS ZLIB_LIBS zlib_LIBS zlib_CFLAGS USE_AS51_FALSE USE_AS51_TRUE USE_AS504_FALSE USE_AS504_TRUE USE_AS504HV_FALSE USE_AS504HV_TRUE RUN_TESTS_FALSE RUN_TESTS_TRUE ASEM51_CHECK AS504_CHECK USE_GTK_FALSE USE_GTK_TRUE GTK_LIBS GTK_CFLAGS GLIB_LIBS GLIB_CFLAGS PKG_CONFIG_LIBDIR PKG_CONFIG_PATH PKG_CONFIG EGREP GREP CPP YFLAGS YACC LEXLIB LEX_OUTPUT_ROOT LEX LIBREADLINE am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC ac_ct_AR AR RANLIB AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM 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 enable_silent_rules enable_dependency_tracking with_readline enable_gui ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS YACC YFLAGS CPP PKG_CONFIG PKG_CONFIG_PATH PKG_CONFIG_LIBDIR GLIB_CFLAGS GLIB_LIBS GTK_CFLAGS GTK_LIBS zlib_CFLAGS zlib_LIBS' # 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_TARNAME}' 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= ;; *) 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 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 emu8051 2.0.1 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/emu8051] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of emu8051 2.0.1:";; esac 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] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build --enable-gui Enable building the GUI (default=yes) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --without-readline disable support for readline 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 YACC The `Yet Another Compiler Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. CPP C preprocessor PKG_CONFIG path to pkg-config utility PKG_CONFIG_PATH directories to add to pkg-config's search path PKG_CONFIG_LIBDIR path overriding pkg-config's built-in search path GLIB_CFLAGS C compiler flags for GLIB, overriding pkg-config GLIB_LIBS linker flags for GLIB, overriding pkg-config GTK_CFLAGS C compiler flags for GTK, overriding pkg-config GTK_LIBS linker flags for GTK, overriding pkg-config zlib_CFLAGS C compiler flags for zlib, overriding pkg-config zlib_LIBS linker flags for zlib, overriding pkg-config 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 . emu8051 home page: . _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 emu8051 configure 2.0.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # 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 || 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # 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 eval \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # 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; } > conftest.i && { 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; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # 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; ${as_lineno_stack:+:} 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 eval \${$3+:} false; 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; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile 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 emu8051 $as_me 2.0.1, which was generated by GNU Autoconf 2.69. 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 $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" 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 $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" 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 $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" 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 $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" 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 # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac 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" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } 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_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$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. ac_config_headers="$ac_config_headers config.h:config-h.in" am__api_version='1.14' # 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 ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$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' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $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 STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $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_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" 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 STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P 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. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk 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 ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$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 AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='emu8051' VERSION='2.0.1' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=0;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' 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}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $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 RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" 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 RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= 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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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 ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$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_error 77 "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 ${ac_cv_objext+:} false; 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 ${ac_cv_c_compiler_gnu+:} false; 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 ${ac_cv_prog_cc_g+:} false; 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 ${ac_cv_prog_cc_c89+:} false; 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 struct stat; /* 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 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 whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" 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 depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test -n "$ac_tool_prefix"; then for ac_prog in ar lib "link -lib" 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 ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="$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 AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AR" && break done fi if test -z "$AR"; then ac_ct_AR=$AR for ac_prog in ar lib "link -lib" 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 ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="$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_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_AR" && break done if test "x$ac_ct_AR" = x; then AR="false" 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 AR=$ac_ct_AR fi fi : ${AR=ar} { $as_echo "$as_me:${as_lineno-$LINENO}: checking the archiver ($AR) interface" >&5 $as_echo_n "checking the archiver ($AR) interface... " >&6; } if ${am_cv_ar_interface+:} false; then : $as_echo_n "(cached) " >&6 else 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 am_cv_ar_interface=ar cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int some_variable = 0; _ACEOF if ac_fn_c_try_compile "$LINENO"; then : am_ar_try='$AR cru libconftest.a conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=ar else am_ar_try='$AR -NOLOGO -OUT:conftest.lib conftest.$ac_objext >&5' { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$am_ar_try\""; } >&5 (eval $am_ar_try) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if test "$ac_status" -eq 0; then am_cv_ar_interface=lib else am_cv_ar_interface=unknown fi fi rm -f conftest.lib libconftest.a fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext 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 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_ar_interface" >&5 $as_echo "$am_cv_ar_interface" >&6; } case $am_cv_ar_interface in ar) ;; lib) # Microsoft lib, so override with the ar-lib wrapper script. # FIXME: It is wrong to rewrite AR. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__AR in this case, # and then we could set am__AR="$am_aux_dir/ar-lib \$(AR)" or something # similar. AR="$am_aux_dir/ar-lib $AR" ;; unknown) as_fn_error $? "could not determine $AR interface" "$LINENO" 5 ;; esac # Check whether --with-readline was given. if test "${with_readline+set}" = set; then : withval=$with_readline; else with_readline=yes fi LIBREADLINE= if test "x$with_readline" != xno; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lreadline" >&5 $as_echo_n "checking for main in -lreadline... " >&6; } if ${ac_cv_lib_readline_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { return main (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_readline_main=yes else ac_cv_lib_readline_main=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_readline_main" >&5 $as_echo "$ac_cv_lib_readline_main" >&6; } if test "x$ac_cv_lib_readline_main" = xyes; then : LIBREADLINE="-lreadline" $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h 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 $? "readline test failed (--without-readline to disable) See \`config.log' for more details" "$LINENO" 5; } fi fi for ac_prog in flex lex 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 ${ac_cv_prog_LEX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$LEX"; then ac_cv_prog_LEX="$LEX" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LEX="$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 LEX=$ac_cv_prog_LEX if test -n "$LEX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LEX" >&5 $as_echo "$LEX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$LEX" && break done test -n "$LEX" || LEX=":" if test "x$LEX" != "x:"; then cat >conftest.l <<_ACEOF %% a { ECHO; } b { REJECT; } c { yymore (); } d { yyless (1); } e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */ yyless ((input () != 0)); } f { unput (yytext[0]); } . { BEGIN INITIAL; } %% #ifdef YYTEXT_POINTER extern char *yytext; #endif int main (void) { return ! yylex () + ! yywrap (); } _ACEOF { { ac_try="$LEX conftest.l" 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 "$LEX conftest.l") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex output file root" >&5 $as_echo_n "checking lex output file root... " >&6; } if ${ac_cv_prog_lex_root+:} false; then : $as_echo_n "(cached) " >&6 else if test -f lex.yy.c; then ac_cv_prog_lex_root=lex.yy elif test -f lexyy.c; then ac_cv_prog_lex_root=lexyy else as_fn_error $? "cannot find output from $LEX; giving up" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_root" >&5 $as_echo "$ac_cv_prog_lex_root" >&6; } LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root if test -z "${LEXLIB+set}"; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking lex library" >&5 $as_echo_n "checking lex library... " >&6; } if ${ac_cv_lib_lex+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_LIBS=$LIBS ac_cv_lib_lex='none needed' for ac_lib in '' -lfl -ll; do LIBS="$ac_lib $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_lex=$ac_lib fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext test "$ac_cv_lib_lex" != 'none needed' && break done LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lex" >&5 $as_echo "$ac_cv_lib_lex" >&6; } test "$ac_cv_lib_lex" != 'none needed' && LEXLIB=$ac_cv_lib_lex fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether yytext is a pointer" >&5 $as_echo_n "checking whether yytext is a pointer... " >&6; } if ${ac_cv_prog_lex_yytext_pointer+:} false; then : $as_echo_n "(cached) " >&6 else # POSIX says lex can declare yytext either as a pointer or an array; the # default is implementation-dependent. Figure out which it is, since # not all implementations provide the %pointer and %array declarations. ac_cv_prog_lex_yytext_pointer=no ac_save_LIBS=$LIBS LIBS="$LEXLIB $ac_save_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define YYTEXT_POINTER 1 `cat $LEX_OUTPUT_ROOT.c` _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_prog_lex_yytext_pointer=yes fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_lex_yytext_pointer" >&5 $as_echo "$ac_cv_prog_lex_yytext_pointer" >&6; } if test $ac_cv_prog_lex_yytext_pointer = yes; then $as_echo "#define YYTEXT_POINTER 1" >>confdefs.h fi rm -f conftest.l $LEX_OUTPUT_ROOT.c fi for ac_prog in 'bison -y' byacc 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 ${ac_cv_prog_YACC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$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 YACC=$ac_cv_prog_YACC if test -n "$YACC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $YACC" >&5 $as_echo "$YACC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$YACC" && break done test -n "$YACC" || YACC="yacc" { $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 ${ac_cv_c_const+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __cplusplus /* Ultrix mips cc rejects this sort of thing. */ typedef int charset[2]; const charset cs = { 0, 0 }; /* 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 sort of thing. */ char tx; char *t = &tx; 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 sort of thing, saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; } bx; struct s *b = &bx; 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_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 ${ac_cv_prog_CPP+:} false; 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.i 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.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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.i 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.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i 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 { $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 ${ac_cv_path_GREP+:} false; 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" as_fn_executable_p "$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 ${ac_cv_path_EGREP+:} false; 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" as_fn_executable_p "$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 ${ac_cv_header_stdc+:} false; 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 " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done ac_fn_c_check_type "$LINENO" "pid_t" "ac_cv_type_pid_t" "$ac_includes_default" if test "x$ac_cv_type_pid_t" = xyes; 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" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi WARNINGCFLAGS="-Wall -Wextra -Wformat -Wformat-security" if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $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 ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" 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 PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GLIB" >&5 $as_echo_n "checking for GLIB... " >&6; } if test -n "$GLIB_CFLAGS"; then pkg_cv_GLIB_CFLAGS="$GLIB_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.26.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.26.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_CFLAGS=`$PKG_CONFIG --cflags "glib-2.0 >= 2.26.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GLIB_LIBS"; then pkg_cv_GLIB_LIBS="$GLIB_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"glib-2.0 >= 2.26.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "glib-2.0 >= 2.26.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GLIB_LIBS=`$PKG_CONFIG --libs "glib-2.0 >= 2.26.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GLIB_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "glib-2.0 >= 2.26.0" 2>&1` else GLIB_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "glib-2.0 >= 2.26.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GLIB_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (glib-2.0 >= 2.26.0) were not met: $GLIB_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GLIB_CFLAGS and GLIB_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else GLIB_CFLAGS=$pkg_cv_GLIB_CFLAGS GLIB_LIBS=$pkg_cv_GLIB_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi # Check whether --enable-gui was given. if test "${enable_gui+set}" = set; then : enableval=$enable_gui; ac_cv_enable_gui=$enableval else ac_cv_enable_gui=yes fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build GUI" >&5 $as_echo_n "checking whether to build GUI... " >&6; } if test x$ac_cv_enable_gui = xyes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GTK" >&5 $as_echo_n "checking for GTK... " >&6; } if test -n "$GTK_CFLAGS"; then pkg_cv_GTK_CFLAGS="$GTK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= 2.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_LIBS"; then pkg_cv_GTK_LIBS="$GTK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= 2.4.0\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= 2.4.0") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= 2.4.0" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= 2.4.0" 2>&1` else GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= 2.4.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_PKG_ERRORS" >&5 ac_cv_enable_gui=no elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } ac_cv_enable_gui=no else GTK_CFLAGS=$pkg_cv_GTK_CFLAGS GTK_LIBS=$pkg_cv_GTK_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi if test x$ac_cv_enable_gui = xyes; then $as_echo "#define HAVE_GTK 1" >>confdefs.h GTK_CFLAGS="${GTK_CFLAGS} -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" fi else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x${ac_cv_enable_gui} = xyes; then USE_GTK_TRUE= USE_GTK_FALSE='#' else USE_GTK_TRUE='#' USE_GTK_FALSE= fi run_tests=no # Extract the first word of "as504", so it can be a program name with args. set dummy as504; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AS504_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AS504_CHECK"; then ac_cv_prog_AS504_CHECK="$AS504_CHECK" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AS504_CHECK="yes" $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 AS504_CHECK=$ac_cv_prog_AS504_CHECK if test -n "$AS504_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS504_CHECK" >&5 $as_echo "$AS504_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$AS504_CHECK" = x"yes" ; then run_tests=yes AS504HV_CHECK=no if as504 2>&1 | grep -q Ooutfile; then AS504HV_CHECK=yes fi fi # Extract the first word of "asem", so it can be a program name with args. set dummy asem; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ASEM51_CHECK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ASEM51_CHECK"; then ac_cv_prog_ASEM51_CHECK="$ASEM51_CHECK" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ASEM51_CHECK="yes" $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 ASEM51_CHECK=$ac_cv_prog_ASEM51_CHECK if test -n "$ASEM51_CHECK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ASEM51_CHECK" >&5 $as_echo "$ASEM51_CHECK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test x"$ASEM51_CHECK" = x"yes" ; then run_tests=yes fi if test x"$run_tests" != x"yes" ; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Please install as504 (http://www.vanwal.nl/as504/) or ASEM-51 (http://plit.de/asem-51) to run test suite." >&5 $as_echo "$as_me: WARNING: Please install as504 (http://www.vanwal.nl/as504/) or ASEM-51 (http://plit.de/asem-51) to run test suite." >&2;} fi if test x"$run_tests" = x"yes"; then RUN_TESTS_TRUE= RUN_TESTS_FALSE='#' else RUN_TESTS_TRUE='#' RUN_TESTS_FALSE= fi if test x"$AS504HV_CHECK" = x"yes"; then USE_AS504HV_TRUE= USE_AS504HV_FALSE='#' else USE_AS504HV_TRUE='#' USE_AS504HV_FALSE= fi if test x"$AS504_CHECK" = x"yes"; then USE_AS504_TRUE= USE_AS504_FALSE='#' else USE_AS504_TRUE='#' USE_AS504_FALSE= fi if test x"$ASEM51_CHECK" = x"yes"; then USE_AS51_TRUE= USE_AS51_FALSE='#' else USE_AS51_TRUE='#' USE_AS51_FALSE= fi ac_have_zlib=no pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlib" >&5 $as_echo_n "checking for zlib... " >&6; } if test -n "$zlib_CFLAGS"; then pkg_cv_zlib_CFLAGS="$zlib_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib > 1.2.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib > 1.2.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_zlib_CFLAGS=`$PKG_CONFIG --cflags "zlib > 1.2.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$zlib_LIBS"; then pkg_cv_zlib_LIBS="$zlib_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"zlib > 1.2.1\""; } >&5 ($PKG_CONFIG --exists --print-errors "zlib > 1.2.1") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then pkg_cv_zlib_LIBS=`$PKG_CONFIG --libs "zlib > 1.2.1" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then zlib_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "zlib > 1.2.1" 2>&1` else zlib_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "zlib > 1.2.1" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$zlib_PKG_ERRORS" >&5 as_fn_error $? "Package requirements (zlib > 1.2.1) were not met: $zlib_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables zlib_CFLAGS and zlib_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details." "$LINENO" 5 elif test $pkg_failed = untried; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables zlib_CFLAGS and zlib_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details" "$LINENO" 5; } else zlib_CFLAGS=$pkg_cv_zlib_CFLAGS zlib_LIBS=$pkg_cv_zlib_LIBS { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -lz" >&5 $as_echo_n "checking for crc32 in -lz... " >&6; } if ${ac_cv_lib_z_crc32+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lz $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 crc32 (); int main () { return crc32 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_z_crc32=yes else ac_cv_lib_z_crc32=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_z_crc32" >&5 $as_echo "$ac_cv_lib_z_crc32" >&6; } if test "x$ac_cv_lib_z_crc32" = xyes; then : ac_have_zlib=yes else ac_have_zlib=no fi fi if test x"$ac_have_zlib" = x"yes" ; then ZLIB_LIBS='-lz' else as_fn_error $? "Please install zlib and zlib-devel packages" "$LINENO" 5 fi ac_config_files="$ac_config_files Makefile src/common/Makefile src/cli/Makefile src/gtk/Makefile data/Makefile doc/Makefile tests/Makefile" 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 if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi 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 { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_GTK_TRUE}" && test -z "${USE_GTK_FALSE}"; then as_fn_error $? "conditional \"USE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${RUN_TESTS_TRUE}" && test -z "${RUN_TESTS_FALSE}"; then as_fn_error $? "conditional \"RUN_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_AS504HV_TRUE}" && test -z "${USE_AS504HV_FALSE}"; then as_fn_error $? "conditional \"USE_AS504HV\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_AS504_TRUE}" && test -z "${USE_AS504_FALSE}"; then as_fn_error $? "conditional \"USE_AS504\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${USE_AS51_TRUE}" && test -z "${USE_AS51_FALSE}"; then as_fn_error $? "conditional \"USE_AS51\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${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. as_myself= 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 STATUS 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=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&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 -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' 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 # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # 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 emu8051 $as_me 2.0.1, which was generated by GNU Autoconf 2.69. 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" config_commands="$ac_config_commands" _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 Configuration commands: $config_commands Report bugs to . emu8051 home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ emu8051 config.status 2.0.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 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' MKDIR_P='$MKDIR_P' AWK='$AWK' 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=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= 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"` ;; '') as_fn_error $? "missing file argument" ;; 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 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _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:config-h.in" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/common/Makefile") CONFIG_FILES="$CONFIG_FILES src/common/Makefile" ;; "src/cli/Makefile") CONFIG_FILES="$CONFIG_FILES src/cli/Makefile" ;; "src/gtk/Makefile") CONFIG_FILES="$CONFIG_FILES src/gtk/Makefile" ;; "data/Makefile") CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; *) 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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_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 -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # 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 {' >"$ac_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 >>"\$ac_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 >>"\$ac_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 < "$ac_tmp/subs1.awk" > "$ac_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 sole $(srcdir), # ${srcdir} and @srcdir@ entries 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[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// 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 >"$ac_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_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; 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 :C $CONFIG_COMMANDS" 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="$ac_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 1 "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 >"$ac_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 ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; 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 s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_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' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_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 "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_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 "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_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 "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; 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 1 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 emu8051-2.0.1/configure.ac0000644000175400017500000000724212313352657012045 00000000000000# configure.ac -- Process this file with autoconf to produce configure dnl Initialization stuff. AC_INIT([emu8051], [2.0.1], [hugo@hugovil.com], [emu8051], [http://www.hugovil.com/fr/emu8051/]) AC_CONFIG_AUX_DIR([build-aux]) AC_CONFIG_SRCDIR(src/common/cpu8051.c) AM_CONFIG_HEADER(config.h:config-h.in) dnl Checking if the NEWS file has been updated to reflect the current version. AM_INIT_AUTOMAKE(check-news -Wall std-options color-tests parallel-tests) AM_SILENT_RULES([yes]) dnl Testing the C compiler. AC_LANG_C dnl Testing for libtool support. AC_PROG_RANLIB AM_PROG_AR AC_ARG_WITH([readline], [AS_HELP_STRING([--without-readline], [disable support for readline])], [], [with_readline=yes]) LIBREADLINE= AS_IF([test "x$with_readline" != xno], [AC_CHECK_LIB([readline], [main], [AC_SUBST([LIBREADLINE], ["-lreadline"]) AC_DEFINE([HAVE_LIBREADLINE], [1], [Define if you have libreadline]) ], [AC_MSG_FAILURE( [readline test failed (--without-readline to disable)])], [] )]) dnl Testing for Lex/Yacc AC_PROG_LEX AC_PROG_YACC dnl Checking for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_PID_T AC_TYPE_SIZE_T dnl Basic warning CFLAGS values WARNINGCFLAGS="-Wall -Wextra -Wformat -Wformat-security" PKG_CHECK_MODULES(GLIB, [glib-2.0 >= 2.26.0]) AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_LIBS) dnl Checks for Gtk+-2.0 AC_ARG_ENABLE(gui, [ --enable-gui Enable building the GUI (default=yes)], [ac_cv_enable_gui=$enableval], [ac_cv_enable_gui=yes]) AC_MSG_CHECKING([whether to build GUI]) if test x$ac_cv_enable_gui = xyes; then AC_MSG_RESULT(yes) PKG_CHECK_MODULES(GTK, gtk+-2.0 >= 2.4.0, [], dnl ac_cv_enable_gui=no) if test x$ac_cv_enable_gui = xyes; then AC_DEFINE([HAVE_GTK],1,[Set to 1 to enable GTK+ support for building GUI.]) GTK_CFLAGS="${GTK_CFLAGS} -DGDK_PIXBUF_DISABLE_DEPRECATED -DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED" AC_SUBST(GTK_CFLAGS) AC_SUBST(GTK_LIBS) fi else AC_MSG_RESULT(no) fi AM_CONDITIONAL([USE_GTK], [test x${ac_cv_enable_gui} = xyes]) dnl Try to locate valid 8051 assembler to generate test files (.hex) run_tests=no AC_CHECK_PROG(AS504_CHECK,as504,yes) if test x"$AS504_CHECK" = x"yes" ; then run_tests=yes dnl Check if as504 has been patched to support option -O: dnl See http://www.hugovil.com/repository/hvlinux/patches/as504-add-output-file-option.patch AS504HV_CHECK=no if as504 2>&1 | grep -q Ooutfile; then AS504HV_CHECK=yes fi fi AC_CHECK_PROG(ASEM51_CHECK,asem,yes) if test x"$ASEM51_CHECK" = x"yes" ; then run_tests=yes fi if test x"$run_tests" != x"yes" ; then AC_MSG_WARN([Please install as504 (http://www.vanwal.nl/as504/) or ASEM-51 (http://plit.de/asem-51) to run test suite.]) fi AM_CONDITIONAL([RUN_TESTS],[test x"$run_tests" = x"yes"]) AM_CONDITIONAL([USE_AS504HV],[test x"$AS504HV_CHECK" = x"yes"]) AM_CONDITIONAL([USE_AS504],[test x"$AS504_CHECK" = x"yes"]) AM_CONDITIONAL([USE_AS51],[test x"$ASEM51_CHECK" = x"yes"]) dnl zlib required for its crc32 function ac_have_zlib=no PKG_CHECK_MODULES([zlib], [zlib > 1.2.1], [AC_CHECK_LIB([z], [crc32], [ac_have_zlib=yes], [ac_have_zlib=no])]) if test x"$ac_have_zlib" = x"yes" ; then ZLIB_LIBS='-lz' AC_SUBST(ZLIB_LIBS) else AC_MSG_ERROR([Please install zlib and zlib-devel packages]) fi AC_SUBST(WARNINGCFLAGS) AC_SUBST(LIBS) AC_SUBST(ac_aux_dir) dnl Creating output file(s) AC_OUTPUT(Makefile src/common/Makefile src/cli/Makefile src/gtk/Makefile data/Makefile doc/Makefile tests/Makefile) emu8051-2.0.1/Makefile.am0000644000175400017500000000225112313352657011606 00000000000000## Makefile.am -- Process this file with automake to produce Makefile.in .PHONY: changelog AUTOMAKE_OPTIONS = gnu SUBDIRS = src/common src/cli src/gtk data doc tests ## We want these in the dist tarball EXTRA_DIST = pixmaps ACLOCAL = aclocal -I $(ac_aux_dir) CLEANFILES = *~ DISTCLEANFILES = .deps/*.P MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ stamp-h.in ChangeLog $(ac_aux_dir)/depcomp \ $(ac_aux_dir)/install-sh $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/compile \ $(ac_aux_dir)/test-driver \ $(ac_aux_dir)/ar-lib \ $(ac_aux_dir)/ylwrap changelog: @if test -d $(srcdir)/.git; then \ $(srcdir)/build-aux/gitlog-to-changelog \ --format='%s%n%n%b%n' \ --no-cluster \ --strip-tab \ --strip-cherry-pick \ >ChangeLog; \ fi emu8051-2.0.1/Makefile.in0000644000175400017500000006276012313352710011620 00000000000000# Makefile.in generated by automake 1.14 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2013 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : subdir = . DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \ $(top_srcdir)/configure $(am__configure_deps) \ $(srcdir)/config-h.in COPYING TODO build-aux/ar-lib \ build-aux/compile build-aux/install-sh build-aux/missing \ $(top_srcdir)/build-aux/ar-lib $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \ $(LISP)config-h.in # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = aclocal -I $(ac_aux_dir) AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AS504_CHECK = @AS504_CHECK@ ASEM51_CHECK = @ASEM51_CHECK@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GLIB_CFLAGS = @GLIB_CFLAGS@ GLIB_LIBS = @GLIB_LIBS@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LEXLIB = @LEXLIB@ LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ LIBOBJS = @LIBOBJS@ LIBREADLINE = @LIBREADLINE@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ RANLIB = @RANLIB@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ WARNINGCFLAGS = @WARNINGCFLAGS@ YACC = @YACC@ YFLAGS = @YFLAGS@ ZLIB_LIBS = @ZLIB_LIBS@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_aux_dir = @ac_aux_dir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build_alias = @build_alias@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host_alias = @host_alias@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ zlib_CFLAGS = @zlib_CFLAGS@ zlib_LIBS = @zlib_LIBS@ AUTOMAKE_OPTIONS = gnu SUBDIRS = src/common src/cli src/gtk data doc tests EXTRA_DIST = pixmaps CLEANFILES = *~ DISTCLEANFILES = .deps/*.P MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in \ stamp-h.in ChangeLog $(ac_aux_dir)/depcomp \ $(ac_aux_dir)/install-sh $(ac_aux_dir)/missing \ $(ac_aux_dir)/mkinstalldirs $(ac_aux_dir)/config.guess \ $(ac_aux_dir)/config.sub $(ac_aux_dir)/ltmain.sh \ $(ac_aux_dir)/compile \ $(ac_aux_dir)/test-driver \ $(ac_aux_dir)/ar-lib \ $(ac_aux_dir)/ylwrap all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): config.h: stamp-h1 @test -f $@ || rm -f stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1 stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config-h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) @case `sed 15q $(srcdir)/NEWS` in \ *"$(VERSION)"*) : ;; \ *) \ echo "NEWS not updated; not releasing" 1>&2; \ exit 1;; \ esac $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile config.h installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: .MAKE: $(am__recursive_targets) all install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \ uninstall-am .PHONY: changelog changelog: @if test -d $(srcdir)/.git; then \ $(srcdir)/build-aux/gitlog-to-changelog \ --format='%s%n%n%b%n' \ --no-cluster \ --strip-tab \ --strip-cherry-pick \ >ChangeLog; \ fi # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: emu8051-2.0.1/config-h.in0000644000175400017500000000356612313352707011602 00000000000000/* config-h.in. Generated from configure.ac by autoheader. */ /* Set to 1 to enable GTK+ support for building GUI. */ #undef HAVE_GTK /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define if you have libreadline */ #undef HAVE_LIBREADLINE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a `char[]'. */ #undef YYTEXT_POINTER /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `int' if does not define. */ #undef pid_t /* Define to `unsigned int' if does not define. */ #undef size_t emu8051-2.0.1/build-aux/0000755000175400017500000000000012313352717011521 500000000000000emu8051-2.0.1/build-aux/compile0000755000175400017500000001624512313352710013020 00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # Written by Tom Tromey . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: emu8051-2.0.1/build-aux/depcomp0000755000175400017500000005601612313352710013017 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2013 Free Software Foundation, Inc. # 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, see . # 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 Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: emu8051-2.0.1/build-aux/test-driver0000755000175400017500000000761112313352710013635 00000000000000#! /bin/sh # test-driver - basic testsuite driver script. scriptversion=2012-06-27.10; # UTC # Copyright (C) 2011-2013 Free Software Foundation, Inc. # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # Make unconditional expansion of undefined variables an error. This # helps a lot in preventing typo-related bugs. set -u usage_error () { echo "$0: $*" >&2 print_usage >&2 exit 2 } print_usage () { cat <$log_file 2>&1 estatus=$? if test $enable_hard_errors = no && test $estatus -eq 99; then estatus=1 fi case $estatus:$expect_failure in 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; 0:*) col=$grn res=PASS recheck=no gcopy=no;; 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; *:*) col=$red res=FAIL recheck=yes gcopy=yes;; esac # Report outcome to console. echo "${col}${res}${std}: $test_name" # Register the test result, and other relevant metadata. echo ":test-result: $res" > $trs_file echo ":global-test-result: $res" >> $trs_file echo ":recheck: $recheck" >> $trs_file echo ":copy-in-global-log: $gcopy" >> $trs_file # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: emu8051-2.0.1/build-aux/install-sh0000755000175400017500000003325512313352710013446 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2011-11-20.07; # 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 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac 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 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac 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 do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 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 problematic for 'test' and other utilities. 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 # 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-writable 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 X"$d" = X && 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: emu8051-2.0.1/build-aux/missing0000755000175400017500000001533112313352710013034 00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2012-06-26.16; # UTC # Copyright (C) 1996-2013 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # 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, see . # 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. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'automa4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # 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: emu8051-2.0.1/build-aux/ar-lib0000755000175400017500000001330212313352710012525 00000000000000#! /bin/sh # Wrapper for Microsoft lib.exe me=ar-lib scriptversion=2012-03-01.08; # UTC # Copyright (C) 2010-2013 Free Software Foundation, Inc. # Written by Peter Rosin . # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . # func_error message func_error () { echo "$me: $1" 1>&2 exit 1 } file_conv= # func_file_conv build_file # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv in mingw) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin) file=`cygpath -m "$file" || echo "$file"` ;; wine) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_at_file at_file operation archive # Iterate over all members in AT_FILE performing OPERATION on ARCHIVE # for each of them. # When interpreting the content of the @FILE, do NOT use func_file_conv, # since the user would need to supply preconverted file names to # binutils ar, at least for MinGW. func_at_file () { operation=$2 archive=$3 at_file_contents=`cat "$1"` eval set x "$at_file_contents" shift for member do $AR -NOLOGO $operation:"$member" "$archive" || exit $? done } case $1 in '') func_error "no command. Try '$0 --help' for more information." ;; -h | --h*) cat <. # # 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, see . # 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. # This file is maintained in Automake, please report # bugs to or send patches to # . get_dirname () { case $1 in */*|*\\*) printf '%s\n' "$1" | sed -e 's|\([\\/]\)[^\\/]*$|\1|';; # Otherwise, we want the empty string (not "."). esac } # guard FILE # ---------- # The CPP macro used to guard inclusion of FILE. guard () { printf '%s\n' "$1" \ | sed \ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/' \ -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ]/_/g' \ -e 's/__*/_/g' } # quote_for_sed [STRING] # ---------------------- # Return STRING (or stdin) quoted to be used as a sed pattern. quote_for_sed () { case $# in 0) cat;; 1) printf '%s\n' "$1";; esac \ | sed -e 's|[][\\.*]|\\&|g' } case "$1" in '') echo "$0: No files given. Try '$0 --help' for more information." 1>&2 exit 1 ;; --basedir) basedir=$2 shift 2 ;; -h|--h*) cat <<\EOF Usage: ylwrap [--help|--version] INPUT [OUTPUT DESIRED]... -- PROGRAM [ARGS]... Wrapper for lex/yacc invocations, renaming files as desired. INPUT is the input file OUTPUT is one file PROG generates DESIRED is the file we actually want instead of OUTPUT PROGRAM is program to run ARGS are passed to PROG Any number of OUTPUT,DESIRED pairs may be used. Report bugs to . EOF exit $? ;; -v|--v*) echo "ylwrap $scriptversion" exit $? ;; esac # The input. input=$1 shift # We'll later need for a correct munging of "#line" directives. input_sub_rx=`get_dirname "$input" | quote_for_sed` case $input in [\\/]* | ?:[\\/]*) # Absolute path; do nothing. ;; *) # Relative path. Make it absolute. input=`pwd`/$input ;; esac input_rx=`get_dirname "$input" | quote_for_sed` # Since DOS filename conventions don't allow two dots, # the DOS version of Bison writes out y_tab.c instead of y.tab.c # and y_tab.h instead of y.tab.h. Test to see if this is the case. y_tab_nodot=false if test -f y_tab.c || test -f y_tab.h; then y_tab_nodot=true fi # The parser itself, the first file, is the destination of the .y.c # rule in the Makefile. parser=$1 # A sed program to s/FROM/TO/g for all the FROM/TO so that, for # instance, we rename #include "y.tab.h" into #include "parse.h" # during the conversion from y.tab.c to parse.c. sed_fix_filenames= # Also rename header guards, as Bison 2.7 for instance uses its header # guard in its implementation file. sed_fix_header_guards= while test $# -ne 0; do if test x"$1" = x"--"; then shift break fi from=$1 # Handle y_tab.c and y_tab.h output by DOS if $y_tab_nodot; then case $from in "y.tab.c") from=y_tab.c;; "y.tab.h") from=y_tab.h;; esac fi shift to=$1 shift sed_fix_filenames="${sed_fix_filenames}s|"`quote_for_sed "$from"`"|$to|g;" sed_fix_header_guards="${sed_fix_header_guards}s|"`guard "$from"`"|"`guard "$to"`"|g;" done # The program to run. prog=$1 shift # Make any relative path in $prog absolute. case $prog in [\\/]* | ?:[\\/]*) ;; *[\\/]*) prog=`pwd`/$prog ;; esac dirname=ylwrap$$ do_exit="cd '`pwd`' && rm -rf $dirname > /dev/null 2>&1;"' (exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 mkdir $dirname || exit 1 cd $dirname case $# in 0) "$prog" "$input" ;; *) "$prog" "$@" "$input" ;; esac ret=$? if test $ret -eq 0; then for from in * do to=`printf '%s\n' "$from" | sed "$sed_fix_filenames"` if test -f "$from"; then # If $2 is an absolute path name, then just use that, # otherwise prepend '../'. case $to in [\\/]* | ?:[\\/]*) target=$to;; *) target=../$to;; esac # Do not overwrite unchanged header files to avoid useless # recompilations. Always update the parser itself: it is the # destination of the .y.c rule in the Makefile. Divert the # output of all other files to a temporary file so we can # compare them to existing versions. if test $from != $parser; then realtarget=$target target=tmp-`printf '%s\n' "$target" | sed 's|.*[\\/]||g'` fi # Munge "#line" or "#" directives. Don't let the resulting # debug information point at an absolute srcdir. Use the real # output file name, not yy.lex.c for instance. Adjust the # include guards too. sed -e "/^#/!b" \ -e "s|$input_rx|$input_sub_rx|" \ -e "$sed_fix_filenames" \ -e "$sed_fix_header_guards" \ "$from" >"$target" || ret=$? # Check whether files must be updated. if test "$from" != "$parser"; then if test -f "$realtarget" && cmp -s "$realtarget" "$target"; then echo "$to is unchanged" rm -f "$target" else echo "updating $to" mv -f "$target" "$realtarget" fi fi else # A missing file is only an error for the parser. This is a # blatant hack to let us support using "yacc -d". If -d is not # specified, don't fail when the header file is "missing". if test "$from" = "$parser"; then ret=1 fi fi done fi # Remove the directory. cd .. rm -rf $dirname exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # 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: emu8051-2.0.1/AUTHORS0000644000175400017500000000043312313352657010622 00000000000000Original authors of emu8051: Hugo Villeneuve Jonathan St-André Pascal Fecteau Jimmy Ringuette Actual maintainer: Hugo Villeneuve Debian package maintainer: Bhavani Shankar Additional contributors / bugs fixing: Anthony Liu Pierre Ferrari Tobias Diedrich emu8051-2.0.1/INSTALL0000644000175400017500000002202412313352657010603 00000000000000Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. This file is free documentation; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. 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, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). It can also use an optional file (typically called `config.cache' and enabled with `--cache-file=config.cache' or simply `-C') that saves the results of its tests to speed up reconfiguring. (Caching is disabled by default to prevent problems with accidental use of stale cache files.) 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 you are using the cache, and at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.ac' (or `configure.in') is used to create `configure' by a program called `autoconf'. You only need `configure.ac' 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. Run `./configure --help' for details on some of the pertinent environment variables. You can give `configure' initial values for configuration parameters by setting variables in the command line or in the environment. Here is an example: ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix *Note Defining Variables::, for more details. 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 support 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' cannot figure out automatically, but needs to determine by the type of machine the package will run on. Usually, assuming the package is built to be run on the _same_ architectures, `configure' can figure that out, but if it prints a message saying it cannot guess the machine type, give it the `--build=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name which has the form: CPU-COMPANY-SYSTEM where SYSTEM can have one of these forms: OS KERNEL-OS 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 machine type. If you are _building_ compiler tools for cross-compiling, you should use the `--target=TYPE' option to select the type of system they will produce code for. If you want to _use_ a cross compiler, that generates code for a platform different from the build platform, you should specify the "host" platform (i.e., that on which the generated programs will eventually be run) with `--host=TYPE'. 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. Defining Variables ================== Variables not defined in a site shell script can be set in the environment passed to `configure'. However, some packages may run configure again during the build, and the customized values of these variables may be lost. In order to avoid this problem, you should set them in the `configure' command line, using `VAR=value'. For example: ./configure CC=/usr/local2/bin/gcc will cause the specified gcc to be used as the C compiler (unless it is overridden in the site shell script). `configure' Invocation ====================== `configure' recognizes the following options to control how it operates. `--help' `-h' Print a summary of the options to `configure', and exit. `--version' `-V' Print the version of Autoconf used to generate the `configure' script, and exit. `--cache-file=FILE' Enable the cache: use and save the results of the tests in FILE, traditionally `config.cache'. FILE defaults to `/dev/null' to disable caching. `--config-cache' `-C' Alias for `--cache-file=config.cache'. `--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. `configure' also accepts some other, not widely useful, options. Run `configure --help' for more details. emu8051-2.0.1/pixmaps/0000755000175400017500000000000012313352657011313 500000000000000emu8051-2.0.1/pixmaps/run.xpm0000644000175400017500000000505512313352657012572 00000000000000/* XPM */ static char * run_xpm[] = { "48 48 4 1", " c None", ". c #000000", "+ c #008C6B", "@ c #FFFFFF", " ........... ", " ................... ", " ........+++++++........ ", " ......+++++++++++++++...... ", " .....+++++++++++++++++++..... ", " .....+++++++++++++++++++++++..... ", " .....+++++++++++++++++++++++++..... ", " ....+++++++++++++++++++++++++++++.... ", " ...+++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++... ", " ....+++++++++++++++++++++++++++++++++.... ", " ...+++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++++... ", " ..+++++++++++++++++++++++++++++++++++++++++.. ", " ..++++++++@@@@@@@++@@++++@@+@@++++@@+++++++.. ", "...++++++++@@@@@@@@+@@++++@@+@@@+++@@+++++++... ", "...++++++++@@++++@@+@@++++@@+@@@+++@@+++++++... ", "..+++++++++@@++++@@+@@++++@@+@@@@++@@++++++++.. ", "..+++++++++@@++++@@+@@++++@@+@@@@++@@++++++++.. ", "..+++++++++@@++++@@+@@++++@@+@@+@@+@@++++++++.. ", "..+++++++++@@@@@@@++@@++++@@+@@+@@+@@++++++++.. ", "..+++++++++@@@@@@@++@@++++@@+@@++@@@@++++++++.. ", "..+++++++++@@++++@@+@@++++@@+@@++@@@@++++++++.. ", "..+++++++++@@++++@@+@@++++@@+@@+++@@@++++++++.. ", "...++++++++@@++++@@+@@@@@@@@+@@+++@@@+++++++... ", "...++++++++@@++++@@++@@@@@@++@@++++@@+++++++... ", " ..+++++++++++++++++++++++++++++++++++++++++.. ", " ..+++++++++++++++++++++++++++++++++++++++++.. ", " ...+++++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++++++... ", " ....+++++++++++++++++++++++++++++++++.... ", " ...+++++++++++++++++++++++++++++++++... ", " ...+++++++++++++++++++++++++++++++... ", " ....+++++++++++++++++++++++++++++.... ", " .....+++++++++++++++++++++++++..... ", " .....+++++++++++++++++++++++..... ", " .....+++++++++++++++++++..... ", " ......+++++++++++++++...... ", " ........+++++++........ ", " ................... ", " ........... ", " "}; emu8051-2.0.1/pixmaps/reset.xpm0000644000175400017500000000504012313352657013102 00000000000000/* XPM */ static char * reset_xpm[] = { "48 48 3 1", " c None", ". c #005A9C", "+ c #FFFFFF", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "..+++++++..++++++++..+++++++.++++++++.++++++++..", "..++++++++.++++++++.++++++++.++++++++.++++++++..", "..++....++.++.......++.......++..........++.....", "..++....++.++.......++.......++..........++.....", "..++....++.++.......++.......++..........++.....", "..++....++.+++++++..+++++++..+++++++.....++.....", "..+++++++..+++++++...+++++++.+++++++.....++.....", "..+++++++..++.............++.++..........++.....", "..++....++.++.............++.++..........++.....", "..++....++.++.............++.++..........++.....", "..++....++.++++++++.++++++++.++++++++....++.....", "..++....++.++++++++.+++++++..++++++++....++.....", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................", "................................................"}; emu8051-2.0.1/pixmaps/step.xpm0000644000175400017500000000507512313352657012743 00000000000000/* XPM */ static char * step_xpm[] = { "48 48 5 1", " c None", ". c #FFDE08", "+ c #000000", "@ c #FFFFFF", "# c #080800", "..........++++++++++++............++++++++++++..", "...........++++++++++++............++++++++++++.", "............++++++++++++............++++++++++++", "+............++++++++++++............+++++++++++", "++............++++++++++++............++++++++++", "+++............++++++++++++............+++++++++", "++++............++++++++++++............++++++++", "+++++............++++++++++++............+++++++", "++++++............++++++++++++............++++++", "+++++++............++++++++++++............+++++", "++++++++............++++++++++++............++++", "+++++++++............++++++++++++............+++", "++++++++++............++++++++++++............++", "+++++++++++............++++++++++++............+", "++++++++++++............++++++++++++............", ".++++++++++++++++++++++++++++++++++++++++++++...", "..+++++++++++++++++++++++++++++++++++++++++++...", "...++++++++++++++++++++++++++++++++++++++++++...", "....++++@@@@@@@+@@@@@@@@+@@@@@@@@+@@@@@@@++++...", "....+++@@@@@@@@+@@@@@@@@+@@@@@@@@+@@@@@@@@+++...", "....+++@@++++++++++@@++++@@+++++++@@++++@@+++...", "....+++@@++++++++++@@++++@@+++++++@@++++@@+++...", "....+++@@++++++++++@@++++@@+++++++@@++++@@+++...", "....+++@@@@@@@+++++@@++++@@@@@@@++@@++++@@+++...", "....++++@@@@@@@++++@@++++@@@@@@@++@@@@@@@@++++..", "....+++++++++@@++++@@++++@@+++++++@@@@@@@++++++.", "....+++++++++@@++++@@++++@@+++++++@@++++++++++++", "+...+++++++++@@++++@@++++@@+++++++@@++++++++++++", "++..+++@@@@@@@@++++@@++++@@@@@@@@+@@++++++++++++", "+++.+++@@@@@@@+++++@@++++@@@@@@@@+@@++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++", "++++++++++++++++++++++++++++++++++++++++++++++++", "+++++++............++++++++++++............+++++", "++++++++............++++++++++++............++++", "+++++++++............+#++++++++++............+++", "++++++++++............++++++++++++............++", "#++++++++++............++++++++++++............+", "++++++++++++............++++++++++++............", ".+#++++++++++............+#++++++++++...........", "..++++++++++++............+#++++++++++..........", "...++++++++++++............++++++++++++.........", "....++++++++++++............++++++++++++........", ".....+#++++++++++............+#++++++++++.......", "......++++++++++++............++++++++++++......", ".......++++++++++++............++++++++++++.....", "........+#++++++++++............++++++++++++....", ".........++++++++++++............+#++++++++++..."}; emu8051-2.0.1/pixmaps/stop.xpm0000644000175400017500000000505612313352657012754 00000000000000/* XPM */ static char * stop_xpm[] = { "48 48 4 1", " c None", ". c #000000", "+ c #C60021", "@ c #FFFFFF", " .................... ", " .++++++++++++++++++++. ", " .++@@@@@@@@@@@@@@@@@@++. ", " .++@@++++++++++++++++@@++. ", " .++@@++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++++++++@@++. ", ".++@@++++++++++++++++++++++++++++++++++++++@@++.", ".+@@++++++++++++++++++++++++++++++++++++++++@@+.", ".+@++++++++++++++++++++++++++++++++++++++++++@+.", ".+@++++++++++++++++++++++++++++++++++++++++++@+.", ".+@+++++@@@@@@@+@@@@@@@@++@@@@@@++@@@@@@@++++@+.", ".+@++++@@@@@@@@+@@@@@@@@++@@@@@@++@@@@@@@@+++@+.", ".+@++++@@++++++++++@@++++@@@++@@@+@@++++@@+++@+.", ".+@++++@@++++++++++@@++++@@++++@@+@@++++@@+++@+.", ".+@++++@@++++++++++@@++++@@++++@@+@@++++@@+++@+.", ".+@++++@@@@@@@+++++@@++++@@++++@@+@@++++@@+++@+.", ".+@+++++@@@@@@@++++@@++++@@++++@@+@@@@@@@@+++@+.", ".+@++++++++++@@++++@@++++@@++++@@+@@@@@@@++++@+.", ".+@++++++++++@@++++@@++++@@++++@@+@@+++++++++@+.", ".+@++++++++++@@++++@@++++@@@++@@@+@@+++++++++@+.", ".+@++++@@@@@@@@++++@@+++++@@@@@@++@@+++++++++@+.", ".+@++++@@@@@@@+++++@@+++++@@@@@@++@@+++++++++@+.", ".+@++++++++++++++++++++++++++++++++++++++++++@+.", ".+@++++++++++++++++++++++++++++++++++++++++++@+.", ".+@@++++++++++++++++++++++++++++++++++++++++@@+.", ".++@@++++++++++++++++++++++++++++++++++++++@@++.", " .++@@++++++++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++++@@++. ", " .++@@++++++++++++++++++@@++. ", " .++@@++++++++++++++++@@++. ", " .++@@@@@@@@@@@@@@@@@@@+. ", " .++++++++++++++++++++. ", " .................... "}; emu8051-2.0.1/ChangeLog0000644000175400017500000007023012313352715011321 000000000000002014-03-22 Hugo Villeneuve emu8051 2.0.1 2014-03-16 Hugo Villeneuve Convert manpage to UTF-8 2014-02-17 Hugo Villeneuve Add tests for CLI version commands 2014-02-17 Hugo Villeneuve Do not display registers at CLI version startup This is to help testing the "dr" command, to be able to match default register values. 2014-02-16 Hugo Villeneuve Add proper error checking in asciihex2int functions 2014-02-15 Hugo Villeneuve Dont exit in case of hexfile reading failure 2014-02-15 Hugo Villeneuve Replace disam.h with opcodes{h,c} Also rename opcode2c.pl -> opcodes2c.pl 2014-02-15 Hugo Villeneuve Fix comment after cleanup 2014-02-15 Hugo Villeneuve Fix splint warnings 2014-02-15 Hugo Villeneuve Fix C99 standard types uintN_t 2014-02-13 Hugo Villeneuve Remove unused header file includes 2014-02-13 Hugo Villeneuve Fix test script to work in external build directory 2014-02-13 Hugo Villeneuve Shorten memory_ functions prefix to mem_ in memory.c 2014-02-13 Hugo Villeneuve Fix checkpatch warnings 2014-02-13 Hugo Villeneuve Move memory read functions to memory.c Fix warnings given by checkpatch.pl 2014-02-13 Hugo Villeneuve Fix auto-generated C source files indentation 2014-02-13 Hugo Villeneuve Remove unnecessary column in opcodes.lst Begin to cleanup Perl code 2014-02-13 Hugo Villeneuve Remove duplicate code for disassembly 2014-02-13 Hugo Villeneuve Fix checkpatch warnings 2014-02-13 Hugo Villeneuve Shorten GPLv2 licence text in header of each source file 2014-02-13 Hugo Villeneuve Add up to 4 emulator timers 2014-02-13 Hugo Villeneuve Rename DumpMem function -> memory_dump 2014-02-13 Hugo Villeneuve Add more error checking for CLI version arguments 2014-02-13 Hugo Villeneuve Cleanup help menu 2014-02-13 Hugo Villeneuve Add support for GNU readline readline input is fed into Lex. This adds commands history. There is also a configure option to disable readline support. 2014-02-13 Hugo Villeneuve Rename CLI and GUI versions main source files 2014-02-13 Hugo Villeneuve Allow hex numbers to begin with 0x or $ prefix in scanner 2014-02-13 Hugo Villeneuve Allow to set all SFR registers in CLI version 2014-02-13 Hugo Villeneuve Add new value range check when writing register in CLI version The GUI version also had this check, so the functionality has been merged. 2014-02-13 Hugo Villeneuve Convert CLI version input parsing to Lex/Yacc Some error checking is still missing, but all commands seem to be working correctly. Update CLI help menu. 2014-02-06 Hugo Villeneuve Remove address parameter from RUN and TRACE CLI commands Also automatically display register contents after each RUN operation. 2014-01-26 Hugo Villeneuve Add general-purpose timer to CLI Also add command to reset it. 2014-01-26 Hugo Villeneuve Add better error checking when loading invalid hex files Also replaced custom error message box with standard one. 2014-01-26 Hugo Villeneuve Refactor hex loading code Merged two identical code portions that validated the checksum. Also added better debug messages. 2014-01-26 Hugo Villeneuve Allow EM command to be specified without arguments In this case, program will run from the current PC address until a breakpoint is reached. 2014-01-26 Hugo Villeneuve Move macro definition to top of file 2014-01-26 Hugo Villeneuve Use log functions to display errors 2014-01-26 Hugo Villeneuve Fix error when specifying start address in CLI version Start address was specified as "0x0000", but need to be "0000". 2014-01-26 Hugo Villeneuve Add square root regression test 2014-01-25 Hugo Villeneuve Return error for test files without any validation condition 2014-01-25 Hugo Villeneuve Do not display eror message when simply pressing return in CLI version Before was displaying message "Syntax error". 2014-01-25 Hugo Villeneuve Add general-purpose timer to GUI This timer is not part of the 8051 hardware. It is a free running timer/counter added as a mean to quickly measure delays in instruction cyles. For now, it is implemented only in GUI version. 2014-01-23 Hugo Villeneuve Add documentation about regression testing 2014-01-23 Hugo Villeneuve Remove display of command line options in GUI mode The information message was manually edited, which creates synchronization problems now that we are using argp to manage our options. 2014-01-23 Hugo Villeneuve Simplify options parsing code 2014-01-23 Hugo Villeneuve emu8051 2.0.0 2014-01-23 Hugo Villeneuve Remove dynamic update of GUI layout The application must restarted for the changes to take effect. Added a message for telling this to the user. 2014-01-23 Hugo Villeneuve Improve view/hide of memory windows Do not restart whole GUI, just update vpaned containing the two memory scroll windows. 2014-01-22 Hugo Villeneuve Remove deprecated view->sfr-window option 2014-01-22 Hugo Villeneuve Fix error when toggling memory display viewing on/off Only the first two rows were displayed. The crc_init variable was not handled correctly. 2014-01-14 Hugo Villeneuve Remove autogen.sh from distribution tarball 2014-01-14 Hugo Villeneuve ChangeLog is now automatically generated from git log output 2014-01-14 Hugo Villeneuve Fix compilation warning 2014-01-14 Hugo Villeneuve Refactor memwin.c for internal and external memories 2014-01-13 Hugo Villeneuve Change confusing variable name bits_per_row to bytes_per_row 2014-01-13 Hugo Villeneuve Improve performance of GUI step operations Use CRC to detect which memory rows have changed. This is only to improve GUI performance when using stepping mode, as we then only update rows which have been modified. 2014-01-13 Hugo Villeneuve Set external memory size default to 256 2014-01-11 Hugo Villeneuve Set program memory size default to 65536 Before was set to 8192. To make sure to not cause problems with bigger programs, or with small programs that are split accross large memory regions. 2014-01-11 Hugo Villeneuve Create common function for running instructions 2014-01-03 Hugo Villeneuve Fix warning for ignored return value for getline() 2014-01-03 Hugo Villeneuve Fix [-Wsign-compare] warnings Original warning message: emuconsole.c:45:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] 2014-01-03 Hugo Villeneuve Merge ADD and ADDC operations into common function 2014-01-03 Hugo Villeneuve Fix code indentation 2014-01-03 Hugo Villeneuve Fix error with ADDC instruction The carry flag was not added to the result. 2014-01-03 Hugo Villeneuve Add tests for ADD and ADDC instructions 2014-01-03 Hugo Villeneuve Fix [-Wformat-security] warning Original warning message: emuconsole.c:316:3: warning: format not a string literal and no format arguments [-Wformat-security] 2014-01-03 Hugo Villeneuve Fix warnings about unused function parameters 2014-01-03 Hugo Villeneuve Fix [-Wmissing-field-initializers] warnings 2014-01-03 Hugo Villeneuve Fix regression with ADDC instruction Introduced when refactoring code with psw_set_ov() function. 2014-01-03 Hugo Villeneuve Add additional compile warning flags Also changed way that warning flags are defined in autoconf files. 2013-12-10 Hugo Villeneuve Move git ignore file list to build-aux 2013-12-10 Hugo Villeneuve Remove configure cache directory after running autoreconf 2013-12-07 Hugo Villeneuve Separate cli and gtk sources into separate directories Also added a common directory to hold common files to both interfaces, and compiled into a static library. 2013-12-07 Hugo Villeneuve Remove obsolescent macro AM_PROG_CC_C_O 2013-12-06 Anthony Liu Improve interrupt trigger code readability 2013-12-05 Anthony Liu Fix bug when processing interrupts Push current PC onto stack and take vector address from parameter. 2013-12-02 Hugo Villeneuve Add support for as504 assembler, with output file option Patch is available here: http://www.hugovil.com/repository/hvlinux/patches/as504-add-output-file-option.patch This patch is usefull because it fixes a bug when testing the distribution in a separate build directory like when using: make distcheck configure.ac automatically detects if as504 supports the option. 2013-12-02 Hugo Villeneuve Add support for as504 assembler 2013-12-01 Hugo Villeneuve Fix bug when using separate build directory to create symbolic link 2013-12-01 Hugo Villeneuve Replace CALL by LCALL for compatibility with AS31 and AS504 assemblers 2013-12-01 Hugo Villeneuve Remove CSEG directive for compatibility with AS31 and AS504 assemblers 2013-12-01 Hugo Villeneuve Remove currently unsupported option to set iram size 2013-12-01 Hugo Villeneuve Fix CPPFLAGS for each target (CLI and GTK) 2013-12-01 Hugo Villeneuve Change way tests are enabled/disabled by asem presence 2013-12-01 Hugo Villeneuve Run each test separately from single shell script Each new test is simply a link to opcodes.sh, generatated automatically. 2013-12-01 Hugo Villeneuve Move timer functions to timers.c 2013-12-01 Hugo Villeneuve Add tests for timers mode 2 2013-12-01 Hugo Villeneuve Change test output expected string layout Also check stack pointer value for all tests 2013-12-01 Hugo Villeneuve Add tests for timers mode 0 2013-12-01 Hugo Villeneuve Fix bug with timers mode 0 (8 bits with 5-bit prescaler) 2013-12-01 Hugo Villeneuve Add tests for timers mode 1 2013-12-01 Hugo Villeneuve Fix error with timer1 being written to timer0 2013-12-01 Hugo Villeneuve Add PC check for all tests 2013-12-01 Hugo Villeneuve Add tests for MOV instruction 2013-12-01 Hugo Villeneuve Add tests for DIV instruction 2013-12-01 Hugo Villeneuve Add tests for ANL instruction 2013-12-01 Hugo Villeneuve Add tests for ORL instruction 2013-12-01 Hugo Villeneuve Add framework for regression testing 2013-12-01 Hugo Villeneuve Automatic generation of test hex files 2013-12-01 Hugo Villeneuve Add tests for MUL instructions 2013-12-01 Hugo Villeneuve Remove hex files 2013-12-01 Hugo Villeneuve Rename test-files directory -> tests 2013-12-01 Hugo Villeneuve Add automake options -Wall and gnu std-options Remove configure verbose output 2013-12-01 Hugo Villeneuve Remove superfluous bytes in program disassembly Sometimes, B1 and B2 were showing old values from previous disassembly. Now explicitly remove them for each disassembly line. 2013-12-01 Hugo Villeneuve Fix code indentation 2013-12-01 Hugo Villeneuve Prevent dissassembling instructions past last address 2013-12-01 Hugo Villeneuve Add ignore files to gitignore 2013-12-01 Hugo Villeneuve Fix syntax error in comments 2013-12-01 Hugo Villeneuve Fix error with EM command in CLI mode Address parameter was not handled correctly. 2013-12-01 Hugo Villeneuve CLI version: Add to display help menu 2013-12-01 Hugo Villeneuve Reintroduce PSW in list of displayed registers (for regression tests) 2013-12-01 Hugo Villeneuve Display SFR registers one per line in automatic run mode 2013-12-01 Hugo Villeneuve Move SFR read/write functions to new file sfr.c 2013-12-01 Hugo Villeneuve Add option to automatically run and stop CLI emulator 2013-12-01 Hugo Villeneuve Replace printf statements with log functions 2013-12-01 Hugo Villeneuve Move variable declaration before statements 2013-12-01 Hugo Villeneuve Display filename in case of HEX file load error 2013-11-22 Hugo Villeneuve Zero all memories when initializing program This is especially usefull to have NOP in program memory. 2013-11-22 Hugo Villeneuve Add grid lines to PSW window 2013-11-21 Hugo Villeneuve Add PSW sub window 2013-11-21 Hugo Villeneuve Use macro to set name of sub window 2013-11-21 Hugo Villeneuve Change scope of local variable to static 2013-11-21 Hugo Villeneuve Add option to display bool hex character 2013-11-21 Hugo Villeneuve Add PSW generic bit write/read functions 2013-11-17 Hugo Villeneuve Add parity bit update each instruction cycle 2013-11-17 Hugo Villeneuve Add function to read 16-bit address/offset/value from pgm memory 2013-11-17 Hugo Villeneuve Fix bug with MOV DPTR,#data16 instruction Source variable was 8 bits instead of 16 bits. 2013-11-17 Hugo Villeneuve Remove unused destination adressing mode #data16 Even if it is required, the destination variable is only 8-bits, so this would have been a potential bug. 2013-11-17 Hugo Villeneuve Make MUL and DIV use generic source/destination variables To remove confusing commented code and compilation warning 2013-11-17 Hugo Villeneuve Refactor perl code to write C source code line 2013-11-17 Hugo Villeneuve Refactor perl code to write file header 2013-11-17 Hugo Villeneuve Add overflow and auxiliary carry flags manipulation functions 2013-11-17 Hugo Villeneuve Simplify carry bit set/clr functions 2013-11-17 Hugo Villeneuve Add carry bit definitions 2013-11-17 Hugo Villeneuve Move PSW bit manipulation functions to psw.c 2013-11-17 Hugo Villeneuve Add carry flag manipulation functions 2013-11-17 Hugo Villeneuve Add stack push/pop functions 2013-11-17 Hugo Villeneuve Add DPTR read/write functions 2013-11-17 Hugo Villeneuve Add comment about reset value of stack pointer 2013-11-17 Hugo Villeneuve Fix error with ADD instruction and AC bit The overflow bit was written instead of the auxiliary carry bit. 2013-11-17 Hugo Villeneuve Fix bug with ANL instruction 2013-11-17 Hugo Villeneuve Fix bug with ORL instruction 2013-11-05 Hugo Villeneuve Fix error with JMP @A,DPTR instruction The resulting jump address is simply the sum of the values in the accumulator and the DPTR registers, not the indirect read of that sum. Error reported and fixed by Anthony (antliu at gmail.com). 2013-11-05 Hugo Villeneuve Fix error with RETI instruction The stack pointer was not updated correctly. Error reported and fixed by Anthony (antliu at gmail.com). 2013-11-05 Hugo Villeneuve Add view menu option to view/hide SFR memory dump window 2013-11-05 Hugo Villeneuve Add support to view/hide SFR memory dump window in config file 2013-11-05 Hugo Villeneuve Update TODO 2013-11-05 Hugo Villeneuve Refactor code to create memory windows 2013-11-05 Hugo Villeneuve Refactor log functions 2013-11-05 Hugo Villeneuve Add option to specify maximum pgm memory size 2013-11-05 Hugo Villeneuve Refactor code to read/write different memory types Dynamic memory buffers allocation depending on sizes specified with command-line options. Add future support for separate IRAM and SFR buffers. 2013-11-05 Hugo Villeneuve Rename macros for maximum memory sizes 2013-11-05 Hugo Villeneuve Limit default external memory size to 1024 bytes Emulator is running very slow if external memory is at its maximum of 64K. 2013-11-05 Hugo Villeneuve Fix syntax error in comment 2013-11-05 Hugo Villeneuve Do not reset emulator on file load (no ram clear) Reset only when loading first file at application startup. 2013-11-05 Hugo Villeneuve Add Timers 0 and 1 to SFR window 2013-11-05 Hugo Villeneuve Add option to specify maximum memory sizes 2013-11-05 Hugo Villeneuve Add view menu option to enable/disable IRAM/XRAM windows 2013-11-05 Hugo Villeneuve Add view menu option for selecting bits per row (8/16) 2013-11-05 Hugo Villeneuve Add support for bits per row in config file Also add support for viewing internal and external memory windows in config file. These 3 new variables are not yet connected (TODO). 2013-11-05 Hugo Villeneuve Add live option to change windows layout Restart UI when changing layout. This is working, altough the main window temporarily disapear in doing so. 2013-11-05 Hugo Villeneuve Use fixed font for ASCII column 2013-11-05 Hugo Villeneuve Align memory data columns text on left side 2013-11-05 Hugo Villeneuve Adjust memory index column header according to number of data columns 2013-11-05 Hugo Villeneuve Harmonize windows refresh function names 2013-11-05 Hugo Villeneuve Save vpane position for memory windows 2013-11-05 Hugo Villeneuve Add external memory window vpaned_mem 2013-11-05 Hugo Villeneuve Convert memwin to display internal or external memory 2013-11-05 Hugo Villeneuve Use single function to refresh all windows Use emugtk_UpdateDisplay() to replace individual calls to these functions: regwin_Show(); memwin_DumpD(); pgmwin_Disasm(); 2013-11-05 Hugo Villeneuve Code cleanup (tree view store init) 2013-11-05 Hugo Villeneuve Increase dissassembled instructions lines from 24 to 100 2013-11-05 Hugo Villeneuve Add red color for current instruction in pgmwin 2013-11-05 Hugo Villeneuve Refresh pgmwin after modifying regwin (PC) 2013-11-05 Hugo Villeneuve Add offset address to memwin dump header 2013-11-05 Hugo Villeneuve Remove address parameter when dumping memwin 2013-11-05 Hugo Villeneuve Refactor code for memwin and pgmwin modify Add common functions int2asciihex and asciihex2int 2013-11-05 Hugo Villeneuve Registers window can now be edited 2013-11-05 Hugo Villeneuve Refresh register window after any memory modification Banked registers R0 to R7 depend on internal memory content. 2013-11-05 Hugo Villeneuve Memory window can now be edited 2013-11-05 Hugo Villeneuve Replace macro EMU8051_DEBUG with logging functions 2013-11-05 Hugo Villeneuve Replace custom command-line options processing with argp 2013-11-05 Hugo Villeneuve Add debug log functions 2013-11-05 Hugo Villeneuve Replace custom help->about dialog with gtk_show_about_dialog 2013-11-05 Hugo Villeneuve Add web site url and bug report email to AC_INIT 2013-10-09 Hugo Villeneuve Act as if reset was pressed if no hex file is specified at startup 2013-10-09 Hugo Villeneuve Replace GTK deprecated functions gtk_signal_connect_object -> g_signal_connect gtk_menu_bar_append -> gtk_menu_shell_append Also simplified ShowMessage function. 2013-10-09 Hugo Villeneuve Replace deprecated gtk_clist (pgmwin) 2013-10-09 Hugo Villeneuve Replace deprecated gtk_clist (regwin) 2013-10-09 Hugo Villeneuve Add title to memory window 2013-10-09 Hugo Villeneuve Refactor memory window ASCII display code section 2013-10-09 Hugo Villeneuve Refactor memory window code section 2013-10-09 Hugo Villeneuve Replace deprecated gtk_clist (memwin) 2013-10-09 Hugo Villeneuve Replace autogen custom commands with autoreconf 2013-10-09 Hugo Villeneuve Rename config to build-aux 2013-10-09 Hugo Villeneuve Remove unused configure option --enable-debug 2013-10-09 Hugo Villeneuve Remove unused/commented code 2013-10-09 Hugo Villeneuve Remove superfluous function call gtk_widget_show_all() when creating menu 2013-10-09 Hugo Villeneuve Remove superfluous function WindowDestroyEvent 2013-10-09 Hugo Villeneuve Fix bug with children not resizing with main window 2013-10-09 Hugo Villeneuve Add Gtk windows diagram Rename main_vbox -> vbox. 2013-10-09 Hugo Villeneuve Add example configuration file 2013-10-09 Hugo Villeneuve Save paned positions and main window size to config file 2013-10-09 Hugo Villeneuve Add support for saving UI settings to config file 2013-10-01 Hugo Villeneuve Rename fixed_frame variable to scrollwin 2013-10-01 Hugo Villeneuve Add vpaned to separate memory dump window 2013-10-01 Hugo Villeneuve Add hpaned to separate pgm and disassembly windows 2013-10-01 Hugo Villeneuve Remove obsolete gtksizes.h 2013-09-30 Hugo Villeneuve Eliminate all fixed size windows 2013-09-30 Hugo Villeneuve Allow frames to expand and fill inside vbox and hbox 2013-09-30 Hugo Villeneuve Remove fixed frame containing the 3 major windows 2013-09-30 Hugo Villeneuve Replace fixed frames with scrollable windows Done for program, register and memory dump windows. 2013-09-30 Hugo Villeneuve Replace deprecated gtk_widget_set_usize() 2013-09-30 Hugo Villeneuve Replace deprecated gtk_menu_append() 2013-09-30 Hugo Villeneuve Replace deprecated gtk_signal_connect() 2013-09-30 Hugo Villeneuve Increase spacing between buttons 2013-09-30 Hugo Villeneuve Replace deprecated functions for displaying pixmap buttons 2013-09-08 Hugo Villeneuve Replace gtk_idle functions with g_idle equivalents 2013-09-08 Hugo Villeneuve Activate gtk deprecated compilation flags 2013-09-08 Hugo Villeneuve Remember previous opened directory in file selection dialog 2013-09-08 Hugo Villeneuve Use current working directory for initial file selection dialog 2013-09-08 Hugo Villeneuve Replace gtk_file_selection dialog with gtk_file_chooser Increase minimum gtk version to 2.4.0. 2013-09-08 Hugo Villeneuve Release v1.1.2 2013-09-08 Hugo Villeneuve Fix compiler warning (and potential bug) in auto-generated 8051 instructions Original warning: warning: operation on ‘cpu8051.pc’ may be undefined [-Wsequence-point] 2013-09-08 Hugo Villeneuve Fix compiler warning about unused variable set by getline() 2013-09-08 Hugo Villeneuve Fix compiler warning about unused variable set by getch() 2013-09-08 Hugo Villeneuve Fix error with CJNE instruction When the comparison was true, the PC was advanced by 2 instead of 3 bytes. Error reported and fixed by Tobias Diedrich (ranma at tdiedrich.de). 2013-09-08 Hugo Villeneuve Add test file for CJNE bug 2013-09-08 Hugo Villeneuve Remove obsolete comment about older c++ code 2013-09-08 Hugo Villeneuve Fix trailing whitespace 2013-09-08 Hugo Villeneuve Create two separate executables, emu8051-cli (default) and emu8051-gtk emu8051-gtk is optional and compiled only if Gtk+ is detected. Add optional size parameter when dumping memory. 2013-09-08 Hugo Villeneuve Add display of address in case of error 2013-09-08 Hugo Villeneuve Fix error with SJMP instruction Error reported and fixed by Pierre Ferrari (piferr4ri at gmail.com). 2013-09-08 Hugo Villeneuve Improve window sizing Based on suggestions from Pierre Ferrari (piferr4ri at gmail.com). 2013-09-08 Hugo Villeneuve Remove unnecessary autoconf checks Disable debug message when not compiled in debug mode. 2013-09-08 Hugo Villeneuve Fix syntax errors in ascii to int conversion 2013-09-08 Hugo Villeneuve Conversion from iso8859-1 to utf-8 2013-09-08 Hugo Villeneuve Run checkpatch.pl on every source file 2013-09-08 Hugo Villeneuve Update NEWS and ChangeLog 2013-09-08 Hugo Villeneuve Reintroduce command line mode 2013-09-08 Hugo Villeneuve Update Free Software Foundation address 2013-09-08 Hugo Villeneuve Add licencing information to each source file Remove some debug messages. 2013-09-08 Hugo Villeneuve Upgrade to gtk+-2 Remove gtk+-1.0 support. 2013-09-08 Hugo Villeneuve Add automatic regeneration of files from opcode2c.pl to src/Makefile.am 2013-09-08 Hugo Villeneuve Code simplification and cleanup 2013-09-08 Hugo Villeneuve Modify generated files for 8051 instructions Seems to be working good. 2013-09-08 Hugo Villeneuve Add options -h and -version Merge common function LoadHexFile() to file.c. 2013-09-08 Hugo Villeneuve Change autogen.sh script and rename test_files directory 2013-09-08 Hugo Villeneuve Increase version number 2013-09-08 Hugo Villeneuve Add documentation 2013-09-08 Hugo Villeneuve Initial import emu8051-2.0.1/COPYING0000644000175400017500000004311012313352657010604 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) 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 this service 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 make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. 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. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute 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 and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), 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 distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the 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 a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, 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. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE 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. 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 convey 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 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision 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, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This 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 Library General Public License instead of this License.