Debug Manual

Table Of Contents
Sample Debug Sessions
Debug Manual421921-003
F-13
TNS Program Example
Displaying String Output
The local buffer, IN_OUT_MSG, is an indirect string. This means that we need to use
the pointer at L 3 to find the address of the data, divide it by 2 to convert from a string
address to a word address, then display the information. We can do this in one step or
two steps by using the indirect form as shown below:
Displaying Data Using Q Address
We can display some data in the selectable segment using the Q address mode. The
extended indirect pointer, SP, is used to store the ARRAY_NUM in location 0 of the
selectable segment. We can separate the characters by using the C grouping option
and hexadecimal output format.
We can also see the results of moving the procedure's buffer into the selectable
segment. Because the data is stored at byte offset 41, we need to round down to the
previous even byte (40). We then divide by 2 to convert to a 16-bit word address offset.
050,03,00013-d l 3
%000026: %000062
050,03,00013-a %62/2, #8/2, c
%000031:abcdefgo
050,03,00013-a l3s, #8/2, c
%000031:abcdefgo
Note. The last character returned is an "o," because we use the same buffer for input and
output. The "o" is from the word "some" in our prompt string "enter some data." An additional
item to note about the above example: The address 62 (octal) returned from the D L 3
command is in the user data (UD) area. We could have entered the A command as A
UD,%62/2, #8/2,C to obtain the same result. In other words, if a space qualifier is not specified
for the A or D command, UD is assumed.
050,03,00013-d q0, c :h
%000000: 01 00
050,03,00013-a q #40/2, #10/2, c
%000024:.abcdefg..