Advertisement
Il_Voza

1.3 Compute OPA+OPB-OPC+OPD

May 3rd, 2013
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;Given the following variables of type word already initialized in memory:
  2. ;•OPA = – 459
  3. ;•OPB = 470
  4. ;•OPC = – 32756
  5. ;•OPD = 1
  6. ;Write a program that computes the expression: OPA+OPB–OPC+OPD, using AX register, and observe, giving reason, the ;behavior of flags (sign, overflow, carry)
  7.  
  8. .MODEL small
  9. .STACK
  10. .DATA
  11. OPA DW -459
  12. OPB DW 470
  13. OPC DW -32756
  14. OPD DW 1
  15. .CODE
  16. .STARTUP
  17. MOV AX,OPA
  18. ADD AX,OPB
  19. SUB AX,OPC
  20. ADD AX,OPD
  21. .EXIT
  22. END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement