
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Problem 1: : Write a program sequence that compares the first 10 bytes of a character string beginning at CHAR_1 with the first 10 bytes of another string beginning at CHAR_2 and branches to MATCH if they are equal, but otherwise continues in sequence. Assume offsets for CHAR_1 and CHAR_2 with SI and DI, respectively. Problem 2: Write a program that outputs (i) “How are you?, (ii) waits for 10 seconds, and (iii) then outputs “I am fine.” Use the concept of terminator to exit a loop. Further, use AH = 0Eh and INT 10h for teletype output. You should write a procedure for printing the strings. Problem 3: Write a program that performs multiplication of numbers using the concept of addition. Use AX and BX to for the operands and CL for the counter. Problem 4: [extra credit] Consider two versions (a) and (b) of a program that move the byte contents of a block of memory to another area in memory. Let LENGTHSTRING1 be 10 (in decimal). In the following, the clock cycles represent number of ‘clock cycles’ that are needed to execute an instruction. (a) Clock cycles (b) Clock cycles MOV SI, OFFSET STRING1 4 MOV SI, OFFSET STRING1 4 MOV DI, OFFSET STRING2 4 MOV DI, OFFSET STRING2 4 MOV CX, LENGTHSTRING1 4 MOV CX, LENGTHSTRING1 4 MOVE: MOV AL, [SI] 13 CLD 2 MOV [DI], AL 14 MOVE: MOVSB 18 INC SI 2 LOOP MOVE *17/7**** INC DI 2 LOOP MOVE *17/7****