add turingcomplete cpu compiler
This commit is contained in:
3
projects/mycpu/assign.j
Normal file
3
projects/mycpu/assign.j
Normal file
@@ -0,0 +1,3 @@
|
||||
x = 10
|
||||
y = 512
|
||||
z = x + y
|
||||
6
projects/mycpu/functions.j
Normal file
6
projects/mycpu/functions.j
Normal file
@@ -0,0 +1,6 @@
|
||||
g = 2
|
||||
|
||||
fn suma(x, y):
|
||||
return x + y
|
||||
|
||||
x = suma(5, 2) - g + 1
|
||||
12
projects/mycpu/ifs.j
Normal file
12
projects/mycpu/ifs.j
Normal file
@@ -0,0 +1,12 @@
|
||||
counter = 0
|
||||
|
||||
fn inc():
|
||||
counter = counter + 1
|
||||
|
||||
fn main():
|
||||
if counter < 30:
|
||||
inc()
|
||||
main()
|
||||
|
||||
|
||||
main()
|
||||
4
projects/mycpu/while.j
Normal file
4
projects/mycpu/while.j
Normal file
@@ -0,0 +1,4 @@
|
||||
counter = 0
|
||||
|
||||
while counter < 65000:
|
||||
counter = counter + 1
|
||||
Reference in New Issue
Block a user