<commit_before>// This file is part of www.nand2tetris.org
// and the book "The Elements of Computing Systems"
// by <NAME> Schocken, MIT Press.
// File name: projects/04/Mult.asm

// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)

// Put your code here.<commit_msg>Start of Mult (no loop yet)<commit_after>// Multiplies R0 and R1 and stores the result in R2.
// (R0, R1, R2 refer to RAM[0], RAM[1], and RAM[2], respectively.)

  @sum // location of memory holding the running total
  M=0 // initialise to zero ( sum = 0 )

  @R0 // load the value of R0 into M
  D=M // Set D to the value of R0
  
  @i // init a variable
  M=D // set i to have the value of R0 ( i = R0 )
  
  // Loop R0 number of times whilst adding R1 to the running total
  // @todo the actual loop!
  @R1 // load the value of R1 into M
  D=M // Set D to the value of R1
  
  @sum // load the sum into M
  D = D + M // Add R1 to the total
  
  @sum
  M=D // remember the result

  @R1 // load the value of R1 into M
  D=M // Set D to the value of R1
  
  @sum // load the sum into M
  D = D + M // Add R1 to the total
{'fraction_non_alphanumeric': 0.111495246326707, 'fraction_numerical': 0.032843560933448576, 'mean_word_length': 2.299145299145299, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6312232', 'n_tokens_mistral': 420, 'n_tokens_neox': 411, 'n_words': 198}