Prev: 56904 Up: Map Next: 56996
56928: Measure The Gap Between The Two Pointers
Used by the routine at DescribeObjectIfPresent.
Measures the gap between the object's description and the location text.
MeasureGapBetweenTwoPointers_Next 56928 PUSH HL Read the object's description.
56929 PUSH DE
56930 LD HL,(56781)
56933 LD DE,(56779) Read the location text.
56937 AND A Clear the carry before subtracting the two text pointers.
56938 SBC HL,DE Subtract the two text pointers to measure the gap.
56940 POP DE Restore the saved source and the saved pointer from the stack.
56941 POP HL
56942 RET Return.
56943 DEFB 32,16 Display record read by ProcessDisplayRecord: flags 32 value 16.
Run by 51812 after the display record at 56943.
56945 CALL PrintNewline Call PrintNewline to print a new line.
56948 LD HL,26797 Take the message, then call PrintTextAndHandleControlCharacters to print the message.
56951 CALL PrintTextAndHandleControlCharacters
56954 LD A,(41014) Call CountObjectsInLocation to count objects in location.
56957 CALL CountObjectsInLocation
56960 AND A See whether it is zero.
56961 LD HL,26880 Point at the text at 26857+23 and go to MeasureGapBetweenTwoPointers_ResultLowByte to list the objects when the count is not zero.
56964 JR NZ,MeasureGapBetweenTwoPointers_ResultLowByte
56966 CALL PrintTextAndHandleControlCharacters Call PrintTextAndHandleControlCharacters to print the message.
56969 OR 1
56971 RET Return.
Store the result in the low byte of the count, then read the character attribute, then store the result in the count.
MeasureGapBetweenTwoPointers_ResultLowByte 56972 LD C,A Read the current character attribute.
56973 LD A,(40970)
56976 LD B,A
56977 LD A,(41014) Read the character being processed, then call PrintObjectListWithFormatting to list the objects and describe them.
56980 CALL PrintObjectListWithFormatting
56983 CALL PrintNewline Call PrintNewline to print a new line.
56986 OR 1
56988 RET Return.
56989 DEFB 56,16,128,33,0,0,0 Display record read by ProcessDisplayRecord: flags 56 value 16 parameters 128 33 0 0 0.
Prev: 56904 Up: Map Next: 56996