Learning AP instruction - need some help
Posted: Wed Aug 22, 2012 9:48 pm
I am trying to learn the intricacies behind AP instruction and am facing a situation.
Below goes the question ::
Given W DC PL2'10', X DC PL2'-6', Y DC CL2'15', and Z DC PL2'8'. Write the BAL code to
determine Z = W + X + Y . Show the hex representation of Z after each instruction. Your final
answer for Z should be X'019C'. (Reminder: Y must be packed before it can be added.
Define a work field if necessary.)
Above question is from assembler book of Bill Qualls
I can understand that W+X+Y = 10 + (-6) + 15 = 19 and the hex representation of 19 in PL2 would be X'019C'. ------- Step 1
What I cannot understand is the hex addition of W+X+Y
Hex representation of W DC PL2'10' = X'010C'
Hex representation of X DC PL2'-6' = X'006D'
Hex representation of Y DC CL2'15' = X'F1F5' = in packed format = X'015F'
W+X = 010c + 006D = 0179
W+X+Y = 0179 + 015F = 02D8
Now how come 02D8 is different from 019C as deducted in Step 1 above. Can somebody pls help me in understanding this?
Below goes the question ::
Given W DC PL2'10', X DC PL2'-6', Y DC CL2'15', and Z DC PL2'8'. Write the BAL code to
determine Z = W + X + Y . Show the hex representation of Z after each instruction. Your final
answer for Z should be X'019C'. (Reminder: Y must be packed before it can be added.
Define a work field if necessary.)
Above question is from assembler book of Bill Qualls
I can understand that W+X+Y = 10 + (-6) + 15 = 19 and the hex representation of 19 in PL2 would be X'019C'. ------- Step 1
What I cannot understand is the hex addition of W+X+Y
Hex representation of W DC PL2'10' = X'010C'
Hex representation of X DC PL2'-6' = X'006D'
Hex representation of Y DC CL2'15' = X'F1F5' = in packed format = X'015F'
W+X = 010c + 006D = 0179
W+X+Y = 0179 + 015F = 02D8
Now how come 02D8 is different from 019C as deducted in Step 1 above. Can somebody pls help me in understanding this?