www.retrosoftware.co.uk
http://www.retrosoftware.co.uk/forum/

Anothe bug found.....
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=17&t=220
Page 1 of 1

Author:  PhillHS [ Mon Dec 01, 2008 3:04 am ]
Post subject:  Anothe bug found.....

This one's in the implementation of the > and < operators, the documentation states :-

Code:
LO(val) or <val     Return lsb of 16-bit expression (like 'val MOD 256')
HI(val) or >val    Return msb of 16-bit expression (like 'val DIV 256')


The actual code is :-

Code:
   { "HI",   10,   &LineParser::EvalHi },
   { "LO",   10,   &LineParser::EvalLo },
   { "<",      10,   &LineParser::EvalHi },
   { ">",      10,   &LineParser::EvalLo },


Clearly the documentation and the code are oposite to each other for > and < (though correct for LO and HI), the documentation agrees with the behavior of other 6502 assemblers (e.g. TASS, 6502sim), so it would be sensible to change the code to agree.

Also to aid in porting code over from other assemblers would it be possible to have BeebAsm recognise '$' as a prefix for hex constants as well as '&', I have tested this in my local copy and it seems to work well.

Cheers.

Phill.

Author:  RichTW [ Mon Dec 01, 2008 9:52 am ]
Post subject:  Re: Anothe bug found.....

Haha, thanks. What a stupid bug!

Those < and > operators always confuse me in assemblers, which was the very reason I implemented HI and LO. Nice to see that they STILL confuse me, even when I was trying very hard to get them right :D

OK, I'll swap those around - and I'll add '$' for hex, since it's not used for anything else. Perhaps I'll also add a % prefix for binary while I'm about it.

Cheers!

Author:  PhillHS [ Mon Dec 01, 2008 2:40 pm ]
Post subject:  Re: Anothe bug found.....

RichTW wrote:
Haha, thanks. What a stupid bug!


Indeed, though things like this are easy enough done when coding :)

Quote:
Those < and > operators always confuse me in assemblers, which was the very reason I implemented HI and LO. Nice to see that they STILL confuse me, even when I was trying very hard to get them right :D


Yes normally I would use hi/low myself, but this was code that I was porting from another assembler, which I guess didn't have hi/lo.

Quote:
OK, I'll swap those around - and I'll add '$' for hex, since it's not used for anything else. Perhaps I'll also add a % prefix for binary while I'm about it.


Yeah % for binary would prolly be usefull too.

Cheers.

Phill.

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/