Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
21 May, 2013, 14:39:40 *
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] 2   Go Down
  Print  
Author Topic: 256=0? - Whyy!?!  (Read 677 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
geekygenius
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 01 July, 2012, 08:42:32
Date Registered: 08 March, 2012, 08:06:48
Posts: 17

Topic starter
Total Post Ratings: +4

View Profile
« on: 04 May, 2012, 04:31:43 »
0

So, I was wondering if there was a way to get a 16-bit variable A to return false when A=256 for A=0. Essentially, how do I force a 16 bit comparison?
Logged
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 07:41:21
Date Registered: 02 July, 2009, 06:38:05
Posts: 1679


Total Post Ratings: +492

View Profile
« Reply #1 on: 04 May, 2012, 04:34:44 »
0

The equals operator in Axe is a 16-bit comparison. Perhaps A is being set improperly?
Logged
geekygenius
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 01 July, 2012, 08:42:32
Date Registered: 08 March, 2012, 08:06:48
Posts: 17

Topic starter
Total Post Ratings: +4

View Profile
« Reply #2 on: 04 May, 2012, 04:46:18 »
0

A is being set through a pointer, and it can be set over 256 and get something over 256. Maybe I forgot the little r thingy that goes after the variable to make it 16 bit...
Logged
Juju
Evil Fluttershy (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Gender: Male
Last Login: Today at 09:54:34
Date Registered: 17 March, 2010, 07:46:57
Location: Québec, North Equestria
Posts: 4535


Total Post Ratings: +394

View Profile WWW
« Reply #3 on: 04 May, 2012, 04:48:10 »
0

Can you post an example? Yeah that might be the r thing indeed.
Logged

LuaIDE
Reuben Quest HD: The PC Remake
Zarmina Project: Play Read
Nspire I/O: Info Download


THEGAME
Spoiler for Other stuff:
Also Yuki "ジュジュ" Kagayaki
Support Casio-Scene against the attacks of matt @ matpac.co.uk ! For more information: Casio-Scene shuts down & Matt actions threads
Find what P+4zJ means and you get free candy! cc4daa9c4645bd123ed22e385ed701fd
#omnimaga on OmniNet, EFNet and Pesterchum
Omnimaga Owner and Former Administrator
Fan of My Little Jim Bauwens: Losing the Game is Magic
Proud member of POLN - Ponys Oppositing Lol Names
Member of OBEL - Omnimaga Board of the EFnrgelnicshh Language - Office Omnimagois de la Langue FArnagnlçaaiiss
あなたはこのゲームを失った
Spoiler for Old spoileryception stuff:

Spoiler for Coming soon...:
Indefinitely halted [|.........] 10%
OmnomIRC Mobile [||||......] 40% (argh threads >_<)
Spoiler for Current/Past TI-related projects:
The Axe Parser Wiki / Founder and maintainer
Keytar Hero [|||||_____] 50% Engine done, wackiness left to do (Halted)
OmniOS
VVVVVV [||||______] 40% (Made most of the engine, extremely glitchy) (Gave it to Leafy)
░█▀█░█░█░█▀▀░█▀█░█▀█░█▀█░▀█▀░█▀▄
░█▀█░▄▀▄░█▀▀░█▀█░█░█░█░█░░█░░█░█
v0.1.0
░▀░▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀▀▀░▀▀░[|||||||||¦] 95ish% (Completed)
tilibs-wii? [._________] 0% (Nope.)
Spoiler for Spoilers:
<!---->
wxWabbitemu Developer
Spoiler for Other Userbars:






<!--Everything done, got 90% Cheesy sudo apt-get install z80asm z80dasm-->
Spoiler for Quote:
We are in 2034. The situation on Earth is catastrophic. The ozone layer has been completely destroyed by the carbonic gas of automobiles, the chemical industries, and the poosh-poosh in little cans. In the end, the earth cooks under the rays of the sun. We must find a planet on which can live 6 billion idiots. The planetary federation turns to the strongest country in the world: Canada. It is Canadian knowledge that has allowed, on October 28, 2034, the launch of the spaceship Romano Fafard, which leaves earth to search the confines of the Universe. Where the hand of man has never set foot.
I hate TI right now
Quote from: jimbauwens
You make me lose the game
Everytime I read your name
Spoiler for The real answer to life, the universe and everything:
Spoiler for Old HTML stuff:
<div style="margin:20px; margin-top:5px"><div class="smallfont" style="margin-bottom:2px">Spoiler for This is another spoiler: <input type="button" value="Show" style="width:60px;font-size:10px;margin:0px;padding:0px;" onclick="window.location.replace('http://goo.gl/QMET');"></div><div class="alt2" style="margin: 0px; padding: 6px; border: 1px inset;"><div style="display: none; ">HAHAHA SUCCESSFUL RICKROLL IS SUCCESSFUL</div></div></div><!-- old avatars:
http://fc00.deviantart.net/fs71/f/2011/120/d/f/nepeta_nyan_cat_by_supuru-d3f8tcx.gif
http://th01.deviantart.net/fs70/PRE/i/2011/099/5/b/rainbow_dash_derping_by_moongazeponies-d3dmg7l.png--><!---->
I may or may not be inactive during work hours (9AM to 5PM EST, Monday to Friday), so for any inquiries please leave a message after the beep and I'll answer you when I have time. Beep. Nevermind, I'm on vacation now. Cheesy
ZippyDee
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 12 May, 2013, 10:03:36
Date Registered: 21 March, 2011, 03:15:07
Location: Yes.
Posts: 704


Total Post Ratings: +73

View Profile
« Reply #4 on: 04 May, 2012, 05:50:44 »
0

I think he meant an 8-bit comparison, not a 16 bit comparison...
Logged

There's something about Tuesday...


Pushpins 'n' stuff...

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 #5 on: 04 May, 2012, 06:05:14 »
0

I think he meant an 8-bit comparison, not a 16 bit comparison...
He said he wanted it "to return false when A=256 for A=0," which would be sixteen bits (which it already is).

Since you're setting it as a pointer, here's something to keep in mind, if you're not aware of it already: Numbers are stored in little-endian format, which means the first byte is the low byte (the the number modulo 256), and the byte after it is the high byte (the number divided by 256).

So if you're doing something like 1→{°A+1} when A was originally zero, A would now equal 256.

Not sure if that's your problem, but I hope that helps.
« Last Edit: 04 May, 2012, 06:05:32 by Deep Thought » Logged




ZippyDee
LV8 Addict (Next: 1000)
********
Offline Offline

Gender: Male
Last Login: 12 May, 2013, 10:03:36
Date Registered: 21 March, 2011, 03:15:07
Location: Yes.
Posts: 704


Total Post Ratings: +73

View Profile
« Reply #6 on: 04 May, 2012, 07:15:07 »
0

Basically he wants to only compare the LSB, as far as I can tell.
Logged

There's something about Tuesday...


Pushpins 'n' stuff...

geekygenius
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 01 July, 2012, 08:42:32
Date Registered: 08 March, 2012, 08:06:48
Posts: 17

Topic starter
Total Post Ratings: +4

View Profile
« Reply #7 on: 04 May, 2012, 07:33:14 »
0

I think he meant an 8-bit comparison, not a 16 bit comparison...
He said he wanted it "to return false when A=256 for A=0," which would be sixteen bits (which it already is).

Since you're setting it as a pointer, here's something to keep in mind, if you're not aware of it already: Numbers are stored in little-endian format, which means the first byte is the low byte (the the number modulo 256), and the byte after it is the high byte (the number divided by 256).

So if you're doing something like 1→{°A+1} when A was originally zero, A would now equal 256.

Not sure if that's your problem, but I hope that helps.
Big frown I don't get why we can't just have the bytes go in a logical order. Thanks though, I'll look at my program with this knowledge. I can just bit-wise and both bits together if I need to. I will also post my final code when I get done, for anyone else with the same question.
Logged
Netham45
WOOOOOO
President
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 06:19:37
Date Registered: 26 August, 2008, 07:35:31
Location: Denver, Colorado
Posts: 2296


Total Post Ratings: +208

View Profile WWW
« Reply #8 on: 04 May, 2012, 08:08:20 »
0

It's up to the CPU, the z80 only handles little-endian. Both storage models (little-endian, big-endian) make sense at different parts of the processes of reading/writing/storing
Logged

Creator of OmnomIRC and SpyBot45
Join LOPN(Lobsters Opposing Pink Names) now, help us fight back!
Message me for more information, and to join now!
Members: Graphmastur;Stefan Bauwens
HOLY SHIT, I HAVE A BLOG



                                     
Put this in your signature if you've played the original WFRNG
Hayleia
Programming Absol
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Last Login: Today at 11:33:46
Date Registered: 01 June, 2011, 20:12:47
Location: ud-ud ?
Posts: 2046


Total Post Ratings: +254

View Profile
« Reply #9 on: 04 May, 2012, 17:47:25 »
0

Big frown I don't get why we can't just have the bytes go in a logical order.
Because if you have a pointer to a 16-bits value that is under 255, you can use the same pointer and get the same value with only 8-bits (dunno if I explained well Tongue)
Logged





Spoiler for what I am according to...:
me: useless
Pokemon Test: an Absol
turiqwalrus: an eggplant
p2: A HUMAN BEING !
Blackpilar and p2: iplantonlyplantwantplanttoplantknowplantifplantyouplantareplantaplantboyplantorplantaplantgirlplant
click here to know where you got your last +1s
geekygenius
LV1 Newcomer (Next: 20)
*
Offline Offline

Last Login: 01 July, 2012, 08:42:32
Date Registered: 08 March, 2012, 08:06:48
Posts: 17

Topic starter
Total Post Ratings: +4

View Profile
« Reply #10 on: 05 May, 2012, 00:32:07 »
0

So, it turns out I forgot to do the {P}^r thingy. It works now! Cheesy Thanks guys!
Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 08:22:03
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50208


Total Post Ratings: +2613

View Profile WWW
« Reply #11 on: 05 May, 2012, 00:34:56 »
0

Hmm you posted 3 times in a row Huh?
Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 12:50:50
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3113


Total Post Ratings: +120

View Profile
« Reply #12 on: 08 May, 2012, 12:05:43 »
0

I actually don't even get what "to return false when A=256 for A=0" means O.o explain please?
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Netham45
WOOOOOO
President
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: Yesterday at 06:19:37
Date Registered: 26 August, 2008, 07:35:31
Location: Denver, Colorado
Posts: 2296


Total Post Ratings: +208

View Profile WWW
« Reply #13 on: 08 May, 2012, 12:06:55 »
0

I actually don't even get what "to return false when A=256 for A=0" means O.o explain please?

He wants to check if the least significant byte is all zero.
Logged

Creator of OmnomIRC and SpyBot45
Join LOPN(Lobsters Opposing Pink Names) now, help us fight back!
Message me for more information, and to join now!
Members: Graphmastur;Stefan Bauwens
HOLY SHIT, I HAVE A BLOG



                                     
Put this in your signature if you've played the original WFRNG
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 12:50:50
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3113


Total Post Ratings: +120

View Profile
« Reply #14 on: 08 May, 2012, 12:08:18 »
0

ah. thanks for explaining.
(so if I get it right he wants to check if the hex number is 00xx)?
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Pages: [1] 2   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.319 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.