BASIC interpreter running an old chat simulator called ELIZA.
Due the the slow clock speed of the DCPU, responses can take anywhere from ten seconds to two minutes, and probably beyond for long input. Optimizations are certainly possible, but ELIZA is a slow and inefficient program to begin with. Maybe there's some other demo that will work a little better.
To avoid the automatic LOAD and RUN, change the 5 in the first line to a 0.
https://github.com/unbibium/dcpu-cbmbasic
Views: 1478 - Submitted: 2 years ago - Forked from: i453i
SET a, b
sets a to bADD a, b
sets a to a+b, sets O to 0x0001 if there's an overflow, 0x0 otherwiseSUB a, b
sets a to a-b, sets O to 0xffff if there's an underflow, 0x0 otherwiseMUL a, b
sets a to a*b, sets O to ((a*b)>>16)&0xffffDIV a, b
sets a to a/b, sets O to ((a<<16)/b)&0xffff. if b==0, sets a and O to 0 instead.MOD a, b
sets a to a%b. if b==0, sets a to 0 instead.SHL a, b
sets a to a<>b)&0xffffSHR a, b
sets a to a>>b, sets O to ((a<<16)>>b)&0xffffAND a, b
sets a to a&bBOR a, b
sets a to a|bXOR a, b
sets a to a^bIFE a, b
performs next instruction only if a==bIFN a, b
performs next instruction only if a!=bIFG a, b
performs next instruction only if a>bIFB a, b
performs next instruction only if (a&b)!=0JSR a
pushes the address of the next instruction to the stack, then sets PC to aBRK
stops execution (non-standard)A
, B
, C
, X
, Y
, Z
, I
, J
POP / [SP++]
PEEK / [SP]
PUSH / [--SP]
SP
, PC
, O
© Matt Bell (mappum) 2012 - DCPU16 code - Site code - Report bugs