IDEAL
MODEL small
STACK 100h
DATASEG
; opcode compositions to be embedded in the code
opcd1  db 0b8h,03h
opcd2  db 00h
opcd3  db 0bbh,03h
grace1 db 0b8h,00h
grace2 db 04ch
grace3 db 0cdh,021h
CODESEG
start:
   mov ax, @data
   mov ds, ax
;move opcodes of 'mov ax,3' to the address after the given code
   mov dx,[word ptr opcd1]
   mov [cs:78],dx
   mov dl,[byte ptr opcd2]
   mov [cs:80],dl
;move opcodes of 'mov bx,3' to the address after the above addition    
   mov dx,[word ptr opcd3]  
   mov [cs:81],dx
   mov dl,[byte ptr opcd2]
   mov [cs:83],dl   
; restore gracefull exit (mov ax,4c00h, int 21h)
   mov dx,[word ptr grace1]  
   mov [cs:84],dx
   mov dl,[byte ptr grace2]
   mov [cs:86],dl 
   mov dx,[word ptr grace3]  
   mov [cs:87],dx   
; The given code     
;-----------------------------------------------------------------    
   xor ax,ax
   xor bx,bx
   add ax,2
   add ax,2
exit:
   mov ax, 4c00h
   int 21h
END start  