Rasbol Instruction Manual The following conventions and abreviations are used throughout this manual. INSTR The Rasbol instruction FLD1 The 4k field address of argument 1. FLD2 " " " " 2. LABEL,LABEL2 etc. Program variable or statement label name. NAME,NAME2,NAME3 Name etc of variable 2 or more words in length INTGR,INTGR2 etc. Name of single word variable LIT,LIT1,LIT2,LIT3, etc. Single word (or part word) numeric literal ACC The main 36 bit accumulator REMACC The 36 bit remainder accumulator [NAME] The contents of the variable NAME [ACC] The contents of the ACC [LOACC] The contents of the low order word of the ACC. [REMACC] The contents of the REMACC. / / Program flow and condition testing instructions ( [ACC] and [REMACC] not effected. ) GOTO ;LABEL Unconditional branch to LABEL GOSUB ;LABEL Branch to RASBOL subroutine at LABEL No arguments are passed. GOPAL ;LABEL Branch to PAL subroutine at LABEL No arguments are passed. GOZERO ;LABEL If [ACC] = 0 , branch to LABEL GOPOS ;LABEL If [ACC] > 0 , branch to LABEL GONEG ;LABEL If [ACC] < 0 , branch to LABEL GONZRO ;LABEL If [ACC] < or > 0 , branch to LABEL GOIF ;LABEL1 ;LABEL2 If [ACC] = 0 , branch to LABEL1, if [ACC] < 0 , branch to LABEL2 GOIFZO ;LABEL ;INTGR If [INTGR] = 0 , branch to LABEL GOIFEQ ;LABEL ;LIT If [ACC] = LIT, branch to LABEL INCGOZ ;LABEL ;INTGR Increment [INTGR] by 1,then if [INTGR] = 0, branch to LABEL. DECGOZ ;LABEL ;INTGR Decrement [INTGR] by 1, then if[INTGR] = 0, branch to LABEL. RANGE ;LABEL ;LIT1 ;LIT2 If [ACC] < LIT1, or [ACC] > LIT2, branch to LABEL. DO ;LABEL ;INTGR ;LIT1 ;LIT2 If [INTGR] does not equal LIT2 add LIT1 to [INTGR] and branch to LABEL YESNO ;LABEL Accept a character from the keyboard, if Y drop thru, if N branch to LABEL, else wait for next char.,repeat instruction. EXIT Returns to the OS/8 System at 7600. ABORT ;LABEL If Control/C is typed following this, branch to LABEL. (to close files etc.) ABORT ;0 If Control/C is typed, return to OS/8. (Default is ABORT ;0 ,if instruction not used.) ......ACCUMULATOR INSTRUCTIONS..... CLEAR The ACC and REMACC are cleared to zero NEGATE Change the sign of the [ACC]. REMAINDER The [ACC] and the [REMACC] are swapped. SIGN1 The sign bit of the low order word of the [ACC] is set as the sign of the [ACC]. e.g. 0000 0000 7654 becomes 7777 7777 7654 SIGN2 The sign bit of the second word of the ACC is set as the sign of the ACC. e.g. 0000 7654 3210 becomes 7777 7654 3210 SHIFTR LIT The [LOACC] is shifted right LIT bits (LIT<13) ANDIM ;LIT The [LOACC] is logical ANDed with LIT, and result left in LOACC ORIM ;LIT The [LOACC] is logical ORed with LIT, and result left in LOACC. RBSW The two 6 bit bytes in the LOACC are swapped. ......MEMORY REFERENCE ACCUMULATOR INSTRUCTIONS...... Loading ACC. The ACC and REMACC are cleared, the variable is unaltered. LOADIM LIT1 ;LIT2 The literal(s) are loaded into the ACC. The literal can range from (octal) 1 to 7;7777. LIT1 is optional. LOAD1 ;NAME A one word variable is loaded into the ACC (LOACC). LOAD2 ;NAME a two word variable is loaded into the ACC (low order two words). LOAD ;NAME A three word variable is loaded into the ACC. ...... Adding to the ACC. The REMACC is unaltered,the result is left in the ACC, and the Variable is unaltered. ADDIM LIT1 ;LIT2 The literal(s) are added to the ACC. ADD1 ;NAME ADD2 ;NAME ADD ;NAME The contents of the variable are added to the ACC. .......... Subtracting from the [ACC]. The REMACC is unaltered,the result is in [ACC] and the Variable is unaltered. SUBTIM LIT1 ;LIT2 The literal(s) are subtracted from the [ACC]. SUBT1 ;NAME SUBT2 ;NAME SUBT ;NAME The contents of the variable are subtracted from the [ACC]. .......... Multiplication. The contents of the variable or literal are mutiplied by the contents of the ACC. The low order 36 bits result are left in the ACC, the high order 36 bits are left in the REMACC. A 10 decimal digit number can be multiplied by another giving a 20 digit true result. MULTIM LIT1 ;LIT2 MULT1 ;NAME MULT2 ;NAME MULT ;NAME .......... Division. If the division immediately follows a multiply, the division is into the 72 bit combined REMACC-ACC, otherwise the 36 bit ACC is divided by the varialble or literal, leaving the signed result in the ACC, and a positive remainder in the REMACC. DIVIM LIT1 ;LIT2 DIVID1 ;NAME DIVID2 ;NAME DIVIDE ;NAME .......... Storing the contents of the ACC. The contents are stored in the variable the ACC is unaltered. STORE1 ;NAME STORE2 ;NAME STORE ;NAME .......... Adding [ACC] to variables, the[ACC] is added to the variable,the result stored in the variable, the [ACC] is unaltered. ADDTO1 ;NAME ADDTO2 ;NAME ADDTO ;NAME There is no subtract-from instruction. Use NEGATE;ADDTO ;NAME. .........MOVING,CLEARING,CONVERTING, COMPARING.......... MOVE1 ;NAME1 ;NAME2 Move 1 word from NAME1 to NAME2 MOVE2 ;NAME1 ;NAME2 Move 2 words from NAME1 to NAME2 MOVE3 ;NAME1 ;NAME2 Move 3 words from NAME1 to NAME2 MOVE ;NAME1 ;NAME2 ;LIT Move LIT words from NAME1 to NAME2 CLEARW ;INTGR The word at INTGR is set to zero CLRWDS ;LIT;NAME LIT words at NAME are set to zero. MOVIM ;LIT ;INTGR Move LIT to INTGR FILL ;LIT1 ;NAME ;LIT2 LIT2 words at NAME are filled with LIT1 INCREM ;INTGR INTGR is incremented by 1. DECREM ;INTGR INTGR is decremented by 1. .......... CONVW6 ;NAME1 ;NAME2 ;LIT LIT characters (1 per word) at NAME1 are stored in 6 bit(2 per word) at NAME2. CONV6W ;NAME1 ;NAME2 ;LIT LIT characters (2 per word) at NAME1 are converted to 8 bit (1 per word) at NAME2. CONVBW ;NAME1 ;NAME2 ;LIT A three word variable at NAME1 is coverted to a zero suppressed string of LIT 8 bit (1 per word) characters at NAME2. CONVWB ;NAME1 ;NAME2 ;LIT A string of LIT numeric characters at NAME1 is coverted to a three word variable at NAME2. .......... PICTURE ;MASK1 ;NAME ;LIT The [ACC] is converted to a LIT character string using the picture at MASK1 and stored at NAME in 6 bit(2 per WORD). See PRINTUSING instruction for use of mask. COMPARE ;NAME1 ;NAME2 ;LIT LIT words at NAME1 are compared logically with LIT words at NAME2 or until inequality is found. The sign of the ACC is set to the result of the comparison[name1-name2]. The actual [ACC] is meaningless. Test with GOIF. ..........INDEX REGISTER INSTRUCTIONS.......... LOADX1 ;INTGR Index reg. 1 is loaded with [INTGR]. LOADX2 ;INTGR Index reg. 2 is loaded with [INTGR]. LOADX3 ;INTGR Index reg. 3 is loaded with [INTGR]. STORX1 The [LOACC] is stored in index reg. 1 STORX2 The [LOACC] is stored in index reg. 2 STORX3 The [LOACC] is stored in index reg. 3 MULTX1 LIT Index reg. 1 is multiplied by LIT.(LIT<64 ) MULTX2 LIT Index reg. 2 is multiplied by LIT.(LIT<64 ) There is no MULTX3 instruction. EXECX3 The contents of index reg.3 are executed as an instruction. ..........CHARACTER OUTPUT.......... PRINT LIT ;TEXT 'ALPHA-LIT' The characters between the delimiters are printed on the terminal. LIT MUST equal the number of characters between the delimiters. Up-arrow(^) is output as TAB, back arrow (_) as CR/LF. PRINTX ;NAME ;LIT LIT characters at NAME are printed on the terminal. ( 6 bit, 2 char.per word). Up-arrow(^) is output as TAB, back arrow (_) as CR/LF. PRINTW ;NAME ;LIT LIT characters at NAME are printed on the terminal. ( 8 bit, 1 char.per word). PRINTC LIT1 ;LIT2 The character LIT2 is printed LIT1 times on the terminal. LIT1<64, LIT2 any 8 bit ch. PRNTCH The character in the [LOACC) is printed on the ..........NUMERIC OUTPUT.......... PRINTO The [LOACC] is printed as 4 octal charaters. PRINTU ;MASK1 ;LIT Using MASK1, the [ACC] is edited and printed as LIT characters, the last char. is always the sign. (LIT<21) . ..........The Picture Mask........... The mask is a ten character TEXT string which defines the required output of the PRINTU and PICTURE instructions. The tenth char is the sign used if the [ACC] is negative, the sign is a space if positive. A positive zero suppressed conversion of the [ACC] is merged from right to left with nine characters of the mask using the following rules: ACC.CHAR. MASK CHAR. RESULT digit blank digit blank blank blank rest of output digit 0 digit blank 0 0 any \ deletion any $ float dollar any * aster.fill. any other insert mask char. ..........NUMERIC INPUT........ TYPIN LIT Accept numeric input from terminal without echoing. Input is cancelled by any alpha char., and terminated by (CR). Results in ACC. TYPIN is normaly followed by a PRINTU instr. LIT is a 2 digit octal number, the first digit being the number of words precision, (1 to 3), the second being the number of decimal places allowed .First=3 for signed input. E.g. TYPIN 32 allows a ten digit number, a minus (-) sign (before or after number), and a period(.) followed by up to 2 digits. If a period is entered, the number will be padded with zeroes if necessary. TYPIN 10 allows a number from 0 to 4095 to be entered, minus and period are not valid characters in this case. If any invalid character is entered, all previous input is ignored, a BELL char is output to the terminal and instruction is re-executed. ..........CHARACTER INPUT.......... TYPCH Accept and echo one character from terminal and store in the ACC (LOACC position). TYPTEX ;NAME ;LIT Accept and echo up to LIT characters from terminal and store in NAME (6 bit,2 char. per word). If (CR) is entered, it is not echoed or stored, and the remainder of NAME is filled with blanks or nulls. TYPWDS ;NAME ;LIT Accept and echo up to LIT characters from terminal and store in NAME (8 bit,1 char. per word). If (CR) is entered, it is not echoed or stored, and the remainder of NAME is filled with blanks or nulls. FILZRO All TYPTEX or TYPWDS instructions following will be filled with nulls (zero) after (CR). FILSPC all TYPTEX or TYPWDS instructions following will be filled with blanks(spaces) after(CR). Obviously FILZRO and FILSPC cannot be in use at the same time as one cancells the other. If neither is used the default is FILZRO.