1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/.hgignore Thu Dec 21 13:30:54 2017 +0100
1.3 @@ -0,0 +1,10 @@
1.4 +syntax: glob
1.5 +
1.6 +*~
1.7 +temp/*
1.8 +
1.9 +syntax: regexp
1.10 +
1.11 +^(java|c\+\+)/[^/]+/dist/
1.12 +^(java|c\+\+)/[^/]+/build/
1.13 +^(java|c\+\+)/[^/]+/nbproject/private/
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
2.2 +++ b/c++/rgb-assembler/.dep.inc Thu Dec 21 13:30:54 2017 +0100
2.3 @@ -0,0 +1,5 @@
2.4 +# This code depends on make tool being used
2.5 +DEPFILES=$(wildcard $(addsuffix .d, ${OBJECTFILES} ${TESTOBJECTFILES}))
2.6 +ifneq (${DEPFILES},)
2.7 +include ${DEPFILES}
2.8 +endif
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/c++/rgb-assembler/Makefile Thu Dec 21 13:30:54 2017 +0100
3.3 @@ -0,0 +1,128 @@
3.4 +#
3.5 +# There exist several targets which are by default empty and which can be
3.6 +# used for execution of your targets. These targets are usually executed
3.7 +# before and after some main targets. They are:
3.8 +#
3.9 +# .build-pre: called before 'build' target
3.10 +# .build-post: called after 'build' target
3.11 +# .clean-pre: called before 'clean' target
3.12 +# .clean-post: called after 'clean' target
3.13 +# .clobber-pre: called before 'clobber' target
3.14 +# .clobber-post: called after 'clobber' target
3.15 +# .all-pre: called before 'all' target
3.16 +# .all-post: called after 'all' target
3.17 +# .help-pre: called before 'help' target
3.18 +# .help-post: called after 'help' target
3.19 +#
3.20 +# Targets beginning with '.' are not intended to be called on their own.
3.21 +#
3.22 +# Main targets can be executed directly, and they are:
3.23 +#
3.24 +# build build a specific configuration
3.25 +# clean remove built files from a configuration
3.26 +# clobber remove all built files
3.27 +# all build all configurations
3.28 +# help print help mesage
3.29 +#
3.30 +# Targets .build-impl, .clean-impl, .clobber-impl, .all-impl, and
3.31 +# .help-impl are implemented in nbproject/makefile-impl.mk.
3.32 +#
3.33 +# Available make variables:
3.34 +#
3.35 +# CND_BASEDIR base directory for relative paths
3.36 +# CND_DISTDIR default top distribution directory (build artifacts)
3.37 +# CND_BUILDDIR default top build directory (object files, ...)
3.38 +# CONF name of current configuration
3.39 +# CND_PLATFORM_${CONF} platform name (current configuration)
3.40 +# CND_ARTIFACT_DIR_${CONF} directory of build artifact (current configuration)
3.41 +# CND_ARTIFACT_NAME_${CONF} name of build artifact (current configuration)
3.42 +# CND_ARTIFACT_PATH_${CONF} path to build artifact (current configuration)
3.43 +# CND_PACKAGE_DIR_${CONF} directory of package (current configuration)
3.44 +# CND_PACKAGE_NAME_${CONF} name of package (current configuration)
3.45 +# CND_PACKAGE_PATH_${CONF} path to package (current configuration)
3.46 +#
3.47 +# NOCDDL
3.48 +
3.49 +
3.50 +# Environment
3.51 +MKDIR=mkdir
3.52 +CP=cp
3.53 +CCADMIN=CCadmin
3.54 +
3.55 +
3.56 +# build
3.57 +build: .build-post
3.58 +
3.59 +.build-pre:
3.60 +# Add your pre 'build' code here...
3.61 +
3.62 +.build-post: .build-impl
3.63 +# Add your post 'build' code here...
3.64 +
3.65 +
3.66 +# clean
3.67 +clean: .clean-post
3.68 +
3.69 +.clean-pre:
3.70 +# Add your pre 'clean' code here...
3.71 +
3.72 +.clean-post: .clean-impl
3.73 +# Add your post 'clean' code here...
3.74 +
3.75 +
3.76 +# clobber
3.77 +clobber: .clobber-post
3.78 +
3.79 +.clobber-pre:
3.80 +# Add your pre 'clobber' code here...
3.81 +
3.82 +.clobber-post: .clobber-impl
3.83 +# Add your post 'clobber' code here...
3.84 +
3.85 +
3.86 +# all
3.87 +all: .all-post
3.88 +
3.89 +.all-pre:
3.90 +# Add your pre 'all' code here...
3.91 +
3.92 +.all-post: .all-impl
3.93 +# Add your post 'all' code here...
3.94 +
3.95 +
3.96 +# build tests
3.97 +build-tests: .build-tests-post
3.98 +
3.99 +.build-tests-pre:
3.100 +# Add your pre 'build-tests' code here...
3.101 +
3.102 +.build-tests-post: .build-tests-impl
3.103 +# Add your post 'build-tests' code here...
3.104 +
3.105 +
3.106 +# run tests
3.107 +test: .test-post
3.108 +
3.109 +.test-pre: build-tests
3.110 +# Add your pre 'test' code here...
3.111 +
3.112 +.test-post: .test-impl
3.113 +# Add your post 'test' code here...
3.114 +
3.115 +
3.116 +# help
3.117 +help: .help-post
3.118 +
3.119 +.help-pre:
3.120 +# Add your pre 'help' code here...
3.121 +
3.122 +.help-post: .help-impl
3.123 +# Add your post 'help' code here...
3.124 +
3.125 +
3.126 +
3.127 +# include project implementation makefile
3.128 +include nbproject/Makefile-impl.mk
3.129 +
3.130 +# include project make variables
3.131 +include nbproject/Makefile-variables.mk
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/c++/rgb-assembler/nbproject/Makefile-Debug.mk Thu Dec 21 13:30:54 2017 +0100
4.3 @@ -0,0 +1,83 @@
4.4 +#
4.5 +# Generated Makefile - do not edit!
4.6 +#
4.7 +# Edit the Makefile in the project folder instead (../Makefile). Each target
4.8 +# has a -pre and a -post target defined where you can add customized code.
4.9 +#
4.10 +# This makefile implements configuration specific macros and targets.
4.11 +
4.12 +
4.13 +# Environment
4.14 +MKDIR=mkdir
4.15 +CP=cp
4.16 +GREP=grep
4.17 +NM=nm
4.18 +CCADMIN=CCadmin
4.19 +RANLIB=ranlib
4.20 +CC=gcc
4.21 +CCC=g++
4.22 +CXX=g++
4.23 +FC=gfortran
4.24 +AS=as
4.25 +
4.26 +# Macros
4.27 +CND_PLATFORM=GNU-Linux
4.28 +CND_DLIB_EXT=so
4.29 +CND_CONF=Debug
4.30 +CND_DISTDIR=dist
4.31 +CND_BUILDDIR=build
4.32 +
4.33 +# Include project Makefile
4.34 +include Makefile
4.35 +
4.36 +# Object Directory
4.37 +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
4.38 +
4.39 +# Object Files
4.40 +OBJECTFILES= \
4.41 + ${OBJECTDIR}/rgb-assembler.o
4.42 +
4.43 +
4.44 +# C Compiler Flags
4.45 +CFLAGS=
4.46 +
4.47 +# CC Compiler Flags
4.48 +CCFLAGS=
4.49 +CXXFLAGS=
4.50 +
4.51 +# Fortran Compiler Flags
4.52 +FFLAGS=
4.53 +
4.54 +# Assembler Flags
4.55 +ASFLAGS=
4.56 +
4.57 +# Link Libraries and Options
4.58 +LDLIBSOPTIONS=
4.59 +
4.60 +# Build Targets
4.61 +.build-conf: ${BUILD_SUBPROJECTS}
4.62 + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler
4.63 +
4.64 +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler: ${OBJECTFILES}
4.65 + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
4.66 + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler ${OBJECTFILES} ${LDLIBSOPTIONS}
4.67 +
4.68 +${OBJECTDIR}/rgb-assembler.o: rgb-assembler.cpp
4.69 + ${MKDIR} -p ${OBJECTDIR}
4.70 + ${RM} "$@.d"
4.71 + $(COMPILE.cc) -g -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/rgb-assembler.o rgb-assembler.cpp
4.72 +
4.73 +# Subprojects
4.74 +.build-subprojects:
4.75 +
4.76 +# Clean Targets
4.77 +.clean-conf: ${CLEAN_SUBPROJECTS}
4.78 + ${RM} -r ${CND_BUILDDIR}/${CND_CONF}
4.79 +
4.80 +# Subprojects
4.81 +.clean-subprojects:
4.82 +
4.83 +# Enable dependency checking
4.84 +.dep.inc: .depcheck-impl
4.85 +
4.86 +include .dep.inc
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
5.2 +++ b/c++/rgb-assembler/nbproject/Makefile-Release.mk Thu Dec 21 13:30:54 2017 +0100
5.3 @@ -0,0 +1,83 @@
5.4 +#
5.5 +# Generated Makefile - do not edit!
5.6 +#
5.7 +# Edit the Makefile in the project folder instead (../Makefile). Each target
5.8 +# has a -pre and a -post target defined where you can add customized code.
5.9 +#
5.10 +# This makefile implements configuration specific macros and targets.
5.11 +
5.12 +
5.13 +# Environment
5.14 +MKDIR=mkdir
5.15 +CP=cp
5.16 +GREP=grep
5.17 +NM=nm
5.18 +CCADMIN=CCadmin
5.19 +RANLIB=ranlib
5.20 +CC=gcc
5.21 +CCC=g++
5.22 +CXX=g++
5.23 +FC=gfortran
5.24 +AS=as
5.25 +
5.26 +# Macros
5.27 +CND_PLATFORM=GNU-Linux
5.28 +CND_DLIB_EXT=so
5.29 +CND_CONF=Release
5.30 +CND_DISTDIR=dist
5.31 +CND_BUILDDIR=build
5.32 +
5.33 +# Include project Makefile
5.34 +include Makefile
5.35 +
5.36 +# Object Directory
5.37 +OBJECTDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}
5.38 +
5.39 +# Object Files
5.40 +OBJECTFILES= \
5.41 + ${OBJECTDIR}/rgb-assembler.o
5.42 +
5.43 +
5.44 +# C Compiler Flags
5.45 +CFLAGS=
5.46 +
5.47 +# CC Compiler Flags
5.48 +CCFLAGS=
5.49 +CXXFLAGS=
5.50 +
5.51 +# Fortran Compiler Flags
5.52 +FFLAGS=
5.53 +
5.54 +# Assembler Flags
5.55 +ASFLAGS=
5.56 +
5.57 +# Link Libraries and Options
5.58 +LDLIBSOPTIONS=
5.59 +
5.60 +# Build Targets
5.61 +.build-conf: ${BUILD_SUBPROJECTS}
5.62 + "${MAKE}" -f nbproject/Makefile-${CND_CONF}.mk ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler
5.63 +
5.64 +${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler: ${OBJECTFILES}
5.65 + ${MKDIR} -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}
5.66 + ${LINK.cc} -o ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler ${OBJECTFILES} ${LDLIBSOPTIONS}
5.67 +
5.68 +${OBJECTDIR}/rgb-assembler.o: rgb-assembler.cpp
5.69 + ${MKDIR} -p ${OBJECTDIR}
5.70 + ${RM} "$@.d"
5.71 + $(COMPILE.cc) -O2 -std=c++11 -MMD -MP -MF "$@.d" -o ${OBJECTDIR}/rgb-assembler.o rgb-assembler.cpp
5.72 +
5.73 +# Subprojects
5.74 +.build-subprojects:
5.75 +
5.76 +# Clean Targets
5.77 +.clean-conf: ${CLEAN_SUBPROJECTS}
5.78 + ${RM} -r ${CND_BUILDDIR}/${CND_CONF}
5.79 +
5.80 +# Subprojects
5.81 +.clean-subprojects:
5.82 +
5.83 +# Enable dependency checking
5.84 +.dep.inc: .depcheck-impl
5.85 +
5.86 +include .dep.inc
6.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
6.2 +++ b/c++/rgb-assembler/nbproject/Makefile-impl.mk Thu Dec 21 13:30:54 2017 +0100
6.3 @@ -0,0 +1,133 @@
6.4 +#
6.5 +# Generated Makefile - do not edit!
6.6 +#
6.7 +# Edit the Makefile in the project folder instead (../Makefile). Each target
6.8 +# has a pre- and a post- target defined where you can add customization code.
6.9 +#
6.10 +# This makefile implements macros and targets common to all configurations.
6.11 +#
6.12 +# NOCDDL
6.13 +
6.14 +
6.15 +# Building and Cleaning subprojects are done by default, but can be controlled with the SUB
6.16 +# macro. If SUB=no, subprojects will not be built or cleaned. The following macro
6.17 +# statements set BUILD_SUB-CONF and CLEAN_SUB-CONF to .build-reqprojects-conf
6.18 +# and .clean-reqprojects-conf unless SUB has the value 'no'
6.19 +SUB_no=NO
6.20 +SUBPROJECTS=${SUB_${SUB}}
6.21 +BUILD_SUBPROJECTS_=.build-subprojects
6.22 +BUILD_SUBPROJECTS_NO=
6.23 +BUILD_SUBPROJECTS=${BUILD_SUBPROJECTS_${SUBPROJECTS}}
6.24 +CLEAN_SUBPROJECTS_=.clean-subprojects
6.25 +CLEAN_SUBPROJECTS_NO=
6.26 +CLEAN_SUBPROJECTS=${CLEAN_SUBPROJECTS_${SUBPROJECTS}}
6.27 +
6.28 +
6.29 +# Project Name
6.30 +PROJECTNAME=rgb-assembler
6.31 +
6.32 +# Active Configuration
6.33 +DEFAULTCONF=Debug
6.34 +CONF=${DEFAULTCONF}
6.35 +
6.36 +# All Configurations
6.37 +ALLCONFS=Debug Release
6.38 +
6.39 +
6.40 +# build
6.41 +.build-impl: .build-pre .validate-impl .depcheck-impl
6.42 + @#echo "=> Running $@... Configuration=$(CONF)"
6.43 + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf
6.44 +
6.45 +
6.46 +# clean
6.47 +.clean-impl: .clean-pre .validate-impl .depcheck-impl
6.48 + @#echo "=> Running $@... Configuration=$(CONF)"
6.49 + "${MAKE}" -f nbproject/Makefile-${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf
6.50 +
6.51 +
6.52 +# clobber
6.53 +.clobber-impl: .clobber-pre .depcheck-impl
6.54 + @#echo "=> Running $@..."
6.55 + for CONF in ${ALLCONFS}; \
6.56 + do \
6.57 + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .clean-conf; \
6.58 + done
6.59 +
6.60 +# all
6.61 +.all-impl: .all-pre .depcheck-impl
6.62 + @#echo "=> Running $@..."
6.63 + for CONF in ${ALLCONFS}; \
6.64 + do \
6.65 + "${MAKE}" -f nbproject/Makefile-$${CONF}.mk QMAKE=${QMAKE} SUBPROJECTS=${SUBPROJECTS} .build-conf; \
6.66 + done
6.67 +
6.68 +# build tests
6.69 +.build-tests-impl: .build-impl .build-tests-pre
6.70 + @#echo "=> Running $@... Configuration=$(CONF)"
6.71 + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .build-tests-conf
6.72 +
6.73 +# run tests
6.74 +.test-impl: .build-tests-impl .test-pre
6.75 + @#echo "=> Running $@... Configuration=$(CONF)"
6.76 + "${MAKE}" -f nbproject/Makefile-${CONF}.mk SUBPROJECTS=${SUBPROJECTS} .test-conf
6.77 +
6.78 +# dependency checking support
6.79 +.depcheck-impl:
6.80 + @echo "# This code depends on make tool being used" >.dep.inc
6.81 + @if [ -n "${MAKE_VERSION}" ]; then \
6.82 + echo "DEPFILES=\$$(wildcard \$$(addsuffix .d, \$${OBJECTFILES} \$${TESTOBJECTFILES}))" >>.dep.inc; \
6.83 + echo "ifneq (\$${DEPFILES},)" >>.dep.inc; \
6.84 + echo "include \$${DEPFILES}" >>.dep.inc; \
6.85 + echo "endif" >>.dep.inc; \
6.86 + else \
6.87 + echo ".KEEP_STATE:" >>.dep.inc; \
6.88 + echo ".KEEP_STATE_FILE:.make.state.\$${CONF}" >>.dep.inc; \
6.89 + fi
6.90 +
6.91 +# configuration validation
6.92 +.validate-impl:
6.93 + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
6.94 + then \
6.95 + echo ""; \
6.96 + echo "Error: can not find the makefile for configuration '${CONF}' in project ${PROJECTNAME}"; \
6.97 + echo "See 'make help' for details."; \
6.98 + echo "Current directory: " `pwd`; \
6.99 + echo ""; \
6.100 + fi
6.101 + @if [ ! -f nbproject/Makefile-${CONF}.mk ]; \
6.102 + then \
6.103 + exit 1; \
6.104 + fi
6.105 +
6.106 +
6.107 +# help
6.108 +.help-impl: .help-pre
6.109 + @echo "This makefile supports the following configurations:"
6.110 + @echo " ${ALLCONFS}"
6.111 + @echo ""
6.112 + @echo "and the following targets:"
6.113 + @echo " build (default target)"
6.114 + @echo " clean"
6.115 + @echo " clobber"
6.116 + @echo " all"
6.117 + @echo " help"
6.118 + @echo ""
6.119 + @echo "Makefile Usage:"
6.120 + @echo " make [CONF=<CONFIGURATION>] [SUB=no] build"
6.121 + @echo " make [CONF=<CONFIGURATION>] [SUB=no] clean"
6.122 + @echo " make [SUB=no] clobber"
6.123 + @echo " make [SUB=no] all"
6.124 + @echo " make help"
6.125 + @echo ""
6.126 + @echo "Target 'build' will build a specific configuration and, unless 'SUB=no',"
6.127 + @echo " also build subprojects."
6.128 + @echo "Target 'clean' will clean a specific configuration and, unless 'SUB=no',"
6.129 + @echo " also clean subprojects."
6.130 + @echo "Target 'clobber' will remove all built files from all configurations and,"
6.131 + @echo " unless 'SUB=no', also from subprojects."
6.132 + @echo "Target 'all' will will build all configurations and, unless 'SUB=no',"
6.133 + @echo " also build subprojects."
6.134 + @echo "Target 'help' prints this message."
6.135 + @echo ""
6.136 +
7.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
7.2 +++ b/c++/rgb-assembler/nbproject/Makefile-variables.mk Thu Dec 21 13:30:54 2017 +0100
7.3 @@ -0,0 +1,35 @@
7.4 +#
7.5 +# Generated - do not edit!
7.6 +#
7.7 +# NOCDDL
7.8 +#
7.9 +CND_BASEDIR=`pwd`
7.10 +CND_BUILDDIR=build
7.11 +CND_DISTDIR=dist
7.12 +# Debug configuration
7.13 +CND_PLATFORM_Debug=GNU-Linux
7.14 +CND_ARTIFACT_DIR_Debug=dist/Debug/GNU-Linux
7.15 +CND_ARTIFACT_NAME_Debug=rgb-assembler
7.16 +CND_ARTIFACT_PATH_Debug=dist/Debug/GNU-Linux/rgb-assembler
7.17 +CND_PACKAGE_DIR_Debug=dist/Debug/GNU-Linux/package
7.18 +CND_PACKAGE_NAME_Debug=rgb-assembler.tar
7.19 +CND_PACKAGE_PATH_Debug=dist/Debug/GNU-Linux/package/rgb-assembler.tar
7.20 +# Release configuration
7.21 +CND_PLATFORM_Release=GNU-Linux
7.22 +CND_ARTIFACT_DIR_Release=dist/Release/GNU-Linux
7.23 +CND_ARTIFACT_NAME_Release=rgb-assembler
7.24 +CND_ARTIFACT_PATH_Release=dist/Release/GNU-Linux/rgb-assembler
7.25 +CND_PACKAGE_DIR_Release=dist/Release/GNU-Linux/package
7.26 +CND_PACKAGE_NAME_Release=rgb-assembler.tar
7.27 +CND_PACKAGE_PATH_Release=dist/Release/GNU-Linux/package/rgb-assembler.tar
7.28 +#
7.29 +# include compiler specific variables
7.30 +#
7.31 +# dmake command
7.32 +ROOT:sh = test -f nbproject/private/Makefile-variables.mk || \
7.33 + (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk)
7.34 +#
7.35 +# gmake command
7.36 +.PHONY: $(shell test -f nbproject/private/Makefile-variables.mk || (mkdir -p nbproject/private && touch nbproject/private/Makefile-variables.mk))
7.37 +#
7.38 +include nbproject/private/Makefile-variables.mk
8.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
8.2 +++ b/c++/rgb-assembler/nbproject/Package-Debug.bash Thu Dec 21 13:30:54 2017 +0100
8.3 @@ -0,0 +1,76 @@
8.4 +#!/bin/bash -x
8.5 +
8.6 +#
8.7 +# Generated - do not edit!
8.8 +#
8.9 +
8.10 +# Macros
8.11 +TOP=`pwd`
8.12 +CND_PLATFORM=GNU-Linux
8.13 +CND_CONF=Debug
8.14 +CND_DISTDIR=dist
8.15 +CND_BUILDDIR=build
8.16 +CND_DLIB_EXT=so
8.17 +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
8.18 +TMPDIRNAME=tmp-packaging
8.19 +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler
8.20 +OUTPUT_BASENAME=rgb-assembler
8.21 +PACKAGE_TOP_DIR=rgb-assembler/
8.22 +
8.23 +# Functions
8.24 +function checkReturnCode
8.25 +{
8.26 + rc=$?
8.27 + if [ $rc != 0 ]
8.28 + then
8.29 + exit $rc
8.30 + fi
8.31 +}
8.32 +function makeDirectory
8.33 +# $1 directory path
8.34 +# $2 permission (optional)
8.35 +{
8.36 + mkdir -p "$1"
8.37 + checkReturnCode
8.38 + if [ "$2" != "" ]
8.39 + then
8.40 + chmod $2 "$1"
8.41 + checkReturnCode
8.42 + fi
8.43 +}
8.44 +function copyFileToTmpDir
8.45 +# $1 from-file path
8.46 +# $2 to-file path
8.47 +# $3 permission
8.48 +{
8.49 + cp "$1" "$2"
8.50 + checkReturnCode
8.51 + if [ "$3" != "" ]
8.52 + then
8.53 + chmod $3 "$2"
8.54 + checkReturnCode
8.55 + fi
8.56 +}
8.57 +
8.58 +# Setup
8.59 +cd "${TOP}"
8.60 +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
8.61 +rm -rf ${NBTMPDIR}
8.62 +mkdir -p ${NBTMPDIR}
8.63 +
8.64 +# Copy files and create directories and links
8.65 +cd "${TOP}"
8.66 +makeDirectory "${NBTMPDIR}/rgb-assembler/bin"
8.67 +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
8.68 +
8.69 +
8.70 +# Generate tar file
8.71 +cd "${TOP}"
8.72 +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/rgb-assembler.tar
8.73 +cd ${NBTMPDIR}
8.74 +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/rgb-assembler.tar *
8.75 +checkReturnCode
8.76 +
8.77 +# Cleanup
8.78 +cd "${TOP}"
8.79 +rm -rf ${NBTMPDIR}
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
9.2 +++ b/c++/rgb-assembler/nbproject/Package-Release.bash Thu Dec 21 13:30:54 2017 +0100
9.3 @@ -0,0 +1,76 @@
9.4 +#!/bin/bash -x
9.5 +
9.6 +#
9.7 +# Generated - do not edit!
9.8 +#
9.9 +
9.10 +# Macros
9.11 +TOP=`pwd`
9.12 +CND_PLATFORM=GNU-Linux
9.13 +CND_CONF=Release
9.14 +CND_DISTDIR=dist
9.15 +CND_BUILDDIR=build
9.16 +CND_DLIB_EXT=so
9.17 +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
9.18 +TMPDIRNAME=tmp-packaging
9.19 +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/rgb-assembler
9.20 +OUTPUT_BASENAME=rgb-assembler
9.21 +PACKAGE_TOP_DIR=rgb-assembler/
9.22 +
9.23 +# Functions
9.24 +function checkReturnCode
9.25 +{
9.26 + rc=$?
9.27 + if [ $rc != 0 ]
9.28 + then
9.29 + exit $rc
9.30 + fi
9.31 +}
9.32 +function makeDirectory
9.33 +# $1 directory path
9.34 +# $2 permission (optional)
9.35 +{
9.36 + mkdir -p "$1"
9.37 + checkReturnCode
9.38 + if [ "$2" != "" ]
9.39 + then
9.40 + chmod $2 "$1"
9.41 + checkReturnCode
9.42 + fi
9.43 +}
9.44 +function copyFileToTmpDir
9.45 +# $1 from-file path
9.46 +# $2 to-file path
9.47 +# $3 permission
9.48 +{
9.49 + cp "$1" "$2"
9.50 + checkReturnCode
9.51 + if [ "$3" != "" ]
9.52 + then
9.53 + chmod $3 "$2"
9.54 + checkReturnCode
9.55 + fi
9.56 +}
9.57 +
9.58 +# Setup
9.59 +cd "${TOP}"
9.60 +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
9.61 +rm -rf ${NBTMPDIR}
9.62 +mkdir -p ${NBTMPDIR}
9.63 +
9.64 +# Copy files and create directories and links
9.65 +cd "${TOP}"
9.66 +makeDirectory "${NBTMPDIR}/rgb-assembler/bin"
9.67 +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
9.68 +
9.69 +
9.70 +# Generate tar file
9.71 +cd "${TOP}"
9.72 +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/rgb-assembler.tar
9.73 +cd ${NBTMPDIR}
9.74 +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/rgb-assembler.tar *
9.75 +checkReturnCode
9.76 +
9.77 +# Cleanup
9.78 +cd "${TOP}"
9.79 +rm -rf ${NBTMPDIR}
10.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
10.2 +++ b/c++/rgb-assembler/nbproject/configurations.xml Thu Dec 21 13:30:54 2017 +0100
10.3 @@ -0,0 +1,71 @@
10.4 +<?xml version="1.0" encoding="UTF-8"?>
10.5 +<configurationDescriptor version="100">
10.6 + <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
10.7 + <logicalFolder name="HeaderFiles"
10.8 + displayName="Header Files"
10.9 + projectFiles="true">
10.10 + </logicalFolder>
10.11 + <logicalFolder name="ResourceFiles"
10.12 + displayName="Resource Files"
10.13 + projectFiles="true">
10.14 + </logicalFolder>
10.15 + <logicalFolder name="SourceFiles"
10.16 + displayName="Source Files"
10.17 + projectFiles="true">
10.18 + <itemPath>rgb-assembler.cpp</itemPath>
10.19 + </logicalFolder>
10.20 + <logicalFolder name="TestFiles"
10.21 + displayName="Test Files"
10.22 + projectFiles="false"
10.23 + kind="TEST_LOGICAL_FOLDER">
10.24 + </logicalFolder>
10.25 + <logicalFolder name="ExternalFiles"
10.26 + displayName="Important Files"
10.27 + projectFiles="false"
10.28 + kind="IMPORTANT_FILES_FOLDER">
10.29 + <itemPath>Makefile</itemPath>
10.30 + </logicalFolder>
10.31 + </logicalFolder>
10.32 + <projectmakefile>Makefile</projectmakefile>
10.33 + <confs>
10.34 + <conf name="Debug" type="1" platformSpecific="true">
10.35 + <toolsSet>
10.36 + <compilerSet>default</compilerSet>
10.37 + <platform>2</platform>
10.38 + <dependencyChecking>true</dependencyChecking>
10.39 + <rebuildPropChanged>false</rebuildPropChanged>
10.40 + </toolsSet>
10.41 + <compileType>
10.42 + <ccTool>
10.43 + <standard>8</standard>
10.44 + </ccTool>
10.45 + </compileType>
10.46 + <item path="rgb-assembler.cpp" ex="false" tool="1" flavor2="0">
10.47 + </item>
10.48 + </conf>
10.49 + <conf name="Release" type="1">
10.50 + <toolsSet>
10.51 + <compilerSet>default</compilerSet>
10.52 + <dependencyChecking>true</dependencyChecking>
10.53 + <rebuildPropChanged>false</rebuildPropChanged>
10.54 + </toolsSet>
10.55 + <compileType>
10.56 + <cTool>
10.57 + <developmentMode>5</developmentMode>
10.58 + </cTool>
10.59 + <ccTool>
10.60 + <developmentMode>5</developmentMode>
10.61 + <standard>8</standard>
10.62 + </ccTool>
10.63 + <fortranCompilerTool>
10.64 + <developmentMode>5</developmentMode>
10.65 + </fortranCompilerTool>
10.66 + <asmTool>
10.67 + <developmentMode>5</developmentMode>
10.68 + </asmTool>
10.69 + </compileType>
10.70 + <item path="rgb-assembler.cpp" ex="false" tool="1" flavor2="0">
10.71 + </item>
10.72 + </conf>
10.73 + </confs>
10.74 +</configurationDescriptor>
11.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
11.2 +++ b/c++/rgb-assembler/nbproject/project.xml Thu Dec 21 13:30:54 2017 +0100
11.3 @@ -0,0 +1,28 @@
11.4 +<?xml version="1.0" encoding="UTF-8"?>
11.5 +<project xmlns="http://www.netbeans.org/ns/project/1">
11.6 + <type>org.netbeans.modules.cnd.makeproject</type>
11.7 + <configuration>
11.8 + <data xmlns="http://www.netbeans.org/ns/make-project/1">
11.9 + <name>rgb-assembler</name>
11.10 + <c-extensions/>
11.11 + <cpp-extensions>cpp</cpp-extensions>
11.12 + <header-extensions/>
11.13 + <sourceEncoding>UTF-8</sourceEncoding>
11.14 + <make-dep-projects/>
11.15 + <sourceRootList/>
11.16 + <confList>
11.17 + <confElem>
11.18 + <name>Debug</name>
11.19 + <type>1</type>
11.20 + </confElem>
11.21 + <confElem>
11.22 + <name>Release</name>
11.23 + <type>1</type>
11.24 + </confElem>
11.25 + </confList>
11.26 + <formatting>
11.27 + <project-formatting-style>false</project-formatting-style>
11.28 + </formatting>
11.29 + </data>
11.30 + </configuration>
11.31 +</project>
12.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
12.2 +++ b/c++/rgb-assembler/rgb-assembler.cpp Thu Dec 21 13:30:54 2017 +0100
12.3 @@ -0,0 +1,75 @@
12.4 +#include <cstdlib>
12.5 +#include <iostream>
12.6 +#include <wchar.h>
12.7 +#include <locale.h>
12.8 +#include <cstring>
12.9 +
12.10 +using namespace std;
12.11 +
12.12 +typedef uint16_t address_t;
12.13 +typedef uint8_t command_t;
12.14 +
12.15 +const address_t MEMORY_SIZE = 1024;
12.16 +
12.17 +const command_t CMD_GOTO = 100;
12.18 +const command_t CMD_SLEEP = 101;
12.19 +const command_t CMD_END = 102;
12.20 +
12.21 +command_t readCommand(command_t (&memory)[MEMORY_SIZE], const address_t index) {
12.22 + // TODO: map higher memory to static hardcoded areas or peripherals
12.23 + return memory[index];
12.24 +}
12.25 +
12.26 +void writeMemoryChar(command_t (&memory)[MEMORY_SIZE], const address_t index, const int value) {
12.27 + memory[index] = value;
12.28 +}
12.29 +
12.30 +void writeMemoryChar(command_t* memory[], const address_t index, const command_t value) {
12.31 + *memory[index] = value;
12.32 +}
12.33 +
12.34 +int main(int argc, char* argv[]) {
12.35 +
12.36 + setlocale(LC_ALL, "");
12.37 +
12.38 +
12.39 + command_t memory[MEMORY_SIZE] = {
12.40 + CMD_SLEEP,
12.41 + CMD_SLEEP,
12.42 + CMD_SLEEP,
12.43 + CMD_END,
12.44 + };
12.45 + address_t memorySize = sizeof (memory) / sizeof (*memory);
12.46 +
12.47 +
12.48 + for (address_t i = 0; i < memorySize; i++) {
12.49 + command_t ch = readCommand(memory, i);
12.50 + wprintf(L"command %d = %d\n", i, ch);
12.51 +
12.52 + string command;
12.53 +
12.54 + switch (ch) {
12.55 + case CMD_GOTO:
12.56 + command.append("GOTO");
12.57 + break;
12.58 + case CMD_SLEEP:
12.59 + command.append("SLEEP");
12.60 + break;
12.61 + case CMD_END:
12.62 + command.append("END");
12.63 + i = memorySize;
12.64 + break;
12.65 +
12.66 + }
12.67 +
12.68 + if (!command.empty()) {
12.69 + wprintf(L"\t%s\n", command.c_str());
12.70 + }
12.71 + }
12.72 +
12.73 +
12.74 +
12.75 + wprintf(L"all done\n");
12.76 + return 0;
12.77 +}
12.78 +