Vous êtes sur la page 1sur 8

; ; ; Copyright (c) 1986-1997 Kevin G. Rhoads. All rights reserved. ; include forframe.

mac ; ; ;DATA segment PUBLIC 'DATA' USE16 DATA segment PUBLIC 'DATA' DATA ends dgroup group DATA ;code segment 'CODE' PUBLIC USE16 code segment 'CODE' PUBLIC assume cs:code,ds:dgroup,es:dgroup,ss:dgroup ; ; USE: int*4 = i1and(int*1 op1, op2) i1and proc far and1 label far iand1 label far public i1and,and1,iand1 save ; push es les si,dword ptr ss:[bp+argone2] ;get far * arg1 mov al,byte ptr es:[si] ;get byte arg1 les bx,dword ptr ss:[bp+argtwo2] ;get far * arg2 mov bl,byte ptr es:[bx] ;get byte arg2 and al,bl cbw ;Convert Byte to Word cwd ;Convert Word to Doubleword ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i1and endp ; ; ; USE: int*4 = i1xor(int*1 op1, op2) i1xor proc far i1eor label far eor1 label far xor1 label far ieor1 label far ixor1 label far public i1xor,i1eor,eor1,xor1,ieor1,ixor1 save ; push es les si,dword ptr ss:[bp+argone2] mov al,byte ptr es:[si] les bx,dword ptr ss:[bp+argtwo2] mov bl,byte ptr es:[bx] xor al,bl cbw ;Convert Byte to Word cwd ;Convert Word to Doubleword ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.'

i1xor endp ; ; ; USE: int*4 = i1ior(int*1 op1, op2) i1ior proc far i1or label far ior1 label far or1 label far public i1ior,i1or,or1,ior1 save ; push es les si,dword ptr ss:[bp+argone2] mov al,byte ptr es:[si] les bx,dword ptr ss:[bp+argtwo2] mov bl,byte ptr es:[bx] or al,bl cbw ;Convert Byte to Word cwd ;Convert Word to Doubleword ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i1ior endp ; ; ; USE: int*4 = i1not(int*1 op1) i1not proc far not1 label far inot1 label far public i1not,not1,inot1 save ; push es les si,dword ptr ss:[bp+argone1] mov al,byte ptr es:[si] not al cbw ;Convert Byte to Word cwd ;Convert Word to Doubleword ; pop es restore ret 4 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i1not endp ; ; ; USE: int*4 = i2and(int*2 op1, op2) i2and proc far and2 label far iand2 label far public i2and,and2,iand2 save ; push es les si,dword ptr ss:[bp+argone2] ;get far * arg1 mov ax,word ptr es:[si] ;get word arg1 les bx,dword ptr ss:[bp+argtwo2] ;get far * arg2 mov bx,word ptr es:[bx] ;get word arg2 and ax,bx cwd ;Convert Word to Doubleword

pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i2and endp ; ; ; USE: int*4 = i2xor(int*2 op1, op2) i2xor proc far i2eor label far eor2 label far xor2 label far ieor2 label far ixor2 label far public i2xor,i2eor,eor2,xor2,ieor2,ixor2 save ; push es les si,dword ptr ss:[bp+argone2] mov ax,word ptr es:[si] les bx,dword ptr ss:[bp+argtwo2] mov bx,word ptr es:[bx] xor ax,bx cwd ;Convert Word to Doubleword ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i2xor endp ; ; ; USE: int*4 = i2ior(int*2 op1, op2) i2ior proc far i2or label far ior2 label far or2 label far public i2ior,i2or,or2,ior2 save ; push es les si,dword ptr ss:[bp+argone2] mov ax,word ptr es:[si] les bx,dword ptr ss:[bp+argtwo2] mov bx,word ptr es:[bx] or ax,bx cwd ;Convert Word to Doubleword ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i2ior endp ; ; ; USE: int*4 = i2not(int*2 op1) i2not proc far not2 label far inot2 label far public i2not,not2,inot2 save

push es les si,dword ptr ss:[bp+argone1] mov ax,word ptr es:[si] not ax cwd ;Convert Word to Doubleword ; pop es restore ret 4 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i2not endp ; ; ; ; USE: int*4 = i4and(int*4 op1, op2) i4and proc far and4 label far public i4and,and4 save ; push es les si,dword ptr ss:[bp+argone2] ;get far * arg1 mov ax,word ptr es:[si] ;get lo word arg1 mov dx,word ptr es:[si+2] ;get hi word arg1 les bx,dword ptr ss:[bp+argtwo2] ;get far * arg2 mov cx,word ptr es:[bx] ;get lo word arg2 mov bx,word ptr es:[bx+2] ;get hi word arg2 and ax,cx and dx,bx ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i4and endp ; ; ; USE: int*4 = i4xor(int*4 op1, op2) i4xor proc far i4eor label far eor4 label far xor4 label far public i4xor,i4eor,eor4,xor4 save ; push es les si,dword ptr ss:[bp+argone2] ;get far * arg1 mov ax,word ptr es:[si] ;get lo word arg1 mov dx,word ptr es:[si+2] ;get hi word arg1 les bx,dword ptr ss:[bp+argtwo2] ;get far * arg2 mov cx,word ptr es:[bx] ;get lo word arg2 mov bx,word ptr es:[bx+2] ;get hi word arg2 xor ax,cx xor dx,bx ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i4xor endp ; ;

; USE: int*4 = i4ior(int*4 op1, op2) i4ior proc far i4or label far or4 label far ior4 label far public i4ior,i4or,or4,ior4 save ; push es les si,dword ptr ss:[bp+argone2] ;get far * arg1 mov ax,word ptr es:[si] ;get lo word arg1 mov dx,word ptr es:[si+2] ;get hi word arg1 les bx,dword ptr ss:[bp+argtwo2] ;get far * arg2 mov cx,word ptr es:[bx] ;get lo word arg2 mov bx,word ptr es:[bx+2] ;get hi word arg2 or ax,cx or dx,bx ; pop es restore ret 8 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i4ior endp ; ; ; USE: int*4 = i4not(int*4 op1) i4not proc far not4 label far public i4not,not4 save ; push es les si,dword ptr ss:[bp+argone1] ;get far * arg1 mov ax,word ptr es:[si] ;get lo word arg1 mov dx,word ptr es:[si+2] ;get hi word arg1 not ax not dx ; pop es restore ret 4 db '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.' i4not endp ; ; ; USE: int*4 = reverb(int*2 op) ; this reverses the low order byte of op reverb proc far brever label far public reverb,brever save ; push es les si,dword ptr ss:[bp+argone1] ;get far * arg1 mov ax,word ptr es:[si] ;get word arg1 mov ah,al rcr ah,1 ;bit 1 -> carry rcl al,1 rcr ah,1 ;bit 2 -> carry rcl al,1 rcr ah,1 ;bit 3 -> carry rcl al,1

rcr ah,1 ;bit 4 -> carry rcl al,1 rcr ah,1 ;bit 5 -> carry rcl al,1 rcr ah,1 ;bit 6 -> carry rcl al,1 rcr ah,1 ;bit 7 -> carry rcl al,1 rcr ah,1 ;bit 8 -> carry rcl al,1 cbw ;Convert Byte to Word cwd ;Convert Word to Doubleword ; pop es restore ret 4 db '(c) 1986-2002 Kevin G. Rhoads, all rights reserved.' reverb endp ; ; ; USE: int*4 = reverw(int*2 op) ; this reverses the low order word of op reverw proc far wrever label far public reverw,wrever save ; push es les si,dword ptr ss:[bp+argone1] ;get far * arg1 mov dx,word ptr es:[si] ;get word arg1 rcr dx,1 ;bit 1 -> carry rcl ax,1 rcr dx,1 ;bit 2 -> carry rcl ax,1 rcr dx,1 ;bit 3 -> carry rcl ax,1 rcr dx,1 ;bit 4 -> carry rcl ax,1 rcr dx,1 ;bit 5 -> carry rcl ax,1 rcr dx,1 ;bit 6 -> carry rcl ax,1 rcr dx,1 ;bit 7 -> carry rcl ax,1 rcr dx,1 ;bit 8 -> carry rcl ax,1 rcr dx,1 ;bit 9 -> carry rcl ax,1 rcr dx,1 ;bit 10 -> carry rcl ax,1 rcr dx,1 ;bit 11 -> carry rcl ax,1 rcr dx,1 ;bit 12 -> carry rcl ax,1 rcr dx,1 ;bit 13 -> carry rcl ax,1 rcr dx,1 ;bit 14 -> carry rcl ax,1 rcr dx,1 ;bit 15 -> carry

rcl ax,1 rcr dx,1 ;bit 16 -> carry rcl ax,1 cwd ;Convert Word to Doubleword ; pop es restore ret 4 db '(c) 1986-2002 Kevin G. Rhoads, all rights reserved.' reverw endp ; ; ;; USE: int*4 = reverl(int*4 op) ;; this reverses the low order word of op ;reverl proc far ;lrever label far ; public reverl,lrever ; save ;; push es ; les si,dword ptr ss:[bp+argone1] ;get far * arg1 ; mov edx,dword ptr es:[si] ;get word arg1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1 ; rcl eax,1 ; rcr edx,1

; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ; rcr ; rcl ;; pop ; restore ; ret ; db ;reverl endp ;; ; code ends e end

eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 edx,1 eax,1 es 4 '(c) 1986-1993 Kevin G. Rhoads, all rights reserved.'

Vous aimerez peut-être aussi