Created
April 13, 2012 20:52
-
-
Save digal/2380123 to your computer and use it in GitHub Desktop.
hello world program on iDCPU-16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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