Микропроцессорные системы Программирование INTEL 8086 Системная программа Debug.

Slides:



Advertisements
Similar presentations
DOS & Windows O/s Prof. Sujata Rao Less 5.
Advertisements

Memory Protection: Kernel and User Address Spaces  Background  Address binding  How memory protection is achieved.
Code Composer Department of Electrical and Computer Engineering
Slide 1CPU Emulator Tutorial This program is part of the software suite that accompanies the book The Digital Core, by Noam Nisan and Shimon Schocken 2003,
Utilizing the GDB debugger to analyze programs Background and application.
Lab6 – Debug Assembly Language Lab
Chapter 2 Machine Language. Machine language The only language a computer can understand directly. Each type of computer has its own unique machine language.
Some thoughts: If it is too good to be true, it isn’t. Success is temporary. It is hard work to make it simple. Knowing you did it right is enough reward.
Chapter 4 H1 Assembly Language: Part 2. Direct instruction Contains the absolute address of the memory location it accesses. ld instruction:
PhD/Master course, Uppsala  Understanding the interaction between your program and computer  Structuring the code  Optimizing the code  Debugging.
Structure of DOS application programs. Contents: 1. PSP 2..COM and.EXE 3. TSR: Terminate and Stay Resident Programs.
Memory & Storage Architecture Seoul National University Computer Architecture “ Bomb Lab Hints” 2nd semester, 2014 Modified version : The original.
OllyDbg Debuger.
Data Transfer & Decisions I (1) Fall 2005 Lecture 3: MIPS Assembly language Decisions I.
Assembly & Machine Languages
Chapter 2 Software Tools and Assembly Language Syntax.
Chapter 1 – Introduction to Computer Systems & QBasic
ICS312 Set 4 Program Structure. Outline for a SMALL Model Program Note the quiz at the next lecture will be to reproduce this slide.MODEL SMALL.586 ;
Lab 1 – Assembly Language and Interfacing Start date: Week 3 Due date: Week 4 1.
Practical Malware Analysis Ch 8: Debugging Rev
Debugging a Program … Using the PC/370 Emulator Interactively !
Ch Review1 Review Chapter Microcomputer Systems Hardware, Software, and the Operating System.
Computer Platforms Week 4: Assembly Language & Operating Systems.
Evolution of Programming Languages Generations of PLs.
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
Debug and Assembler By, B.R.Chandavarkar Lect. COMP Department NITK, Surathkal.
Vintage Computer Hardware 101 Featuring the MITS Altair 680b Bill Degnan.
IT253: Computer Organization Lecture 3: Memory and Bit Operations Tonga Institute of Higher Education.
Shell Script Programming. 2 Using UNIX Shell Scripts Unlike high-level language programs, shell scripts do not have to be converted into machine language.
Objective At the conclusion of this chapter you will be able to:
Lecture 8 February 29, Topics Questions about Exercise 4, due Thursday? Object Based Programming (Chapter 8) –Basic Principles –Methods –Fields.
MIPS coding. slt, slti slt $t3, $t1, $t2 – set $t3 to be 1 if $t1 < $t2 ; else clear $t3 to be 0. – “Set Less Than.” slti $t3, $t1, 100 – set $t3 to be.
Computer Systems Week 7: Looping and Input/Output with 3-bit Alma Whitfield.
What does C store? >>A = [1 2 3] >>B = [1 1] >>[C,D]=meshgrid(A,B) c) a) d) b)
2003 Dominic Swayne1 Microsoft Disk Operating System and PC DOS CS-550-1: Operating Systems Fall 2003 Dominic Swayne.
D75P 34 – HNC Computer Architecture Week 5 Memory Maps. © C Nyssen/Aberdeen College 2003 All images © C Nyssen/Aberdeen College except where stated Prepared.
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
CSNB374: Microprocessor Systems Chapter 5: Procedures and Interrupts.
Debuggers A program needed when writing any type of code Displays the contents of memory Lets you view registers and variables and see how they change.
UHD:CS2401: A. Berrached1 The Intel x86 Hardware Organization.
© GCSE Computing Candidates should be able to:  describe the characteristics of an assembler Slide 1.
Lecture 26: Reusable Methods: Enviable Sloth. Creating Function M-files User defined functions are stored as M- files To use them, they must be in the.
CS 342 – Operating Systems Spring 2003 © Ibrahim Korpeoglu Bilkent University1 Input/Output – 2 I/O Software CS 342 – Operating Systems Ibrahim Korpeoglu.
7. IRQ and PIC ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  Interrupts ◦ Section
EEL 3801 Part IV The Assembler. OFFSET Operator Returns address of variable used as operand. Actually, it represents the offset from the beginning of.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
1 เครื่องมือในการพัฒนาภาษา แอสเซมบลี้. 2 Tools Assembly language vs. machine code Edit and debugging tools Debug, program you can use to test and debug.
Introduction to Computing Systems and Programming Programming.
Preliminary to Assembly Language Programming CE 140 A1/A2 28 June 2003.
CC410: System Programming Dr. Manal Helal – Fall 2014 – Lecture 10 – Loaders.
Programming PIC 16F84A in Assembly. PIC16F84 pin-out and required external components.
Operating Systems A Biswas, Dept. of Information Technology.
Some of the utilities associated with the development of programs. These program development tools allow users to write and construct programs that the.
COMP 1321 Digital Infrastructure
Assembly Language Programming Part 3
Debugging with gdb gdb is the GNU debugger on our CS machines.
Computer Organization & Assembly Language Chapter 3
CS703 - Advanced Operating Systems
CS 301 Fall 2001 – Chapter 3 Slides by Prof. Hartman, following “IBM PC Assembly Language Programming” by Peter Abel 9/17/2018.
Computer Architecture “Bomb Lab Hints”
Introduction to Assembly Language
Operation System Program 4
Chapter 7 LC-2 Assembly Language.
DEBUG.
Operating Systems Chapter 5: Input/Output Management
CSC235 - Visual Studio Tutorial
TRAP Routines Privileged Instructions Subroutines
Embedded System Development Lecture 13 4/11/2007
Modern PC operating systems
Microprocessor and Assembly Language
Presentation transcript:

Микропроцессорные системы Программирование INTEL 8086 Системная программа Debug

Вопросы

Запуск программы Debug Для запуска программы Debug В DOS - набрать debug в командной строке В Windows – Нажать Пуск -> Выполнить -> набрать debug в командной строке Для перехода из оконного режима в полноэкранный и обратно нажимайте Alt+Enter Окно программы Debug в среде Windows

Команды Debug: a Перевод мнемонических машинных кодов в числовой код(ввод программы в память) (a) ssembler а [нач.адрес] нач.адрес указывает адрес, с которого программа располагается в памяти

Команды Debug: d Вывод на экран содержимого участка памяти(d)unp d[нач.адрес] L [число] нач.адрес указывает на первый байт сегмента памяти, который надо вывести на экран; число задает размер участка памяти, который надо просмотреть

Команды Debug: e Ввод данных в оперативную память компьютера(e)nter е[нач.адрес] [список значений] нач.адрес указывает на первый байт сегмента памяти; список значений задает вводимые значения в шестнадцатерчином виде через пробел

Команды Debug: t Выполнение одной (нескольких) команд в пошаговом режиме(t)race t=[Haч.адрес] [число] нач.адрес указывает адрес команды. число задает количество команд которые требуется выполнить

Hex: H value1 value2 Простой калькулятор для сложений и вычитаний шестнадцатиричных чисел. Можно ввести два числа, каждое не более чем по 4 цифры. Сначала debug выведет сумму этих чисел, а затем разность. Search: S range list Searches within a range of addresses for a pattern of one or more byte values given in a list. The list can be comprised of numbers or character strings enclosed by matching single or double quote marks. [ NOTE: In the examples below, if you do find the same data on your computer, the locations could easily vary from ours! ] Compare: C range address Compares two blocks of memory. If there are no differences, then DEBUG simply displays another prompt (-). Fill: F range list This command can also be used to clear a whole segment of Memory as well as filling smaller areas with a continuously repeating phrase or single byte.

Go: G [=address] [addresses] Go is used to run a program and set breakpoints in the program's code. Unassemble: U [range] Disassembles machine instructions into 8086 Assembly code. Without the optional [range], it uses Offset 100 as its starting point, disassembles about 32 bytes and then remembers the next byte it should start with if the command is used again. Input: I port Output: O port byte The use of I/O commands while running Windows™9x/Me is just plain unreliable! This is especially true when trying to directly access hard disks! Under Win NT/2000/XP, the I/O commands are only an emulation; so don't trust them. Though the example below still works under Win2000/XP, it's most likely using some WinAPI code to show what's in the Windows clock area; not directly from an RTC chip.

Load: L [address] [drive] [firstsector] [number] or program! (See the N command for more on this) This command will LOAD the selected number of sectors from any disk's Logical Drive under the control of MS-DOS or Windows into Memory. The address is the location in Memory the data will be copied to (use only 4 hex digits to keep it within the memory allocated to DEBUG), the drive number is mapped as: 0=A:, 1=B:, 2=C:, etc., firstsector counts from ZERO to the largest sector in the volume and finally number specifies in hexadecimal the total number of sectors that will be copied into Memory (so a floppy disk with 0 through 2,879 sectors would be: 0 through B3F in Hex).N command Move: M range address This command should really be called: COPY (not Move) as it actually copies all the bytes from within the specified range to a new address. Name: N [pathname] [arglist] This command can be used to load files into DEBUG's Memory after you have started the program, but it's main function is to create a new file under control of the Operating System which DEBUG can WRITE data to.WRITE

Register: R [register] Entering ' r ' all by itself will display all of the 8086 register's contents and the next instruction which the IP register points to in both machine code and an unassembled (Assembly Language) form. Proceed: P [=address] [number] Proceed acts exactly the same as Debug's T (Trace) command for most types of instructions... EXCEPT: Proceed will immediately execute ALL the instructions (rather than stepping through each one) inside any Subroutine CALL, a LOOP, a REPeated string instruction or any software INTerrupts. This means that you do not have to single-step through any of the code contained in a Subroutine or INT call if you use the Proceed (P) command. This means Proceed will be the command you use most often to debug programs, and Trace will only be used to step into a Subroutine or possibly check the logic of the first few iterations of a LOOP or REP instruction.T (Trace) command Write: W [address] [drive] [firstsector] [number] The WRITE (W) command is often used to save a program to your hard disk from within DEBUG. But the only safe way to do so, especially under Windows, is by allowing the OS to decide where to physically create that file on the disk. This is done by first using the Name (N) command to set up an optional path and filename for the new file (or to overwrite one that already exists).Name (N) command