Menu

[Solved]Write Program Assembly X86 Masm Irvine User Thinks Number Computer Guesses Guesses Correct Q37212278

Write a program in assembly (x86 MASM irvine), where the userthinks of a number and the computer guesses until it guesses thecorrect number.

  • You think of a number (between 1 – 100)

  • Computer takes a guess

  • You type “too high” or “too low” or “yes”

  • Based on that, the computer adjusts its guess.

HINT: Code that compares two strings in MASM

include Irvine32.inc.dataresponse BYTE 10 DUP(0)directions BYTE “Keep going? (yes go) or (no stop): “, 0yesStr BYTE “yes go”, 0noStr BYTE “no stop”, 0.codemain procTELLGUESS :mov edx, OFFSET directionscall WriteStringmov edx, OFFSET responsemov ecx, 9call ReadStringINVOKE Str_compare, ADDR response, ADDR yesStrje YESINVOKE Str_compare, ADDR response, ADDR noStrje NOYES :mov edx, OFFSET yesStrcall WriteStringcall Crlfjmp TELLGUESSNO :mov edx, OFFSET noStrcall WriteStringcall Crlfinvoke ExitProcess, 0main endpend main

Expert Answer


Answer to Write a program in assembly (x86 MASM irvine), where the user thinks of a number and the computer guesses until it guess… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *