Advertisement
PhotoShaman

ASM.Лаба3

Mar 5th, 2017
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; multi-segment executable file template.
  2.  
  3. data segment
  4.     ; add your data here!
  5.            
  6.     A db 01001101b
  7.     B db 01101010b
  8.     C db 10101101b
  9.     D db 11011011b
  10.     E db 10101100b
  11.            
  12.     pkey db "press any key...$"
  13. ends
  14.  
  15. stack segment
  16.     dw   128  dup(0)
  17. ends
  18.  
  19. code segment
  20. start:
  21. ; set segment registers:
  22.     mov ax, data
  23.     mov ds, ax
  24.     mov es, ax
  25.  
  26.     ; add your code here
  27.    
  28.     mov al, A
  29.     shl al, 1  
  30.    
  31.     mov al, A
  32.     shr al, 1
  33.    
  34.     mov al, A
  35.     sar al, 1
  36.    
  37.     mov al, A
  38.     ror al, 1
  39.    
  40.     mov al, A
  41.     rol al, 1
  42.     ;...
  43.    
  44.     lea dx, pkey
  45.     mov ah, 9
  46.     int 21h        ; output string at ds:dx
  47.    
  48.     ; wait for any key....    
  49.     mov ah, 1
  50.     int 21h
  51.    
  52.     mov ax, 4c00h ; exit to operating system.
  53.     int 21h    
  54. ends
  55.  
  56. end start ; set entry point and stop the assembler.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement