Author Topic: Features Wishlist  (Read 702722 times)

0 Members and 1 Guest are viewing this topic.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #1695 on: December 25, 2010, 02:22:35 am »
Those new features sound excellent :D and speaking of, i have a new request.  The If A=# changing into !If A-# is such a great optimization (6 bytes and a speed increase).  Maybe it would be worthwhile into looking into auto optimizing that?  I know its got to be used a lot in programs, i went through PortalX and found so many places where it could be optimized, possibly hundreds of bytes saved, and im sure other programs could benefit too :)

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #1696 on: December 25, 2010, 03:03:52 am »
That's a nice idea Builderboy, but unfortunately users have to choose to optimize their own code in cases like this. This is because, although If A=B and !If A-B would form identical control structures, they would not return the same values. And the programmer may want to use the value returned. For instance, the following code would no longer work as the programmer planned if this auto-optimization existed:

Code: [Select]
If A=5
  →B
  .Do stuff
Else
  .Do stuff
End
« Last Edit: December 25, 2010, 03:05:13 am by Runer112 »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Features Wishlist
« Reply #1697 on: December 25, 2010, 03:23:12 am »
ah i see what you mean, i guess its just a matter of having to optimize it ourselves then, which works too :)

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 #1698 on: December 25, 2010, 03:29:59 am »
Runner, the one I made is much smaller than the one from WikiTI:

Code: ("ASM") [Select]
p_DispHex:
ld b,4
__DispHexLoop:
xor a
add hl,hl
rla
add hl,hl
rla
add hl,hl
rla
add hl,hl
rla
add a,$90
daa
adc a,$40
daa
B_CALL(_PutC)
djnz __DispHexLoop
ret

It would be about 8 bytes larger to save it to a buffer.  The syntax wouldn't really work well though because axe would throw a fit if you tried to do Disp A►Hex->B for instance since the display routine looks for commas.  You would have to do some hackish code by putting the store on the line after it or using the address of the buffer directly.  But I guess if this is a conversion command rather than a display command this could be allowed... and then I would only need one routine for both display and text.  That might actually work.   I will have to see if I can make that more consistent with the other display format commands because that does sound convenient.

Builderboy.  I really want to but I'm afraid it will break too much compatibility with current Axe programs.  For instance:

Code: ("Axe") [Select]
:A+1->A
:If A=10
:->A
:End

This code increments A and if it goes above 10 rests it back to 1.  Here you are using the fact that the result of the if expression is a one if it ends up going inside the block.  It would be impossible for me to tell if the next expression is going to use the result of the if expression or not.

NINJA'D!
« Last Edit: December 25, 2010, 03:32:48 am by Quigibo »
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Features Wishlist
« Reply #1699 on: December 25, 2010, 04:04:47 am »
Yeah, I think it would be nice to make it secretly be a conversion command, not an actual display command. Although it makes the routine slightly larger, I think it would definitely be worth it.

And by the way, optimization of your code ;)

Code: [Select]
p_DispHex:
ld b,4
__DispHexLoop:
ld a,$1F
__DispHexShiftLoop:
add hl,hl
rla
jr nc,__DispHexShiftLoop
daa
add a,$A0
adc a,$40
B_CALL(_PutC)
djnz __DispHexLoop
ret

And here's what your code modified into a hex conversion routine might look like:

Code: [Select]
p_ConvHex:
ld de,vx_Hex
push de
ld b,4
__ConvHexLoop:
ld a,$1F
__ConvHexShiftLoop:
add hl,hl
rla
jr nc,__ConvHexShiftLoop
daa
add a,$A0
adc a,$40
ld (de),a
inc de
djnz __ConvHexLoop
xor a
ld (de),a
pop hl
ret
« Last Edit: December 25, 2010, 04:06:32 am by Runer112 »

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 #1700 on: December 25, 2010, 06:20:39 am »
Thanks Runer!  Its actually kind of freaky how nearly identical it was to my modifications O.O  But I didn't catch that one with the daa since I'm still not entirely sure how that instruction works.

I should be on schedule for an update tomorrow night.  ;D
___Axe_Parser___
Today the calculator, tomorrow the world!

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 #1701 on: December 25, 2010, 07:22:03 am »
Nice! I can't wait, because I already have plenty of ideas how to re-create my constest entry, but I want to do it in Axe 1.0.0 ;)

*LC wishes he could understand all those ASM code snippets, and decides to look for a clear tut somewhere*
« Last Edit: December 25, 2010, 07:22:30 am 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 jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Features Wishlist
« Reply #1702 on: December 25, 2010, 10:13:05 pm »
Actually, I just thought how awesome it would be if Axe supported usb. Even if it was an axiom or something. But, it's such a pain, that I wouldn't ask for it, but would rather do it.

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 #1703 on: December 26, 2010, 02:57:15 am »
Awesome updates QUigibo!

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Features Wishlist
« Reply #1704 on: December 26, 2010, 10:26:00 am »
I had an idea:

Code: [Select]
Disp "Hello"
. THIS IS A COMMENT
Disp "This is not a com."
. THIS IS A NEW COMMENT

What if we could have

Code: [Select]
...
This is a comment
This is also a comment
This is the third line of the comment
And this is the last line of a multi-line comment
...
Disp "This is not a com."

Multi-Line comments would be very useful for me, and I hope other people too, because I sometimes want to keep 10 lines of code in a program, but hide it for debugging. I have to put a '.' before all lines and that's very tiring on-calc.

Probably someone already suggested this feature, but this thread is 114 pages long :S

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Features Wishlist
« Reply #1705 on: December 26, 2010, 04:47:56 pm »
I haven't seen requests for multi-line comments yet, actually.
That doesn't seem like it would be too difficult to implement, either.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
-Adam Osborne
Spoiler For "PartesOS links":
I'll put it online when it does something.

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Features Wishlist
« Reply #1706 on: December 26, 2010, 04:48:04 pm »
Instead of ..., why not have it have an opening and closing comment character. That way, you don't get confused too.

Offline nemo

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1203
  • Rating: +95/-11
    • View Profile
Re: Features Wishlist
« Reply #1707 on: December 26, 2010, 04:49:06 pm »
/.
comment
./

how about that?

edit: nevermind that's not really accessible on calc..
« Last Edit: December 26, 2010, 04:49:32 pm by nemo »


Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Features Wishlist
« Reply #1708 on: December 26, 2010, 04:49:21 pm »
Instead of ..., why not have it have an opening and closing comment character. That way, you don't get confused too.

Yes, '...' was just an idea.

What about

'./


/.'
« Last Edit: December 26, 2010, 04:49:34 pm by ScoutDavid »

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Features Wishlist
« Reply #1709 on: December 26, 2010, 04:50:32 pm »
/.
comment
./

how about that?

edit: nevermind that's not really accessible on calc..

That might get complicated for Axe, since / is already used for something. . already means a comment anyway, so I support the ... suggestion. Multi-line comments would be nice :)

EDIT: Just read what graphmastur said. How about .< to open and .> to close, then?
« Last Edit: December 26, 2010, 04:51:13 pm by Deep Thought »