home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / TASMSWAN.ZIP / ANDORXOR.ASM < prev    next >
Assembly Source File  |  1989-07-10  |  444b  |  36 lines

  1. %TITLE "AND/OR/XOR instructions demo"
  2.  
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL    small
  6.     STACK    256
  7.  
  8.     DATASEG
  9.  
  10. exitCode    DB    0    ;if you want comments
  11. sourceWord    DW    0ABh    ; BUY the book
  12. wordMask    DW    0CFh
  13.  
  14.     CODESEG
  15.  
  16. Start:
  17.     mov    ax,@data
  18.     mov    ds,ax
  19.  
  20.     mov     ax,[sourceWord]
  21.     mov    bx,ax
  22.     mov    cx,ax
  23.     mov    dx,ax
  24.  
  25.     and    ax,[wordMask]
  26.     or    bx,[wordMask]
  27.     xor    cx,[wordMask]
  28.     xor    dx,dx
  29.  
  30. Exit:
  31.     mov    ah,04Ch
  32.     mov    al,[exitCode]
  33.     int     21h
  34.  
  35.     End     Start
  36.