Author Topic: Function  (Read 6582 times)

0 Members and 1 Guest are viewing this topic.

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Function
« on: July 02, 2012, 06:43:14 pm »
I just wanted a further explanation of this:

Data(NUM,...)
Key: ΔList() 
Adds the bytes to program memory. Numbers ending with r are added as 2 byte numbers.

Schrodinger's cat walks into a bar... and doesn't.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: Function
« Reply #1 on: July 02, 2012, 06:50:08 pm »
You have to point your liste of data. Eg :
Code: [Select]
:Data(2,5,100,40,3)->Str1
You can read those data in this way :
Code: [Select]
:{Str1}
:.Return 2

:{Str1+1}
:.Return 5

...

:{Str1+X}

If you want add a 2-bytes number, you can use ^r (2nd angle 3) :
Code: [Select]
:Data(12,500^r,200,30000^r)->Pic1

:{Pic1}
:.Return 12

:{Pic1+1}^r
:.Return 500

:{Pic1+3}
:.Return 200

:{Pic1+4}^r
:.Return 30000
« Last Edit: July 02, 2012, 06:50:44 pm by kindermoumoute »
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #2 on: July 02, 2012, 06:53:39 pm »
Which numbers are two bye and which are single bye , etc ?
Schrodinger's cat walks into a bar... and doesn't.

Offline kindermoumoute

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 836
  • Rating: +54/-3
    • View Profile
Re: Function
« Reply #3 on: July 02, 2012, 06:56:55 pm »
Endeed a byte is 8 bits. Then a byte can take 2^8 (=256) values, that to say a number beetwen 0 and 255. A 2 byte number can take 2^16 (=65356) values, it means a number beetwen 0 and 65355.

Axe variables are 2 bytes number.
Projects :

Worms armageddon z80 :
- smoothscrolling Pixelmapping : 100%
- Map editor : 80%
- Game System : 0%

Tutoriel français sur l'Axe Parser
- 1ère partie : en ligne.
- 2ème partie : en ligne.
- 3ème partie : en ligne.
- 4ème partie : 10%
- Annexe : 100%

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #4 on: July 02, 2012, 07:02:05 pm »
Endeed a byte is 8 bits. Then a byte can take 2^8 (=256) values, that to say a number beetwen 0 and 255. A 2 byte number can take 2^16 (=65356) values, it means a number beetwen 0 and 65355.

Axe variables are 2 bytes number.

Thanx this really helps.
Schrodinger's cat walks into a bar... and doesn't.

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #5 on: July 03, 2012, 02:57:33 pm »
Do you know about anything about numbers bigger than 65355? Are they 3 bytes or 4 or something like that?
Schrodinger's cat walks into a bar... and doesn't.

Offline blue_bear_94

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 801
  • Rating: +25/-35
  • Touhou Enthusiast / Former Troll / 68k Programmer
    • View Profile
Re: Function
« Reply #6 on: July 03, 2012, 03:00:51 pm »
You can combine 2 real variables or use the OP registers...
Due to dissatisfaction, I will be inactive on Omnimaga until further notice. (?? THP hasn't been much success and there's also the CE. I might possibly be here for a while.)
If you want to implore me to come back, or otherwise contact me, I can be found on GitHub (bluebear94), Twitter (@melranosF_), Reddit (/u/Fluffy8x), or e-mail (if you know my address). As a last resort, send me a PM on Cemetech (bluebear94) or join Touhou Prono (don't be fooled by the name). I've also enabled notifications for PMs on Omnimaga, but I don't advise using that since I might be banned.
Elvyna (Sunrise) 4 5%
TI-84+SE User (2.30 2.55 MP 2.43)
TI-89 Titanium User (3.10)
Casio Prizm User? (1.02)
Bag  東方ぷろの

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #7 on: July 04, 2012, 08:18:57 pm »
Combine how ? and what are OP registers?
Schrodinger's cat walks into a bar... and doesn't.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Function
« Reply #8 on: July 05, 2012, 02:07:40 am »
You can combine 2 real variables or use the OP registers...
Or use this ;)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline ben_g

  • Hey cool I can set a custom title now :)
  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1002
  • Rating: +125/-4
  • Asm noob
    • View Profile
    • Our programmer's team: GameCommandoSquad
Re: Function
« Reply #9 on: July 05, 2012, 08:04:57 am »
Do you know about anything about numbers bigger than 65355? Are they 3 bytes or 4 or something like that?
Depends on how much bigger than 65355.
My projects
 - The Lost Survivors (Unreal Engine) ACTIVE [GameCommandoSquad main project]
 - Oxo, with single-calc multiplayer and AI (axe) RELEASED (screenshot) (topic)
 - An android version of oxo (java)  ACTIVE
 - A 3D collision detection library (axe) RELEASED! (topic)(screenshot)(more recent screenshot)(screenshot of it being used in a tilemapper)
Spoiler For inactive:
- A first person shooter with a polygon-based 3d engine. (z80, will probably be recoded in axe using GLib) ON HOLD (screenshot)
 - A java MORPG. (pc) DEEP COMA(read more)(screenshot)
 - a minecraft game in axe DEAD (source code available)
 - a 3D racing game (axe) ON HOLD (outdated screenshot of asm version)

This signature was last updated on 20/04/2015 and may be outdated

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #10 on: July 05, 2012, 12:00:01 pm »
Do you know about anything about numbers bigger than 65355? Are they 3 bytes or 4 or something like that?
Depends on how much bigger than 65355.

Like in the millions.
Schrodinger's cat walks into a bar... and doesn't.

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Function
« Reply #11 on: July 05, 2012, 12:04:41 pm »
Basically, to know the limit of X bytes, you do 2X*8-1.
So 1 byte stops at 255, 2 bytes stop at 65535, etc :)
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline danny90444

  • LV3 Member (Next: 100)
  • ***
  • Posts: 41
  • Rating: +0/-0
  • Physics :)
    • View Profile
    • facebook
Re: Function
« Reply #12 on: July 05, 2012, 12:06:31 pm »
Basically, to know the limit of X bytes, you do 2X*8-1.
So 1 byte stops at 255, 2 bytes stop at 65535, etc :)

Ok thanks . Whats OP though?
Schrodinger's cat walks into a bar... and doesn't.

Offline calcdude84se

  • Needs Motivation
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2272
  • Rating: +78/-13
  • Wondering where their free time went...
    • View Profile
Re: Function
« Reply #13 on: July 06, 2012, 02:50:48 am »
The OP "registers" are a set of memory areas that are used as operands by the OS's floating point routines. Unless you need floating point, there shouldn't be a need to explicitly deal with them.
If you want to do math with larger integers, you basically need to write the routines yourself (precluding a library/axiom already having been written. I don't follow Axe too much.).
For example, to add the number BA (formed from variables A and B) to DC, and store the result back to BA, you could do something like A+C->A<C+B+D->B, where -> is the STO> symbol.
An easier-to-follow variation goes like this:
Code: [Select]
A+C->A
If A<C
B+D->B
Else
B+D+1->B
End
"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 aeTIos

  • Nonbinary computing specialist
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3915
  • Rating: +184/-32
    • View Profile
    • wank.party
Re: Function
« Reply #14 on: July 06, 2012, 08:38:59 am »
By the way, the r in the description is the radians r (it's in the [2nd][Apps] menu)
I'm not a nerd but I pretend: