Skip to content

Instantly share code, notes, and snippets.

@digal
Created April 13, 2012 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digal/2380123 to your computer and use it in GitHub Desktop.
Save digal/2380123 to your computer and use it in GitHub Desktop.
hello world program on iDCPU-16
UInt16 program[] = {
SET | X << 4 | 0x2A << 10, //SET X, 11
ADD | X << 4 | NW << 10, VMEM_DISPLAY_START + 32*6, //ADD x, VMEM + 32 * 6
SET | Y << 4 | 0x2D << 10, //SET Y, :data
IFE | MEM_Y << 4 | 0x20 << 10, //IFE [X], 20
SET | PC << 4 | 0x2C << 10, //JMP :loop
SET | MEM_X << 4 | MEM_Y << 10, //SET [Y], [X]
BOR | MEM_X << 4 | NW << 10, 0x0F00, //BOR [Y], 0x0F00 ; set char color
ADD | X << 4 | 0x21 << 10, //ADD X, 1
ADD | Y << 4 | 0x21 << 10, //ADD Y, 1
SET | PC << 4 | 0x24 << 10, //ADD Y, 1
SET | PC << 4 | 0x2C << 10, //JMP :loop
'H', 'e', 'l', 'l', 'o', ',', ' ', 'W', 'o', 'r', 'l', 'd', '!', 0x0
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment