In Assembly Language (MASM) Irvine32.inc I have done A though D. I need help wit
ID: 3698069 • Letter: I
Question
In Assembly Language (MASM)
Irvine32.inc
I have done A though D. I need help with the remaining PLEASE!!!!
1) Write a single program to do all of the following tasks:
a. Read in 3 integer dwords, A, B and Y, using 3 procedures called ReadA , ReadB and ReadY
b. Use a procedure to determine XDELTA
c. Display a red line “**************” line starting at A across, ending at B across, and Y down using a 1 second delay.
d. Change the text color back to white after the last *
e. Hard Question: Write a second procedure to print a red line up. Then use it from xend y, and to xend, y-xdelta .
You should get (if xdelta was 4) :
*
*
*
****
f. Honor Question Using 4 line procedures for across, across backward, up and down, lines, create a red rectangle each, with side xdelta
g. Really Really Hard Question: Using the procedures, fill in the red square with succeeding squares of different colors.
Explanation / Answer
include io.h data segment lf db 0dh,0 cr db 0ah,0 n_prompt db "Enter n:",0 num_prompt db "Enter number",0 res_sum db "Sum = ",0 res_avg db "Average = ",0 n dw 40 DUP(?) bar dw 40 DUP(?) arr dw 100 DUP(?) data ends code segment Assume cs:code, ds:data start: mov ax, data mov ds,ax output n_prompt output lf output cr inputs bar,40 atoi bar mov n,ax lea bx, arr mov dx,n __inp: output num_prompt output lf output cr inputs bar, 40 atoi bar mov [bx],ax add bx,2 dec dx cmp dx,0 jne __inp mov ax,0 lea bx,arr mov dx,n sum: add ax,[bx] add bx,2 dec dx cmp dx,0 jne sum itoa bar,ax output res_sum output bar avg: cwd idiv n itoa bar, ax output cr output lf output res_avg output bar quit: mov al,0 mov ah,4ch int 21h code ends end start