BASIC with Star Trek, Eliza, and 10 PRINT by unbibium

As always, the keyboard won't work until you press the CTRL key once.

Use the LOAD command to cycle through available programs, or LOAD "$" to get a directory.

Star Trek is a port of a very old BASIC strategy game. adapted for a 32-column screen and color. Warp factor 1 should take you to the next quadrant, and fractional warp factors will take you to other sectors in the quadrant. Use phasers to attack without aiming. Use torpedoes to destroy ships if you have line-of-sight. Fractional course settings are allowed too. And I forget how docking at starbases works.

The previous ELIZA and 10 PRINT demos are there also.

Have fun!

Views: 1561 - Submitted: 2 years ago - Programs forked from this


DCPU16 Quick Reference

Basic Opcodes

  • SET a, b sets a to b
  • ADD a, b sets a to a+b, sets O to 0x0001 if there's an overflow, 0x0 otherwise
  • SUB a, b sets a to a-b, sets O to 0xffff if there's an underflow, 0x0 otherwise
  • MUL a, b sets a to a*b, sets O to ((a*b)>>16)&0xffff
  • DIV 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)&0xffff
  • SHR a, b sets a to a>>b, sets O to ((a<<16)>>b)&0xffff
  • AND a, b sets a to a&b
  • BOR a, b sets a to a|b
  • XOR a, b sets a to a^b
  • IFE a, b performs next instruction only if a==b
  • IFN a, b performs next instruction only if a!=b
  • IFG a, b performs next instruction only if a>b
  • IFB a, b performs next instruction only if (a&b)!=0

Non-basic Opcodes

  • JSR a pushes the address of the next instruction to the stack, then sets PC to a
  • BRK stops execution (non-standard)


  • A, B, C, X, Y, Z, I, J

Other Values

  • POP / [SP++]
  • PEEK / [SP]
  • PUSH / [--SP]
  • SP, PC, O

© Matt Bell (mappum) 2012 - DCPU16 code - Site code - Report bugs