problem with task in assembler 8086

Discussion in 'The Projects Forum' started by zemzi, Dec 14, 2011.

  1. zemzi

    Thread Starter New Member

    Dec 14, 2011
    8
    0
    Matrix given in memory to print the spiral in opposite direction from clockwise (left column down the right lower range, right up column, a series of upper left, etc. until you get to the middle) in 8086 assembler
    Code ( (Unknown Language)):
    1.  
    2.   mov     ecx,0
    3.         mov     cl,[QDM]
    4.         mov     ebx,ecx
    5.         mov     edi,Matrix
    6. mSpiral:
    7.         push    edi
    8.  
    9.         mov     al,[edi];Output [edi]
    10.         push    ecx
    11.  
    12.         mov     edx,ecx
    13.         mov     ecx,edx
    14.         dec     ecx
    15.         cmp     ecx,0
    16.         jle     mSkD1
    17. mD1:
    18.         add     edi,ebx
    19.         mov     al,[edi];Output [edi]
    20.         loop    mD1
    21. mSkD1:
    22.  
    23.         mov     ecx,edx
    24.         dec     ecx
    25.         cmp     ecx,0
    26.         jle     mSkD2
    27. mD2:
    28.         inc     edi
    29.         mov     al,[edi];Output [edi]
    30.         loop    mD2
    31. mSkD2:
    32.  
    33.         mov     ecx,edx
    34.         dec     ecx
    35.         cmp     ecx,0
    36.         jle     mSkD3
    37. mD3:
    38.         sub     edi,ebx
    39.         mov     al,[edi];Output [edi]
    40.         loop    mD3
    41. mSkD3:
    42.  
    43.         mov     ecx,edx
    44.         sub     ecx,2
    45.         cmp     ecx,0
    46.         jle     mSkD4
    47. mD4:
    48.         dec     edi
    49.         mov     al,[edi];Output [edi]
    50.         loop    mD4
    51. mSkD4:
    52.  
    53.         pop     ecx
    54.  
    55.         pop     edi
    56.         add     edi,ecx
    57.         inc     edi
    58.  
    59.         sub     ecx,2
    60.         cmp     ecx,0
    61.         jle     mEx
    62.         jmp     mSpiral
    63. mEx:
    64.  
    65. Matrix  db 0,1,2,3,4,5,6,7,8,9,0Ah,0Bh,0Ch,0Dh,0Eh,0Fh
    66. QDM     db 4;Matrix dimension
    67.  
    I solve the task, but does not work , Can someone help me how to solve? it is very important...Please
     
    Last edited by a moderator: Dec 15, 2011
  2. zemzi

    Thread Starter New Member

    Dec 14, 2011
    8
    0
    Please help me, if you understand my task, it is very important for me....
     
Loading...