' @(#) $Header: /home/abrown/public_html/first/first2003chs/software/simulator/RCS/pbtest2.bsx,v 2.3 2006/12/14 19:40:16 abrown Exp $
' Allen Brown date="20061214 11:33:37"
' -----------------------------------------------------------------
' pbtest1.bsx is a simple test suite for the pb2c translator.
' It needs to be expanded greatly to test more of the language.
'
' Copyright (C) 2002 Allen Brown
'
' This program is free software; you can redistribute it and/or modify
' it under the terms of the GNU General Public License version 2 as
' published by the Free Software Foundation.
'
' 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
'
' To contact the author of this software:
' Allen Brown
' PO Box J
' Corvallis, OR
'
' http://brown.armoredpenguin.com/~abrown/contact.html
' -----------------------------------------------------------------
vara var word
varb var byte
vara = 3 + 1
varb = 2
'%assertpbnumber( vara, makepbnumber( 0, 4, 16, 0, "vara" ),"38" );
'%assertpbnumber( varb, makepbnumber( 0, 2, 8, 0, "varb" ),"39" );
loop:
vara = vara + varb
varb = varb + 1
'%printf( "vara=%d(%x).\n", *vara.vpoint, *vara.vpoint );
'%printf( "varb=%d(%x).\n", *varb.vpoint, *varb.vpoint );
if vara > 1000 then exitloop:
goto loop:
exitloop:
varb = (varb - vara) + 2
'%printf( "varb=%d(%x).\n", *varb.vpoint, *varb.vpoint );
varb = varb + $12
'%printf( "varb=%d(%x).\n", *varb.vpoint, *varb.vpoint );
' varb = varb + %0101
'%printf( "varb=%d(%x).\n", *varb.vpoint, *varb.vpoint );