6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu May 09, 2024 10:37 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
PostPosted: Sat Dec 06, 2014 8:44 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 575
Interesting. Given that memory is plentiful on the '816 wasting a byte for each stored address seems acceptable to avoid that penalty.


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 07, 2014 6:47 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1928
Location: Sacramento, CA, USA
Dr Jefyll wrote:
Oops -- thanks, Mike. You've reminded me to mention that my "times 2" and "times 4" comments apply when the underlying machine addresses bytes -- unlike yours, obviously! And of course byte addressing, though sometimes handy, is hardly a necessity.

Since it does nothing (multiplies "times 1"), your code for cells has only one optimization possible. When cells appears in the source code have it defined to do nothing then, not at run time. IOW don't even compile a jump to NEXT. :shock: :D

J

I don't know this for sure, but doesn't CELLS have to be present in some form or other to be considered "ANS compliant"? Or does that only apply to the source code of a compliant program, and not the actual compiler output? (Still learning ...)

Maybe I could try this instead?
Code:
                 ; 1035 ;--------------------------------------------------------- CELLS
00000318:00000313; 1036         NOT_IMM 'CELLS'
00000319:0543454c; 1036
0000031a:4c530000; 1036
                 ; 1037 _cells: ; ( n -- n' )  Cells->address units
0000031b:00000053; 1038         .dw  donext_

I'm not sure if that's kosher or not (comments welcome), but I think that's about as far as I could go, at least in ITC. With no actual unique code field, it might make de-compiling or tracing a bit confusing at times, no?

Mike


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 07, 2014 7:45 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8432
Location: Southern California
Do this:

: CELLS ; IMMEDIATE

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
PostPosted: Sun Dec 07, 2014 8:23 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8177
Location: Midwestern USA
Martin_H wrote:
Interesting. Given that memory is plentiful on the '816 wasting a byte for each stored address seems acceptable to avoid that penalty.

It's the age-old tradeoff between performance and resource conservation.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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: