It is currently Mon Oct 20, 2014 5:32 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Anothe bug found.....
PostPosted: Mon Dec 01, 2008 3:04 am 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
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.


Top
 
PostPosted: Mon Dec 01, 2008 9:52 am 
Online
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
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!


Top
 
PostPosted: Mon Dec 01, 2008 2:40 pm 
Offline
 Profile

Joined: Thu Nov 06, 2008 1:13 am
Posts: 14
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.


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: