


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Problem 1. Given the decimal number 29, what is it hexadecimal equivalent? Answer: In decimal, 29 = 16 + 13. Decimal 13 = 0xD. Then, we have Answer: 1D. Problem 2: This value is stored in a location declared as H1 DC Hโ0โ The value here is initialized to 0, but can be overwritten. What is the value stored, in hexadecimal? Answer: How many bytes are assigned to H1? Two What are the hexadecimal values stored? Xโ001Dโ NOTE: One hexadecimal digit represents 4 bits. 0x0 is 0000 and 0xF = 1111. One byte represents eight bits. It can be represented as 2 hexadecimal digits. A halfword is 16 bits. It can be represented by four hexadecimal digits.* A fullword is 32 bits. It can be represented by eight hexadecimal digits.* *This is IBM mainframe terminology.
Packed Decimal Look at the declaration P1 DC PL4โ123456โ What is the value stored, in hexadecimal digits? Xโ0123456Cโ. P2 DC PL3 โ12โ How many bytes of data here? 3 bytes. What is the value stored (in hex) X โ00012Cโ P3 DC PL4โ14โ Decimal value 14 How many bytes of data? 4 What is the value in hex? Xโ0000014Cโ How does this look in binary? 0000 0000 0000 0000 0000 0001 0100 1100 Open Question We execute the instruction LH 3,P What value, in decimal, is stored in register 3? Reason: The halfword beginning at address P3 is 0000 0000 0000 0000
Name DC CโABโ What is the hexadecimal value stored? XโC1C2โ One strange question. Zero DC Pโ0โ What is the value in hexadecimal stored at zero? X โ0Cโ This one byte is loaded into a register. What decimal value is loaded? 12 Another strange question. Take the declaration Z1 DC Pโ0โ One byte Xโ0Cโ Z2 DC Pโ1โ One byte Xโ1Cโ We execute the instruction LH 7,Z1. What hexadecimal value is loaded into register 7? Xโ0C1Cโ