Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- model small
- .stack 100h
- .data
- a dw 1
- b dw 2
- c dw 3
- d dw 4
- .code
- start:
- MOV AX, @data
- MOV DS, AX
- ;<readABCD>
- mov ax, c
- mov bx, d
- or ax, bx ; c | d
- mov bx, a
- mov cx, b
- add bx,cx ; a + b
- cmp bx, ax
- jne else1 ; if a + b != c | d
- mov bx, d
- mov cx, c
- xor bx,cx ; c ^ d
- mov ax, a
- mov cx, b
- add ax,cx ; a + b
- and ax,bx ; (a + b) & (c ^ d)
- ;<print>
- jmp all
- else1:
- mov ax, a
- mov bx, d
- or ax,bx ; a | d
- mov cx, b
- mov bx, c
- xor cx,bx ; b ^ c
- cmp ax,cx ; if b ^ c != a | d
- jne else2 ;
- and ax,cx ; (b ^ c) & (a | d)
- ;<print>
- jmp all
- else2:
- mov ax, a
- mov bx, b
- xor ax,bx ; a ^ b
- mov cx, c
- mov bx, d
- xor cx,bx ; c ^ d
- or ax,cx ; print a ^ b | c ^ d
- ;<print>
- all:
- MOV AH, 4Ch
- INT 21h
- end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement