Advertisement
THOMAS_SHELBY_18

4

May 25th, 2024
13
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 KB | None | 0 0
  1. org 100h
  2. Start:
  3. push Arr
  4. call Proc
  5. movzx cx, byte[Arr]
  6. mov si, Arr+1
  7.  
  8. Output:
  9. .startLoop:
  10. mov dl, [si]
  11. mov ah, 02h
  12. add dl, '0'
  13. int 21h
  14.  
  15. mov dl, ' '
  16. mov ah, 02h
  17. int 21h
  18.  
  19. inc si
  20. loop .startLoop
  21.  
  22. mov ah, 08h
  23. int 21h
  24. ret
  25.  
  26. Proc:
  27. .prolog:
  28. push bp
  29. mov bp, sp
  30. sub sp, 0
  31.  
  32. .processing:
  33. push di
  34. mov di, [bp+4]
  35. movzx cx, byte[di] ;äëèíà ìàññèâà
  36. inc di
  37.  
  38. .startLoop:
  39. movsx dx, byte[di]
  40. and dx, 0000'0100b
  41. jz .addBit
  42. .delBit:
  43. and byte[di], 1111'1011b
  44. jmp .endLoop
  45. .addBit:
  46. or byte[di], 0000'0100b
  47. .endLoop:
  48. inc di
  49. loop .startLoop
  50.  
  51. .endProc:
  52. pop di
  53.  
  54. .epilog:
  55. mov sp, bp
  56. pop bp
  57. ret 4
  58.  
  59. Arr db 5, 1, 12, 4, 3, 3
  60.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement