Guide to Assembly Language Programming in Linux

Part VI: Advanced Assembly Language

Chapter List

Chapter 17: String Processing
Chapter 18: ASCII and BCD Arithmetic
Chapter 19: Recursion
Chapter 20: Protected-Mode Interrupt Processing
Chapter 21: High-Level Language Interface
Chapter 22: Floating-Point Operations

String manipulation is an important aspect of any programming task. Strings are represented in a variety of ways. We start the chapter with a discussion of the two representation schemes used to store strings. The IA-32 instruction set supports string processing by a special set of instructions. We describe these instructions in detail. Several examples are presented to illustrate the use of string instructions in developing procedures for string processing. We also describe a program to test the procedures developed here. A novelty of this program is that it demonstrates the use of indirect procedure calls. Even though these instructions are called string instructions, they can be used for processing other types data. We demonstrate this aspect by means of an example. The chapter concludes with a summary.

String Representation

A string can be represented either as a fixed-length string or as a variable-length string. In the fixed-length representation, each string occupies exactly the same number of character positions. That is, each string has the same length, where the length of a string refers to the number of characters in the string. In this representation, if a string has fewer characters, it is extended by padding, for example, with blank characters. On the other hand, if a string has more characters, it is usually truncated to fit the storage...

UNLIMITED FREE
ACCESS
TO THE WORLD'S BEST IDEAS

SUBMIT
Already a GlobalSpec user? Log in.

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.

Customize Your GlobalSpec Experience

Category: Pup Joints
Finish!
Privacy Policy

This is embarrasing...

An error occurred while processing the form. Please try again in a few minutes.