StoneHaos

sofa_7_asm

Jun 17th, 2021
694
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. include io.asm
  2.  
  3. segment sstack stack
  4.     db 128 dup(?)
  5. ends sstack
  6.  
  7. segment sdata
  8.  
  9. inputn db "Input n(1..10)>", "$"
  10. inputm db "Input m(1..10)>", "$"
  11. inpute db "Input elements of matrix(0..255)", "$"
  12.  
  13. n dw 0
  14. m dw 0
  15. maxrow dw 0
  16. currow dw 0
  17. matrix db 100 dup(0)
  18.  
  19. ends sdata
  20.  
  21. segment scode
  22. assume cs:scode, ds:sdata, ss:sstack
  23. start:
  24.     mov ax,sdata
  25.     mov ds,ax
  26.  
  27.     mov dx,offset inputn
  28.     outstr
  29.     inint n
  30.  
  31.     mov dx,offset inputm
  32.     outstr
  33.     inint m
  34.  
  35.     mov dx,offset inpute
  36.     outstr
  37.     newline
  38.     mov ax,n
  39.     mov bx,m
  40.     mul bl
  41.     mov cx,ax
  42.     mov bx,offset matrix
  43.     mov dx,m
  44.     input_elements:
  45.         inint ax
  46.         mov [bx],al
  47.         add currow,ax
  48.         dec dx
  49.         cmp dx,0
  50.         jne not_comp
  51.             mov dx,currow
  52.             cmp dx,maxrow
  53.             jbe not_great
  54.                 mov maxrow,dx
  55.             not_great:
  56.             mov dx,0
  57.             mov currow,dx
  58.             mov dx,m
  59.         not_comp:
  60.         inc bx
  61.         loop input_elements
  62.  
  63.     newline
  64.     newline
  65.     newline
  66.     outint maxrow
  67.  
  68.     finish
  69. ends scode
  70. end start
RAW Paste Data