6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue Jul 02, 2024 1:24 am

All times are UTC




Post new topic Reply to topic  [ 33 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Tue Jan 30, 2018 6:13 pm 
Offline
User avatar

Joined: Mon May 12, 2014 6:18 pm
Posts: 365
Quote:
whartung wrote:
Druzyek wrote:
Exactly. This is why I think a program to figure out what goes where would be a great help.

They call programs that do this "compilers".
What I'm thinking about would better be called an optimizer. To be a compiler it would have to produce machine code, not just reworked assembly.

[quote]This is exactly what prompted me to come up with PLASMA: Proto Language AsSembler for Apple.[quote]Cool! I saw one of your demonstration videos about PLASMA. Are you still working with byte code? How do you split up memory usage in functions between zero page and the data stack?


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 30, 2018 6:37 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
Druzyek wrote:
To be a compiler it would have to produce machine code, not just reworked assembly.

Sorry, can't say I quite see the difference.

Many compilers create assembly source code. Even compiler writers realize its far easier for an assembler to create machine code than to incorporate all that in to the code generation of the compiler itself.

Naturally there are always exceptions.


Top
 Profile  
Reply with quote  
PostPosted: Tue Jan 30, 2018 9:50 pm 
Offline

Joined: Sat Dec 12, 2015 7:48 pm
Posts: 126
Location: Lake Tahoe
Druzyek wrote:
Quote:
whartung wrote:
Druzyek wrote:
Exactly. This is why I think a program to figure out what goes where would be a great help.

They call programs that do this "compilers".
What I'm thinking about would better be called an optimizer. To be a compiler it would have to produce machine code, not just reworked assembly.

Quote:
This is exactly what prompted me to come up with PLASMA: Proto Language AsSembler for Apple.

Quote:
Cool! I saw one of your demonstration videos about PLASMA. Are you still working with byte code? How do you split up memory usage in functions between zero page and the data stack?


This is where I diverged from the original concept of three output options: byte code, threaded code, and pure native code. The code is still on the backwaters of SourceForge: http://vm02.sf.net but I've focussed on the byte code implementation for all subsequent versions. It's pretty easy to conceptualize the byte codes as macros to be expanded in-line.

The zero page usage breaks down as a split evaluation stack indexed by X, a NEXTOP/FETCHOP that isn't needed for non-bytecode implementations, a local frame stack pointer for all the local variables, and some temps. All values are copied to the evaluations stack for processing (but caching TOS in A,Y really helps here for native code).

Dave...


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 12 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: