Advertisement
RobertCurll

lab4

Apr 25th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. TITLE MASM Template (main.asm)
  2.  
  3. INCLUDE Irvine32.inc
  4. .data
  5. STARTVAL DWORD ? ;starting value
  6. ENDVAL DWORD ? ;ending value
  7. RNGamt DWORD ? ;number of times to generate a random number
  8.  
  9.  
  10. intro BYTE "Welcome to Lottery Simular by Robert Curll & Jeremy",0dh,0ah,0
  11. startValPrompt BYTE "Please enter the starting value",0dh,0ah,0
  12. endValPrompt BYTE "Please enter the ending value ",0dh,0ah,0
  13. rngPrompt BYTE "Please enter the amount of times you want to generate a random number",0dh,0ah,0
  14.  
  15. .code
  16. main PROC
  17. MOV edx, OFFSET intro ;plays intro
  18. CALL WriteString
  19. CALL CRLF ;blank line
  20. MOV edx, OFFSET startValPrompt ;asks for starting value
  21. CALL WriteString
  22. CALL ReadInt ;takes input and stores to eax.
  23. MOV STARTVAL, eax ;moves input to startval.
  24. CALL CRLF
  25. MOV edx, OFFSET endvalPrompt ;asks for end value
  26. CALL WriteString ;
  27. CALL ReadInt ;stores input into eax
  28. MOV ENDVAL, eax ;puts eax into endval
  29. CALL CRLF
  30. MOV edx, OFFSET rngPrompt
  31. CALL WriteString
  32. CALL ReadInt
  33. MOV RNGamt, eax
  34. CALL DumpRegs
  35.  
  36. exit
  37. main ENDP
  38.  
  39. END main
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement