Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

Tasm - Control flow

markkkk31

The Fanatic
Advanced Member
Messages
421
Reaction score
0
Points
26
Mga master na magagaling at experts sa assembly program need help po. bali yung code sa baba, dapat po may menu kami A, B, C, and 0 if yung input at di isa dun mag prompt sya na wrong input and select to return on the menu. if may makaka pag bigay ng advise or help anu po mali namin sa code maapreciatepo namin yun.


.model small
.stack
.data

mo db "MAIN MENU $"
mm db "[A] FIRST NAME $"
mi db " MIDDLE NAME $"
mh db "[C] LAST NAME $"
mg db "[x] EXIT $"
mf db "Enter your choice $"
me db "Press 0 to go back to main menu $"
ml db "Iguadala $"
mb db "Underson $"
mc db "Burst $"
md db "Wrong Entry $"

.code
start:

mov ax,@data
mov ds, ax

mov ah, 06
mov bh, 41h
mov cx, 0
mov dx, 184Fh
int 10h


mov ah, 2
mov bh, 0
mov dh, 9
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mo
int 21h

mov ah, 2
mov bh, 0
mov dh, 11
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mm
int 21h

mov ah, 2
mov bh, 0
mov dh, 12
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mi
int 21h

mov ah, 2
mov bh, 0
mov dh, 13
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mh
int 21h

mov ah, 2
mov bh, 0
mov dh, 14
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mg
int 21h

mov ah, 2
mov bh, 0
mov dh, 16
mov dl, 34
int 10h

mov ah, 9h
mov dx, offset mf
int 21h

mov ah, 2
mov bh, 0
mov dh, 16
mov dl, 53
int 10h

mov ah,07h
int 21h

cmp al,41h
JE first
jmp wrong


start5:
jmp start

first:


mov ah, 06
mov bh, 44h
mov cx, 0924h
mov dx, 0929h
int 10h

mov ah, 06
mov bh, 44h
mov cx, 0926h
mov dx, 1027h
int 10h

mov ah, 06
mov bh, 44h
mov cx, 1124h
mov dx, 1129h
int 10h

mov ah, 2
mov bh, 0
mov dh, 20
mov dl, 34
int 10h

mov ah, 09h
mov dx, offset ml
int 21h

mov ah, 2
mov bh, 0
mov dh, 20
mov dl, 35
int 10h

mov ah, 9h
mov dx, offset me
int 21h

mov ah, 2
mov bh, 0
mov dh, 16
mov dl, 38
int 10h
mov ah,07h
int 21h

cmp al,30h
je start5

start3:
jmp start

third1:
jmp third

start6:
jmp start5

second:
mov ah, 06
mov bh, 70h
mov cx, 0
mov dx, 184Fh
int 10h

mov ah, 2
mov bh, 01h
mov cx, 0924h
mov dx, 0D26h
int 10h

mov ah, 2
mov bh, 01h
mov cx, 0C25h
mov dx, 0E2Bh
int 10h

mov ah, 2
mov bh, 01h
mov cx, 092Ah
mov dx, 0D2Ch
int 10h

mov ah, 2
mov bh, 0
mov dh, 16
mov dl, 38
int 10h

mov ah, 9
mov dx, offset mb
int 21h

mov ah, 2
mov bh, 0
mov dh, 20
mov dl, 35
int 10h

mov ah, 9
mov dx, offset me
int 21h


mov ah, 07h
int 21h

cmp al, 30h
je start6
jmp wrong


start2:
jmp start3


third:

mov ah, 06
mov bh, 70h
mov cx, 0
mov dx, 184Fh
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0924h
mov dx, 0E26h
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0926h
mov dx, 0A2Ah
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0B26h
mov dx, 0C2Ah
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0D26h
mov dx, 0E2Ah
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0A2Ah
mov dx, 0B2Ch
int 10h

mov ah, 2
mov bh, 06h
mov cx, 0C2Ah
mov dx,0D2Ch
int 10h

mov ah, 2
mov bh, 0
mov dh, 16
mov dl, 38
int 10h

mov ah, 9
mov dx, offset mh
int 21h
jmp start

start1:
jmp start2

mov ah, 07h
int 21h

cmp al, 58h
je exit
jmp wrong

wrong:

mov ah, 06
mov bh, 70h
mov cx, 0
mov dx, 184Fh
int 10h

mov ah, 6
mov bh, 44h
mov cx, 0
mov dx, 184fH
int 10h

mov ah, 2
mov bh, 0
mov dh, 10
mov dl, 35
int 10h

mov ah, 9
mov dx, offset md
int 21h

mov ah, 2
mov bh, 0
mov dh, 14
mov dl, 35
int 10h

mov ah, 9
mov dx, offset me
int 21h

mov ah, 07h
int 21h

cmp al, 30h
je start1
jmp wrong


exit:
mov ah,4ch
int 21h
end start


View attachment 371247
attached the pic of sample menu. Anyhelp po mga master.
 

Attachments

  • Capture.JPG
    Capture.JPG
    26.3 KB · Views: 8
Last edited:
Back
Top Bottom