NOVA CSC 206 - Procedures and Interrupts (28 pages)

Previewing pages 1, 2, 3, 26, 27, 28 of 28 page document View the full content.
View Full Document

Procedures and Interrupts



Previewing pages 1, 2, 3, 26, 27, 28 of actual document.

View the full content.
View Full Document
View Full Document

Procedures and Interrupts

30 views

Lecture Notes


Pages:
28
School:
Northern Virginia Community College
Course:
Csc 206 - Assembly Language

Unformatted text preview:

01 14 19 CSC 206 Chapter 5 Procedures and Interrupts Instructor James Hutchinson 1 01 14 19 CSC 206 Topics Stack Operations Procedures Procedure Parameters Software Interrupts MS DOS Function Calls BIOS Level Keyboard Input Interrupt 16h Recursion Review Questions 2 CSC 206 Introduction As Program become larger and more sophisticated they must be subdivided into procedures A procedure is a block of logically related instructions Each procedure is written to solve a single problem Each procedure is completely self contain with a clearly defined interface A procedure is written general enough to apply to new situations code reuse Large programming projects use the divide and conquer methodology The stack is the mechanism by which we invoke procedures 01 14 19 3 CSC 206 Stack Operations 01 14 19 Definition A stack is a special memory buffer located outside of the CPU USED as a temporary holding Operation The stack is a last in first out structure All items in a stack are added and removed from the top of the stack The are two operations defined on this structure Push and Pop The Push function places an item on the top of the stack The Pop function removes the item located at the top of the stack Each location in the stack is a full word 16 bits The stack pointer SP points to the element at the top of the stack 4 CSC 206 Stack Operations Continued 01 14 19 The Push Operation Definition Place an item onto the top of the stack General Form push full word register Where a full word register is one of the following 16 bit registers in 16 bit mode or a 32 bit register in 32 bit mode Example Consider a stack containing the value 6000h an AX 4000h If the instruction push AX is executed the stack would look as follows Before high memory 6000 After SP high memory 6000 4000 SP 5 01 14 19 CSC 206 Stack Operations Continued After Execution of the following set of instructions mov bx 0AB1h mov cx 1234h push bx push cx The stack look as follow Stack with new elements added 6000 4000



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Procedures and Interrupts and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Procedures and Interrupts and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?