c++

You need an actual VIC.

Moderator: Moderators

User avatar
beamrider
Vic 20 Nerd
Posts: 814
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

c++

Postby beamrider » Wed Oct 05, 2016 12:00 pm

https://www.youtube.com/watch?v=zBkNBP00wJE

Interesting presentation. Could equally apply to the Vic-20. Certainly seems to generate leaner code than CC65.

groepaz
Vic 20 Nerd
Posts: 553
Joined: Wed Aug 25, 2010 5:30 pm

Re: c++

Postby groepaz » Wed Oct 05, 2016 12:40 pm

Certainly seems to generate leaner code than CC65

actually, no it doesnt

User avatar
beamrider
Vic 20 Nerd
Posts: 814
Joined: Sun Oct 17, 2010 2:28 pm
Location: UK

Re: c++

Postby beamrider » Wed Oct 05, 2016 2:50 pm

so does CC65 support in-lining now?

groepaz
Vic 20 Nerd
Posts: 553
Joined: Wed Aug 25, 2010 5:30 pm

Re: c++

Postby groepaz » Wed Oct 05, 2016 3:07 pm

not really (*) - however what you saw in that video can easily be done in cc65, and it will result in better code than what is shown in that video. remember what they are doing is using a x86 compiler, and then translating x86 code to 6502 - which doesnt work well or efficient at all. actually the whole "lets use 6502 as an example" is pretty misleading, the techniques shown are useful for targets for which an actual c++ compiler backend exists - but their x86-to-6502 translator thing isnt really usable for anything (it even chokes on some simple stuff in the video at some point).

(*) some sort of inlining happens by wrapping function calls into macros, and using eg the VIC structs for accessing registers in a similar way as in that video will result in the same "perfect" lda/sta code.


Return to “Emulation and Cross Development”

Who is online

Users browsing this forum: No registered users and 1 guest