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

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.