1 ; PAULMON 8051 Debugger by Paul Stoffregen
3 ; .command +h58 ;set page height to 58 in listing file...
5 .equ start,0000h ;address for start of EPROM (0000h)
6 .equ program,2000h ;address for program loading location
11 .org start+3 ;ext int #0
13 .org start+11 ;timer #0
15 .org start+13h ;external interrupt routine #1
17 ljmp program+13h ;don't do ssrun if edge trigger'd
18 intr0: ajmp step ;but do ssrun if level trigger'd
19 .org start+1bh ;timer #1
21 .org start+23h ;serial port
23 .org start+2bh ;timer #2 (8052 only)
27 .org start+30h ;the jump table
39 step: ;this is the single step interrupt processor code...
40 push psw ;better save these while we still can
42 clr psw.3 ;gotta be set to bank zero...
46 step2: cjne a,#13,step7
48 step7: cjne a,#32,step8 ;check space
50 step8: cjne a,#'?',step10 ;check '?'
53 step10: cjne a,#'Q',step11 ;check 'Q'=quit and run normal
62 step11: cjne a,#'H',step12 ;check 'H'=hex dump internal ram
65 step12: cjne a,#'R',step13 ;check 'R'=print out registers
67 step13: cjne a,#'S',step14 ;check 'S'=skip this inst
69 step14: cjne a,#'A',step20 ;check 'A'=change acc value
79 status: ;prints two-line status during single step run
148 acall space ;now begin printing the 2nd line
320 lcall inst ;print skipped instruction r0 points to pc
325 mov @r0,dph ;actually change the pc!
331 lcall inst ;print new instruction
360 chacc2: mov dptr,#abort
369 DownLoad: ;Note, this is a modified version of the
370 ;auto baud rate detection routine from
371 ;MDP/51. Thank You, Kei-Yong Khoo (3-31-87)
375 acall pstr ;"begin sending file <ESC> to abort"
377 CJNE A, #27, DWLD0 ; Test for escape
378 dwldesc:mov dptr,#dwlds2
379 acall pstr ;"download aborted."
384 CJNE a, #0x3A, DWLD0a ; wait for ':'
387 MOV R0, A ; R0 = # of data bytes
390 MOV DPH, A ; High byte of load address
393 MOV DPL, A ; Low byte of load address
394 ACALL ghex ; Record type
396 CJNE A, #1, DWLD1 ; End record?
398 acall pstr ;"download went ok..."
402 DWLD1: INC R0 ; adjust for repeat loop
404 DWLD2: ACALL ghex ; Get data byte
408 DWLD3: DJNZ R0, DWLD2
409 ACALL ghex ; Discard checksum
413 INIT: ;Note, this is a modified version of the
414 ;auto baud rate detection routine from
415 ;MDP/51. Thank You, Kei-Yong Khoo (3-31-87)
416 orl PCON,#10000000b ; set double baud rate
418 MOV SCON,#01010000b ; Set Serial for mode 1 &
420 ORL TCON,#01010010b ; Start timer 1 both timer
431 sjmp autoend ;baud rate is known from last time...
432 AUTO: CLR TR1 ; Stop timer 1
433 MOV TH1, #0 ; Clear timer 1
435 JB RXD, * ; Wait for start bit
436 JB RXD,AUTO ; make sure it's not just noise
440 JNB RXD, * ; skip start bit
445 JNB RXD, * ; Count 3 more bits
448 MOV A, TL1 ; divide TH1-TL1 by 128
453 INC A ; 2's complement
454 mov b,a ; store the reload value four times
455 mov 7Bh,a ;so that it might be there later
456 xrl a,#01010101b ;we'll store the reload value
457 mov 7Ah,a ;four times, just to be safe
466 mov tmod,#00100001b ;now it's 8 bit auto-reload
477 help0: movc a,@a+dptr
486 movc a,@a+dptr ;(high)
490 movc a,@a+dptr ;(low)
504 help_2: mov dptr,#help2txt
518 mov dptr,#abort ;if they press <ESC>
523 run1: cjne a,#'?',run3
524 mov dptr,#help3txt ;if they pressed ?
533 run2: mov dptr,#help4txt
540 run3: cjne a,#'S',run4
544 run4: mov dptr,#runstd
546 mov dptr,#prompt8 ;run the user's program
576 ret ;<-- actually jumps to user's program
579 ssrun: mov dptr,#prompt8 ;run single step
602 mov dptr,#sserr1 ;give error msg if int1 not grounded
607 ssrun2: mov dptr,#prompt9 ;ask for priority
617 ssrun3: cjne a,#'L',ssrun4
620 ssrun4: mov ip,#00000100b
621 ssrun5: mov dptr,#ssmsg ;tell 'em it now time, remind to
622 acall pstr ;to hit <RET> for next inst
649 mov r2,#16 ;number of lines to print
651 dump1: mov r0,#20h ;pointer to memory to store bytes
657 dump2: clr A ;<--acquire 16 bytes
658 movc a,@a+dptr ;and store from 20 to 2F
667 mov r0,#20h ;now we'll print it in ascii
669 anl a,#01111111b ;avoid unprintable characters
682 djnz r2,dump1 ;loop back up to print next line
703 newloc1:mov dptr,#abort
710 edit: ;edit external ram...
738 edit2: mov dptr,#edits2
744 list: ;prints out dis-assembly list of memory
745 mov r2,#18 ;# of lines to list
749 acall disasm ;this obviously does all the work
761 JNB RI,cin ; wait for character
766 COUT: ;note, improved... much faster transmission
767 jnb ti,* ;wait if a character is still sending
769 CLR TI ;note: hardware will set ti when the
770 RET ; character finishes sending...
772 esc: ;checks to see if <ESC> is waiting on serial port.
773 ;C=clear if no <ESC>, C=set if <ESC> pressed, buffer flushed
791 g1hex: ;gets one character. Converts to hex and places in Acc
792 ;C=1 if <ESC> pressed, 0 otherwise
793 ;PSW.5=1 if <RET> pressed, 0 otherwise
794 ;PSW.2=1 if backspace or delete, 0 otherwise (not yet)
803 g1hex2: cjne a,#27,g1hex2a
806 g1hex2a:cjne a,#8,g1hex2c
809 g1hex2c:cjne a,#127,g1hex3
814 jc g1hex4 ;they typed a bad char, so go back
823 ghex: ; gets an 8-bit hex value from keyboard, returned in A.
824 ; C=1 if <ESC> pressed, 0 otherwise
825 ; PSW.5 if <RET> pressed w/ no input, 0 otherwise
851 ghex16: ; gets a 16-bit hex value from keyboard, returned in DPTR.
852 ; C=0 if normal <RET>, C=1 if <ESC> pressed
863 ghex16a:acall g1hex ;get first character
868 ghex16e:acall g1hex ;get second character
876 ghex16i:acall g1hex ;get third character
884 ghex16m:acall g1hex ;get fourth character
892 ghex16s:mov dph,#0 ;one digit entered
895 ghex16t:mov dph,#0 ;two digit entered
901 ghex16u:mov dph,r0 ;three digit entered
907 ghex16v:mov a,r0 ;all four digit entered
915 ghex16z:pop acc ;exit, at last...
940 .DB "0123456789ABCDEF"
942 asc2hex: ;carry set if invalid input
954 anl a,#11110000b ;just in case...
961 upper: ;converts the ascii code in Acc to uppercase, if it is lowercase
966 jc upper1; not a lowercase character
1001 jnb ti,* ;wait for last character to finish sending
1016 disasm: ;prints out instruction @dptr, and advances dptr
1017 acall phex16 ;they'd like to know the address...
1024 mov dptr,#mnot ;mnot=mnunonic offset table
1028 mov dptr,#opot ;opot=operand offset table
1030 mov r6,a ;these 2 tables are a bitch to enter!!!
1044 movc a,@a+dptr ;fetch 2nd byte (if nec)
1051 movc a,@a+dptr ;fetch 3rd byte (if nec)
1054 disasm1:acall disasm4 ;prints the bytes+spaces
1057 mov dptr,#mnu_tbl ;mnu_tlb: table with actual text...
1058 acall disasm5 ;prints the mnenonic+spaces
1065 mov r6,a ;(high) in case of ajmp or acall or rel
1072 mov b,#dasm2 & 0xff ;(low)
1074 mov b,#dasm2 / 256 ;(high)
1076 mov dptr,#oprt ;oprt=operand routine table
1083 disasm4:mov a,#':' ;print bytes and some punctuation
1105 disasm5:mov r0,#7+1 ;prints the mnunonic+spaces
1120 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1121 ; 2k page boundry must exist between these dividers ;
1122 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1125 prompt1:.db ">Loc=",0
1126 prompt2:.db ": (Version 1.0) Command>",0
1127 prompt3:.db "Location (",0
1128 prompt4:.db "=Default): ",0
1129 prompt5:.db "New memory pointer location: ",0
1130 prompt6:.db "\rS=Single Step, N=Normal (default), ?=Help >",0
1131 prompt7:.db "Press any key: ",0
1132 prompt8:.db "\r\rRun from memory loaction (",0
1133 prompt9:.db "\r\rInterrupt priority> "
1134 .db "L=Low, H=High (default): ",0
1135 prompt10:.db ") New Value: ",0
1136 abort: .db " Command Aborted!\r",0
1139 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1140 ; 2k page boundry must exist between these dividers ;
1141 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1144 oprt: ajmp opcd1 ;addr11
1146 ajmp opcd3 ;A,direct
1149 ajmp opcd6 ;direct,A
1150 ajmp opcd7 ;direct,#data
1153 ajmp opcd10 ;A,direct,rel
1154 ajmp opcd11 ;A,#data,rel
1155 ajmp opcd12 ;Rn,#data,rel
1156 ajmp opcd13 ;@Ri,#data,rel
1164 ajmp opcd21 ;direct,rel
1167 ajmp opcd24 ;bit,rel
1169 ajmp opcd26 ;@A+DPTR
1172 ajmp opcd29 ;Rn,direct
1173 ajmp opcd30 ;Rn,#data
1174 ajmp opcd31 ;direct,Rn
1175 ajmp opcd32 ;direct,direct
1176 ajmp opcd33 ;direct,@Ri
1178 ajmp opcd35 ;@Ri,direct
1179 ajmp opcd36 ;@Ri,#data
1181 ajmp opcd38 ;DPTR,#data16
1182 ajmp opcd39 ;A,@A+DPTR
1183 ajmp opcd40 ;A,@A+PC
1184 ajmp opcd41 ;A,@DPTR
1185 ajmp opcd42 ;@DPTR,A
1186 ajmp opcd43 ; <nothing>
1210 pdir1: mov dptr,#sfrmnu
1236 mov dptr,#bitptr ;it's a Special Function Reg.
1246 pbit1: mov a,r0 ;it's between 20h and 2Fh
1280 opcd1: mov a,r6 ;addr11 done
1296 opcd3: ;A,direct done
1304 opcd5: ;A,#data done
1311 opcd6: ;direct,A done
1316 opcd7: ;direct,#data done
1333 opcd10: ;A,direct,rel done
1336 opcd10a:acall pcomma
1341 opcd11: ;A,#data,rel done
1343 opcd11a:acall pcomma
1348 opcd12: ;Rn,#data,rel done
1351 opcd13: ;@Ri,#data,rel done
1363 opcd17: ;direct done
1374 opcd20: ;Rn,rel done
1379 opcd21: ;direct,rel done
1388 opcd24: ;bit,rel done
1394 opcd26: ;@A+DPTR done
1406 opcd29: ;Rn,direct done
1411 opcd30: ;Rn,#data done
1414 opcd31: ;direct,Rn done
1419 opcd32: ;direct,direct done
1430 opcd33: ;direct,@Ri done
1440 opcd35: ;@Ri,direct done
1445 opcd36: ;@Ri,#data done
1453 opcd38: ;DPTR,#data16 done
1457 opcd27: mov a,r4 ;addr16 done
1462 opcd39: ;A,@A+DPTR done
1470 opcd40: ;A,@A+PC done
1480 opcd41: ;A,@DPTR done
1485 opcd42: ;@DPTR,A done
1490 opcd43: ret ;<nothing> done
1492 pat: ;prints the '@' symbol
1496 pcomma: ;prints a comma
1501 plb: ;prints the '#' symbol
1528 clr psw.3 ;set for register bank 0 (init needs it)
1531 setb ti ;ti is normally set in this program
1532 clr ri ;ri is normallt cleared
1552 lCALL CIN ;GET THE INPUT CHARACTER
1556 MOV DPTR,#CMD_TBL ;BEGIN SEARCH THRU THE TABLE
1559 JZ MENU3 ;JUMP IF END OF TABLE REACHED
1560 CJNE A,CHAR,MENU2 ;JUMP IF THIS IS NOT THE COMMAND TYPED
1561 INC DPTR ;OK, SO THIS IS THE RIGHT ONE...
1573 lCALL PSTR ;PRINT THE COMMAND NAME
1594 RET ;SIMULATED CALL TO THE ROUTINE
1596 MENU2: INC DPTR ;SKIP THIS TABLE ENTRY
1602 MENU3: POP DPH ;NOW WE TELL 'EM THEY TYPED
1603 POP DPL ;AN ILLEGAL CHARACTER
1608 ;this prints the instructions for status and skip in single-step
1609 inst: mov a,r1 ;r0 must point to pc
1623 mov dph,@r0 ;put pc into dptr for disasm
1646 ;---------------------------------------------------------;
1648 ; Here begins the data tables and strings: ;
1650 ;---------------------------------------------------------;
1653 .db 12,"Welcome to the new and possibly even "
1654 .db "improved 8031 monitor/debugger\r"
1655 .db "by Paul Stoffregen on 14-OCT-91 "
1656 .db "for no good reason whatsoever...\r\r"
1657 ;columbs 1234567890123456789012345678901234567890
1658 .db "These are some of the features offered "
1659 .db "by this particular debugger:\r\r"
1660 .db " Download programs from PC "
1661 .db "User-Friendliness!!!!!\r"
1663 .db "Uses no external RAM\r"
1664 .db " (Normal, or single-step) "
1665 .db "<ESC> key is supported\r"
1666 .db " List assemble code from memory "
1667 .db "automatic baud rate detection\r"
1668 .db " Hex Dump and Edit external RAM "
1669 .db "On-line help (type '?')\r"
1670 .db "\rHowever, you don't get somethin' for "
1671 .db "nothin'... The code for this debugger\r"
1672 .db "requires quite a bit more room than is "
1673 .db "typical for a debugger, but it will all\r"
1674 .db "fit into a 2764 (8K x 8) EPROM.\r"
1675 .db "\rNO Copyright!! Please distribute freely. "
1676 .db "Make as many copies as you want.\r\r\r",0
1678 mnu_tbl:.db "ACAL",'L'+128 ;comma is ok
1679 .db "AD",'D'+128,' '
1724 bitmnu: .db 'P','0'+128
1742 sfrmnu: .db 0xE0,"AC",'C'+128
1743 .db 0x81,'S','P'+128
1744 .DB 0x82,"DP",'L'+128
1745 .DB 0x83,"DP",'H'+128
1746 .DB 0x80,'P','0'+128
1747 .DB 0x90,'P','1'+128
1748 .DB 0xA0,'P','2'+128
1749 .DB 0xB0,'P','3'+128
1750 .DB 0x99,"SBU",'F'+128
1751 .DB 0xCD,"TH",'2'+128
1752 .DB 0xC8,"T2CO",'N'+128
1753 .DB 0xCC,"TL",'2'+128
1754 .DB 0xCB,"RCAP2",'H'+128
1755 .DB 0xCA,"RCAP2",'L'+128
1756 .DB 0x8C,"TH",'0'+128
1757 .DB 0x8A,"TL",'0'+128
1758 .DB 0x8D,"TH",'1'+128
1759 .DB 0x8B,"TL",'1'+128
1760 sfr1: .db 0xF0,'B'+128 ;5
1761 sfr2: .db 0xD0,"PS",'W'+128 ;7
1762 sfr3: .DB 0xA8,'I','E'+128
1763 sfr4: .DB 0xB8,'I','P'+128
1764 sfr5: .DB 0x89,"TMO",'D'+128 ;8
1765 sfr6: .DB 0x88,"TCO",'N'+128 ;8
1766 sfr7: .DB 0x98,"SCO",'N'+128 ;8
1767 sfr8: .DB 0x87,"PCO",'N'+128 ;8
1771 mnot: ;mnunonic offset table (gives offset into above table)
1773 .db 5Ah,0Eh,48h,73h,2Bh,2Bh,2Bh,2Bh
1774 .DB 2Bh,2Bh,2Bh,2Bh,2Bh,2Bh,2Bh,2Bh ;INC
1775 .DB 30h,00h,43h,75h,21h,21h,21h,21h
1776 .DB 21h,21h,21h,21h,21h,21h,21h,21h ;DEC
1777 .DB 2Eh,0Eh,67h,6Eh,06h,06h,06h,06h
1778 .DB 06h,06h,06h,06h,06h,06h,06h,06h ;ADD
1779 .DB 38h,00h,6Ah,70h,0Ah,0Ah,0Ah,0Ah
1780 .DB 0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah ;ADDC
1781 .DB 33h,0Eh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh
1782 .DB 5Dh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh ;ORL
1783 .DB 3Bh,00h,12h,12h,12h,12h,12h,12h
1784 .DB 12h,12h,12h,12h,12h,12h,12h,12h ;ANL
1785 .DB 41h,0Eh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh
1786 .DB 8Fh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh ;XLR
1787 .DB 3Eh,00h,5Dh,35h,4Ch,4Ch,4Ch,4Ch
1788 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1789 .DB 7Ch,0Eh,12h,4Fh,24h,4Ch,4Ch,4Ch
1790 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1791 .DB 4Ch,00h,4Ch,4Fh,80h,80h,80h,80h
1792 .DB 80h,80h,80h,80h,80h,80h,80h,80h ;SUBB
1793 .DB 5Dh,0Eh,4Ch,2Bh,57h,92h,4Ch,4Ch
1794 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1795 .DB 12h,00h,1Ch,1Ch,15h,15h,15h,15h
1796 .DB 15h,15h,15h,15h,15h,15h,15h,15h ;CJNE
1797 .DB 63h,0Eh,19h,19h,84h,88h,88h,88h
1798 .DB 88h,88h,88h,88h,88h,88h,88h,88h ;XCH
1799 .DB 60h,00h,78h,78h,1Fh,27h,8Bh,8Bh
1800 .DB 27h,27h,27h,27h,27h,27h,27h,27h ;DJNZ
1801 .DB 53h,0Eh,53h,53h,19h,4Ch,4Ch,4Ch
1802 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1803 .DB 53h,00h,53h,53h,1Ch,4Ch,4Ch,4Ch
1804 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1806 bitptr: .db 00h,02h,06h,08h,0Ch,0Eh,10h,12h
1807 .db 14h,16h,1Bh,1Eh,20h,23h,24h,25h
1809 opot: ;opcode offset table (gives #bytes for the instruction
1810 ;and the number of the routine to print the operands)
1812 .db 43*4+1,1*4+2,27*4+3,14*4+1 ;00
1813 .db 14*4+1,17*4+2,18*4+1,18*4+1
1814 .db 89,89,89,89,89,89,89,89 ;inc
1815 .db 24*4+3,1*4+2,27*4+3,14*4+1 ;10
1816 .db 14*4+1,17*4+2,18*4+1,18*4+1
1817 .db 89,89,89,89,89,89,89,89 ;dec
1818 .db 24*4+3,1*4+2,43*4+1,14*4+1 ;20
1819 .db 5*4+2,3*4+2,4*4+1,4*4+1
1820 .db 9,9,9,9,9,9,9,9 ;add
1821 .db 24*4+3,1*4+2,43*4+1,14*4+1 ;30
1822 .db 5*4+2,3*4+2,4*4+1,4*4+1
1823 .db 9,9,9,9,9,9,9,9 ;addc
1824 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;40
1825 .db 5*4+2,3*4+2,4*4+1,4*4+1
1826 .db 9,9,9,9,9,9,9,9 ;orl
1827 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;50
1828 .db 5*4+2,3*4+2,4*4+1,4*4+1
1829 .db 9,9,9,9,9,9,9,9 ;anl
1830 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;60
1831 .db 5*4+2,3*4+2,4*4+1,4*4+1
1832 .db 9,9,9,9,9,9,9,9 ;xrl
1833 .db 25*4+2,1*4+2,8*4+2,26*4+1 ;70
1834 .db 5*4+2,7*4+3,36*4+2,33*4+2
1835 .db 122,122,122,122,122,122,122,122 ;mov
1836 .db 25*4+2,1*4+2,34,40*4+1 ;80
1837 .db 19*4+1,32*4+3,33*4+2,33*4+2
1838 .db 126,126,126,126,126,126,126,126 ;mov
1839 .db 38*4+3,1*4+2,37*4+2,39*4+1 ;90
1840 .db 5*4+2,3*4+2,4*4+1,4*4+1
1841 .db 9,9,9,9,9,9,9,9 ;subb
1842 .db 9*4+2,1*4+2,8*4+2,23*4+1 ;A0
1843 .db 19*4+1,43*4+1,35*4+2,35*4+2
1844 .db 118,118,118,118,118,118,118,118 ;mov
1845 .db 9*4+2,1*4+2,16*4+2,15*4+1 ;B0
1846 .db 11*4+3,10*4+3,13*4+3,13*4+3
1847 .db 51,51,51,51,51,51,51,51 ;cjne
1848 .db 17*4+2,1*4+2,16*4+2,15*4+1 ;C0
1849 .db 14*4+1,3*4+2,4*4+1,4*4+1
1850 .db 9,9,9,9,9,9,9,9 ;xch
1851 .db 17*4+2,1*4+2,16*4+2,15*4+1 ;D0
1852 .db 14*4+1,21*4+3,4*4+1,4*4+1
1853 .db 82,82,82,82,82,82,82,82 ;djnz
1854 .db 41*4+1,1*4+2,4*4+1,4*4+1 ;E0
1855 .db 14*4+1,3*4+2,4*4+1,4*4+1
1856 .db 9,9,9,9,9,9,9,9 ;mov
1857 .db 42*4+1,1*4+2,34*4+1,34*4+1 ;F0
1858 .db 14*4+1,6*4+2,34*4+1,34*4+1
1859 .db 113,113,113,113,113,113,113,113 ;mov
1861 edits1: .db "\rEditing External RAM...<ESC> to quit\r",0
1862 edits2: .db " Editing finished, this location unchanged\r\r",0
1863 dwlds1: .db "\r\rBegin ascii transmission of "
1864 .db "Intel HEX format file, "
1865 .db "or <ESC> to abort\r\r",0
1866 dwlds2: .db "Download aborted by user\r\r",0
1867 dwlds3: .db "\r\r\r\rDownload completed\r\r",0
1868 runstd: .db "Run normally",0
1869 runs1: .db "\rNow running the program...\r\r",0
1870 runss: .db "Run in single step mode",0
1871 sserr1: .db "\r\rThe single step run feature will not function"
1872 .db " unless INT1 (pin #13) is\r"
1873 .db "connected to ground or otherwise held low.\r\r",0
1874 ssmsg: .db "\rNow running in single step mode: "
1875 .db "<RET>=default, ?=Help\r\r",0
1876 sskip1: .db "Skipping ------>",0
1877 sskip2: .db "Next will be -->",0
1878 ssdmps1:.db "\rLoc: Internal Ram Memory Contents\r",0
1879 chaccs1:.db "New Acc Value: ",0
1880 squit: .db "\rQuit single step mode, now running normally.\r\r",0
1904 CMD_run:.db " Run program",0
1905 CMD_new:.db " New memory location",0
1906 CMD_dmp:.db " HEX Dump Memory to the Screen",0
1907 CMD_lst:.db " List assembly code",0
1908 CMD_hlp:.DB " Help???",0
1909 CMD_dwl:.Db " Download program from PC",0
1910 CMD_edt:.db " Edit external ram",0
1912 .db 12,"These commands are currently "
1913 .db "supported:\r\r",0
1915 ; 1234567890123456789012345678901234567890
1916 .db "\rAll numerical values are shown in hex. "
1918 .db "Pressing <ESC> key will exit the\r"
1919 .db "current command, even while listing/dumping. "
1920 .db "Most prompts require a\r"
1921 .db "single character, typically the first letter "
1922 .db "of the desired option.\r\rFor information "
1923 .db "regarding the single-step run feature,\r"
1924 .db "type '?' when asked 'Single-step/Normal' "
1925 .db "before running the program.\r\r",0
1927 ; 1234567890123456789012345678901234567890
1928 .db 12,"The single step run feature allows you "
1929 .db "to execute your program from memory\r" ;1
1930 .db "one instruction at a time, while monitoring "
1931 .db "the registers and instructions.\r" ;2
1932 .db "It it NOT a simulation, the program is "
1933 .db "executed by the 8031/51 processor.\r" ;3
1934 .db "External Interrupt #1 must be held low "
1935 .db "to make the single step function.\r" ;4
1937 .db "Despite attempts to make the single "
1938 .db "step run compatible with all programs,\r" ;6
1939 .db "there will always be some basic limitations "
1940 .db "due to its nature:\r\r" ;7 8
1941 .db " 1- External Interrupt #1 must not be"
1942 .db " disabled, e.g. MOV IE,#81h\r" ;9
1943 .db " 2- Timer #1 must be correctly generating "
1944 .db " the baud rate for the serial port\r" ;10
1945 .db " 3- TI and RI will not work normally, "
1946 .db "e.g. 2003: JNB RI,2003, use skip...\r" ;11
1947 .db " 4- Interrupts will not get service "
1948 .db "or will interrupt the single step\r" ;12
1949 .db " 5- About 30 bytes of space must be "
1950 .db "left available on the stack!\r" ;13
1951 .db " 6- ??? Other problems may also "
1952 .db "exist, (this program is FREE, you know)\r" ;14
1953 ; 1234567890123456789012345678901234567890
1955 .db "Perhaps the worst limitation of the "
1956 .db "single step run is that it takes a\r" ;16
1957 .db "very long time to execute even short "
1958 .db "pieces of code. It is recommended that\r" ;17
1959 .db "a normal run be attempted first to "
1960 .db "estimate where the program goes astray,\r" ;18
1961 .db "the attempt a single step at the beginning "
1962 .db "of the questionable code, with a\r" ;19
1963 .db "hardcopy of the assembly listing file "
1964 .db "on-hand for memory location reference.\r\r",0 ;20 21
1967 ; 1234567890123456789012345678901234567890
1969 .db 12,"Between steps, the monitor uses absolutely "
1970 .db "NO internal or external memory.\r"
1971 .db "However, about 30 bytes of stack space "
1972 .db "must be left available...\r\r"
1973 .db "During a single step run, pressing RETURN "
1974 .db "repeatedly will be the usual course\r"
1975 .db "of action. However, other options are "
1976 .db "available.\r\r"
1978 .db "Typing '?' will display this help screen\r\r",0
1981 .db "Single Step Commands:\r\r"
1982 .db " <RET> Print Status and execute "
1983 .db "the next instruction\r"
1984 .db " <SPACE> Execute next instruction w/out status lines\r"
1985 .db " '?' Display this on-line help\r"
1986 .db " 'R' Print out Special Function Registers\r"
1987 .db " 'H' Hex dump internal ram\r"
1988 .db " 'S' Skip this instruction\r"
1989 .db " 'A' Change the Accumulator's value\r"
1990 .db " 'Q' Quit Single Step, continue executing normally\r"