Results 1 to 3 of 3

Thread: MASM Help.

Threaded View

  1. #1

    Thread Starter
    Member
    Join Date
    Feb 2005
    Location
    Usa Nyc
    Posts
    45

    MASM Help.

    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:
    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
    For some reason it just does 2 lines of asterisks.
    Last edited by Evgeni; Feb 2nd, 2005 at 03:37 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width