Assembly language lab [AL Fundamentals] using emu8086
1. printing ‘hello world’ 7. mov ax,@data 10. ret
1. org 100h 8. mov ds,ax
2. .data =======division======
9. mov dx, offset var1
3. var1 DD "Hello 10. mov ah,09h 1. org 100h
World" 11. int 21h 2. num1 DD 1000 ;what is
4. .code 12. ret ?100,1000
5. ;mov dh,0E
3. num2 DD 100 ;what if
6. mov ah,2 =======or ========
?110,110
7. mov DL,'H'
8. int 21h 1. include '[Link]' 4. .code
9. mov DL,'E' 2. org 100h 5. mov Ax,num1
10. int 21h 3. printn "Hello World$" 6. mov Bx,num2
11. mov DL,'L' ;$ to indicate the end 7. div Bx
12. int 21h of the string ;Dx:10,DX:0000 why?
13. mov DL,'L' 4. ret 8. Ret
14. int 21h =======Or=======
15. mov DL,'O' 2. Add,sub,div,Mult, 1. org 100h
16. int 21h 3. org 100h 2. mov Ax,1004h
17. ;mov dl,032 4. .data ;division from
18. ;int 21h 5. var1 db 5 ;200 two registers
19. mov DL,'W' 3. mov dx,1004h
6. var2 db -3 ;100
20. int 21h 4. mov Bx,1234h
7. .code
21. mov DL,'O' 5. div Bx
22. int 21h 8. MOV AL, var1
6. ret
23. mov DL,'R' ;addition & subtraction
24. int 21h 9. ADD AL, var2 ===multiplication===
25. mov DL,'L' 10. inc al
1. org 100h
26. int 21h 11. sub al,3 ;which carry
2. mov AL,14h
27. mov DL,'D' flag is affected
3. mov BL,24h
28. mov cx,var1 12. ret ;o/p:00
29. int 21h 4. MUL BL ;AH=02 AL=D0
30. ret ======or====== 5. Ret
======or======
========or========== 1. org 100h 1. org 100h
2. .data 2. mov Ax,1234h
1. .model small;tiny 3. var1 dd 200 3. mov BX,45F4h
,large 4. var2 dd 56 4. MUL BX
2. .stack 100h 5. .code ;AX=5D90,DX=04F9
3. org 100h 6. MOV AX, var1 1. Ret
4. .data 7. ADD AX, var2 1. org 100h
5. var1 DB "Hello 2. mov Ax,10
8. inc AX
3. mov BX,10
World$" ;$ to indicate 9. sub AX,260 ; which 4. MUL BX
the end of the string carry flag will be 5. ret
6. .code affected? clc