User Tools

Site Tools


notes:comporg:spring2024:projects:pncx

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
notes:comporg:spring2024:projects:pncx [2024/04/24 21:00] – [Array in ASM] wgates1notes:comporg:spring2024:projects:pncx [2024/04/24 23:18] (current) – [dmorey2 pnc2 runtimes] dmorey2
Line 261: Line 261:
 Lets look at what is happening here, so we have created an array called primeAr and we have a loop that starts at 2 and goes till upperBound which could be 1024, 2048, and so on. Inside the loop, we are specifying the index at a given point in the array and assigning it pop. This is populating our array going 2,3,4,5,...upperBound which will be important for the logic later down the line. Lets look at what is happening here, so we have created an array called primeAr and we have a loop that starts at 2 and goes till upperBound which could be 1024, 2048, and so on. Inside the loop, we are specifying the index at a given point in the array and assigning it pop. This is populating our array going 2,3,4,5,...upperBound which will be important for the logic later down the line.
  
 +Now lets look at that in asm:
 +<code asm>
 +    mov R8, primeAr ; Starting point goes into R8
 +    iadd R8, 2      ; Incrementing R8 by 2
 +    mov R9, 2       ; starting point/number (pop in C)
 +
 +_bLoop:
 +    ; Loop condition
 +    mov R13, R9
 +    ile R13, R2
 +    jf R13, _bLoopEnd
 +
 +    mov [R8], R9 ; R9 moved into R8 array at current index
 +    iadd R8, 1   ; Increment memory address
 +    iadd R9, 1   ; Increment loop
 +
 +    jmp _bLoop ; Back to start of loop
 +
 +_bLoopEnd:
 +</code>
 +
 +As you can see the logic is very similar but just knowing how to write it might be the hard part but after doing a couple look overs and experimenting it will click.
  
  
Line 308: Line 330:
 ====dmorey2 pnc1 runtimes==== ====dmorey2 pnc1 runtimes====
 {{:notes:comporg:spring2024:projects:meta-chart.png?400|}} {{:notes:comporg:spring2024:projects:meta-chart.png?400|}}
 +
 +====dmorey2 pnc2 runtimes====
 +{{:notes:comporg:spring2024:projects:meta-chart_1_.png?400|}}
 ====rspringe Runtimes==== ====rspringe Runtimes====
 ===pnc0=== ===pnc0===
Line 314: Line 339:
 {{:notes:comporg:spring2024:projects:rspringe_pnc1_graph.png?400|}} {{:notes:comporg:spring2024:projects:rspringe_pnc1_graph.png?400|}}
 ===pnc2=== ===pnc2===
 +{{:notes:comporg:spring2024:projects:rspringe_pnc2_graph_-_1.png?400|}} 
 +{{:notes:comporg:spring2024:projects:rspringe_pnc2_graph_-_2.png?400|}}
notes/comporg/spring2024/projects/pncx.1714006821.txt.gz · Last modified: 2024/04/24 21:00 by wgates1