Understanding Assembly Language Programming and DEBUG Environment
Exploring the world of Assembly Language Programming through DEBUG, a program that facilitates testing and debugging code by allowing users to step through programs, view and modify registers and memory, and analyze how instructions impact flags. Learn about DEBUG commands, register displays, flag manipulation, and more from the provided educational resources. Dive into the fundamentals of computer organization and architecture with practical examples and references to enhance your understanding of programming at the machine level.
Download Presentation
Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
E N D
Presentation Transcript
Assembly Language DEBUG Department of Computer Science, Faculty of Science, Chiang Mai University
The DEBUG Program The DEBUG program provides an environment in which a program may be tested. The user can step through a program, and display and change the registers and memory. We use DEBUG to demonstrate the way instructions affect the flags. To enter DEBUG with our demonstration program, we type C:\DEBUG filename.exe 2 204231: Computer Organization and Architecture
DEBUG Commands R display registers T trace the instruction at CS:IP G execute at CS:IP to completion U unassembled data in instruction format D dump bytes in hex format E enter data in list beginning at start Q quit DEBUG and return to DOS 3 204231: Computer Organization and Architecture
R R RAX Display registers and flags Display AX and change contents if desired - R AX=FFFF BX=0000 CX=0019 DX=0000 SP=0100 BP=0000 SI=0000 DI=0000 DS=06BA ES=06BA SS=06CC CS=06CA IP=0000 NU UP EI PL NZ NA PO NC 06CA:0000 BBCBO6 MOV AX, 06CB Flags Machine Code Segment : Offset 4 204231: Computer Organization and Architecture
FLAG CLEAR (0) SYMBOL SET (1) SYMBOL Overflow Flag Direction Flag * Interrupt Flag * Sign Flag Zero Flag Auxiliary Carry Flag Parity Flag Carry Flag NV (no overflow) UP (up) DI (disable interrupt) PL (plus) NZ (nonzero) NA (no auxiliary carry) AC (auxiliary carry) PO (odd parity) NC (no carry) OV (overflow) DN (down) EI (enable interrupts) NG (negative) ZR (zero) PE (even parity) CY (carry) * Control Flags 5
Reference Ytha Yu and Charles Marut, Assembly Language Programming and Organization of the IBM PC. New York: McGraw-Hill, 1992. 6 204231: Computer Organization and Architecture