Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DIM EQU 5
- .MODEL SMALL
- .STACK
- .DATA
- DATA1 DB 01001001B, 01110001B, 11010101B, 10101101B, 01011010B
- DATA2 DB 10110101B, 10101001B, 11011101B, 10101111B, 10101011B
- DATAR DB DIM DUP(?)
- .CODE
- .STARTUP
- MOV SI, 0 ; Indice scorrimento vettore
- MOV CX, DIM ; Contatore passi
- MOV AH, 0 ; Contatore byte con bit a 1 dispari
- ANDPF: MOV AL, DATA1[SI]
- AND AL, DATA2[SI]
- MOV DATAR[SI], AL ; DATAR = DATA1 AND DATA2
- OR DATAR[SI], 0 ; Giusto per settare i flag (e dunque anche PF)
- JNP DISPARI ; # Bit a 1 dispari?
- INC AH ; Se # bit a 1 pari, incremento il contatore
- DISPARI: INC SI ; In ogni caso passo all'elemento successivo
- LOOP ANDPF ; e ciclo.
- .EXIT
- END
Advertisement
Add Comment
Please, Sign In to add comment