Islamic Azad University, Central Branch, Faculty of Technology – Computer Dep.
Machine and Assembly Language Programming- Code:3672 – BSc Computer Eng.
2nd Semester 82-83 - Date: 31/3/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 for adding two 2 byte numbers pushed into stack by the main program prior to calling proc add2 far ( proc for adding two numbers). Use BP to transfer the numbers to proc add2. Draw the status of SP and BP in the stack at various stages(.(2
b) Write the main and add2 procs in two different files.(1)
c) What are the stages of generating main.exe if the main proc is in main.asm and add2 in procs.asm. (1)
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 in this string and using function 09 display the message “number of 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)
a) Draw an appropriate diagram to explain pipelining. (1)
b) Explain the stages of Read and transferring of sum to ALU from main memory in execution of add sum,05. (0.5)
c) 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.5)
m=mantissa, s= sign, b=number of bits allocated to e’ , e’= e+2b-1
b) what is the BCD representation of -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)