Question: I need help creating a program i n assembly that draws the letter v i n memory. I a m using 3 2 bit registers.
I need help creating a program assembly that draws the letter memory. I using bit registers. I also have a template and would greatly appreciate someone could figure out the rest the code. Instructions: you should have a total of four loops:
One outer loop to loop over the N top rows
One inner loop to print the number of spaces before the first asterisk in the top N rows
One inner loop to print the number of spaces between the first and second asterisk in the top N
rows
One loop to print the number of spaces before the asterisk in the bottom final row
In addition to the above, you also need to:
Use the runtime stack to switch ECX back and forth between the outer loop and the
inner loops. We saw before that one way that you could save and restore ECX was by using a variable or
another register to do so but we can also accomplish this with the runtime stack. In this assignment you need to
use the runtime stack to do this.
Implement the logic for drawing the V pattern in memory in a procedure function
named drawvpattern this logic should NOT be in main! In main you need to call the
drawvpattern procedure. Make sure to properly initialize the appropriate registers in main BEFORE the call to
the drawvpattern procedure. Make sure to also return back to main when the drawvpattern procedure is
finished! template: ; Program template
model flat,stdcall
stack
ExitProcess proto,dwExitCode:dword
ROWS ; this can be changed to any value between ; the correct V pattern should be "drawn" in memory in all cases
COLS ROWS
MIDCOL COLS
data
V BYTE ROWS dup ; the memory allocated for the V pattern
currrow BYTE ; this refers to the current row in the pattern being processed
; count is used to refer to a row in memory, such as xrow xrow xrow etc
; You need to use count to move between the different rows in memory
; HINT: think about incrementing or decrementing count by
count DWORD ROWS ; you can change the initial value depending on if you want it to count up or down
code
main proc
; IMPLEMENT THIS
; IMPLEMENT THIS
; IMPLEMENT THIS
; IMPLEMENT THIS
; IMPLEMENT THIS
invoke ExitProcess,
main endp
end main
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
