Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Instruction Set of the Basic Computer effective address M: memory word (operand)

ID: 3806532 • Letter: I

Question



Instruction Set of the Basic Computer effective address M: memory word (operand) AND 0 or 8 AND M to AC found at m ADD 1 9 Add M to AC, to E 2 or A Load AC from M STA 3 or B Store AC in M BUN 4 or CBranch to m return address in m and branch to m 1 6 or E Increment M and skip if zero CLA 7800 Clear AC CLE 7400 Clear E10 CMA 7200 Complement AC CME 7100 Complement E 7080 Circulate right E and AC 7040 Circulate left E and AC ncrement AC, carry to E INC 7020 SPA 7010 Skip if AC is positive SNA 7008 Skip if AC is negative SZA 7004 Skip if AC is zero SZE 7002 Skip if E is zero HLT 7001 Halt computer information and clear flag OUT F400 output information and clear flag SKI F200 Skip if input flag is on SKO F100 Skip if output flag is on ION F080 Turn interrupt on IOF F040 Turn interrupt off

Explanation / Answer


Label   Opcode   operand       Comments

   ORG   100       /Origin of Program is HEX 100
   LDA   ADS       /Load first address of operands
   STA   PTR       /Store in pointer
   LDA   NBR       /Load minus 9(no of values to be added)
   STA   CTR       /Store in counter
   CLA           /Clears the Accumulator
LOP,   ISZ   PTR       /Increment Pointer
   Isz   CTR       /Increment Counter
   LDA   PTR       /Load from the address location
   SPA           /Skip Next instruction if A is positive
   BUN   LOP       /Unconditional Loop back if A is Negative
   CLA           /Clears the Accumulator
   ADD   PTR       /Add an operand to Accumulator
   STA   SUM       /Store the total
   Isz   CTR       /Increment Counter
   HLT
ADS,   HEX   200       /First Address of operands
PTR,   Hex   0       /Location reserved for a pointer
NBR,   DEC   -9       /Constatnt to initialized counter
CTR,   HEX   0       /Location reserved for a counter      
SUM,   Hex   0       /Sum is stored here

   ORG   200       /Origin of Operands
   DEC   10       /First operand
   .
   .
   .
   .
   .
   .
   Dec   0       /Last operand