An os whith a menu.

Please support our Assembly advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jun 2008
Posts: 105
Reputation: Alex_ is an unknown quantity at this point 
Solved Threads: 2
Alex_'s Avatar
Alex_ Alex_ is offline Offline
Junior Poster

An os whith a menu.

 
0
  #1
Nov 4th, 2009
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
  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?
Last edited by Alex_; Nov 4th, 2009 at 3:16 am.
Attached Thumbnails
Screenshot-1.png  
Fundamental law of life:
do{ ThingsToDo+=me.CompleteTask(ThingsToDo); }while(ThingsToDo); Die(me);
Law of the Spirit:
do{ Rebuke(me); }while(!me.Repented); LiveEternal(me);
PM me to know more why i wrote this or what it means.
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 830
Reputation: wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all wildgoose is a name known to all 
Solved Threads: 94
wildgoose's Avatar
wildgoose wildgoose is offline Offline
Practically a Posting Shark
 
0
  #2
Nov 4th, 2009
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!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 105
Reputation: Alex_ is an unknown quantity at this point 
Solved Threads: 2
Alex_'s Avatar
Alex_ Alex_ is offline Offline
Junior Poster
 
0
  #3
Nov 4th, 2009
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*
Fundamental law of life:
do{ ThingsToDo+=me.CompleteTask(ThingsToDo); }while(ThingsToDo); Die(me);
Law of the Spirit:
do{ Rebuke(me); }while(!me.Repented); LiveEternal(me);
PM me to know more why i wrote this or what it means.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:




Views: 383 | Replies: 2
Thread Tools Search this Thread



Tag cloud for Assembly
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC