Question: ( Can someone help me translate this to asm please ) #include #include #include windows.h using namespace std; const int Biggy _ Size =
Can someone help me translate this to asm please
#include
#include
#include "windows.h
using namespace std;
const int BiggySize ; as instructed on the homework
line using Bresenham's line drawing algorithm
void drawLineint startX, int startY, int endX, int endY, char&bitsBiggySizeBiggySize
F push ebp
F mov ebp,esp
F sub esp,Ch
F push ebx
FA push esi
FB push edi
FC lea edi,ebpCh
FF mov ecx,h
mov eax,CCCCCCCCh
rep stos dword ptr es:edi
B mov ecx,offset DFABJJLab@cpp AFh
call @CheckForDebuggerJustMyCode@Bh
int DeltaX absendX startX;
mov eax,dword ptr endX
sub eax,dword ptr startX
B push eax
C call abs h
add esp,
mov dword ptr DeltaXeax
int DeltaY absendY startY;
mov eax,dword ptr endY
A sub eax,dword ptr startY
D push eax
E call abs h
add esp,
mov dword ptr DeltaYeax
int sx startX endX : ;
mov eax,dword ptr startX
C cmp eax,dword ptr endX
F jge $EncStackInitStarth Dh
mov dword ptr ebpCh
B jmp $EncStackInitStartBh h
D mov dword ptr ebpChFFFFFFFFh
mov ecx,dword ptr ebpCh
D mov dword ptr sxecx
int sy startY endY : ;
mov eax,dword ptr startY
cmp eax,dword ptr endY
jge $EncStackInitStarth h
mov dword ptr ebpCh
jmp $EncStackInitStarth Eh
mov dword ptr ebpChFFFFFFFFh
E mov ecx,dword ptr ebpCh
mov dword ptr syecx
int err DeltaX DeltaY;
mov eax,dword ptr DeltaX
A sub eax,dword ptr DeltaY
D mov dword ptr erreax
int e;
while true
mov eax,
test eax,eax
je $EncStackInitStartFFh FBh
bitsstartYstartX; Set pixel to black for the line
mov eax,dword ptr startY
C shl eax,
F add eax,dword ptr bits
A mov ecx,dword ptr startX
A mov byte ptr eaxecx
if startX endX && startY endY break;
A mov eax,dword ptr startX
AC cmp eax,dword ptr endX
AF jne $EncStackInitStartBFh BBh
B mov eax,dword ptr startY
B cmp eax,dword ptr endY
B jne $EncStackInitStartBFh BBh
B jmp $EncStackInitStartFFh FBh
e err;
BB mov eax,dword ptr err
BE shl eax,
C mov dword ptr eeax
if eDeltaY
C mov eax,dword ptr DeltaY
C neg eax
C cmp dword ptr eeax
CB jle $EncStackInitStartEh DFh
err DeltaY;
CD mov eax,dword ptr err
D sub eax,dword ptr DeltaY
D mov dword ptr erreax
startX sx;
D mov eax,dword ptr startX
D add eax,dword ptr sx
DC mov dword ptr startXeax
if e DeltaX
DF mov eax,dword ptr e
E cmp eax,dword ptr DeltaX
E jge $EncStackInitStartFDh Fh
err DeltaX;
E mov eax,dword ptr err
EA add eax,dword ptr DeltaX
ED mov dword ptr erreax
startY sy;
F mov eax,dword ptr startY
F add eax,dword ptr sy
F mov dword ptr startYeax
F jmp $EncStackInitStarth h
FB pop edi
FC pop esi
FD pop ebx
FE add esp,Ch
cmp ebp,esp
call RTCCheckEsp Ah
B mov esp,ebp
D pop ebp
E ret
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
