### Author Topic: For those of us who dont know binary...  (Read 6819 times)

0 Members and 1 Guest are viewing this topic.

#### Munchor

• LV13 Extreme Addict (Next: 9001)
• Posts: 6199
• Rating: +295/-121
• Code Recycler
##### Re: For those of us who dont know binary...
« Reply #15 on: January 21, 2011, 04:09:03 pm »

I'm gonna print that so I can remember it all the time, I don't feel like memorizing it.

• Guest
##### Re: For those of us who dont know binary...
« Reply #16 on: January 21, 2011, 04:09:29 pm »

I'm gonna print that so I can remember it all the time, I don't feel like memorizing it.

^++

#### z80man

• Casio Traitor
• Posts: 977
• Rating: +85/-3
##### Re: For those of us who dont know binary...
« Reply #17 on: January 21, 2011, 05:45:08 pm »
If you don't know binary there is no reason why you can't learn now.
Lets start by reviewing the number system you're probaly used to, the decimal system. It is called the decimal system because there are ten digits. 0 1 2 3 4 5 6 7 8 9. Now you probaly write zero as 0 but for the time being lets call it 0000. ( this will help you with binary later) If you increment 0000 by 1 you get 0001. Now if you do this eight more times you will have 0009. Now we are going to call the digit on the far right the zero's place, the second to right the one's place and so on. The dilema you now face is that there is no digit above 9. (No 10 is not a digit!) So what you can do now is increment the digit to the left of nine to one and you reset the 9 back to zero. 0010. Hey look you got the number 10  . Okay so you're probaly thinking I already know this, but to learn binary you need to go back to the basics and learn the fundamentals of all number systems.

Now lets start learning binary. It is called binary because there are two digits 0 and 1. So lets start at zero. You write zero in binary as 0000. Look it is the same thing in decimal. Binary is easy. And if you increment that. Yep you guessed right 0001 is the number one. Now we face an issue. We are all out of digits. So what do we do? We reset the furthest right digit and increment the one to its left. So you get 0010. Now this looks like the number ten but it is really two. Now if we keep on following thsi we get 0011 0100 0101 0110 0111 1000 ans so on. In binary we call each digit a bit. and 8 bits make a byte. In one unsigned (not negative) byte you can write numbers from 0 to 255. Hope you now know binary

Pop quiz:
1001 =
0011 + 0100 =
1100 - 0101 =
9
7
7

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: For those of us who dont know binary...
« Reply #18 on: January 22, 2011, 03:04:13 am »
Very nice.
As a side note:
Code: [Select]
0->B->C->DFor(A,0,15)Pt-Off(0,A,{o}A)EndDispGraphShould give the same thing. (except for the randomness of whatever is in B, C, and D)
{o}=o

That is an amazingly neat piece of code!  I think

Code: [Select]
For(F,0,15F->{F*12+L6}End
might be smaller though

#### calc84maniac

• eZ80 Guru
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2897
• Rating: +467/-17
##### Re: For those of us who dont know binary...
« Reply #19 on: January 22, 2011, 09:38:36 am »
Don't forget to "last answer" optimize
Code: [Select]
For(F,0,15F->{*12+L6}End
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### Binder News

• Posts: 785
• Rating: +46/-3
• Zombie of Tomorrow
##### Re: For those of us who dont know binary...
« Reply #20 on: January 22, 2011, 09:56:14 am »
Holy...
Yeah, that's a lot more optimized. Thanks!
Code: [Select]
ClrDrawFor(F,0,15F->{*12+L6}EndDispGraph
Spoiler For userbars:

Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: For those of us who dont know binary...
« Reply #21 on: January 22, 2011, 03:03:40 pm »
Don't forget to "last answer" optimize
Code: [Select]
For(F,0,15F->{*12+L6}End

Bah, I  never remember the tricky optimizations

#### nemo

• LV9 Veteran (Next: 1337)
• Posts: 1203
• Rating: +95/-11
##### Re: For those of us who dont know binary...
« Reply #22 on: January 22, 2011, 06:44:35 pm »
Code: [Select]
0->FWhile -16F->{*12+L6}F+1->FEndcan't hurt to save a byte

#### Binder News

• Posts: 785
• Rating: +46/-3
• Zombie of Tomorrow
##### Re: For those of us who dont know binary...
« Reply #23 on: January 22, 2011, 08:14:22 pm »
Code: [Select]
0->FWhile -16F->{*12+L6}F+1->FEndcan't hurt to save a byte
OMG. That's insane!
I should just write it in ASM and post the hex.
Spoiler For userbars:

Hacker-in-training!   Z80 Assembly Programmer     Axe Programmer
C++ H4X0R             Java Coder                           I <3 Python!

Perdidisti ludum     Cerebrum non habes

"We are humans first, no matter what."
"Fame is a vapor, popularity an accident, and riches take wings. Only one thing endures, and that is character."
Spoiler For Test Results:

#### nemo

• LV9 Veteran (Next: 1337)
• Posts: 1203
• Rating: +95/-11
##### Re: For those of us who dont know binary...
« Reply #24 on: January 22, 2011, 08:27:59 pm »
Code: [Select]
0->FWhile -16F->{*12+L6}F+1->FEndcan't hurt to save a byte
OMG. That's insane!
I should just write it in ASM and post the hex.

Code: [Select]
xor ald (plotsScreen), ainc ald (plotsScreen+12), ainc ald (plotsScreen+24), ainc ald (plotsScreen+36), ainc ald (plotsScreen+48), ainc ald (plotsScreen+60), ainc ald (plotsScreen+72), ainc ald (plotsScreen+84), ainc ald (plotsScreen+96), ainc ald (plotsScreen+108), ainc ald (plotsScreen+120), ainc ald (plotsScreen+132), ainc ald (plotsScreen+144), ainc ald (plotsScreen+156), ainc ald (plotsScreen+168), ainc ald (plotsScreen+180), a
cause screw loops.
« Last Edit: January 22, 2011, 08:28:15 pm by nemo »