0

good morning everyone I am writing a program whose output is in accordance with this image Operation in question and the main loop (k1) must be run again and run a second time on the next line, but when I run this code the first loop (k1) will not run a second time and Even the commands of the second (k2) and third (k3) loops are repeated infinitely.The result of the program and its problem

    .code

    mov  cx, 2
  k1: 

    mov  al, 'a'

    mov  ah, 0eh
    int  10h 
    push cx    
    mov  cx, 3    
    k2:
           mov  al, 'b'
           mov  ah, 0eh
           int  10h                               
                                              
           mov cx, 2
           k3:
           mov  al, 'c'              
           mov  ah, 0eh
           int  10h
           
           loop  k3
            
           loop  k2            
                
    pop  cx       
          
    loop k1                
Erik Eidt
  • 23,049
  • 2
  • 29
  • 53
Alone
  • 1

1 Answers1

0

Single step in the debugger and look here:

       int  10h
       
       loop  k3
        
       loop  k2     <------------

inspect and observe the registers.

Erik Eidt
  • 23,049
  • 2
  • 29
  • 53