How can I create a simple menu?

  • (2 Pages)
  • +
  • 1
  • 2

17 Replies - 1037 Views - Last Post: 13 December 2013 - 10:38 PM

#16 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: How can I create a simple menu?

Posted 13 December 2013 - 08:17 AM

I'm being punked, right? if you really don't know why you cannot use menu items more than 2, then you need to retake your course, or buy a assembly basics book.

I will not tell you the reason but will give you a hint. you need to change the line after cmp al "3"
Was This Post Helpful? 1
  • +
  • -

#17 HowtoX  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 20
  • Joined: 14-October 13

Re: How can I create a simple menu?

Posted 13 December 2013 - 09:12 AM

I'm really sorry for being a complete idiot in assembly :sad3: and I really appreciate all of the helps and replies you've given me. I'm really trying here. I've done that before [changing the line after cmp al 3] and I thought it would've worked, but it didn't. It gives a new error when I do that. This is it:

input redirection is not supported yet!
INT 21h/9h should be used instead. refer to interrupt reference.


I even changed

    cmp     al, "3"
    jmp     Quit   


To

    cmp     al, "3"
    jmp     OpenFile


I said for a minute I would exclude "Exit" and replace "OpenFile" in "3" and when I press "3" it should "open the file" instead of "quitting". But it gives me that error.

This post has been edited by HowtoX: 13 December 2013 - 09:17 AM

Was This Post Helpful? 0
  • +
  • -

#18 GunnerInc  Icon User is offline

  • "Hurry up and wait"
  • member icon




Reputation: 858
  • View blog
  • Posts: 2,279
  • Joined: 28-March 11

Re: How can I create a simple menu?

Posted 13 December 2013 - 10:38 PM

Quote

input redirection is not supported yet!
INT 21h/9h should be used instead. refer to interrupt reference.

You are using an emulator and it probably does not support the interrupts you are trying to use. Not sure why some teachers use emu8086 when you can use DOSBox without issue. You will have to work that issue out on your own by looking at the docs at http://ctyme.com/rbrown.htm

This is what you have,

cmp     al, "1"
je      CreateFile
cmp     al, "2"
je      ShowAbout
cmp     al, "3"
jmp     Quit          
cmp     al, "4"
je    OpenFile


I told you that you need to change something after cmp al, "3", what do all the other cmp's have after them? a je right? Soooo, your code should look like this:

cmp     al, "1"
je      CreateFile
cmp     al, "2"
je      ShowAbout
cmp     al, "3"
je     Quit          
cmp     al, "4"
je    OpenFile

Was This Post Helpful? 1
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2