fork download
  1. INCLUDE Irvine32.inc
  2.  
  3. .code
  4. main PROC
  5. call IFOrder
  6. call ReversedHexadecimal
  7. call PrimOrNotOrEmprim
  8. call ArmStrong
  9. call Reversestring
  10. main ENDP
  11.  
  12.  
  13. .DATA
  14. count EQU 100
  15. input BYTE count DUP(?), 0
  16. output BYTE count DUP(?), 0
  17. .CODE
  18.  
  19. Reversestring PROC
  20. MOV EDX, OFFSET input
  21. MOV ECX, count
  22. CALL ReadString
  23. MOV ECX, EAX
  24. MOV ESI, EDX
  25. MOV EDI, offset output
  26.  
  27. MOV EAX, ECX
  28.  
  29. L1:
  30. MOVZX EBX, BYTE PTR [ESI]
  31. PUSH EBX
  32. INC ESI
  33. LOOP L1
  34.  
  35. MOV ECX, EAX
  36.  
  37. L2:
  38. POP EBX
  39. MOV BYTE PTR[EDI], BL
  40. INC EDI
  41. LOOP L2
  42. MOV EDX, offset output
  43. CALL WriteString
  44. CALL CRLF
  45. ret
  46. Reversestring ENDP
  47.  
  48. .Data
  49. Input1 dword ?
  50. GoodOutput byte "Ordered"
  51. BadOutput byte "Not Ordered"
  52. countT dword ?
  53.  
  54.  
  55. .code
  56. IFOrder PROC
  57.  
  58. mov edx, offset Input1
  59. mov eax,0
  60. mov ecx,11
  61. call readstring
  62. mov ebx,[edx]
  63. mov countT,041
  64. L1:
  65. cmp ebx,countT
  66. ;dec counter
  67. JE Equal
  68. JL NotDefined
  69. inc countT
  70. loop L1
  71. mov ecx,11
  72.  
  73. Equal:
  74. mov ebx,[edx]
  75. cmp ebx,countt
  76. inc ebx
  77. inc countt
  78. JNE NotOrdered
  79. loop Equal
  80. mov ebx,offset GoodOutput
  81. mov ecx,7
  82. L2:
  83. mov edx,[ebx]
  84. inc ebx
  85. call writestring
  86. loop L2
  87.  
  88.  
  89. NotOrdered:
  90. mov ebx,offset BadOutput
  91. mov ecx,11
  92. L5:
  93. mov edx,[ebx]
  94. inc ebx
  95. call writestring
  96. loop L5
  97.  
  98. NotDefined:
  99.  
  100. ret
  101. IFOrder ENDP
  102.  
  103.  
  104. .Code
  105.  
  106. ReversedHexadecimal PROC
  107. mov ecx, count
  108. GetInput:
  109. call Readdec ; get input
  110. push eax ; push to stack
  111. loop GetInput
  112.  
  113. call Crlf
  114. mov ecx,count
  115. DisplayIt:
  116. pop eax ; get number from stack (LIFO)
  117. call WriteDec ; display it
  118. loop DisplayIt
  119.  
  120. call Crlf
  121. ret
  122. ReversedHexadecimal ENDP
  123.  
  124.  
  125. .Data
  126. PrimOrNot word ?
  127. NotPrimNumber byte "Not Prim number"
  128. Emprimnumb word ?
  129. OnlyPrim byte "it is Prim"
  130. PrimAndEmprim byte "Its an emprim number"
  131.  
  132.  
  133. .Code
  134. PrimOrNotOrEmprim Proc
  135.  
  136. call readint
  137. mov PrimOrNot,ax
  138. mov bl,2
  139. div bl
  140. mov cx,ax
  141. Divided:
  142. div bl
  143. cmp Dx,0
  144. Je NotPrim
  145. inc bl
  146. loop Divided
  147. jmp Emprim
  148. NotPrim:
  149. mov ebx ,offset NotPrimNumber
  150. mov ecx ,8
  151. NotP:
  152. mov edx,[ebx]
  153. inc ebx
  154. call writestring
  155. Loop NotP
  156. Jmp Finish
  157.  
  158. Emprim:
  159. mov bx,10
  160. mov ax,PrimOrNot
  161. mov ecx,2
  162. EmprimOrNot:
  163. div bx
  164. mov EmprimNumb,ax
  165. Loop EmprimOrNot
  166. mov ax,EmprimNumb
  167. mov bx,2
  168. div bx
  169. mov cx,ax
  170. mov ax,EmprimNumb
  171. Divided2:
  172. div bl
  173. cmp Dx,0
  174. Je NotEmprim
  175. inc bl
  176. loop Divided2
  177.  
  178. NotEmprim:
  179. mov ebx, offset OnlyPrim
  180. mov ecx ,15
  181. PrimOnly:
  182. mov edx,[ebx]
  183. inc ebx
  184. call writestring
  185. Loop PrimOnly
  186. Jmp Finish
  187.  
  188. EmprimNumber:
  189. mov ebx ,offset PrimAndEmprim
  190. mov ecx ,20
  191. Emprimnum:
  192. mov edx,[ebx]
  193. inc ebx
  194. call writestring
  195. Loop EmprimNum
  196. Jmp Finish
  197.  
  198.  
  199. finish:
  200. ret
  201. PrimOrNotOrEmprim ENDP
  202.  
  203.  
  204. .Data
  205. strong word ?
  206. Arms word 3 dup(?)
  207. ItIsEqual byte "The number is armstrong"
  208. ItIsNotEqual byte "The number is not armstrong"
  209.  
  210. .Code
  211. ArmStrong PROC
  212. mov bx,100
  213. call readdec
  214. mov strong,ax
  215. mov bx,100
  216. mov esi, offset Arms
  217. mov ecx,3
  218. Arm:
  219. div bx
  220. mov[esi],ax
  221. mov ax,dx
  222. Loop Arm
  223. mov ax,arms
  224. mul arms+2
  225. mul arms+4
  226. mov bx,strong
  227. cmp ax,bx
  228. Je Armstr
  229. JNE NotArmstr
  230.  
  231. armstr:
  232. mov ebx, offset ItIsEqual
  233. mov ecx ,23
  234. Emprimnum:
  235. mov edx,[ebx]
  236. inc ebx
  237. call writestring
  238. Loop armstr
  239. Jmp Finish
  240.  
  241. NotArmstr:
  242. mov ebx ,offset ItIsNotEqual
  243. mov ecx ,27
  244. armstro:
  245. mov edx,[ebx]
  246. inc ebx
  247. call writestring
  248. Loop armstro
  249. Jmp Finish
  250.  
  251.  
  252. Finish:
  253. ret
  254. ArmStrong ENDP
  255.  
  256.  
  257. END main
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(1,0): error CS1525: Unexpected symbol `INCLUDE'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty