Author Topic: Features Wishlist  (Read 687150 times)

0 Members and 2 Guests are viewing this topic.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #1095 on: August 18, 2010, 02:24:12 pm »
I forgot to address the break and continue idea.  Those are both definitely possible, it could even be used in If and Switch statements which would be cool.  Finding a token in a convenient menu might be a challenge though.
I would say don't make Break exit just the If statement, but instead make it exit the loop outside. Otherwise you couldn't conditionally Break :P

Break should probably be required after each case of a switch statement of course, unless you want to the code to keep running into the next case (which might be useful actually).

Basically just do it like C, lol :P
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #1096 on: August 18, 2010, 02:40:14 pm »
Well I was thinking of instead of having just "Break" and "Continue", I also have "BreakIf" and "ContinueIf" as well as their conjugates since then they can be used in conditionals because I think that feature would be nice and this way the assembly is more optimized anyway than having a separate conditional.  Also, I'm not even sure how I could make it break out of multiple levels of nested statements anyway with the way I currently handle nested blocks.

My switch command is going to be really different as well.  I need it to be optimized enough where it is much more favorable to use so I think there will be no switch statement, only case statements.  For instance:

Code: [Select]
:
:A*12+(B/8)         .The last expression used becomes the switch statement automatically
:Case 0
:  .Function1
:Case 83
:  .Function2
:Case -1
:  .Function3
:End
:

The look-ahead parsing to pregenerate a jump table would be messy and memory hungry so I'd have to see how feasible it is.  So that means I am still unsure if automatic breaks would need to be implemented or not.  I'm also unsure if I want to make this command a single byte only command since it could lead to a huge optimization
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Features Wishlist
« Reply #1097 on: August 18, 2010, 03:23:38 pm »
I think doing switch, continue, and break like that are all good ideas.  My only request is to allow a "Default" case in the switch structure as well. :)

Offline LordConiupiter

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 339
  • Rating: +3/-0
  • Just one of the thousands of Axe-fans...
    • View Profile
Re: Features Wishlist
« Reply #1098 on: August 18, 2010, 03:37:34 pm »
The "Default" could be written like "Case ?" or perhaps "Else"?
« Last Edit: August 18, 2010, 03:37:59 pm by LordConiupiter »
everytime that I was down, you would always come around, and get my feedback on the ground. (modified part from 'Seasons in the sun')

No matter how many errors are bothering you, always try to stay rel-Axe!

The HoMM project will be resumed as soon Axe 1.0.0 will be released!
Projects:
Code: [Select]
HoMM:   [==--------]    Project 'resumed': I'm suffering overwhelming new ideas being popped up in my dreams :P
tiDE:   [----------]    Explored and understood the main part of the code: just started writing a Tokenizer.



password of the week: uvanapererubupa (Any pronunciation is the right one ;) )   :D click me, and you'll be raided :D

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: Features Wishlist
« Reply #1099 on: August 20, 2010, 07:25:18 am »
See the TI-Basic code below:

Code: [Select]
"HELLO"->Str1
Str1+" WORLD"->Str1

Can this be done in Axe? How?


And, as for the Bitmap( command, it says the structure pointed to should be width x height x rows of img. What does this mean exactly? Let's say I wanted a blank sprite that is 7x7 pixels. How should my arguments for Bitmap look (The X and Y can be an arbitrary X and Y)?
« Last Edit: August 20, 2010, 07:30:22 am by ACagliano »

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Features Wishlist
« Reply #1100 on: August 20, 2010, 08:25:50 am »
See the TI-Basic code below:

Code: [Select]
"HELLO"->Str1
Str1+" WORLD"->Str1

Can this be done in Axe? How?


And, as for the Bitmap( command, it says the structure pointed to should be width x height x rows of img. What does this mean exactly? Let's say I wanted a blank sprite that is 7x7 pixels. How should my arguments for Bitmap look (The X and Y can be an arbitrary X and Y)?
Here's a way to do what you said, I think. Note that extra data bytes are inserted after Str1 is defined. This is important! Otherwise the new data at Str1 would overflow into other data.

Code: [Select]
.Data initialization
"HELLO"->Str1
Zeros(6)
" WORLD"->Str2

.Code to append Str2 to Str1
.Copies length(Str2)+1 bytes to include null terminator
Copy(Str2,length(Str1)+Str1,length(Str2)+1)

Edit:
I also have a feature request. A function for _Insertmem and _Delmem (with a warning to use wisely :P)
« Last Edit: August 20, 2010, 08:36:49 am by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Features Wishlist
« Reply #1101 on: August 20, 2010, 09:42:32 am »
I also have a feature request. A function for _Insertmem and _Delmem (with a warning to use wisely :P)
O.o

I'd like them too, but only if they are used wisely.  I'll like the extra RAM. :)

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Features Wishlist
« Reply #1102 on: August 20, 2010, 12:03:26 pm »
Here's a way to do what you said, I think. Note that extra data bytes are inserted after Str1 is defined. This is important! Otherwise the new data at Str1 would overflow into other data.

Code: [Select]
.Data initialization
"HELLO"->Str1
Zeros(6)
" WORLD"->Str2

.Code to append Str2 to Str1
.Copies length(Str2)+1 bytes to include null terminator
Copy(Str2,length(Str1)+Str1,length(Str2)+1)

So, that takes Str1 and adds it to Str2? Writing it into my calculator with a Disp Str2 doesn't return "Hello World"
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Features Wishlist
« Reply #1103 on: August 20, 2010, 12:07:22 pm »
So, that takes Str1 and adds it to Str2? Writing it into my calculator with a Disp Str2 doesn't return "Hello World"
You need to do Disp Str1. :)

Before that the memory looks like this:
"HELLO",0,0,0,0,0,0,0," WORLD",0
After that, the memory looks like this:
"HELLO WORLD",0," WORLD",0

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Features Wishlist
« Reply #1104 on: August 20, 2010, 12:15:50 pm »
I also have a feature request. A function for _Insertmem and _Delmem (with a warning to use wisely :P)
To insert stuff at a memory address and offsetting some of the stuff below, right?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Features Wishlist
« Reply #1105 on: August 20, 2010, 12:50:04 pm »
You need to do Disp Str1. :)

Before that the memory looks like this:
"HELLO",0,0,0,0,0,0,0," WORLD",0
After that, the memory looks like this:
"HELLO WORLD",0," WORLD",0

I suspect something might be wrong with my calculator, then. The code I put in was

Code: [Select]
.AB
"Hello"->Str1
Zeros(6)
" World"->Str2
Copy(str2,length(Str1)+Str1,length(Str2)+1)
Disp Str1
While getkey=/=9
End

What I get back out is a blank line where Str1 should be displayed.
« Last Edit: August 20, 2010, 12:50:28 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: Features Wishlist
« Reply #1106 on: August 20, 2010, 01:35:59 pm »
That code should work.  Are you sure you recompiled it after making changes to the source?

The InsertMen and DeleteMem commands I was considering to add at one time, but then I realized that you can do basically the exact same thing by creating an appvar, string, program, etc. in ram and then delete it when you're done to get a quick temporary variable without any extra syntax.

By the way, I happened to stumble upon an undocumented bcall on brandonw's website that is nearly identical to BASIC's "Input" function, and so I've added that functionality now.  The way it works is that it stores the input to a temporary string in ram and returns the pointer to it just like you would read any other external string.  The only difficulty is that similar to strings, its token based instead of character based so anything that's not a number or uppercase letter has to be converted.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Features Wishlist
« Reply #1107 on: August 20, 2010, 01:43:28 pm »
Yep, it was recompiled. Looks like I'll have to just hope other calculators can understand if I ever use that in a program.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Features Wishlist
« Reply #1108 on: August 20, 2010, 01:58:18 pm »
The InsertMen and DeleteMem commands I was considering to add at one time, but then I realized that you can do basically the exact same thing by creating an appvar, string, program, etc. in ram and then delete it when you're done to get a quick temporary variable without any extra syntax.
Yes but working at a fixed address would be faster, and I'm all for more speed. ;D

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #1109 on: August 20, 2010, 02:40:28 pm »
I'd really like InsertMem and DelMem. I'm currently working on a project that stores data in an appvar that can get very large and change size, and there may not be enough RAM to make a whole other appvar of the new size to coy the data into.