Advertisement
Nahid8195

1st lab (just input no output)

Oct 24th, 2021
2,414
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .MODEL SMALL   ; IN THIS COURSE ALL MODEL ARE SMALL
  2. .STACK 100H    ; WE ALWAYS USE STACK 100H
  3. .DATA     ; DATA SEGMENT
  4. A DW 5    ; A = 5
  5. B DW 2    ; B = 2
  6. SUM DW ?  ; SUM = ?
  7. .CODE
  8.  
  9. MAIN PROC       ; MAIN CODE START HERE
  10.    
  11.     ; PROGRAMME SEGMENT PREFIX
  12.     MOV AX,@DATA
  13.     MOV DS,AX     ; INITILATION OF DS
  14.    
  15.     MOV AX,A  ; PUT A IN REGISTER
  16.     ADD AX,B  ; ADD B IN REGISTER AND CALCULATE SUM
  17.     MOV SUM,AX  ; RESULT PUT IN SUM
  18.    
  19.     ; THERE IS NO OUTPUT SO OUTPUT IS BLANK
  20.    
  21.     MOV AX,4CH ; TERMINATED THE CODE AND EXIT
  22.     INT 21H
  23.     MAIN ENDP
  24. END MAIN
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement