Assembly Program for Basic Computer :: Add two numbers and Store the result in memory

Q. Write an assembly program for Basic Computer (designed by M. Morris Mano) to add two numbers located at 100H and 200H. Then, store the result in 300H if the result is positive, else store in 400H.

LDA 100H        /AC<-M[100H]
ADD 200H        /AC<-AC+M[200H]
SNA                  /skip if AC -ve
STA 300H        /M[300H]<-AC
SPA                  /skip if AC +ve
STA 400H        /M[400H]<-AC
HLT                 /stop i.e. S<-0

No comments:

Post a Comment