
M-51 for TUC52, Issue 1.0
Page 6
January 21, 1998
File: m51-i1.doc
2.4.2
LIST STACK (L)
The LIST STACK command prints out the values on the user's stack, a few entries above and below the
current user’s stack pointer location. The label "SP" denotes the current user’s stack pointer address and
data.
An example would be:
m51-> l {rtn}
ADR: 58 59 5A 5B 5C 5D 5E 5F 60 61 62 63 64 65 66 67 68
------------------------SP------------------------
DAT: DD 13 93 8A 8B 92 98 31 98 3E 93 99 93 DD 13 93 8A
m51->
2.4.3
MOVE (M)
The MOVE command is used to move data from one portion of XDM to another portion of XDM. The
move command is followed by three arguments. The first is the starting address of the source range; the
second is the last address of the source range and the third is the starting address of the destination range.
An example would be:
m51-> m 8000 87f4 9001 {rtn}
m51->
This would fill the XDM locations 9001 to 97F5 inclusive with the data starting at XDM location 8000.
2.4.4
NEXT (N)
The NEXT command is a "single step" command and is probably the most powerful command available to
the user. When the user gives the monitor a NEXT command the monitor will look at the opcode pointed to
by the user's PC register, determine the address of the following instruction to be executed and put a trap
(actually an LCALL) instruction at that second address. Then the monitor will load the user's registers into
the 8051 and jump to the address pointed to by the user's PC register. The 8051 will execute one instruction
and then go on to the following instruction where it will then encounter the previously placed monitor trap
instruction. This instruction will transfer execution back to the monitor which will, (1) swap the trap
instruction with the user’s original instruction at the trap address, (2) save the user's registers, (3) print the
user’s registers to the terminal and (4) wait for the next user's command from the keyboard (which very
likely will be another NEXT command). The NEXT command is like a special case of the GO command
where monitor will use the user's PC register data to determine where to go and where to set the break-point
address such that only one instruction will be executed.
As an example, after several NEXT commands, the screen might look like this:
FF 11111110 FE 03 97 B6 5F 6A E7 64 C9 48 FF FF FFFF FF FF 60 8000 02 80 7C
FF 11111110 FE 03 97 B6 5F 6A E7 64 C9 48 FF FF FFFF FF FF 60 807C C2 AF 75
FF 11111110 FE 03 97 B6 5F 6A E7 64 C9 48 FF FF FFFF FF FF 60 807E 75 D0 10
FF 00010000 10 02 FF FF FF FF FF FF FF FF FF FF FFFF FF FF 60 8081 75 81 60
FF 00010000 10 02 FF FF FF FF FF FF FF FF FF FF FFFF FF FF 60 8084 12 8E 62
FF 00010000 10 02 FF FF FF FF FF FF FF FF FF FF FFFF FF FF 62 8E62 75 98 52
FF 00010000 10 02 FF FF FF FF FF FF FF FF FF FF FFFF FF FF 62 8E65 43 87 80
FF 00010000 10 02 FF FF FF FF FF FF FF FF FF FF FFFF FF FF 62 8E68 75 89 2D
A CAFBBOFP PS RB R0 R1 R2 R3 R4 R5 R6 R7 @R0 @R1 DPTR @DP B SP PCTR @PC +1 +2
Be sure to review the section on "Cautions with GO Breakpoints, NEXT and ZNEXT Commands". This is
important information.