This file contains hidden or 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
| /* Author: Richard James Howe | |
| * Email: [email protected] | |
| * Using primitives available in SUBLEQ to perform bitwise operations */ | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <stdlib.h> | |
| #define N (16) | |
| #define TST (9999) |
This file contains hidden or 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
| #include <stdio.h> /* [email protected], Richard James Howe */ | |
| int main(void){short p=0,m[65536] = { /* eForth for 16-bit SUBLEQ */ | |
| 0,0,40,7,3168,-32768,-2,-1,1,2,16,0,5646,7642,8728,10118,11034,8728,0,0,0, | |
| 0,0,0,0,0,11492,0,0,10,-1,0,0,11474,0,3358,-32768,-32768,32512,32512,37,37, | |
| 43,36,0,46,0,37,49,0,0,52,39,39,55,38,0,58,0,39,61,0,0,64,18,18,67,12,0,70, | |
| 0,18,73,0,0,76,19,19,79,18,0,82,0,19,85,0,0,88,7,18,91,106,106,94,19,0,97,0, | |
| 106,100,0,0,103,21,21,106,0,0,109,0,21,112,0,0,115,19,19,118,21,0,121,0,19, | |
| 124,0,0,127,35,21,130,21,0,136,0,0,139,0,0,154,153,153,142,19,0,145,0,153, | |
| 148,0,0,151,0,0,154,7,39,157,193,193,160,39,0,163,0,193,166,0,0,169,194,194, | |
| 172,39,0,175,0,194,178,0,0,181,200,200,184,39,0,187,0,200,190,0,0,193,0,0, |
This file contains hidden or 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
| /* This short program uses Less-Than-Or-Equal-To-Zero | |
| * to create the various signed comparison operators. | |
| * | |
| * The reason for this program is to understand how | |
| * those operators can be implemented on a SUBLEQ | |
| * One Instruction Set Computer. | |
| * | |
| * It is trivial to construct addition, subtraction | |
| * and branching with the SUBLEQ machine, but the | |
| * comparison and bitwise operators are more complex. |