Microprocessors and Interfacing: Lab Task-3
Microprocessors and Interfacing: Lab Task-3
Lab Task- 3
Introduction to AFD Debugger
The Netwide Assembler, NASM, is an 80x86 and x86-64 assembler designed for portability and modularity. It supports a range of object file formats, including Linux and *BSD a.out, ELF, COFF, Mach-O, Microsoft 16-bit OBJ, Win32 and Win64. It will also output plain binary files. Its syntax is designed to be simple and easy to understand, similar to Intel's but less complex. It supports all currently known x86 architectural extensions, and has strong support for macros. Procedure: 1. Open an editor. I used Note pad. 2. Write the program in the Note Pad. 3. The Program is as follows. 4. [Org 0x, 100] mov ax, 5 mov bx, 10 add ax, bx mov bx, 15 add ax, bx mov ax,0x4c00 int 0x21
or
5. [Org 0x, 100] mov ah, 10 mov al, 5 add bx, ax mov ax,0x4c00 int 0x21
3
6. Now save it. 7. Change the extension of the file from *.txt to *.asm. 8. Copy this file and paste in the Folder where nasm is installed. 9. Now open nasm. 10. It would be like this C:\Program files\NASM> 11. Write the code as
12. C:\Program files\NASM> nasm a.asm o a.obj l a.lst 13. C:\Program files\NASM>edit a.lst
15. Press Enter. 16. The window will look like this.
17. Now here we will use Advanced Full Screen Debugger (AFD). 18. Copy AFD.exe file into the NASM folder. 19. Open NASM. 20. It would be like this C:\Program files\NASM>
21. C:\Program files\NASM> AFD a.lst
Conclusion:
5
Here we used AFD debugger to debug our code in assembly language. The upper left side in the window is showing registers and their stored values. We have IP (Index Pointer) indicating the next command to be executed. Below we have the program that is our code. By pressing F1 we can execute our commands.