This library contains macros that have been written to make writing code for the IBM 1401 easier. The language used is Autocoder. The Autocoder we are using is written by Van Snyder of JPL. Van’s Autocoder is 99.9% the same as the Autocoder supplied by IBM back in the 1960’s. Autocoder never had the #include of modern C++ but a macro call with no arguments in Autocoder works the same. The HEAD macro supplies all of the base items to write almost any Autocoder program. The EXIT macro provides the exit routine to end your program. If SENSE SWITCH G is on, it will branch to START after the halt. If your code was loaded from a PC, it will return to the loader routing in high memory. If not, it will read cards from the card reader until it finds the first card of the next program and turn over control to that deck. A simple ‘hello world’ program looks like this: HEAD *INVOKE THE HEAD MACRO TEXT DCW @HELLO WORLD@ *DEFINE THE TEXT START MCW TEXT,PRINT+12 *MOVE TEXT TO PRINT BUFFER W *PRINT A LINE EXIT *EXIT STAGE LEFT END START *END OF SOURCE CODE AND ID’S THE ENTRY POINT HEAD.mac EXIT.mac Loop macro makes it simple to loop a piece of code. Hear is how it works with the ‘hello world’ program. HEAD *INVOKE THE HEAD MACRO TEXT DCW @HELLO WORLD@ *DEFINE THE TEXT COUNT DCW @00@ *LOOP COUNTER START MCW TEXT,PRINT+12 *MOVE TEXT TO PRINT BUFFER W *PRINT A LINE LOOP START,COUNT,@10@ EXIT *EXIT STAGE LEFT END START *END OF SOURCE CODE AND ID’S THE ENTRY POINT notes: 1. The size of the second and third variable MUST be of the same length. 2. The second variable shuld not be a literal 3. The third variable may be a variable or a literal 4. The second variable WILL be incremented to the value of the third variable. If LOOP is used more than one time in a program, the second parameter MUST be reset before each loop. LOOP.mac The following three macros allow you to call and return from procedures within your Autocoder program. You must put STACK in your data section before the actual program. This is a 10 level stack used by KALL and RETRN. 'CALL' is a reserved word in Autocoder so I used KALL. To call a program, use KALL with the only parameter is tha address of the routine to be 'called'. Anywhere in that routine, you can use RETRN to the next instruction after the original KALL. You can use as many RETRN statement as required in your routine. KALL and RETRN may be used up to 10 levels deep.may be used up to 10 levels deep. Sample Code: HEAD STACK START NOP KALL FRED *CALL THE ROUTINE NAMED FRED EXIT *************************************** FRED MCW @FRED HERE@,230 W RETRN END START KALL.mac RETRN.mac STACK.mac MULTP allows you to multiply on the 1401 two number, each from 1 to 10 digits long. The actual 1401 multiply is not easy to use. This one is MULTP name of first value, name of second number, name of where to put the answer. Sample Code: HEAD M1 DCW @123@ *FIRST NUMBER M2 DCW @4567@ *SECOND NUMBER ANS DCW @00000000@ *ANSWER START NOP MULTPM1,M2,ANS *MULTIPLY MCW M1,PRINT+10 MCW M2,PRINT+20 MCW ANS,PRINT+25 W EXIT END START MULTP.mac DEVID.MAC