Search found 21 matches

by rudla.kudla
Mon Jul 15, 2013 11:17 am
Forum: NESdev
Topic: Small C for NES: A Curious Journey
Replies: 69
Views: 13152

Re: Small C for NES: A Curious Journey

Hi, as the author of Atalan I can assure you it's not yet in the state of semi-abandonware :-) I'm rewriting significant (well almost all) parts of Atalan based on the experience I acquired when writing the version 0. That's why I'm not commiting the changes to repository as the compiler currently c...
by rudla.kudla
Thu Apr 05, 2012 2:14 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

Improved optimization

Being provoked by previous posts, I have decided to implement new optimizations (and thus introduce new bugs) instead of fixing bugs. :-) For this code: use NES const EDIT_CURSOR_TILEID = 100 const EditCursorCHR:array() = 0,1,2,3,4,5,6,7 ppu.ptr = EDIT_CURSOR_TILEID*16 for i:0..7 ppu.data = 0 for i:...
by rudla.kudla
Sun Mar 25, 2012 4:27 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

The inferring does not work with global variables. That's what you use in your first example.
by rudla.kudla
Sun Mar 25, 2012 3:23 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

Atalan tries to infer set of possible values of the result of every operator in the code. So it not only deduces, that the variable should be integer, but also the range of the integer. The following examples use type assert. assert x:min..max makes sure the compiler at specified line inferred the r...
by rudla.kudla
Sun Mar 25, 2012 12:56 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

Thanks for trying Atalan. I'm sorry your experience has not been better. Atalan is still work in progress (and will probably be forever :-) ) and not much code has been written in it, therefore it is not impossible (or even hard) to encounter error in parsing. They are usually easy to fix, and I wil...
by rudla.kudla
Wed Jul 20, 2011 8:40 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

Then I believe Atalan may be just the right thing for you :-) Errors are single most significant problem in new programming language. The number of combinations of different features is simply unlimited! However, we do not so much talk about newbies. How many of us, who still develop something for 8...
by rudla.kudla
Mon Jul 18, 2011 11:43 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

Well, if you implement local variables like this, then nothing prevents you from implementing function calls in expressions. You do not need the stack then. It may be useful to think about the goals of your language. I understand very well that you want to try to implement your own language, not jus...
by rudla.kudla
Mon Jul 18, 2011 8:54 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

Local variables are quite easy. I will try to demonstrate the concept: p:x, y, z -> q = a = x + y q = a * z s = p 13,10,4 can be translated to: p: p_x, p_y, p_z -> p_q = p_a = p_x + p_y p_q = p_a * p_z p_x = 13 p_y = 10 p_z = 4 call p s = p_q Now all the variables are global, only some have 'p_' pre...
by rudla.kudla
Mon Jul 18, 2011 7:52 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

However this static assignment of temporary variable space means that the entire scope of the expression must be constant, knowable at compile-time and consistent. This is why function calls within expressions are not possible. That's not really true, you know. Atalan does it. Local variables, func...
by rudla.kudla
Mon Jul 18, 2011 5:21 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

Oh, I forgot, could you, please, provide more information on Memory files (large arrays using pointers for indexing).

?
How exactly does such structure look and what are the operations?

Thanks,

Rudla
by rudla.kudla
Mon Jul 18, 2011 5:20 am
Forum: NESdev
Topic: Thoughts on Higher Level Language Design for 6502 Systems
Replies: 77
Views: 23593

When discussing the language design, you must first decide, whether you are going to implement the language on 6502 system or as a cross-compiler. While it is possible to implement a decent native compiler (see Action!), I believe today it does not have much practical sense, so let's talk about cros...
by rudla.kudla
Sun Nov 28, 2010 4:23 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

You inspired me to develop optimization for these cases. :-) Now the code looks like this (see how that same optimization applied at the beginning of the source code): RANDOM equ 53770 VCOUNT equ 54283 WSYNC equ 54282 button__state__pressed equ 0 STRIG equ 644 DMACTL equ 559 player_size equ 53256 pl...
by rudla.kudla
Tue Nov 23, 2010 2:37 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

@mic_:

Your guess is correct.
Loop optimizer decided x could be used throughout the loop and does not need to be reloaded - it's value was originally in a. The lda #0 tax is the last remaining artifact of this.
by rudla.kudla
Tue Nov 23, 2010 1:50 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

Optimizer currently has rule, that it won't change short instruction to longer one (i.e. tax to ldx #0). In this situation, the rule should be more complicated - it should recognize, the lda #0 would not b needed if ldx #0 is used. But that is to be done, yet. Optimizer is not perfect yet, but I bel...
by rudla.kudla
Tue Nov 23, 2010 12:53 pm
Forum: NESdev
Topic: ATALAN - new programming language for 6502
Replies: 36
Views: 13832

As an example of quality of generated code, see for example this simple program and it's translation to 6502 code. ; Horizontal Stars ; Demo program for ATALAN programming language ;(c) 2010 Rudla Kudla i:0..242 ; number of lines with stars hpos:array(242) of byte speed:array(242) of 1..4 col:array(...