Question: Homework 2 Q1. Rewrite program of slide 31, Chapter 3a to transfer one word at a time instead of one byte. Q2. In some applications

Homework 2 Q1. Rewrite program of slide 31, Chapter 3a to transfer one word at a time instead of one byte. Q2. In some applications it is common practice to save all registers at the beginning of a subroutine. Assume that SP = 1288H before a subroutine CALL. Show the contents of the stack pointer and the exact memory contents of the stack after PUSHF for the following: 1132:0450 CALL PROC1 1132:0453 INC BX PROC1 PROC PUSH AX PUSH BX PUSH CX PUSH DX PUSH SI PUSH DI PUSHF PROC1 ENDP 2.3: MORE SAMPLE PROGRAMS Program, and the list file generated when the program was assembled. Write, run, and analyze a program that adds 5 bytes of data and saves the result. The data should be the following hex numbers: 25, 12, 15, 1F, and 2B. PAGE 60,132 TITLE PROG2-1 (EXE) PURPOSE: ADDS 5 BYTES OF DATA .MODEL SMALL STACK 64 DATA DB DATA IN SUM ; 25H, 12H, 15H, 1FH, 2BH ? DB MAIN AGAIN: ..CODE PROC MOV MOV MOV MOV MOV ADD INC DEC JNZ MOV MOV INT ENDP END FAR AX, DATA DS, AX CX,05 BX,OFFSET DATA IN AL, O AL,[BX] BX CX AGAIN SUM, AL AH, 4CH 21H ;set up loop counter CX-5 set up data pointer BX ;initialize AL ; add next data item to AL make BX point to next data item decrement loop counter jump if loop counter not zero ; load result into sum ; set up return ;return to OS PEA MAIN MAIN
Step by Step Solution
There are 3 Steps involved in it
To address the homework questions lets tackle each one stepbystep Q1 Rewrite program to transfer one ... View full answer
Get step-by-step solutions from verified subject matter experts
