Posted 04 March 2014 - 05:20 PM
CCPU v1.0
What is it?
An emulated CPU.
Its main purpose is to allow programming in an assembly language in ComputerCraft.
It comes with an entire development toolset which includes an assembler used to
produce machine code for the CCPU.
What can I do with it?
Addition, subtraction, comparison, jumping, the basics…
I'm hoping that this will eventually be able to replace Lua.
But we're on v1.0, so it won't change the world as of now :)/>.
Got any code examples?
Of course!
Spoiler
acu_is_zero:
mov 79, gp1
ret
end
loop:
mov 111, gp1
cmp acu, 0
jc acu_is_zero
mov gp1, pr1
wrt
add acu, 1
mov ret1, acu
lt acu, 5
jc loop
ret
end
jmp loop
mov 104, pr1
wrt
mov 33, pr1
wrt
mov 10, pr1
wrt
This prints "Oooooh!". Don't ask. Please.
This is an example program that ships with the development tools.
So if you have them installed, you can run this program.
In your root directory, do this:
cd ccpudev
ccasm example.asm example
pccpu example
Where do I get it from?
Type these in CraftOS to get the core:
pastebin run TGU43NWP
pastebin get qmrXGnV4 pccpu
If you also wish to install the developer tools, type this after the previous ones:
pastebin run rMrXRH3Y
This uses oeed's awesome Package Maker!
How do I use it?
I wrote a tutorial. You can find it here. I'm not a skilled web designer, but it does its job.
Known Bugs
- Nested labels cause errors.
Edited on 06 March 2014 - 10:49 AM