944,179 Members | Top Members by Rank

Ad:
  • Assembly Discussion Thread
  • Marked Solved
  • Views: 590
  • Assembly RSS
Nov 4th, 2009
0

An os whith a menu.

Expand Post »
hello people. I am doing an "os" (small) that's mainly a menu. It just prints some strings and highlights some words when you pres 1,2 or 3. And by pressing enter while a option is selected, it has to do something.
The problem is that the program gets stuck in the beginning ... and i don't know where is the problem. Can't run a debug because it's a bootable bin file. Can some one please tell me where is the error?
I'm using linux+ nasm
asm Syntax (Toggle Plain Text)
  1. [BITS 16]
  2. jmp 07C0h:start
  3. snd db 'Sound'
  4. lsnd equ $-snd
  5. abt db 'About'
  6. labt equ $-abt
  7. hlp db 'Help'
  8. lhlp equ $-hlp
  9.  
  10. start:
  11.  
  12. is1:
  13. call init
  14. ;print "sound"
  15. mov ax,1300h
  16. mov bh,0
  17. mov bl,2
  18. mov cx,lsnd
  19. mov dx,0
  20. push cs
  21. pop es
  22. mov bp,snd
  23. int 10h
  24. wait_:
  25. mov ah,00h
  26. int 16h
  27.  
  28. cmp ah,13
  29. je make_sound
  30.  
  31. cmp ah,49
  32. je is1
  33.  
  34. cmp ah,50
  35. je is2
  36.  
  37. cmp ah,51
  38. je is3
  39.  
  40. jmp wait_
  41. is2:
  42. call init
  43. ;print "About"
  44. mov ax,1300h
  45. mov bh,0
  46. mov bl,2
  47. mov cx,labt
  48. mov dl,5
  49. push cs
  50. pop es
  51. mov bp,abt
  52. int 10h
  53. jmp wait_
  54.  
  55. is3: jmp wait_
  56.  
  57. make_sound:
  58. mov ax, 0E07h
  59. xor bx, bx
  60. int 10h
  61. jmp wait_
  62.  
  63. init:
  64. ;print "sound"
  65. mov ax,1300h
  66. mov bh,0
  67. mov bl,5
  68. mov cx,lsnd
  69. mov dx,0
  70. push cs
  71. pop es
  72. mov bp,snd
  73. int 10h
  74. ;print "About"
  75. mov ax,1300h
  76. mov bh,0
  77. mov cx,labt
  78. mov dl,5
  79. push cs
  80. pop es
  81. mov bp,abt
  82. int 10h
  83. ;print "Help"
  84. mov ax,1300h
  85. mov bh,0
  86. mov cx,lhlp
  87. mov dl,10
  88. push cs
  89. pop es
  90. mov bp,hlp
  91. int 10h
  92. ret
  93.  
  94.  
  95. times 510-($-$$) db 0
  96. dw 0AA55h

The attachment shows the result of the execution. To me, it looks like he executes init then ;print "sound" then gets stuck. Maybe the function that i use to wait for a char isn't the right one?
Attached Thumbnails
Click image for larger version

Name:	Screenshot-1.png
Views:	17
Size:	17.5 KB
ID:	12447  
Last edited by Alex_; Nov 4th, 2009 at 3:16 am.
Similar Threads
Reputation Points: 10
Solved Threads: 3
Junior Poster
Alex_ is offline Offline
175 posts
since Jun 2008
Nov 4th, 2009
0
Re: An os whith a menu.
Review how VIDEO BIOS Interrupt 10h is suppose to function!

You indicate string doesn't contain attributes with AX,1300h
BUT Never set BL to indicate attribute to use!

ALSO DL=column DH=Row

Now check all your prints!
Reputation Points: 546
Solved Threads: 99
Practically a Posting Shark
wildgoose is offline Offline
891 posts
since Jun 2009
Nov 4th, 2009
0
Re: An os whith a menu.
I don't understand: why not setting BL for an attribute? It works fine for me...

I managed to fix my error,however. I was comparing ah when the character returned was in al. *oops*
Reputation Points: 10
Solved Threads: 3
Junior Poster
Alex_ is offline Offline
175 posts
since Jun 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Assembly Forum Timeline: Need help with a mips program
Next Thread in Assembly Forum Timeline: Beginner SPIM Array help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC