An Introduction to Interrupts

An interrupt is an unexpected hardware initiated subroutine call or jump that temporarily suspends the running of the current program.
Interrupts occur when a peripheral device asserts an interrupt input pin of the micro-processor. Provided the interrupt is permitted, it will be acknowledged by the processor at the end of the current memory cycle. The processor then services the interrupt by branching to a special service routine written to handle that particular interrupt. Upon servicing the device, the processor is then instructed to continue with what is was doing previously (by use of a special “return from interrupt” instruction).
Interrupts fall into two major categories, maskable and non-maskable. Continue reading “An Introduction to Interrupts”

Advertisements

Assembly Language Programming – Program management tools

These tools are designed to make the process of maintaining programs easier.

MAKE

This utility is designed to ease updating of programs, especially multiple module programs.

It works by using a list of dependencies. These dependencies illustrate the relationship between the source, include, object and executable versions of the program.

Continue reading “Assembly Language Programming – Program management tools”

Assembly Language – Interfacing to Hill Routines

INTERFACING TO HLL ROUTINES

There are times that high level languages need to call assembly language modules. This results due to constraints like speed and memory space.

We shall look at interfacing a Pascal program to an assembly language module.

The Pascal program will declare an integer based array, and pass the address of this array, and the number of elements in the array, to an assembly language module. Continue reading “Assembly Language – Interfacing to Hill Routines”

Compiling and executing assembly language programs

This section discusses the basics of generating an executable file from an Assembly language source code file. There is also a discussion of the compiler options of conditional assembly and macros.

With the older versions of Microsoft Assemblers, there are two basic steps used to generate an executable file to run under DOS. The first step is to compile the Assembly language source code into an object file. The second step is to link the object file with any other object files necessary and any needed library routines to generate the executable file. With the new version of Microsoft Assembler, you can compile and link with a single command. Continue reading “Compiling and executing assembly language programs”

Assembly Language Programming – 16 bit processing

[8086] In the code examples so far, we have separated out the coded instructions from the data. Modern processors like the 8088 have separate registers which deal with each section of a program.


	CS and IP = instructions
	DS, BX, SI= data 
	ES, BX, DI= extra data 
	SS, SP, BP= stack

In writing programs for modern processors like the 8088, the program is structured with a minimum of three sections, called SEGMENTS. The three segments represent the CODE, DATA and STACK areas of the program. Information within each segment is accessed differently depending upon the segment type. To access data in the stack segment requires the use of the SS, SP and or BP registers. The following diagrams illustrates how information in the stack and data segments are accessed.

 

Special assembler directives are used to specify the different segments

Continue reading “Assembly Language Programming – 16 bit processing”

Assembly Language: Data Conversions Routines

Computer systems use character based keyboards and displays for inputting and outputting data. Conversion routines are necessary to convert data types to character strings and back again.

Consider the entry from a keyboard of an integer value 276. This represents a three character sequence of ‘2’, ‘7’ and ‘6’. This character sequence will need to be converted into an appropriate 16bit value representing an integer. Also consider displaying the value of a byte as two hex digits. Each nibble must be converted to an ASCII character before displaying on the terminal screen. Continue reading “Assembly Language: Data Conversions Routines”