assembly laboratory

4
 Org 100h ; assembler directives .model SMALL ; assembler directives .stack ; assembler directives .data msg_1 db "Please type yor !" msg # db "$ame !" %ame 1 db 1& dp '(() msg * db "Age !" age_1 db + dp '(() msg_+ db ",S$ !" ,s% 1 db 1& dp '(() i%st db "-Select the best a%ser!-" /e_1 db "1. Se! -Male -emale -2oth -3veryday "40dh40ah4(( Se_1 db #0 dp '(() /e_# db "#. avorite ood! -Siomai - Siopao -all "40dh40ah4(( ave 1 db #0 dp '(() /e_* db "*. School ! -AMA rocks55 -6i %y 6 ots -7arva rd "40dh4 0ah4(( School 1 db #0 dp '(() /e + db "+. Pet(s $ame! -2ar%ey -2or8ak -Pikach "4 0dh40ah4(( Pet 1 db #0 dp '(() /e_& db "&. 9rsh! -:ames -:ames Agai% -:ames yapo% "4 0dh40ah4(( 9rsh 1 db #0 dp '(() Sm db "Smmary ! " Ot Se db "Se !" Ot_ave db "avorite ood !" Ot School db "School !" Ot_Pet db "Pet(s $ame !" Ot 9rsh db "9rsh !" .code mov d4 o<<set msg 1 ;;;;;;;;;;;;;;;; P=>$6 ;;;;;;;;;;;;;;; call pri%t ot ;;;;;;; PL3AS3 3$63= ?O,=! ;;;;;;;;;;;;;;;; call %e t li%e ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; mov d4 o<<set msg # ;;;;;;;;;;;;; P=>$6 ;;;;;;;;;;; call pri%t_ot ;;;;;;; $AM3! ;;;;;;; call type %ame ;;;;;;;; AS@ O= >$P,6 ;;;;;;;;; call Store data ;;;;;;;; SA3S A6 A >$P,6 ;;;;;;;;;;

Upload: harvey-james-chua

Post on 05-Oct-2015

1 views

Category:

Documents


0 download

DESCRIPTION

Assembly Language Program

TRANSCRIPT

Org100h; assembler directives.model SMALL; assembler directives.stack; assembler directives.data

msg_1 db "Please type your :$"msg_2db "Name :$"name_1db 15 dup ('$')msg_3db "Age :$"age_1db 4 dup ('$')msg_4 db "USN :$"Usn_1db 15 dup ('$')inst db "*Select the best answer:*$"

que_1 db "1. Sex: *Male *Female *Both *Everyday ",0dh,0ah,'$'Sex_1db 20 dup ('$')

que_2db "2. Favorite Food: *Siomai *Siopao *all ",0dh,0ah,'$'Fave_1db 20 dup ('$')

que_3 db "3. School: *AMA rocks!! *Tiny Tots *Harvard ",0dh,0ah,'$'School_1db 20 dup ('$')que_4 db "4. Pet's Name: *Barney*Borjak *Pikachu ", 0dh,0ah,'$'Pet_1db 20 dup ('$')

que_5db "5. Crush: *James *James Again *James Dyapon ", 0dh,0ah,'$'Crush_1db 20 dup ('$')

Sum db "Summary : $"Out_Sexdb "Sex :$"Out_Fave db "Favorite Food :$"Out_Schooldb "School :$"Out_Pet db "Pet's Name :$"Out_Crushdb "Crush :$".code

mov dx, offset msg_1;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;call print_out;;;;;;; PLEASE ENTER YOUR: ;;;;;;;;;;;;;;;;call next_line;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset msg_2;;;;;;;;;;;;; PRINT ;;;;;;;;;;;call print_out;;;;;;;NAME: ;;;;;;;call type_name;;;;;;;;ASK FOR INPUT ;;;;;;;;;call Store_data;;;;;;;; SAVES DATA INPUT ;;;;;;;;;;mov dx, offset msg_3;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;call print_out;;;;;;; AGE: ;;;;;;;call type_name1;;;;;;;;;;;ASK FOR INPUT;;;;;;;call Store_data;;;;;;;SAVES DATA INPUT;;;;;;;mov dx, offset msg_4;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;call print_out;;;;;;;USN: ;;;;;;;call type_name2;;;;;;; ASK FOR INPUT ;;;;;;;call Store_data;;;;;;;; SAVES DATA INPUT ;;;;;;;;call next_line;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset inst;;;;;;;;;;;;;;;PRINT;;;;;;;;;;;;;;call print_out;;;;;;; *Select the best answer:* ;;;;;;;;;;;;;;call next_line;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset que_1;;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;;;;;;call print_out;;;;;;; 1. Sex: *Male *Female *Both *Everyday ;;;;;;;;;;call type_name3;;;;;;;;;;; ASK FOR INPUT ;;;;;;;;;;;call Store_data;;;;;;;;;;; SAVES DATA INPUT ;;;;;;;;;;;mov dx, offset que_2;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;call print_out;;;;;;; 2. Favorite Food: *Siomai *Siopao *all ;;;;;;call type_name4;;;;;;;;;;;;;;;ASK FOR INPUT ;;;;;;;;;;;;;;;;;;;call Store_data;;;;;;;;;;;;SAVES DATA INPUT ;;;;;;;;;;;;mov dx, offset que_3;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;call print_out;;; 3. School: *AMA rocks!! *Tiny Tots *Harvard ;;;;;;call type_name5;;;;;;;;;;;;; ASK FOR INPUT ;;;;;;;;;;;;call Store_data;;;;;;;;;;;;; SAVES DATA INPUT ;;;;;;;;;;;;mov dx, offset que_4;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;call print_out;;;;; 4. Pet's Name: *Barney *Borjack *Pikachu ;;;;;;;;;call type_name6;;;;;;;;;;;;;;;;; ASK FOR INPUT ;;;;;;;;;;;;;;;;call Store_data;;;;;;;;;;;;;; SAVES DATA INPUT ;;;;;;;;;;;;;;;;mov dx, offset que_5;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;;;;;call print_out;;;; 5. Crush: *James *James Again *James Gyapon ;;;;call type_name7;;;;;;;;;;;; ASK FOR INPUT;;;;;;;;;;;;call Store_data;;;;;;;;;;;;SAVES DATA INPUT;;;;;;;;;;;;

;;;;;;;SUMMARY;;;;;;;mov dx, offset Sum;;;;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;SUMMARY ;;;;;;;;;;;;;;;;call next_line;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset msg_2;;;;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;NAME: _______________________;;;;;;;;;;;;;;;;mov dx, offset name_1;;;;;;;;;;;;;;PRINTS SAVED DATA;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset msg_3;;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;AGE: ________________________ ;;;;;;;;;;;;;;;;mov dx, offset age_1;;;;;;;;;;;;;;PRINTS SAVED DATA;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset msg_4;;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;USN: ________________________;;;;;;;;;;;;;;;;mov dx, offset Usn_1;;;;;;;;;;;;;PRINTS SAVED DATA;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset Out_Sex;;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;SEX: ________________________;;;;;;;;;;;;;;;;mov dx, offset Sex_1;;;;;;;;;;; PRINTS SAVED DATA ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset Out_Fave;;;;;;;;;;;;;;;;;PRINT;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;FAVORITE FOOD: ______________ ;;;;;;;;;;;;;;;;mov dx, offset Fave_1;;;;;;;;;;;PRINTS SAVED DATA ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset Out_School;;;;;;;;;;;;;;;;;PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;; SCHOOL: ______________________;;;;;;;;;;;;;;;;mov dx, offset School_1;;;;;;;;;; PRINTS SAVED DATA;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset Out_Pet;;;;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;; PET'S NAME: __________________ ;;;;;;;;;;;;;;;;mov dx, offset Pet_1;;;;;;;;;; PRINTS SAVED DATA ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov dx, offset Out_Crush;;;;;;;;;;;;;;;;; PRINT ;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;CRUSH: ______________________;;;;;;;;;;;;;;;;mov dx, offset Crush_1;;;;;;;;;;PRINTS SAVED DATA ;;;;;;;;;;;;;;;;;call print_out;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mov ah, 4Ch;;;;;;;;;;;;;; END PROGRAM;;;;;;;;;;;;;;;;int 21h;;;;;;;;;;;;;;END PROGRAM;;;;;;;;;;;;;;;;

;;;;;PROCEDURES;;;;;;;;;;;;;PRINT;;;;;print_out: mov ax, @datamov ds, axmov ah, 9hint 21hret;;;;;INPUT;;;;;type_name:mov dx, offset name_1rettype_name1:mov dx, offset age_1ret

type_name2:mov dx, offset Usn_1ret

type_name3:mov dx, offset Sex_1ret

type_name4:mov dx, offset Fave_1rettype_name5:mov dx, offset School_1ret

type_name6:mov dx, offset Pet_1ret

type_name7:mov dx, offset Crush_1ret;;;;Store the Data;;;;Store_data:mov ah, 3fhint 21hret

;;;;NextLine;;;;next_line:mov ah,2mov dl,0ahint 21hmov ah,2mov dl,0Dhint 21hretEND