Welcome

Anti Essays offers essay examples to help students with their essay writing.

Sign Up

Nasm Essay

Open Document

Below is an essay on "Nasm" from Anti Essays, your source for research papers, essays, and term paper examples.

Enter age program

org 100h

mov ah, 9
mov dx, str1
int 21h

mov ah, 1
int 21h

mov ah, 9

cmp al, 37h

jz age_same
jg age_older
jl age_younger
jmp after

age_same:
mov dx, str2
int 21h
jmp after

age_older:
mov dx, str3
int 21h
jmp after

age_younger:
mov dx, str4
int 21h
jmp after

after:

mov ah, 4Ch
int 21h

str1 db 'ENTER YOUR AGE: $'
str2 db 0Ah, 'Wow. You and I are the same age.$'
str3 db 0Ah, 'You are older than me, pal. Cool!$'
str4 db 0Ah, 'I am older than you, haha!$s'


NASM - The Netwide Assembler
• February 18, 2012, 10:32:47 pm  
• Welcome, Guest
Please login or register.
 
Login with username, password and session length
   
News:
We are back up and running!
• Home
• Help
• Search
• Calendar
• Login
• Register
• NASM - The Netwide Assembler >
• NASM Forum >
• Example Code >
• Enter your age program
« previous next »
Pages: [1]
• Print
Author Topic: Enter your age program   (Read 848 times)
sledge
• Jr. Member

• Offline
• Posts: 19


Enter your age program
« on: August 23, 2011, 02:56:11 am »
________________________________________
Code: [Select]
org 100h

mov ah, 9
mov dx, str1
int 21h

mov ah, 1
int 21h

mov ah, 9

cmp al, 37h

jz age_same
jg age_older
jl age_younger
jmp after

age_same:
mov dx, str2
int 21h
jmp after

age_older:
mov dx, str3
int 21h
jmp after

age_younger:
mov dx, str4
int 21h
jmp after

after:

mov ah, 4Ch
int 21h

str1 db 'ENTER YOUR AGE: $'
str2 db 0Ah, 'Wow. You and I are the same age.$'
str3 db 0Ah, 'You are older than me, pal. Cool!$'
str4 db 0Ah, 'I am older than you, haha!$s'

This wonderful program asks for your age, compare and then outputs a message based on how old you claimed to be.
Problem is I can't type more than one character... so in this program you cant be older than 9 years old.
Logged
Frank Kotler
• NASM Developer
• Hero Member
•    
• Country:  
•...

Show More


Citations

MLA Citation

"Nasm". Anti Essays. 16 Dec. 2018

<http://parimatch-stavka7.com/free-essays/Nasm-168743.html>

APA Citation

Nasm. Anti Essays. Retrieved December 16, 2018, from the World Wide Web: http://parimatch-stavka7.com/free-essays/Nasm-168743.html


余り物になるわけがない | Abraham Lincoln Essay | ซีรี่ย์ ดีแมทฝ่าวิกฤตทีมแพทย์กู้ภัย