TAPR M-51 Operation Manual Download Page 6

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.

Summary of Contents for M-51

Page 1: ...from double mapped program and data RAM memory This manual describes how to use the monitor what s needed for hardware and different options for recovering the lost P0 and P2 ports which are not available for I O since they are used to create the address and data bus As with all instruction manuals there may be some errors or sections that do not provide satisfactory explanations If you find error...

Page 2: ... a summary for each command The next section provides the details of each command Table 1 Command Summary Command Description Usage BLAST FROM Blast from XDM BF adr data BLAST TO Blast to XDM BT adr data CHECK PROG MEM Checksum of PM CP first last CHECK XDATA Checksum of XDM CX first last DISPLAY PGM Display Program Memory DP first last DISPLAY XDM Display External Data Memory DX first last DISPLA...

Page 3: ...d is followed by two arguments CHECKSUM calculates a 16 bit sum checksum from arg0 to arg1 inclusive and prints the sum on the console Use CP first last for Program Memory and CX first last for XDM An example would be m51 cp 1000 1fff rtn Checksum 14DE m51 2 3 3 DISPLAY DP DX DI DS The DISPLAY is used to show the data at multiple consecutive locations of PM XDM IDM or SFRs Use DP for PM DX for XDM...

Page 4: ...egister incl reg bank XK display and allow changes of just the current reg bank within PSW XRn display and allow changes of Rn of the selected register bank n 0 1 7 XD display and allow changes of the DPTR register 16 bits XB display and allow changes of the B register XS display and allow changes of the SP register XP display and allow changes of the PCTR register 16 bits Some examples would be m...

Page 5: ...or and the monitor will return the original user s data to the breakpoint address The GO command restores all user registers before going to the user program and it saves all user registers following a break point Be sure to review the section near the end of this document titled Cautions with GO Breakpoints NEXT and ZNEXT Commands This is important information 2 3 7 HELP H The HELP command will p...

Page 6: ...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...

Page 7: ...mory space The RXINTEL command may be followed by an optional offset argument The offset value is added to the address contained in each record of the HEX code The result of the addition points to where the data portion of the record will be stored in XDM If the offset is omitted it is assumed to be zero When a record is correctly received a dot will be printed on the console When the end of file ...

Page 8: ...or heavily capacitivly coupled address and or data leads An example would be m51 tx 0 1000 rtn TR Write Read Write Test TR Loading initial value 00 TR Walking ones 01 02 04 08 10 20 40 80 TR Loading initial value FF TR Walking zeros FE FD FB F7 EF DF BF 7F TR Random data test TR Test OK m51 3 MEMORY AND PORT MAPPING The m 51 monitor as configured for TUC 52 requires that the monitor ROM start at 0...

Page 9: ...and P3 7 are lost to RD and WR signals Ports 0 and 2 can be recovered by 8255 I O ports to some extent If possible assign those I Os that need to be bi directional of quickly bit banged to P1 and the unused sections of P3 Then group all the remaining inputs to one 8255 port configured as in input and all the remaining outputs to another 8255 port configured as an output In most cases this will giv...

Page 10: ... point address es However the monitor isn t always successful at this You may need to re download the your code again to ensure that your code is intact Recall that the monitor uses a three byte LCALL instruction as its breakpoint trap instruction It s unfortunate that the 8051 doesn t include a single byte call instruction like the RSTn of the 8080 family This would be ideal for use by a simple m...

Page 11: ...ruction to any other location in the Program Memory space In general the first vector location 0003H jumps to EFFDH the second vector 000BH jumps to EFFAH and so on At the time this document was written the interrupt vectors were as follows Table 2 Interrupt Vectors3 ROM Adr Jumps to RAM Adr 00003H Jumps to 0EFFDH 0000BH Jumps to 0EFFAH 00013H Jumps to 0EFF7H 0001BH Jumps to 0EFF4H 00023H Jumps to...

Reviews: