Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR ASSEMBLY

multiply two numbers assembly lmc

     INP
     STA R0
     INP
     STA R1

LOOP LDA R1
     BRZ END
     SUB ONE
     STA R1
     LDA RES
     ADD R0
     STA RES
     BRA LOOP

END  LDA RES
     OUT

     // Temporary storage
R1   DAT
R0   DAT
RES  DAT

     // Constants
ONE  DAT 1
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiply #numbers #assembly #lmc
ADD COMMENT
Topic
Name
1+4 =