Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - rvw

Pages: [1]
1
The Axe Parser Project / Re: Axe Parser
« on: May 30, 2010, 12:14:20 pm »
And about commands.htm:
Fix CODE: Changes how text is drawn. Code must be a constant.
Wouldn't it make more sense to make CODE consist of flags? That way you can set multiple values at once. Especially useful if you want to reset everything at the end of your code.
That's actually a really cool suggestion!  Are you suggesting that saying Fix 135 would behave the same as Fix 1:Fix 3:Fix 5 ?  That could work, I like the idea!
Actually, I was thinking about binary flags. There's two possible ways to do this though...
Option 1: BigText = 1, so passing in any odd number (number with lsb set) will enable BigText while any even number (lsb reset) will automatically enable SmallText.
Option 2: make seperate, independent flags for "opposite options". So BigText = 1, SmallText = 2 (next option = 4, etc.).
Benefits option 1: room for more flags (I have no idea whether this is an issue), possibly more intuitive, probably easier to execute (the internal function which gets called when a programmer uses "Fix" would be smaller and faster).
Benefits option 2: it's possible to set one option without changing (and without knowing the current value of) other options (I don't know whether there are any situations where you'd want to do this).
Which option to choose (1, 2 or the approach you suggested yourself) is something you have to decide, I just wanted to point out the possibilities.

Btw, I understand Axe was developed specifically to be editable on-calc. However, I wonder whether you've thought about making a computer version as well? The data structure (source program) both versions see would be identical, so the port should be pretty straight-forward. (Well, except for the .8xp header, but that's not a big issue; the encoding of the content itself is the same, which makes life far easier.) I'm thinking about developing on-calc, then when you've completed your program (when you have to transfer it to a computer anyway if you intend to share it with more people then just a couple of friends), you pull it through a compiler which really tries hard to optimize things as far as possible, potentially using techniques which are just not suitable for the on-calc compiler.

Pointers (page 9)
Actually, there's no such thing as "the zeroth item"; the correct way to say this would be "the first byte has address zero, the second byte has address one". Not exactly intuitive, I know. If you don't want to change this I can understand.
Actually, in computer science, you really DO start counting at zero so you can have a 0th element as part of a list.
Like I said, it's a minor nit-pick; it's more of a linguistics thing than a technical one. I'm a computer science student myself, the standard example I know is "you have five fingers, with indices 0, 1, 2, 3 and 4. The first has index zero, the second has index one, ..., the fifth (and last) has index four." Essentially, ordinal numbers start at "first" (both in computer science and in general) while cardinal numbers start at zero (at least in computer science). With "ordinal numbers" and "cardinal numbers" I mean the linguistic terms.

2
The Axe Parser Project / Re: Axe Parser
« on: May 29, 2010, 09:25:33 pm »
Hello,

I just saw Axe on ticalc.org. At the moment I don't have a physical calculator to test with, nor do I have a ROM dump on this machine. My comments are based only on the text in "Documentation.pdf". Here's some feedback on it:

Pointers (page 9)
"The 0th byte has the address 0, the 1st byte has the address 1, all the way up to the last byte with the address 65536."

Minor nit-picking:
Actually, there's no such thing as "the zeroth item"; the correct way to say this would be "the first byte has address zero, the second byte has address one". Not exactly intuitive, I know. If you don't want to change this I can understand.

Actual error:
The last byte has address 65535.

Data & Arrays (page 11)

"Disp {A+GDB1},i"
It might be easier to understand to write "GDB1+A" (assuming that Axe understands this; I didn't check, but assume it does). I understand the current notation is not so much wrong, but it could be unclear for beginning programmers.
Since you are very consistent about this notation, I assume there's a reason for it... performance? Can Axe optimize "A+GDB1" better than it optimizes "GDB1+A"? If so, maybe you should explicitely state both are valid, but "A+GDB1" is slightly faster.

"We use the curly brackets to indicate that we want the byte that's at the address of the pointer, not the the value of the pointer itself."
From reading your code samples:
Disp Str1        Displays the contents of the (probably zero-terminated) string starting at the address in Str1.
Disp {A+GDB1}    Displays the value of the single byte at base address GDB1 incremented with offset A.

That's quite a difference from what you're saying in the documentation...

Data & Arrays (page 11)

The comments for one of the pieces of sample code say "BAISC", oops...

An Example Program (page 14)

You're already using the "optimized dual-store":
0->S-1->D
This hasn't been explained yet and is hardly standard notation. Putting a note "see page 17 for details" would be helpful.

Optimization tricks (page 17)

"Evaluate all constant expressions before compiling."
It would be very awesome if you could teach Axe to recognize expressions working on two constants and automatically decide to pre-compute them...

"If the last line of your program is Return, then remove it. Even if it was part of a subroutine, the return is automatically added at the end for you so there's no need to have 2 returns at the end. Saves 1 byte."
Uhm, that saves 1 byte in the source, not in the executable, right?

And about commands.htm:
Fix CODE: Changes how text is drawn. Code must be a constant.
Wouldn't it make more sense to make CODE consist of flags? That way you can set multiple values at once. Especially useful if you want to reset everything at the end of your code.

ReturnIf EXP
Is there a special reason to include this? It seems to be equivalent to If EXP Return End.


Cool project!

Pages: [1]