WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
What is FASM G
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
Pages (2) [1] 2   ( Go to first unread post )

Menu in Assembly, how to make a menu in assembly using TAsm

rswest
Quote Post


New Member
*

Group: Members
Posts: 3
Member No.: 56948
Joined: 4-March 13


Sponsored Links
hello. i am an engineering student and i have assembly programming a a minor subject. i am pretty new at assembly programming and at school we are using TASM for 8086 machines. we have been tasked to make a program that shows a menu. the menu should look like the interface of turbo C. we only need to show the menu and not the functions. for example if i press h the help menu would appear with its sub menus and i have to press a letter to access the sub menus that i want.

im sorry if im asking to much i just want to get some pointers from you guys. i have a week to make this program so i want to start early so i could understand how it works. any ideas or tips? thanks.
PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2331
Member No.: 160
Joined: 22-June 04


the simlpiest way is:
1.declare text for menu and all submenus:
CODE

main_menu db "1. submenu 1",13,10
                db "2. submenu 2",13,10
                ...
                db "0. exit","$"
sub_menu1 db "1. option 1",13,10
                db "2. option 2",13,10
                ...
                db "0. main menu","$"
sub_menu2 db "1. option 1",13,10
                db "2. option 2",13,10
                ...
                db "0. main menu","$"

every menu must have variable where you can read number of items
CODE

items_0 db 5; main menu items number
items_1 db 3; submenu1 items number etc.

then use this routine:
- take main menu text address
loop:
- display menu text
- copy proper items number into work variable
- wait for keypress
- check if it is number [in range "0" - "9"] (ignore if not)
- check if it is below or equal of current items number (ignore if not)
- process it:
if it is not zero:
if it is menu - take submenu text and items number and go up to loop
if it is submenu - ignore it
if it is zero:
if it is menu - exit program
if it is submenu - take main menu text address and item number and go to loop

use byte variable to keep number of current menu/submenu (say, main menu has number "0")

use int21 to display text, wait for keypress and exit from program
PMEmail PosterUsers Website
Top
rswest
Quote Post


New Member
*

Group: Members
Posts: 3
Member No.: 56948
Joined: 4-March 13


hey thanks shoorick. im still at school. ill post what i have come up so far when i get home. please take a look at it. thanks so much you are very nice :D
PMEmail Poster
Top
rswest
Quote Post


New Member
*

Group: Members
Posts: 3
Member No.: 56948
Joined: 4-March 13


hello again shoorick. i am having trouble understanding assembly programming.
basically this is what i want to do in the program.

ill have a background color as gray then when i press h the help menu pop ups with this choices:

(IMG:http://i47.tinypic.com/ixfjaa.jpg)

then if i press their first letter like C the for Contents a box would pop out with some message like "You pressed C this is the Contents box". etc.

forgive me for being a total noob about this. our professor gave this as a project and told us to do advancre reading on the matter, but i am really having a hard time understanding what is happening. i hope anyone an \help me. and can you do //comments on the codes so i could understand it better :) sorry for asking to much im pretty desperate :( thanks .

PMEmail Poster
Top
shoorick
Quote Post


Extremely Active Member
******

Group: Admins
Posts: 2331
Member No.: 160
Joined: 22-June 04


to say true, the main problem is here: "i am having trouble understanding assembly programming" is not compatible with "this is what i want to do in the program". it is not too complex task, but impossible without understanding basics of assembly: indirect memory access, loops, text video memory organisation, usage of structrures and linked lists. you need to spend some time with simple examples to understand it, then you will be able to write such kind of program.

***********
part A
***********

1.learn what is video mode 3, where and how characters from screen
(and their attributes) are situated in memory.

try to put a character to screen into desired location, or read any existing character from screen and put it into another place

2.learn how to implement memory copy:
- how lodsb/stosb, lodsw/stosw work
- how es and ds are using to point memory segments
- how to make loop with cx

try to do something with loop, say read screen characters from one location and put it to the next location, eg. make your scroll

3.learn how to make nested loop.

try to fill with character the rectangular area at the screen.

*************************************************
if you did all above, let me know, i'll tell you what to do next
*************************************************
PMEmail PosterUsers Website
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Pages (2) [1] 2  Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google