Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;Given the following variables of type word (unsigned) already initialized in memory:
- ;•OPA = 32767
- ;•OPB = 1
- ;Write a program to compute the expression OPA+OPB+OPA+OPB, using AX register, and observe, giving reason, the ;behavior of flags (sign, overflow, carry)
- ;NB: 8086: Representation of numbers
- ;8086 processor lets to do operations on numbers in CA2 (signed) or in pure binary
- ;Let's analyze 'add' instruction:
- ;-Carry Flag is set to pass between FFFF and 0000
- ;-Overflow Flag is set to pass between 7FFF and 8000
- ;So,it's need to be care about the behavior of flags, considering the representation type that we would like to use
- .MODEL small
- .STACK
- .DATA
- OPA DW 32767
- OPB DW 1
- .CODE
- .STARTUP
- MOV AX,OPA
- ADD AX,OPB
- ADD AX,OPA
- ADD AX,OPB
- .EXIT
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement