Discuss Please help me solve this one !! in the Other Programming Languages forum on Dev Shed. Please help me solve this one !! A place for discussing programming languages not covered in specific forums such as Assembler, COBOL, etc. - you get the idea.
Posts: 3
Time spent in forums: 27 m 51 sec
Reputation Power: 0
Assembly - Please help me solve this one !!
please help me solve this one !!
Code:
1. The Macro program given below displays one character passed to it as an argument on the output screen. Use it complete the Main Proc to display an array of characters on the screen.
mPutchar MACRO char
push eax
mov al, char
call WriteChar
pop eax
ENDM
.data
myName BYTE “Welcome to Ajman University!”,0
.code
Main PROC
Start: MOV SI, OFFSET myName
MOV CX, LENGTHOF myName
L1: MOV BL, [SI]
----------------------------
----------------------------
----------------------------
----------------------------
----------------------------
----------------------------
----------------------------
2. Write assembly program that reads a word from the key board and compares it with an already defined word in the data segment. If the two words are the same it display “Correct Password” else it will display “Incorrect Password”.
Extra 1 mark: Incase of incorrect password it will give the user 3 tries.
3. Description: The greatest common divisor of two integers is the largest
integer that will evenly divide both integers. The GCD algorithm involves
integer division in a loop, described by the following C++ code:
int GCD(int x, int y)
{
x = abs(x); // absolute value of x
y = absyes ; // absolute value of y
do {
int n = x % y; // REMAINDER
x = y;
y = n;
} while y > 0;
return y;
}
Implement this function in assembly language
Posts: 9,917
Time spent in forums: 2 Months 3 Weeks 1 Day 10 h 25 m 30 sec
Reputation Power: 6113
Aoko, this forum is not designed for people to do your homework for you. If you're having trouble, contact your TA or your professor, that's their job. Thread closed.
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
"The greatest tragedy of this changing society is that people who never knew what it was like before will simply assume that this is the way things are supposed to be." -2600 Magazine, Fall 2002