ASM 1
Sapioi kodikes ChAosZz By knackrack615 on 17th March 2018 01:55:41 AM
  1. read:
  2.  
  3. addi $2,$0,5 => $2=5
  4.  
  5. syscall
  6.  
  7. add $6,$0,$2 => $6=5
  8.  
  9. Example program:
  10.  
  11. .data
  12. .text
  13. .globl main
  14.  
  15. main:
  16.  
  17. addi $2,$0,5
  18.  
  19. syscall
  20.  
  21. add $6,$0,$2
  22.  
  23. addi $2,$0,5
  24.  
  25. syscall
  26.  
  27. add $7,$0,$2
  28.  
  29. addi $2,$0,5
  30.  
  31. syscall
  32.  
  33. add $8,$0,$2
  34.  
  35. add $9,$6,$7
  36.  
  37. add $10,$9,$8 // add $9,$9,$8
  38.  
  39. j main
  40.  
  41. print:
  42.  
  43. addi $2,$0,1
  44.  
  45. addi $4,$0,10
  46.  
  47. syscall
  48.  
  49. Example program II :
  50.  
  51. .data
  52. .text
  53. .globl main
  54.  
  55. main:
  56.  
  57. addi $2,$0,5
  58.  
  59. syscall
  60.  
  61. add $6,$0,$2 #scan $6
  62.  
  63. addi $2,$0,5
  64.  
  65. syscall
  66.  
  67. add $7,$0,$2 #scan $7
  68.  
  69. addi $2,$0,5
  70.  
  71. syscall
  72.  
  73. add $8,$0,$2 #scan $8
  74.  
  75. addi $2,$0,1
  76.  
  77. add $4,$0,$6 #print $6
  78.  
  79. syscall
  80.  
  81. addi $2,$0,1
  82.  
  83. add $4,$0,$7 #print $7
  84.  
  85. syscall
  86.  
  87. j main
  88.  
  89. Example program III:
  90.  
  91. .data
  92. .text
  93. .globl main
  94.  
  95. main:
  96.  
  97. addi $2,$0,5
  98.  
  99. syscall
  100.  
  101. add $6,$0,$2
  102.  
  103. addi $2,$0,1
  104.  
  105. subi $8,$6,2
  106.  
  107. addi $8,$8,10
  108.  
  109. addi $4,$8,2
  110.  
  111. syscall
  112.  
  113. add $4,$0,$0
  114.  
  115. syscall
  116.  
  117. syscall
  118.  
  119. j main
  120.  
  121. variables:
  122.  
  123. .data
  124. str(name):asciiz(type) "hello"(var)
  125.  
  126. la=load address
  127.  
  128. Example program 4:
  129.  
  130. .data
  131. str:asciiz "hello"
  132. .text
  133. .globlmain
  134.  
  135. main:
  136.  
  137. addi $2,$0,4
  138.  
  139. la $4,str #print "hello"
  140.  
  141. syscall
  142.  
  143. j
  144.  
  145. ------------------------
  146. ~~~~~~~~~HW~~~~~~~~~~~~~
  147.  
  148. 1.na dilosetai mia metavliti stin mnimi mai to onoma sas
  149. 2.na diavasetai 5 arithmous apo to pliktrologio
  150. 3.tous dio protous na tous ektiposetai (1,2)
  151. 4.tous dio epomenouns na vrite to athrisma(3,4)
  152. 5.kanw aferesi me ton telefteo (1,2,3,4-5)
  153. 6.ektiponetai tin aferesi
  154. 7.ektiponetai to onoma sas
  155.  
  156. ------------------------

HGC Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.