Unless I'm understanding the two branch instructions incorrectly, what I'm saying is you can only branch by the distance specified in the operand. If you wanted to branch by the value in the accumulator or the value at a memory location, you would have to store it over the branch's operand.
It's not especially relevant for programs this small, so it's just an observation rather than a criticism.
Oh okay. Yeah, I should add some way to branch according to a memory value or accumulator. Should be easy enough to add, I'll add it to the to do list.
I have an IQ of ~153, and this **** makes me feel stupid. I think it's one of those things where you either have the knack for it (And/or you've been studying it for a long time), or you don't.
On the other hand, maybe it's simply because I do not understand 80% of the jargon involved. I think if I knew what-the-hell half of the expressions meant, I would be much closer to grasping it and being able to apply it.
Rollback Post to RevisionRollBack
Spark becomes a flame.
Flame becomes a fire.
Forge a blade to slay the stranger.
Take whatever we desire.
Move by will alone.
I have an IQ of ~153, and this **** makes me feel stupid. I think it's one of those things where you either have the knack for it (And/or you've been studying it for a long time), or you don't.
On the other hand, maybe it's simply because I do not understand 80% of the jargon involved. I think if I knew what-the-hell half of the expressions meant, I would be much closer to grasping it and being able to apply it.
That's definitely part of it - once you understand the concepts behind programming and computer architecture, the specifics all become pretty self explanatory. Once you know one computer language, you know them all.
On the other hand, even amongst programmers assembly coding is seen as something of an arcane art. Ironically it's much simpler and more structured than high level languages (until you start messing with bios interrupts. shudders). It just takes much more work for much less output.
Though it's one thing to understand the concepts of building a computer from components and actually doing so. I assure you what the1laz is up to is probably making everyone here feel stupid. Although I commented on using 256 instructions and some missing stuff in the current 16, I'm fully aware that each one needs to be hard-wired into the monolithically complex redstone control unit.
For sure. I have a pretty decent understanding of "logic" and binary, and even electronics, really. My father studied electrical engineering in college and was pretty genius with electronics. He's the reason I got into gaming, as he purchased a Celeco Vision and an Atari when I was about 3-4 years old. Nonetheless, all the jargon and code makes me want to put my head in an oven.
Rollback Post to RevisionRollBack
Spark becomes a flame.
Flame becomes a fire.
Forge a blade to slay the stranger.
Take whatever we desire.
Move by will alone.
I whole-heartedly approve of this thread.
But could people start submitting programs with pseudocode or even a flowchart (if you have the time) to explain them? Reading so much of an unfamiliar language is killing my brain.
For sure. I have a pretty decent understanding of "logic" and binary, and even electronics, really. My father studied electrical engineering in college and was pretty genius with electronics. He's the reason I got into gaming, as he purchased a Celeco Vision and an Atari when I was about 3-4 years old. Nonetheless, all the jargon and code makes me want to put my head in an oven.
Haha, yeah, it is a lot to take in. Bhaumat is right though, it's all very self-explanatory once you know the concepts behind it. It all just "makes sense", you just need to be shown it in the first place. I'm thinking about writing tutorials on my blog to explain it all from the ground up, which would make things easier for people to understand everything that's going on.
The point of adding m009 twice is that this effectively creates a left shift. Adding one fills in the now empty bit on the end (e.g. 0000 0111 + 0000 0111 + 0000 0001 = 0000 1111).
So the output should be:
0000 0000 (assumed initial display state)
0000 0001 (0000 0000 + 0000 0000 + 0000 0001)
0000 0011 (0000 0001 + 0000 0001 + 0000 0001)
0000 0111 (0000 0011 + 0000 0011 + 0000 0001)
0000 1111 (0000 0111 + 0000 0111 + 0000 0001)
0001 1111 (0000 1111 + 0000 1111 + 0000 0001)
0011 1111 (0001 1111 + 0001 1111 + 0000 0001)
0111 1111 (0011 1111 + 0011 1111 + 0000 0001)
1111 1111 (0111 1111 + 0111 1111 + 0000 0001)
0111 1110 (1111 1111 + 1111 1111 + 1000 0000) <- At this point, "ANDi i128,A" is non-zero, causing the program to start skipping the +1.
1111 1101 (0111 1110 + 0111 1110 + 1000 0000) <- Because of the mistakenly placed 0 in the 8th bit, things go crazy.
0111 1010 (1111 1101 + 1111 1101 + 1000 0000)
etc.
wait what.. i missed something.
the +1 only happens in the first 2 loops. after that A is replaced with m009, aka no more +1
i thought the output would be 0->1->3->9->27 etc.. and i thought BranchZero was branch if A IS 0, not non-zero
wait what.. i missed something.
the +1 only happens in the first 2 loops. after that A is replaced with m009, aka no more +1
i thought the output would be 0->1->3->9->27 etc.. and i thought BranchZero was branch if A IS 0, not non-zero
Erg. How do I describe this...
The contents of the accumulator are lost at the ANDi instruction - what that's doing is masking out bits 0-6 (seeing as 128 decimal == 1000 000 binary), and leaving the 7th. So after that instruction the accumulator can only physically contain 0000 0000 or 1000 0000. The branch-if-zero then jumps to the start in the first case, or passes thought to the second jump otherwise.
Hence for the first 7 iterations of the code, the printed contents of the accumulator all have a 0 in the 7th bit, and hence after "ANDi", the accumulator becomes 0, causing it to jump to the start. m009 needs to be added twice because it has been wiped from the accumulator.
On the 8th iteration, the accumulator contains 1111 1111, which gets ANDed to 1000 0000, causing the code to start the crazy alternating-jumps.
Sorry for all these monolithic posts. Maybe I'm rather too excited by this thread...
LOL, i failed. didn't see that A would become zero and cause you to jump to the beginning and not 02.
i assumed the branchzero was when A became 128. but thats an xor/sub check not an AND.
LOL, i failed. didn't see that A would become zero and cause you to jump to the beginning and not 02.
i assumed the branchzero was when A became 128. but thats an xor/sub check not an AND.
It's fair enough. I've certainly confused myself enough times over such a tiny piece of code.
Yeah, I got confused the first couple of times I read through it, but I got there in the end. Nice bit of code!
Rewrite MineCraft in this language.
Play MineCraft in MineCraft.
Sell MineCraft in MineCraft.
Make a "Yo Dawg" including your picture of MineCraft in MineCraft.
Get free scholarships to Harvard and Yale.
Ok, how's this for insanely confusing. This program uses IOWrite for storage, extra space as bitmask storage, and uses the bitmasks themselves as the addresses of the next part of the animation (via self modifying code and some cunning data layout). Oh, and the opcode value of the ANDi instruction as an address...
Accumulator must be initialised to 0 for this to work.
00: ANDi, 0000 1111 ;Mask out the top 4 bits
02: STOREm, 0000 0101 (05) ;Write the Acc to the operand of LOADm instruction
04: LOADm, 0000 0000 ;Load next bitmask
06: IOWRITE, 1101 1011 ;Print to output & bitmask part 2
08: JMP 1111 1000 (-8) ;Loop from start
10: unused, 1011 1101 ;Bitmask pt 3
12: unused, 0111 1110 ;Bitmask pt 4
14: 1110 0111, unused ;Bitmask pt 1
Instead writing a program, I'll give some suggestions on where to use this minecraft computer:
a) attach it to some doors so only setting a correct password thru switches allow to open it;
:cool.gif: attach it to a TNT cannon and start the Minecraft Space Program, with the goal to put a mob in the moon until beta;
c) attach it to minecarts and make them run automatically, like a subway.
Instead writing a program, I'll give some suggestions on where to use this minecraft computer:
a) attach it to some doors so only setting a correct password thru switches allow to open it;
:cool.gif: attach it to a TNT cannon and start the Minecraft Space Program, with the goal to put a mob in the moon until beta;
c) attach it to minecarts and make them run automatically, like a subway.
Quote from Bhaumat »
Though that makes me imagine ... computer controlled maze of iron doors? Sounds like fun!
Example:
If the first two bytes contain 15 30, then the CPU will do operation 15 (load) and load the value 30. If the next two bytes are 10 12, then it'll do operation 12 (add), and add 12 to whatever is already stored in the CPU, which is 30. The result, 42, is stored in the CPU.
Hey wait a minute... This program sounds familiar.. Some input -> takes forever -> "42"
Example:
If the first two bytes contain 15 30, then the CPU will do operation 15 (load) and load the value 30. If the next two bytes are 10 12, then it'll do operation 12 (add), and add 12 to whatever is already stored in the CPU, which is 30. The result, 42, is stored in the CPU.
Hey wait a minute... This program sounds familiar.. Some input -> takes forever -> "42"
Haha, yes, and my computer is called Deep Thought. :tongue.gif:
So are you the guy that made the CPU only with a book? I still failed to see how you can actually do that in a virtual game...
So, whats the progress and is it "public"?
A quick study into computer circuitry will tell you yes this is very possible, due to the red stone torches amazing capability to turn off/on with input.
Once you finish the screen, run minecraft, and make ANOTHER computer within your minecraft computer, and once completed with that computer, run minecraft make another 16bit redstone computer inside the 2nd 16bit redstone computer inside your first 16bit computer, then Ride a creeper into the sunset 8)
Rollback Post to RevisionRollBack
Creepers. [SSSS] devastating our works of art since 2010.
Short time poster, Long time lurker.
So are you the guy that made the CPU only with a book? I still failed to see how you can actually do that in a virtual game...
So, whats the progress and is it "public"?
I'm probably not the guy you're thinking about. I'm the guy who made a CPU with mainly just a block diagram and this page: http://minecraftwiki.net/wiki/Redstone_circuits . It works in a virtual game just like in reality, you have some things that can store numbers, some things that can add or subtract these numbers, and some things that tell all the other things when to do their stuff, and they work together to do what you tell them to. Watch here for progress: http://lazcraft.tumblr.com/ The save isn't available yet, but it will be soon enough.
Oh okay. Yeah, I should add some way to branch according to a memory value or accumulator. Should be easy enough to add, I'll add it to the to do list.
On the other hand, maybe it's simply because I do not understand 80% of the jargon involved. I think if I knew what-the-hell half of the expressions meant, I would be much closer to grasping it and being able to apply it.
Flame becomes a fire.
Forge a blade to slay the stranger.
Take whatever we desire.
Move by will alone.
For sure. I have a pretty decent understanding of "logic" and binary, and even electronics, really. My father studied electrical engineering in college and was pretty genius with electronics. He's the reason I got into gaming, as he purchased a Celeco Vision and an Atari when I was about 3-4 years old. Nonetheless, all the jargon and code makes me want to put my head in an oven.
Flame becomes a fire.
Forge a blade to slay the stranger.
Take whatever we desire.
Move by will alone.
But could people start submitting programs with pseudocode or even a flowchart (if you have the time) to explain them? Reading so much of an unfamiliar language is killing my brain.
Haha, yeah, it is a lot to take in. Bhaumat is right though, it's all very self-explanatory once you know the concepts behind it. It all just "makes sense", you just need to be shown it in the first place. I'm thinking about writing tutorials on my blog to explain it all from the ground up, which would make things easier for people to understand everything that's going on.
wait what.. i missed something.
the +1 only happens in the first 2 loops. after that A is replaced with m009, aka no more +1
i thought the output would be 0->1->3->9->27 etc.. and i thought BranchZero was branch if A IS 0, not non-zero
This thread is now [Diamond]
LOL, i failed. didn't see that A would become zero and cause you to jump to the beginning and not 02.
i assumed the branchzero was when A became 128. but thats an xor/sub check not an AND.
This thread is now [Diamond]
Yeah, I got confused the first couple of times I read through it, but I got there in the end. Nice bit of code!
Play MineCraft in MineCraft.
Sell MineCraft in MineCraft.
Make a "Yo Dawg" including your picture of MineCraft in MineCraft.
Get free scholarships to Harvard and Yale.
~Victory is ours~
~Shawnyall~
niceeee
This thread is now [Diamond]
a) attach it to some doors so only setting a correct password thru switches allow to open it;
:cool.gif: attach it to a TNT cannon and start the Minecraft Space Program, with the goal to put a mob in the moon until beta;
c) attach it to minecarts and make them run automatically, like a subway.
Awesome, added to the list: http://lazcraft.tumblr.com/post/1515820 ... e-computer
Hey wait a minute... This program sounds familiar.. Some input -> takes forever -> "42"
Timelapsed Let's Play
This. XD
Also, great work man d^_^b
Haha, yes, and my computer is called Deep Thought. :tongue.gif:
A quick study into computer circuitry will tell you yes this is very possible, due to the red stone torches amazing capability to turn off/on with input.
Short time poster, Long time lurker.
I'm probably not the guy you're thinking about. I'm the guy who made a CPU with mainly just a block diagram and this page: http://minecraftwiki.net/wiki/Redstone_circuits . It works in a virtual game just like in reality, you have some things that can store numbers, some things that can add or subtract these numbers, and some things that tell all the other things when to do their stuff, and they work together to do what you tell them to. Watch here for progress: http://lazcraft.tumblr.com/ The save isn't available yet, but it will be soon enough.