HP (Hewlett-Packard) IA-64 Computer Accessories User Manual


 
8-2 Debugging Copyright © 2000 Hewlett-Packard Co.
Ski IA-64 Simulator Reference Manual 1.0L
The hexadecimal value 0x1234 is assigned to general register 1. The six upper (more significant) bytes are padded
with zeroes.
= r1 ip+10
The value in ip added to 0x10 is assigned to general register 1.
= f2.m 1234 ; = f2.s 1 ; = f2.e 10033
The hexadecimal value 0x300330000000000001234 is assigned to floating register 2. The register now encodes the
decimal value of -2.2754, approximately. The “= f2.m 1234 part sets the mantissa (the 64 low-order bits). The “=
f2.s 1
part encodes the mantissa sign (the most significant of the 82 bits). The = f2.e 10033 encodes the 17
exponent bits (which fit between the sign bit and mantissa bits), using a bias of 65,535 (0xffff).
=4 __data_start+30 0d10 13feffff b3
The decimal value 10 is assigned to the four bytes starting 48 bytes past the location of the symbol “__data_start”.
Because the value 10 occupies only one byte, three high-order zero bytes will be padded in, so the actual value
assigned will be 0x0000000a. The value 13feffff is assigned to the four bytes starting 52 bytes past the location of
__data_start. The lower four bytes of branch register 3 will be copied into the four bytes starting 56 bytes past the
location of __data_start. (To assign the value 0xb3, use the 0x prefix.)
=s main ThisProgramIsBroken
The string ThisProgramIsBroken with a null byte appended is placed in memory overwriting the instructions at the
start of the program, as shown in the “before” and “after” views of Figure 8-1 and Figure 8-2. (The symbol “main” tradi-
tionally marks the first instruction of a user program written in the C language.) The instructions previously at that loca-
tion are lost. If you attempt to run the program, it will almost certainly fail! Note that the string is not quoted and has no
whitespace.
Figure 8-1. The Original Program Loaded in
ski