Besonderhede van voorbeeld: 6727604806799842594

Metadata

Author: WikiMatrix

Data

English[en]
The following example is written in the MIPS assembly language: begin: addi $8, $0, 0 # initialize sum to 0 addi $9, $0, 1 # set first number to add = 1 loop: slti $10, $9, 1000 # check if the number is less than 1000 beq $10, $0, finish # if odd number is greater than n then exit add $8, $8, $9 # update sum addi $9, $9, 1 # get next number j loop # repeat the summing process finish: add $2, $8, $0 # put sum in output register Once told to run this program, the computer will perform the repetitive addition task without further human intervention.
Finnish[fi]
Seuraava esimerkki on kirjoitettu MIPS-suorittimen assembly-kielellä: begin: addi $8, $0, 0 # initialize sum to 0 addi $9, $0, 1 # set first number to add = 1 loop: slti $10, $9, 1000 # check if the number is less than 1000 beq $10, $0, finish # if odd number is greater than n then exit add $8, $8, $9 # update sum addi $9, $9, 1 # get next number j loop # repeat the summing process finish: add $2, $8, $0 # put sum in output register Pääartikkeli: Tietokonearkkitehtuuri Tietokonearkkitehtuureista yleisimmät ovat Von Neumannin arkkitehtuuri ja Harvardin arkkitehtuuri.

History

Your action: