CoreLife: The Linear Thinkers Nightmare. By Brent Adams Copyright (c) 1993. CoreLife is a training program designed to improve the skills used in a multitasked environment. It is, however, just a game. (don't blame me if it can't do your taxes) The CORE is a simulated 2 dimensional parallel processing computer with language and addressing modes similiar to conventional assembled code. The programs in memory compete for system resources (namely space), while conserving energy. This is accomplished by accumulating space as fast as possible while minimizing the number of logical threads. (parallel paths) Conflicts for space (ie. moving a new command into an opponents territory) are resolved using a dice roll based on the strength of the opponents. STRENGTH = (AREA accumulated)/(Number of logical threads) Programs are considered dead if net area ever falls below zero. The winner is the last program that survives. Programmed in Borland TURBO C++, simply the best language I have ever used. (which I learned while writing this, I might add.) The Editor is where source code is written and compiled into object code. Editor Commands: ,,,: Cursor Control. Alt ,,,: Expand/Contract Size of Cells. Ctrl ,,,: Toggle Logical Flow of Current Cell. Delete : Delete Contents of Current Cell. Insert : Insert Contents of Delete Buffer into Current Cell. F1: Help F2: Edit Mode: F1: Help F2: Save Edited Text. F3: Abort Edit and Restore Original Text. F3: Toggle Display of Source code and Object Code. Note: If there are errors in the source code, the Object display will list the errors. F4: File Menu: F1: Help F2: Save Current File. (Source and Object Code) F3: Load Current Source File. F4: Edit File Stats: Name : Current Program Name. Author: Your Name. Win : Text Printed When This Player Wins. Lose : Text Printed When This Player Loses. Code : Authors Registration Code. F5: Change to Monitor Mode. F6: Compile Current Source File. (This is done automatically 95% of the time.) The Monitor is where current cells in the CORE are translated into object code and displayed as text. This is also where programs are loaded and deleted from the CORE. Monitor Commands: F1: Help F3: Switch to Runtime Mode. F4: Edit list of current programs: #n Name : Name of n'th Program. #n Origin: Origin (0,0) of n'th Program. : Randomize Origins of all Programs and then Load. : Load all Programs to CORE. : Return to Monitor. The Runtime module is where the currently loaded programs are executed and displayed graphically. Runtime Commands: F3: Switch back to Monitor Mode. F6: Execute Code for One Clock Cycle. F7: Execute Code / Update Status Display. F8: Execute Code. Language Syntax: The CORE consists of 10,000 cells arranged in a 100 by 100 matrix. Each cell contains a Mnemonic with either one or two arguments. The cell also has flags designating logical flow out of the cell. Each cell may also have a label. +------^-----+ After execution logical flow follows the arrows. |label: mnem | Ex: execution of this cell follows the cell below, |i(dX,Y) > and precedes execution of the cells above |i(dX,Y) | and to the right. +------^-----+ Label Syntax: Labels can be 1 to 8 alphanumeric characters (A-Z,0-9) wide, ending with a colon. Labels store both the X and Y component of the cell they are in. Ex: TOPLEFT:, TOP1:, SCRIM: Note: When used in an argument, the colon is dropped. Important Note: The label 'START:' must be included in each program to tell the runtime module where to begin execution. Argument Syntax: Each argument consists of an X and Y component and a direct and an indirect addressing mode. X: Horizontal component of argument Y: Vertical component of argument d: Direct addressing mode: #: Data; X and Y are taken as arguments. Note: this is the default mode if no other mode is designated. ^: Relative; argument refers to cell relative to the current cell offset by current (X,Y) Ex: (^1,0) refers to cell one to the right. Ex: (^TOP) refers to cell labelled TOP, relatively. &: Absolute; argument refers to cell relative to the current program's (0,0) location offset by (X,Y) Ex: (&1,0) refers to cell one to the right of the current program's (0,0) Ex: (&TOP) refers to cell labelled TOP, absolutely. If the direct addressing mode refers to a DATA statement, the DATA statement's X and Y components can be PRE or POST incremented '>' or decremented '<'. Ex: (^>TOP,TOP) refers to DATA statement labelled TOP and increments TOP's X component prior to the current command being executed. Ex: (&TOP,TOP<) refers to cell labelled TOP and following execution decrements TOP's Y component. i:Indirect addressing mode: relative and absolute modes are valid only if direct mode is '#' or refers to a DATA statement #: Data; Value from direct mode is taken without modification. ^: Program Counter relative; argument refers to cell relative to the current cell offset by DATA statement's (X,Y) Ex: ^(^TOP) refers to cell relative to current cell offset by value of DATA statement labelled TOP. @: DATA relative; argument refers to cell relative to the DATA statement offset by DATA statement's (X,Y) Ex: @(^TOP) refers to cell relative to DATA statement labelled TOP offset by value of TOP &: Absolute; argument refers to cell relative to the current program's (0,0) offset by the DATA statement's (X,Y) Ex: &(^TOP) refers to current program's origin offset by value of DATA statement labelled TOP Ex: (&3,3); refers to current program's (3,3) cell, relatively. Ex: (^3,3); refers to current program's (3,3) cell, absolutely. Note: These two examples refer to the same cell in source code because the direct relative addressing mode is adjusted during compilation from absolute addresses. Ex: ^(3,3); refers to cell 3 to the right and 3 down from current location. Note: Indirect addressing is not adjusted during compilation Command List: ADD arg1 arg2 Add arg1 to arg2, store result in arg2. AND arg1 arg2 AND arg1 with arg2, store result in arg2. DATA arg1 Not executable, arg1 is stored as a value. Note: This command causes an error when executed. DIV arg1 arg2 Divide arg2 by arg1, store result in arg2 JMP arg1 Jump to arg1, note: logical flow does not follow the Flow designators out of this cell. JMPnn arg1 arg2 Perform JMP to arg2 if condition 'nn' is true, ELSE Logical flow follows flow designators,but, only if condition 'nn' is false Conditions: XZ: True if X component is Zero. XN: True if X component is Not zero. YZ: True if Y component is Zero. YN: True if Y component is Not zero. BZ: True if X an Y components are both Zero. BN: True if X an Y components are both Not zero. NR: True if North flag is Reset NS: True if North flag is Set ER: True if East flag is Reset ES: True if East flag is Set SR: True if South flag is Reset SS: True if South flag is Set WR: True if West flag is Reset WS: True if West flag is Set MF: True if cell not owned by program (Mine False) MT: True if cell is owned by program (Mine True) OF: True if cell not owned by Opposition (Opp False) OT: True if cell is owned by Opposition (Opp True) OT: True if cell is owned by Opposition (Opp True) RZ: True if both components of a random dice role of arg1 are both equal to Zero RN: True if both components of a random dice role of arg1 are both Not equal to zero MOD arg1 arg2 Store remainder of arg2 divided by arg1 in arg2. MOVE arg1 arg2 Move contents of arg1 to arg2. MULT arg1 arg2 Multiply arg1 times arg2, store result in arg2. NOT arg1 Logically invert arg1. NOP No operation, Note: this does not cause an error when executed. OR arg1 arg2 Logically OR arg1 with arg2, store result in arg2. PROT arg1 Set protect flag on arg1, this protects cell from one write attempt. This shows up on graphic display as a white border. RAND arg1 arg2 Move random value from (0,0) to arg1(X,Y) to arg2. RSTn arg1 Reset 'n' Flow designator, where n is: N: North (up) E: East (right) S: South (down) W: West (left) SETn arg1 Set 'n' Flow designator, where n is: N: North (up) E: East (right) S: South (down) W: West (left) SPLIT arg1 Start a logical thread at arg1. Note: Logical flow continues, following flow designators (unlike a JMP statement) SUB arg1 arg2 Subtract arg1 from arg2, store result in arg2. Note: Everything following a semicolon ';' is assumed to be a remark, and is ignored by the compilor. Final Note: The best way to learn is to start programming, check out the programs included for examples of how this code is written. Program's included are PINWHEEL,BACKTRAC and SPIRAL. Registration information: The only function inhibited before registration is the function that attaches your name(AUTHOR), gloat(WIN) and arghh(LOSE) text to your program's compiled object code. To register: Send $19.95 in US currency or $11.95 and the name/phone number of a BBS you've loaded this program to. To: Brent Adams 7766-F Brosend Drive Newburg, IN 47630 Important: Include the name you want to appear in the AUTHOR slot, so I can send the correct registration CODE. CORELIFE IS SHAREWARE, COPIES MAY BE DISTRIBUTED FREELY SO LONG AS THEY ARE NOT MODIFIED AND NO CHARGE IS MADE BEYOND THE COST OF THE MEDIA IT IS DISTRIBUTED ON. (Support the shareware concept) CORELIFE IS DISTRIBUTED AS-IS. NO LIABILITY IS ASSUMED BY THE AUTHOR.