HPlogo HP Assembler Reference Manual: HP 9000 Computers

Chapter 7 Programming Examples

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

This chapter consists of five programming examples in assembly language. The first three examples show typical assembly language code sequences; the last two examples show the correspondence between C, a higher-level programming language, and assembly language.

Title not available (Programming Examples)

Example 1

Calculates the highest bit position set in a passed parameter. A binary search is used to enhance performance.

Example 2

Copies bytes from a source location to a destination location. Both locations and the number of bytes to copy are passed in as parameters.

Example 3

Uses Divide Step to divide a 64-bit signed dividend by a 32-bit signed divisor.

Example 4

Uses a procedure call from a C program to the Assembler to verify that the program is passing the correct argument.

Example 5

Shows a C program that generates assembly code to call printf().

© 1998 Hewlett-Packard Development Company, L.P.