Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

2. Here is the DEBUG program you need to enter and execute: a mov ax,0 mov bx,12

ID: 2080808 • Letter: 2

Question

2. Here is the DEBUG program you need to enter and execute:

a

mov ax,0

mov bx,1234

mov cx, 5678

mov dx, 9abc

and ax, bx

or ax, cx

xor ax, dx

not ax

r

t8

q

3. Run DEBUG and enter the program and commands line by line. The blank line after the not ax instruction is needed to get out of the “a” command.

4. Examine the DEBUG output. The final value in AX should be 333B. This would be a good time to do an Alt + Print Screen to capture a screen shot of the DEBUG window to paste into your lab writeup.

5. Quit DEBUG and then run it again.

6. After entering the “a” command, change the first instruction from mov ax, 0 to mov ax, ???? where ‘????’ is your 4-digit birth date. For example, if you were born on July 15, your instruction would be mov ax,0715 Then enter the rest of the instructions and commands.

7. Use DEBUG to run the modified program. Be sure to perform another Alt + Print Screen to grab the new DEBUG results for your lab write-up.

Note: type answer please

Explanation / Answer

DEBUG: In general terms, a debugger refers to a computer program which assists in detecting and correcting errors. Assembly language just like any other language also requires a utility program for performing the above two functions of error correction and detection.

There are many commercial debuggers existing for Intel processors which are useful at the assembly level. These include but not limited to DEBUG, Periscope, Turbo Debuggers, Codesmith-86 and Advanced trace-86. DEBUG is the simplest of them all.

A DEBUG is a utility program for the assembly language which is helpful in displaying the contents in memory and also viewing registers and other variables. It is also a useful tool when stepping through a program to check for logical errors.

In quite general terms, any debugger will perform the following rudimentary functions;

Assembly of short programs.

Viewing program source code simultaneously with the related machine code.

Viewing registers and flags for the central processing unit.

Stepping through program.

Assist in watching as the variables change.

Entering new values into memory.

Performs search for ASCII values in memory.

Useful when moving a block of memory to a different location.

Performs a fill function to a block of memory.

The fundamental principles learned when using DEBUG are applicable to all other assembly level debuggers. This in itself explains why this debugger is regarded as the most basic and simplest of all.

Windows 95, 98, XP-32 bit, Vista-32 bit, or 7-32 bit come with the DEBUG already built in the operating system. 64-bit versions of windows XP, Vista, 7, or 8 requires some special software installed called BosBox to create a DEBUG environment.

Conclusion:The exercises performed in this experiment reveals that DEBUG is indeed an easy to use assembly level software which displays assembly mnemonics only. The skills acquired from this practice are useful to any assembly language programmer using this basic tool to debug their program.

MASM ASSEMBLER AND LINKER:

An assembler refers to a software program for translating an assembly language mnemonics into binary codes understandable by the machines. This process takes two major steps. During the first step, the assembler program identifies memory locations having labels to ensure that the relationship between the addresses and symbolic names is known in the process of translating instructions. In the second step each assembly statement is translated by combining register specifiers, the numeric equivalents of opcodes, and labels into legal instructions.

When an assembler is run, it performs the read operation on the source file of the program from where it is saved. Further running makes the contents of this file to be loaded into memory and run.

The second file is an assembler list having an extension .LST

Linkers on the other hand describes a program which performs the linking function. This implies that the program connects a number of smaller object files into a larger one.

Programs are normally written in modular form where each module is written, tested and debugged separately. The object modules are then linked into one functional program.

It is also that the object modules can be kept in the library file and linked into some other programs when needed.

A linker in this case will produce a link file containing binary codes for all the combined modules. It also produces a link map that contains the address information concerning the linked files.

Linkers that come with TASM or MASM produces a link with an extension .EXT.

MASM is an acronym for Microsoft Macro Assembler. When working with MASM, it is important that one the requirements of the assembler to ascertain that they are in correspondence with the operating system as well as the hardware requirement.

MASM has capability of building complete executable files, dynamic link libraries and separate object modules. It is generally complex to master but exhibits higher performance once one has an experience with it.

Conclusion:This session was highly informative. We went through the procedure for downloading, extracting and installing MASM. The details provided concerning this software revealed that the software requires some bit of repeated exercise in order to master it. However, once mastered, the software offers greater performance.

INTRODUCTION TO ASSEMBLY LANGUAGE PROGRAMMING:

Assembly language programming refers to the use of symbols to represent computer’s binary codes. It is more readable than the machine language since it uses symbols rather than bits as is the case of machine language programming. Assembly language allows programmers to use labels in identifying and naming certain memory words which hold instructions and/or data.The use of assembly language in programming offers some advantages in the sense that it requires less memory space and execution time besides its suitability for time critical jobs.

Interacting with assembly language helps one gain some knowledge of Interfacing programs with processors, operating systems and BIOS.

How the instructions access and operate on data.

How a program gains access to external devices.

In and while using assembly language, it is needful that one familiarizes with the notations, use of assignment statements as well as looping statements and variable allocations.

Assembly language can be used to perform mathematical computations. Consider the example shown below.

X=Y*Z

This is an instruction to multiply a value Y and Z and store the result in X. The assembly language representation for this is as follows.

y

imul z

mov x

ax

Conclusion:The exercise on using assembly language to perform mathematical computation was of great help. Even though I encountered some difficulties in getting the notations right, after a repeated exercise I was able to master. The step by step approach taken in this exercise provides skills which are of great importance to any programmer since it helps reduce logical mistakes in programming process.

8086/8088 INTERRUPTS:

An interrupt refers to a signal emitted by either a software or hardware to the processor requesting for a more urgent attention.Most interrupts occur outside the processor and the processor therefore must receive signals informing it about the interrupt. Interrupts are obviously asynchronous and unpredictable. This implies that their occurrence is independent of the processor operations since most of them are external to the processor and there is no certainty with regard to the time when they will occur.

CONTROLLING HARDWARE OF A PERSONNAL COMPUTER DIRECTLY

This exercise is done in assembly language using a software called TONE.ASM. The fundamental property of this software is that it can be used to control the pitch or frequency of sound of laptop speakers. An assembly language is normally used to modify the frequency at which the laptop speakers beep. This software is available online and for this exercise, it is to be downloaded, assembled and run.

There are also open source assembly programs online that can be used on the software.

Conclusion I successfully assembled tone.asm program and controlled the frequency of speakers of a laptop. From the cumulative experiences acquired from these exercises, it can clearly be noted that the sessions were highly informative despite a few technical drawbacks arising from programming and hardware connections. The technical assistants came in handy and the

Interrupts are classified as either hardware or software. Hardware interrupts describes those interrupts originating from hardware devices external to the processor which may require special attention. Software interrupts on the other hand refer to the interrupts arising from special instructions to the processor or within the processor itself.

8086/8088 microprocessors has special pins for addressing this. 8086 for instance has two pins INTR for receiving interrupt requests and INTA for acknowledging the receipt of interrupt. A request at the INTR pin causes it to switch to logic 1 indicating to the microprocessor that there an active interrupt that needs to be serviced. Once a request has been received, the output of INTA pin goes LOW to signify to the requesting device that the request has been received.

Conclusion: The exercise was highly informative. From the discussed pin out of 8086 and 8086 I was able to get an insight on the architecture of the two processors and also their comparisons. I covered the interrupts in details and was able to program the processor to respond to external requests input from the interrupt pins.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote