Monday, September 22, 2008

Password – Sample Assembly Program

; This program will validate if the user enter a correct password

.mode small
.code
.stack
org 100h

START:
MOV AH, 07 ; use service 7 command
INT 21H
CMP AL, ‘G’ ; was the type letter = G?
JNE START ; if no start over
INT 21H ; if yes get next letter
CMP AL, ‘A’; was the type letter = A?
JNE START ; if no start over
INT 21H ; if yes get the last letter
CMP AL, ‘B’ ; was the type letter = B?
JNE START ; if no start over
FINISH:
INT 27H ; if yes terminate
END START

2 comments:

Unknown said...

.mode small

to model small

Unknown said...

أكتب برنامج يطلب من المستخدم تعين كلمه السر تتكون من (n)من الحروف والرموز بحيث تحقق الشروط التاليه
1-لايقل طول كلمه السر عن 6بايت
2-يجب ان تبدا كلمه السر بحرف capital
3-يجب ان تنتهي كلمه السر برقم
4-يجب ان تحتوي على حرف smallعلى الاقل
5-يجب ان تكون كلمه السر خليط من الاحرف والرموز

ثم اكتب برنامج اخر يطلب من المستخدم ادخال كلمه المرور ومقارنتها بكلمه السر في البرنامج السابق اذ كانت صحيحه يطبع correct واذ كانت خاطئه يتم طباعه try again
بلغه التجميع الاسمبلي
وجزك الله خير