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
OR
OR