I'm a VB and a C++ programmer and just started to learn asm. I'm trying to replicate my old c++ newbie programs into asm code. One of the programs i tried to replicate is an easy one it just draws a right triangle in console mode with asterisks.
Asm Code:
For some reason it just does 2 lines of asterisks.Code:main proc LOCAL x:DWORD LOCAL y:DWORD LOCAL inptVal:DWORD mov eax, sval(input("Height of the triangle:")) mov y,0 YLoop: print chr$(13,10) mov x,0 add y,1 mov ebx,y cmp y,eax jg Done XLoop: add x,1 cmp x,ebx jg YLoop print "*" jmp XLoop Done: mov inptVal, input("Press any key to continue . . .") ;to halt and let the output be seen ret main endp![]()




Reply With Quote