beebasm

changeset 47:c69aab9bc64c v1.08

Fixed makefile for GCC (MinGW) builds. Added COPYBLOCK command to manage blocks of memory.
author RichTW <richtw1@gmail.com>
date Thu Jan 19 19:15:40 2012 +0100
parents 0824f1c0ceaa
children c35bc523430d
files about.txt beebasm.exe demo.ssd src/Makefile src/Makefile.inc src/asmexception.cpp src/asmexception.h src/assemble.cpp src/commands.cpp src/discimage.cpp src/discimage.h src/expression.cpp src/globaldata.cpp src/globaldata.h src/lineparser.cpp src/lineparser.h src/macro.cpp src/macro.h src/main.cpp src/main.h src/objectcode.cpp src/objectcode.h src/sourcecode.cpp src/sourcecode.h src/sourcefile.cpp src/sourcefile.h src/stringutils.cpp src/stringutils.h src/symboltable.cpp src/symboltable.h
diffstat 30 files changed, 183 insertions(+), 60 deletions(-) [+]
line diff
     1.1 --- a/about.txt	Thu Oct 06 18:19:01 2011 +0200
     1.2 +++ b/about.txt	Thu Jan 19 19:15:40 2012 +0100
     1.3 @@ -1,10 +1,10 @@
     1.4  *******************************************************************************
     1.5  *                                                                             *
     1.6 -*                               BeebAsm V1.06                                 *
     1.7 +*                               BeebAsm V1.08                                 *
     1.8  *                                                                             *
     1.9  *             A portable 6502 assembler with BBC Micro style syntax           *
    1.10  *                                                                             *
    1.11 -*                  Copyright (C) Rich Talbot-Watkins 2007-2011                *
    1.12 +*                  Copyright (C) Rich Talbot-Watkins 2007-2012                *
    1.13  *                             <richtw1@gmail.com>                             *
    1.14  *                                                                             *
    1.15  *    This program is free software: you can redistribute it and/or modify     *
    1.16 @@ -713,11 +713,18 @@
    1.17  
    1.18  9. VERSION HISTORY
    1.19  
    1.20 +19/01/2012  1.08  Fixed makefile for GCC (MinGW) builds.
    1.21 +                  Added COPYBLOCK command to manage blocks of memory.
    1.22 +06/10/2011  1.07  Fixed mixed-case bug for keywords (so now oddities such as
    1.23 +                  INy are parsed correctly).
    1.24 +                  Now function keywords require an open bracket immediately
    1.25 +                  afterwards (which now means that symbol names such as
    1.26 +                  HIGHSCORE, which start with the keyword HI, are valid).
    1.27  16/06/2011  1.06  Fixed bug in EQUD with unsigned int values.
    1.28                    Added ERROR directive.
    1.29  25/04/2011  1.05  Added macros.
    1.30                    Added PUTFILE and PUTBASIC (to tokenise a plaintext BASIC
    1.31 -				  file, using code by Thomas Harte).
    1.32 +                  file, using code by Thomas Harte).
    1.33  02/12/2009  1.04  Additions by Kevin Bracey:
    1.34                    Added 65C02 instruction set and CPU directive.
    1.35                    Added ELIF, EQUD.
     2.1 Binary file beebasm.exe has changed
     3.1 Binary file demo.ssd has changed
     4.1 --- a/src/Makefile	Thu Oct 06 18:19:01 2011 +0200
     4.2 +++ b/src/Makefile	Thu Jan 19 19:15:40 2012 +0100
     4.3 @@ -3,7 +3,7 @@
     4.4  #	Makefile for beebasm
     4.5  #
     4.6  #
     4.7 -#	Copyright (C) Rich Talbot-Watkins 2007, 2008
     4.8 +#	Copyright (C) Rich Talbot-Watkins 2007-2012
     4.9  #
    4.10  #	This file is part of BeebAsm.
    4.11  #
    4.12 @@ -47,7 +47,7 @@
    4.13  
    4.14  # Define GNU libs to link
    4.15  
    4.16 -LDLIBS			:=		-lstdc++ -lm
    4.17 +LDLIBS			:=		-lm
    4.18  
    4.19  # Parameters to the executable
    4.20  
     5.1 --- a/src/Makefile.inc	Thu Oct 06 18:19:01 2011 +0200
     5.2 +++ b/src/Makefile.inc	Thu Jan 19 19:15:40 2012 +0100
     5.3 @@ -22,7 +22,7 @@
     5.4  #		VERBOSE			Echoes all commands launched by make
     5.5  #
     5.6  #
     5.7 -#	Copyright (C) Rich Talbot-Watkins 2007, 2008
     5.8 +#	Copyright (C) Rich Talbot-Watkins 2007-2012
     5.9  #
    5.10  #	This file is part of BeebAsm.
    5.11  #
    5.12 @@ -53,8 +53,8 @@
    5.13  # Declare executable names
    5.14  
    5.15  CC				:=		gcc
    5.16 -CXX				:=		gcc
    5.17 -LD				:=		gcc
    5.18 +CXX				:=		g++
    5.19 +LD				:=		g++
    5.20  MKDIR			:=		mkdir -p
    5.21  RM				:=		rm -f
    5.22  ECHO			:=		@@echo -e
    5.23 @@ -63,8 +63,7 @@
    5.24  # List of allowed platform names.
    5.25  # Add extra valid platforms to this list as they are supported.
    5.26  
    5.27 -PLATFORM_LIST	:=		mingw-gcc3
    5.28 -PLATFORM_LIST	+=		mingw-gcc4
    5.29 +PLATFORM_LIST	:=		mingw-gcc
    5.30  PLATFORM_LIST	+=		linux
    5.31  PLATFORM_LIST	+=		macosx
    5.32  
    5.33 @@ -89,11 +88,7 @@
    5.34  endif
    5.35  
    5.36  ifeq ($(OS),Windows_NT)
    5.37 -ifeq ($(word 1,$(subst ., ,$(shell $(CC) -dumpversion))),4)
    5.38 -PLATFORM		:=		mingw-gcc4
    5.39 -else
    5.40 -PLATFORM		:=		mingw-gcc3
    5.41 -endif
    5.42 +PLATFORM		:=		mingw-gcc
    5.43  endif
    5.44  
    5.45  ifdef PLATFORM
    5.46 @@ -134,11 +129,7 @@
    5.47  
    5.48  # Add platform-specific flags
    5.49  
    5.50 -ifeq ($(PLATFORM),mingw-gcc3)
    5.51 -TARGET			:=		$(addsuffix .exe,$(TARGET))
    5.52 -endif
    5.53 -
    5.54 -ifeq ($(PLATFORM),mingw-gcc4)
    5.55 +ifeq ($(PLATFORM),mingw-gcc)
    5.56  LDFLAGS			+=		-static
    5.57  TARGET			:=		$(addsuffix .exe,$(TARGET))
    5.58  endif
     6.1 --- a/src/asmexception.cpp	Thu Oct 06 18:19:01 2011 +0200
     6.2 +++ b/src/asmexception.cpp	Thu Jan 19 19:15:40 2012 +0100
     6.3 @@ -5,7 +5,7 @@
     6.4  	Exception handling for the app
     6.5  
     6.6  
     6.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
     6.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
     6.9  
    6.10  	This file is part of BeebAsm.
    6.11  
     7.1 --- a/src/asmexception.h	Thu Oct 06 18:19:01 2011 +0200
     7.2 +++ b/src/asmexception.h	Thu Jan 19 19:15:40 2012 +0100
     7.3 @@ -3,7 +3,7 @@
     7.4  	asmexception.h
     7.5  
     7.6  
     7.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
     7.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
     7.9  
    7.10  	This file is part of BeebAsm.
    7.11  
     8.1 --- a/src/assemble.cpp	Thu Oct 06 18:19:01 2011 +0200
     8.2 +++ b/src/assemble.cpp	Thu Jan 19 19:15:40 2012 +0100
     8.3 @@ -5,7 +5,7 @@
     8.4  	Contains all the LineParser methods for assembling code
     8.5  
     8.6  
     8.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
     8.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
     8.9  
    8.10  	This file is part of BeebAsm.
    8.11  
     9.1 --- a/src/commands.cpp	Thu Oct 06 18:19:01 2011 +0200
     9.2 +++ b/src/commands.cpp	Thu Jan 19 19:15:40 2012 +0100
     9.3 @@ -5,7 +5,7 @@
     9.4  	Contains all the LineParser methods for parsing and handling assembler commands
     9.5  
     9.6  
     9.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
     9.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
     9.9  
    9.10  	This file is part of BeebAsm.
    9.11  
    9.12 @@ -73,7 +73,8 @@
    9.13  	{ "PUTBASIC",	&LineParser::HandlePutBasic,			0 },
    9.14  	{ "MACRO",		&LineParser::HandleMacro,				&SourceFile::StartMacro },
    9.15  	{ "ENDMACRO",	&LineParser::HandleEndMacro,			&SourceFile::EndMacro },
    9.16 -	{ "ERROR",		&LineParser::HandleError,				0 }
    9.17 +	{ "ERROR",		&LineParser::HandleError,				0 },
    9.18 +	{ "COPYBLOCK",	&LineParser::HandleCopyBlock,			0 }
    9.19  };
    9.20  
    9.21  
    9.22 @@ -304,7 +305,7 @@
    9.23  void LineParser::HandleClear()
    9.24  {
    9.25  	int start = EvaluateExpressionAsInt();
    9.26 -	if ( start < 0 || start > 0x10000 )
    9.27 +	if ( start < 0 || start > 0xFFFF )
    9.28  	{
    9.29  		throw AsmException_SyntaxError_OutOfRange( m_line, m_column );
    9.30  	}
    9.31 @@ -318,7 +319,7 @@
    9.32  	m_column++;
    9.33  
    9.34  	int end = EvaluateExpressionAsInt();
    9.35 -	if ( end < 0 || end > 0xFFFF )
    9.36 +	if ( end < 0 || end > 0x10000 )
    9.37  	{
    9.38  		throw AsmException_SyntaxError_OutOfRange( m_line, m_column );
    9.39  	}
    9.40 @@ -504,7 +505,7 @@
    9.41  	int oldColumn = m_column;
    9.42  
    9.43  	int addr = EvaluateExpressionAsInt();
    9.44 -	if ( addr < 0 || addr > 0xFFFF )
    9.45 +	if ( addr < 0 || addr > 0x10000 )
    9.46  	{
    9.47  		throw AsmException_SyntaxError_BadAddress( m_line, oldColumn );
    9.48  	}
    9.49 @@ -1829,3 +1830,57 @@
    9.50  	}
    9.51  }
    9.52  
    9.53 +
    9.54 +/*************************************************************************************************/
    9.55 +/**
    9.56 +	LineParser::HandleCopyBlock()
    9.57 +*/
    9.58 +/*************************************************************************************************/
    9.59 +void LineParser::HandleCopyBlock()
    9.60 +{
    9.61 +	int start = EvaluateExpressionAsInt();
    9.62 +	if ( start < 0 || start > 0xFFFF )
    9.63 +	{
    9.64 +		throw AsmException_SyntaxError_OutOfRange( m_line, m_column );
    9.65 +	}
    9.66 +
    9.67 +	if ( m_column >= m_line.length() || m_line[ m_column ] != ',' )
    9.68 +	{
    9.69 +		// did not find a comma
    9.70 +		throw AsmException_SyntaxError_InvalidCharacter( m_line, m_column );
    9.71 +	}
    9.72 +
    9.73 +	m_column++;
    9.74 +
    9.75 +	int end = EvaluateExpressionAsInt();
    9.76 +	if ( end < 0 || end > 0xFFFF )
    9.77 +	{
    9.78 +		throw AsmException_SyntaxError_OutOfRange( m_line, m_column );
    9.79 +	}
    9.80 +
    9.81 +	if ( m_column >= m_line.length() || m_line[ m_column ] != ',' )
    9.82 +	{
    9.83 +		// did not find a comma
    9.84 +		throw AsmException_SyntaxError_InvalidCharacter( m_line, m_column );
    9.85 +	}
    9.86 +
    9.87 +	m_column++;
    9.88 +
    9.89 +	int dest = EvaluateExpressionAsInt();
    9.90 +	if ( dest < 0 || dest > 0xFFFF )
    9.91 +	{
    9.92 +		throw AsmException_SyntaxError_OutOfRange( m_line, m_column );
    9.93 +	}
    9.94 +
    9.95 +	if ( GlobalData::Instance().IsSecondPass() )
    9.96 +	{
    9.97 +		ObjectCode::Instance().CopyBlock( start, end, dest );
    9.98 +	}
    9.99 +
   9.100 +	if ( m_column < m_line.length() && m_line[ m_column ] == ',' )
   9.101 +	{
   9.102 +		// Unexpected comma (remembering that an expression can validly end with a comma)
   9.103 +		throw AsmException_SyntaxError_UnexpectedComma( m_line, m_column );
   9.104 +	}
   9.105 +}
   9.106 +
    10.1 --- a/src/discimage.cpp	Thu Oct 06 18:19:01 2011 +0200
    10.2 +++ b/src/discimage.cpp	Thu Jan 19 19:15:40 2012 +0100
    10.3 @@ -3,7 +3,7 @@
    10.4  	discimage.cpp
    10.5  
    10.6  
    10.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    10.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    10.9  
   10.10  	This file is part of BeebAsm.
   10.11  
    11.1 --- a/src/discimage.h	Thu Oct 06 18:19:01 2011 +0200
    11.2 +++ b/src/discimage.h	Thu Jan 19 19:15:40 2012 +0100
    11.3 @@ -3,7 +3,7 @@
    11.4  	discimage.h
    11.5  
    11.6  
    11.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    11.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    11.9  
   11.10  	This file is part of BeebAsm.
   11.11  
    12.1 --- a/src/expression.cpp	Thu Oct 06 18:19:01 2011 +0200
    12.2 +++ b/src/expression.cpp	Thu Jan 19 19:15:40 2012 +0100
    12.3 @@ -5,7 +5,7 @@
    12.4  	Contains all the LineParser methods for parsing and evaluating expressions
    12.5  
    12.6  
    12.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    12.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    12.9  
   12.10  	This file is part of BeebAsm.
   12.11  
    13.1 --- a/src/globaldata.cpp	Thu Oct 06 18:19:01 2011 +0200
    13.2 +++ b/src/globaldata.cpp	Thu Jan 19 19:15:40 2012 +0100
    13.3 @@ -3,7 +3,7 @@
    13.4  	globaldata.cpp
    13.5  
    13.6  
    13.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    13.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    13.9  
   13.10  	This file is part of BeebAsm.
   13.11  
    14.1 --- a/src/globaldata.h	Thu Oct 06 18:19:01 2011 +0200
    14.2 +++ b/src/globaldata.h	Thu Jan 19 19:15:40 2012 +0100
    14.3 @@ -3,7 +3,7 @@
    14.4  	globaldata.h
    14.5  
    14.6  
    14.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    14.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    14.9  
   14.10  	This file is part of BeebAsm.
   14.11  
    15.1 --- a/src/lineparser.cpp	Thu Oct 06 18:19:01 2011 +0200
    15.2 +++ b/src/lineparser.cpp	Thu Jan 19 19:15:40 2012 +0100
    15.3 @@ -5,7 +5,7 @@
    15.4  	Represents a line of the source file
    15.5  
    15.6  
    15.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    15.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    15.9  
   15.10  	This file is part of BeebAsm.
   15.11  
    16.1 --- a/src/lineparser.h	Thu Oct 06 18:19:01 2011 +0200
    16.2 +++ b/src/lineparser.h	Thu Jan 19 19:15:40 2012 +0100
    16.3 @@ -3,7 +3,7 @@
    16.4  	lineparser.h
    16.5  
    16.6  
    16.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    16.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    16.9  
   16.10  	This file is part of BeebAsm.
   16.11  
   16.12 @@ -154,6 +154,7 @@
   16.13  	void			HandleMacro();
   16.14  	void			HandleEndMacro();
   16.15  	void			HandleError();
   16.16 +	void			HandleCopyBlock();
   16.17  
   16.18  	// expression evaluating methods
   16.19  
    17.1 --- a/src/macro.cpp	Thu Oct 06 18:19:01 2011 +0200
    17.2 +++ b/src/macro.cpp	Thu Jan 19 19:15:40 2012 +0100
    17.3 @@ -3,7 +3,7 @@
    17.4  	macro.cpp
    17.5  
    17.6  
    17.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    17.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    17.9  
   17.10  	This file is part of BeebAsm.
   17.11  
    18.1 --- a/src/macro.h	Thu Oct 06 18:19:01 2011 +0200
    18.2 +++ b/src/macro.h	Thu Jan 19 19:15:40 2012 +0100
    18.3 @@ -3,7 +3,7 @@
    18.4  	macro.h
    18.5  
    18.6  
    18.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    18.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    18.9  
   18.10  	This file is part of BeebAsm.
   18.11  
    19.1 --- a/src/main.cpp	Thu Oct 06 18:19:01 2011 +0200
    19.2 +++ b/src/main.cpp	Thu Jan 19 19:15:40 2012 +0100
    19.3 @@ -5,7 +5,7 @@
    19.4  	Main entry point for the application
    19.5  
    19.6  
    19.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    19.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    19.9  
   19.10  	This file is part of BeebAsm.
   19.11  
   19.12 @@ -41,7 +41,7 @@
   19.13  using namespace std;
   19.14  
   19.15  
   19.16 -#define VERSION "1.07"
   19.17 +#define VERSION "1.08"
   19.18  
   19.19  
   19.20  /*************************************************************************************************/
   19.21 @@ -233,8 +233,7 @@
   19.22  		for ( int pass = 0; pass < 2; pass++ )
   19.23  		{
   19.24  			GlobalData::Instance().SetPass( pass );
   19.25 -			ObjectCode::Instance().SetPC( 0 );
   19.26 -			ObjectCode::Instance().Clear( 0, 0x10000, false );
   19.27 +			ObjectCode::Instance().InitialisePass();
   19.28  			GlobalData::Instance().ResetForId();
   19.29  			srand( static_cast< unsigned int >( randomSeed ) );
   19.30  			SourceFile input( pInputFile );
    20.1 --- a/src/main.h	Thu Oct 06 18:19:01 2011 +0200
    20.2 +++ b/src/main.h	Thu Jan 19 19:15:40 2012 +0100
    20.3 @@ -3,7 +3,7 @@
    20.4  	main.h
    20.5  
    20.6  
    20.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    20.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    20.9  
   20.10  	This file is part of BeebAsm.
   20.11  
    21.1 --- a/src/objectcode.cpp	Thu Oct 06 18:19:01 2011 +0200
    21.2 +++ b/src/objectcode.cpp	Thu Jan 19 19:15:40 2012 +0100
    21.3 @@ -3,7 +3,7 @@
    21.4  	objectcode.cpp
    21.5  
    21.6  
    21.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    21.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    21.9  
   21.10  	This file is part of BeebAsm.
   21.11  
   21.12 @@ -82,13 +82,6 @@
   21.13  {
   21.14  	memset( m_aMemory, 0, sizeof m_aMemory );
   21.15  	memset( m_aFlags, 0, sizeof m_aFlags );
   21.16 -
   21.17 -	// initialise ascii mapping table
   21.18 -
   21.19 -	for ( int i = 0; i < 96; i++ )
   21.20 -	{
   21.21 -		m_aMapChar[ i ] = i + 32;
   21.22 -	}
   21.23  }
   21.24  
   21.25  
   21.26 @@ -105,6 +98,33 @@
   21.27  }
   21.28  
   21.29  
   21.30 +/*************************************************************************************************/
   21.31 +/**
   21.32 +	ObjectCode::InitialisePass()
   21.33 +
   21.34 +	Initialise at the beginning of each pass
   21.35 +*/
   21.36 +/*************************************************************************************************/
   21.37 +void ObjectCode::InitialisePass()
   21.38 +{
   21.39 +	// Reset CPU type and PC
   21.40 +
   21.41 +	SetCPU( 0 );
   21.42 +	SetPC( 0 );
   21.43 +	SymbolTable::Instance().ChangeSymbol( "P%", m_PC );
   21.44 +
   21.45 +	// Clear flags between passes
   21.46 +
   21.47 +	Clear( 0, 0x10000, false );
   21.48 +
   21.49 +	// initialise ascii mapping table
   21.50 +
   21.51 +	for ( int i = 0; i < 96; i++ )
   21.52 +	{
   21.53 +		m_aMapChar[ i ] = i + 32;
   21.54 +	}
   21.55 +}
   21.56 +
   21.57  
   21.58  /*************************************************************************************************/
   21.59  /**
   21.60 @@ -387,7 +407,7 @@
   21.61  
   21.62  /*************************************************************************************************/
   21.63  /**
   21.64 -	ObjectCode::SetMapping()
   21.65 +	ObjectCode::GetMapping()
   21.66  */
   21.67  /*************************************************************************************************/
   21.68  int ObjectCode::GetMapping( int ascii ) const
   21.69 @@ -395,3 +415,50 @@
   21.70  	assert( ascii > 31 && ascii < 127 );
   21.71  	return m_aMapChar[ ascii - 32 ];
   21.72  }
   21.73 +
   21.74 +
   21.75 +
   21.76 +/*************************************************************************************************/
   21.77 +/**
   21.78 +	ObjectCode::CopyBlock()
   21.79 +*/
   21.80 +/*************************************************************************************************/
   21.81 +void ObjectCode::CopyBlock( int start, int end, int dest )
   21.82 +{
   21.83 +	int length = end - start;
   21.84 +
   21.85 +	if ( start + length > 0x10000 ||
   21.86 +		 dest + length > 0x10000 )
   21.87 +	{
   21.88 +		throw AsmException_AssembleError_OutOfMemory();
   21.89 +	}
   21.90 +
   21.91 +	if ( start < dest )
   21.92 +	{
   21.93 +		for ( int i = length - 1; i >= 0; i-- )
   21.94 +		{
   21.95 +			if ( m_aFlags[ dest + i ] & GUARD )
   21.96 +			{
   21.97 +				throw AsmException_AssembleError_GuardHit();
   21.98 +			}
   21.99 +
  21.100 +			m_aMemory[ dest + i ] = m_aMemory[ start + i ];
  21.101 +			m_aFlags[ dest + i ] = m_aFlags[ start + i ];
  21.102 +			m_aFlags[ start + i ] &= ( CHECK | DONT_CHECK );
  21.103 +		}
  21.104 +	}
  21.105 +	else if ( start > dest )
  21.106 +	{
  21.107 +		for ( int i = 0; i < length; i++ )
  21.108 +		{
  21.109 +			if ( m_aFlags[ dest + i ] & GUARD )
  21.110 +			{
  21.111 +				throw AsmException_AssembleError_GuardHit();
  21.112 +			}
  21.113 +
  21.114 +			m_aMemory[ dest + i ] = m_aMemory[ start + i ];
  21.115 +			m_aFlags[ dest + i ] = m_aFlags[ start + i ];
  21.116 +			m_aFlags[ start + i ] &= ( CHECK | DONT_CHECK );
  21.117 +		}
  21.118 +	}
  21.119 +}
    22.1 --- a/src/objectcode.h	Thu Oct 06 18:19:01 2011 +0200
    22.2 +++ b/src/objectcode.h	Thu Jan 19 19:15:40 2012 +0100
    22.3 @@ -3,7 +3,7 @@
    22.4  	objectcode.h
    22.5  
    22.6  
    22.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    22.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    22.9  
   22.10  	This file is part of BeebAsm.
   22.11  
   22.12 @@ -43,6 +43,8 @@
   22.13  
   22.14  	inline const unsigned char* GetAddr( int i ) const { return m_aMemory + i; }
   22.15  
   22.16 +	void InitialisePass();
   22.17 +
   22.18  	void PutByte( unsigned int byte );
   22.19  	void Assemble1( unsigned int opcode );
   22.20  	void Assemble2( unsigned int opcode, unsigned int val );
   22.21 @@ -55,6 +57,7 @@
   22.22  	void SetMapping( int ascii, int mapped );
   22.23  	int GetMapping( int ascii ) const;
   22.24  
   22.25 +	void CopyBlock( int start, int end, int dest );
   22.26  
   22.27  private:
   22.28  
    23.1 --- a/src/sourcecode.cpp	Thu Oct 06 18:19:01 2011 +0200
    23.2 +++ b/src/sourcecode.cpp	Thu Jan 19 19:15:40 2012 +0100
    23.3 @@ -5,7 +5,7 @@
    23.4  	Represents a piece of source code, whether from a file, or a macro definition.
    23.5  
    23.6  
    23.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    23.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    23.9  
   23.10  	This file is part of BeebAsm.
   23.11  
    24.1 --- a/src/sourcecode.h	Thu Oct 06 18:19:01 2011 +0200
    24.2 +++ b/src/sourcecode.h	Thu Jan 19 19:15:40 2012 +0100
    24.3 @@ -3,7 +3,7 @@
    24.4  	sourcecode.h
    24.5  
    24.6  
    24.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    24.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    24.9  
   24.10  	This file is part of BeebAsm.
   24.11  
    25.1 --- a/src/sourcefile.cpp	Thu Oct 06 18:19:01 2011 +0200
    25.2 +++ b/src/sourcefile.cpp	Thu Jan 19 19:15:40 2012 +0100
    25.3 @@ -5,7 +5,7 @@
    25.4  	Assembles a file
    25.5  
    25.6  
    25.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    25.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    25.9  
   25.10  	This file is part of BeebAsm.
   25.11  
    26.1 --- a/src/sourcefile.h	Thu Oct 06 18:19:01 2011 +0200
    26.2 +++ b/src/sourcefile.h	Thu Jan 19 19:15:40 2012 +0100
    26.3 @@ -3,7 +3,7 @@
    26.4  	sourcefile.h
    26.5  
    26.6  
    26.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    26.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    26.9  
   26.10  	This file is part of BeebAsm.
   26.11  
    27.1 --- a/src/stringutils.cpp	Thu Oct 06 18:19:01 2011 +0200
    27.2 +++ b/src/stringutils.cpp	Thu Jan 19 19:15:40 2012 +0100
    27.3 @@ -3,7 +3,7 @@
    27.4  	stringutils.cpp
    27.5  
    27.6  
    27.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    27.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    27.9  
   27.10  	This file is part of BeebAsm.
   27.11  
    28.1 --- a/src/stringutils.h	Thu Oct 06 18:19:01 2011 +0200
    28.2 +++ b/src/stringutils.h	Thu Jan 19 19:15:40 2012 +0100
    28.3 @@ -3,7 +3,7 @@
    28.4  	stringutils.h
    28.5  
    28.6  
    28.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    28.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    28.9  
   28.10  	This file is part of BeebAsm.
   28.11  
    29.1 --- a/src/symboltable.cpp	Thu Oct 06 18:19:01 2011 +0200
    29.2 +++ b/src/symboltable.cpp	Thu Jan 19 19:15:40 2012 +0100
    29.3 @@ -3,7 +3,7 @@
    29.4  	symboltable.cpp
    29.5  
    29.6  
    29.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    29.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    29.9  
   29.10  	This file is part of BeebAsm.
   29.11  
    30.1 --- a/src/symboltable.h	Thu Oct 06 18:19:01 2011 +0200
    30.2 +++ b/src/symboltable.h	Thu Jan 19 19:15:40 2012 +0100
    30.3 @@ -3,7 +3,7 @@
    30.4  	symboltable.h
    30.5  
    30.6  
    30.7 -	Copyright (C) Rich Talbot-Watkins 2007 - 2011
    30.8 +	Copyright (C) Rich Talbot-Watkins 2007 - 2012
    30.9  
   30.10  	This file is part of BeebAsm.
   30.11