Forums - Open Redstone Engineers
BFCPU (big - fucking - cpu) - Printable Version

+- Forums - Open Redstone Engineers (https://forum.openredstone.org)
+-- Forum: ORE General (https://forum.openredstone.org/forum-39.html)
+--- Forum: Projects & Inventions (https://forum.openredstone.org/forum-19.html)
+---- Forum: In Progress (https://forum.openredstone.org/forum-20.html)
+---- Thread: BFCPU (big - fucking - cpu) (/thread-5896.html)

Pages: 1 2 3


RE: BFCPU (big - fucking - cpu) - fuirippu - 03-07-2015

Yes, lacks detail on cloning 3/10, otherwise looks awesome.


RE: BFCPU (big - fucking - cpu) - VoltzLive - 03-07-2015

Quote:@Voltz jump and return commands can effectively be functions.

That is exactly the point.... Extensible programming.


RE: BFCPU (big - fucking - cpu) - Konstacon - 03-10-2015

What the hell is U/I. if it is user input im disgusted.

That awkward moment when you dont have a stack pointer


RE: BFCPU (big - fucking - cpu) - LordDecapo - 03-11-2015

Still reading. but I see u have 1 in boxes that should be 001... in excel and open office You can use an apostrophe like this;

'001
and it will disable auto format that drops the 0's, as well as will make the apostrophe unseen.


RE: BFCPU (big - fucking - cpu) - LordDecapo - 03-11-2015

Also, call return are so much easier to just add as an argument in an IS the a function. Speeds it up like 4 fold atleast


RE: BFCPU (big - fucking - cpu) - greatgamer34 - 03-11-2015

What do you mean? Im still fairly un-familiar with call and return. Arent they just for running subroutines? Why not just have a branch to the sub routine?


RE: BFCPU (big - fucking - cpu) - fuirippu - 03-11-2015

(03-11-2015, 07:41 PM)greatgamer34 Wrote: ...call and return. Arent they just for running subroutines? Why not just have a branch to the sub routine?

You're right they "just" run subroutines.... but it saves the programmer work, and saves memory (program space). "Call" is like "branch", but it automagically stores a return address, which means the end of the subroutine is simply a "return" instead of a "jump to <address>".

Sure, I could (among other possibilities)

Code:
PUSH <PC + 4>
JMP <subroutine>

and my subroutine could finish with

Code:
PULL reg0
JMP <reg0>

But you're looking at probably 4-bytes of instruction per call, and another 4-bytes for return. (That's assuming you've got PUSH and PULL instructions). Instead with call and return, you're looking at probably 2-bytes per CALL and 1-byte to return.

It might not sound like much, but how much program memory does the average Redstone computer have?

And then there's the debugging cost: with automagic CALL and RETURN, there's no way for me to screw up and push the wrong return address, or forget to push anything at all.


RE: BFCPU (big - fucking - cpu) - embizone - 03-12-2015

RISC-16 (that's the ISA ur using right? Link is broken) can emulate calls quite adequately with the JALR (jump and link register) instruction. Just jump to an address and save the PC to memory / software stack. Just an extra instruction, unless of course you're implementing software stack then maybe an extra 2.


RE: BFCPU (big - fucking - cpu) - greatgamer34 - 03-12-2015

Well I have 7 registers dedicated for saving pointers to do such a thing. Big Grin


RE: BFCPU (big - fucking - cpu) - fuirippu - 03-12-2015

You're right: it can be done. But with IS-level-support for subroutines, the correct pointer is automatically stored and retrieved. Shorter programs, less bugs. (or, to look at it another way... more work for the hardware engineer, less for the software developer)