Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
22 May, 2013, 20:29:28 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 82 83 [84] 85 86 ... 110   Go Down
  Print  
Author Topic: Axe Q&A -  (Read 59454 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 17:37:02
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1245 on: 17 December, 2011, 19:57:26 »
0

getKey(2)?X--
Evidently not, when I tried something like that it threw an error at compile-time. Undecided

I get no such error, and there should be no difference between the two syntaxes. You mentioned something about Pt-X commands not working in them, and this is true, but not because of a syntax difference. It's because Axe requires that some comamnds start a line, and the Pt-X commands are among them, so you can't use them mid-line in an inline conditional.
Logged
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 19:41:15
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2169


Total Post Ratings: +119

View Profile
« Reply #1246 on: 17 December, 2011, 19:58:54 »
0

Any other often-used commands that can't be used with ? ?
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
chattahippie
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 March, 2013, 05:21:38
Date Registered: 19 July, 2011, 04:13:49
Location: Somewhere
Posts: 358


Total Post Ratings: +27

View Profile
« Reply #1247 on: 17 December, 2011, 20:00:32 »
0

A ? is an "if and only if" statement, right?
Logged
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 17:37:02
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1248 on: 17 December, 2011, 20:01:04 »
+1

The general rule is, if the command token starts with a capital letter, it has to be at the start of a line.
Logged
epic7
Chopin!
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 19:41:15
Date Registered: 22 October, 2011, 01:45:43
Location: Northeast US
Posts: 2169


Total Post Ratings: +119

View Profile
« Reply #1249 on: 17 December, 2011, 20:03:49 »
0

Like the first word of a sentence Tongue

Ok, I guess there is a lot of differences since there's lots of commands starting with capitals.
Logged



Current Projects:
TitleLanguageProgressStatus
DrillMiner    C (ndless)   35%         Active
?     C (ndless)   0%        Unconfirmed

Spoiler for Programming languages I currently know:
Java (Learning in AP Comp Sci)
C (Specifically Ndless)
Unity JavaScript
LabView (For FIRST robotics)
z80 ASM (Just a little bit Tongue)
Darl181
Vy'o'us pleorsdtu tlh'e gjaemue.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Gender: Male
Last Login: Today at 18:24:34
Date Registered: 10 June, 2010, 00:32:08
Location: {I*9+L₁+1},{I*9+L₁+3}
Posts: 3276


Total Post Ratings: +267

View Profile WWW
« Reply #1250 on: 17 December, 2011, 20:04:50 »
0

So, the compiled size is the same?

(also 84 pages Tongue)

Also just noticed this:
i think that is becasue X-- is a command, not a value.  Try x-1->x
That one has worked for me, even in the conditional.

(btw @epic X-getKey(2)→X would work for the example code Tongue)
« Last Edit: 17 December, 2011, 20:07:59 by Darl181 » Logged




 
Spoiler for Stuff:



OS 2.43  Boot 1.02  Hardware Rev. B

OS 1.04.32

OS 3.1.0.392  Boot1 3.0.99  Boot2 3.10.16
Spoiler for Misc:
Quote
You'll understand / It's not a shame / To be always / Losing the game / Burma-Shave
"Dynamic userbars!"
Omnimaga radio
Interactive Omnimaga radio
Our World of Text
Draw on websites
Then blow them up
In-browser flight simulator
Haxball: MMO soccer/air hockey game
  Draw with sand.  Yay?
The Game
You just lost the game
Zombo.com
light post color is #dfefff
dark post color is #cae4ff
quote box color is #6699ff
transparent color is...transparent 0.o
Spoiler for Forum search alternative (bookmarklet):
https://www.squarefree.com/bookmarklets/search.html
javascript:q=""+(window.getSelection?window.getSelection():document.getSelection?document.getSelection():document.selection.createRange().text);if(!q)q=prompt("No%20selected%20text;%20enter%20search%20term.").replace(/\s\+/g,"%252B");if(q!=null)location="http://www.google.com/search?q="+q.replace(/\s+/g,"+")+"+site:"+location.hostname;void(0);
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 17:37:02
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1251 on: 17 December, 2011, 20:08:11 »
0

Yes. X?Y produces the same code as If X : Y : End, and X?Y,Z produces the same code as If X : Y : Else : Z : End.
Logged
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1252 on: 19 December, 2011, 14:07:12 »
0

I have a question: why doesn't this code work? (It compiles, but it glitches on me)
0→{S}→{S+5}→{S+15}
and S is the pointer to appvar.
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #1253 on: 19 December, 2011, 14:10:57 »
0

I have a question: why doesn't this code work? (It compiles, but it glitches on me)
0→{S}→{S+5}→{S+15}
and S is the pointer to appvar.
(I just had this happen to me too and I spent a couple of hours before getting Runer's help and facepalming.)

Because of the way Axe optimizes, number→{pointer} returns the pointer instead of the number.  The code equivalent to what you are doing is actually this:
:0→{S} :S→{S+5} :S+5→{S+15}
Logged

Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1254 on: 19 December, 2011, 14:13:30 »
0

oh! Big frown
Thank you. Now I can optimize stuff a bit more!
(I was using 0→{S}:0→{S+5}:etc)
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 17:37:02
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1255 on: 19 December, 2011, 18:37:24 »
+2

If you're wondering, the optimized way to do that would be:

and 0→{→{→{S}+5}+10}
Logged
Freyaday
The One And Only Serial Time Killing Catboy-Loli-Ballerino
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 19:17:51
Date Registered: 24 February, 2011, 17:10:56
Location: ¿¿¿
Posts: 1889


Total Post Ratings: +110

View Profile WWW
« Reply #1256 on: 20 December, 2011, 01:03:44 »
0

If you're wondering, the optimized way to do that would be:

and 0→{→{→{S}+5}+10}
I find it both scary and hilarious how unreadable that is. I can almost guarantee that optimized Axe code will elict a WTF? from the viewer. Even if you're the one that wrote it Tongue
Logged

In other news, Frey continues kicking unprecedented levels of ass.
Proud member of LF#N--Lolis For #9678B6 Names


Beware the Bitulator! ,.,./`My Artwork!
Yeong
Eternally Young Scarlet Moon
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: 20 May, 2013, 01:44:48
Date Registered: 15 October, 2010, 04:29:49
Location: Arden, NC
Posts: 3694


Total Post Ratings: +260

View Profile
« Reply #1257 on: 20 December, 2011, 03:39:44 »
0

question from the former code: what does that "and" do?
Logged

Project Redemption....

My project progresses:HERE
My Pastebin stuffs:HERE
Check your rate: HERE
My Animations: HERE
Spoiler for Images :D:

ノ◕ヮ◕)ノ:・゚ PENGUIN WAVE!!:„ø¤º°¨ ¨°º¤KEEP THE PENGUIN GOING ¸„ø¤º°¨ ¨°º¤øº LETS GO PENGUIN !¤¤º°¨¨°º¤øº¤ø„¸¸ø¤º°¨„ ø¤º°¨¨°º
Builderboy
Physics Guru
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Today at 12:12:34
Date Registered: 20 April, 2009, 00:28:53
Location: Ravenholm
Posts: 5642


Total Post Ratings: +589

View Profile
« Reply #1258 on: 20 December, 2011, 04:33:12 »
0

I think it generates the number 0 without actually storing it in the program.  It basically AND's the previous value of HL with 0, which always results in 0.  Similar to how assembly optimizers often do XOR A instead of Ld A,0
Logged

Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: 19 May, 2013, 19:18:47
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7813


Total Post Ratings: +706

View Profile WWW
« Reply #1259 on: 20 December, 2011, 04:53:18 »
+1

Since →{} stores only the lower eight bits (one byte), it doesn't matter what the high byte of HL is as long as the low byte is zero. In other words, all we need is for the last eight bits of HL to be zero. and 0 does a bitwise AND on the last eight bits of HL, which looks like this:
     ****************     // Original value of HL; * is either 0 or 1
and         00000000     //  and 0
     ********00000000     // Final value of HL
And that's all that's needed to store one byte of zero to {S}. It's also one byte smaller than just using 0 (LD L,0 versus LD HL,0), which is why Runer112 uses it.

Clever optimization there Cheesy
Logged




Pages: 1 ... 82 83 [84] 85 86 ... 110   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.333 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.