Islamic Azad University, Central Branch, Faculty of Technology – Computer Dep.
Machine and Assembly Language Programming- Code:3672 – BSc Computer Eng.
1st Semester 83-84 - Date: 24/10/83 - Time allowed: 2 hours
System time can be set using function ah=2D of int 21h. CH is hour (0-23) , CL is minutes (0-59), DH seconds and DL hundredths of seconds. Write a program for inputting the time using function 0A in the hh:mm format and storing it in location time. Convert the input string into an integer in a Far proc named integer . Then by giving the above registers the correct value (DL=DH=0) set system time. Use bitwise operations where possible. (4)
a) Write a program to convert the contents of AX register to its BCD equivalent. Do the conversion in “convert proc far”, taking into account the sign of the number. Use bitwise operations where possible. (2)
b) Write convert proc far in a separate file to the main program.(1)
c) What are the stages of generating main.exe if the main proc is in main.asm and convert in procs.asm. (1)
a) Write a program for inputting a line of string of with maximum of 80 characters using function 0A. Use repne and scasb to count the number of ‘a’ s and ‘A’ s in this string ( taking into account the first and last characters ) and using function 09 display the message “number of a’s and A’s are=# #” on the screen. Convert the numbers into ASCII using proc itoa especially written for converting non-signed two figure numbers utilizing bitwise operations.(4)
b) Using a diagram show the way the data is stored in data and stack segments and also indicate the offset of each data unit.
a) Does the object code of an interrupt affect the volume of the calling program? Please explain. (0.5)
b) Why is the source of script programs transferred to the client in the Internet?(0.5)
a) What is the denary equivalent of the floating number C4642000 (1)
m=mantissa, s= sign, b=number of bits allocated to e’ , e’= e+2b-1
b) what is the BCD representation ob -1?(0.5)
What is the effect of test ah,20h with AH=61h on ZF?
What is the effect of sar ah,1 with AH=81h on SF and OF?
What is the effect of sub ah,40h with AH=30h on CF? (1)
Write the object code and location counter for the following program (3)
With reference to Q7 will mov ax,aa execute faster or mov ax,0 ? Explain using the stages of execution of instructions. (0.5)