1 ; PAULMON 8051 Debugger by Paul Stoffregen
2 ; Please distribute freely -- may not be sold, period.
4 ; .command +h58 ;set page height to 58 in listing file...
6 .equ start,0000h ;address for start of EPROM (0000h)
7 .equ program,2000h ;address for program loading location
12 .org start+3 ;ext int #0
14 .org start+11 ;timer #0
16 .org start+13h ;external interrupt routine #1
18 ljmp program+13h ;don't do ssrun if edge trigger'd
19 intr0: ajmp step ;but do ssrun if level trigger'd
20 .org start+1bh ;timer #1
22 .org start+23h ;serial port
24 .org start+2bh ;timer #2 (8052 only)
28 .org start+30h ;the jump table
40 step: ;this is the single step interrupt processor code...
41 push psw ;better save these while we still can
43 clr psw.3 ;gotta be set to bank zero...
47 step2: cjne a,#13,step7
49 step7: cjne a,#32,step8 ;check space
51 step8: cjne a,#'?',step10 ;check '?'
54 step10: cjne a,#'Q',step11 ;check 'Q'=quit and run normal
63 step11: cjne a,#'H',step12 ;check 'H'=hex dump internal ram
66 step12: cjne a,#'R',step13 ;check 'R'=print out registers
68 step13: cjne a,#'S',step14 ;check 'S'=skip this inst
70 step14: cjne a,#'A',step20 ;check 'A'=change acc value
80 status: ;prints two-line status during single step run
149 acall space ;now begin printing the 2nd line
321 lcall inst ;print skipped instruction r0 points to pc
326 mov @r0,dph ;actually change the pc!
332 lcall inst ;print new instruction
361 chacc2: mov dptr,#abort
370 DownLoad: ;Note, this is a modified version of the
371 ;auto baud rate detection routine from
372 ;MDP/51. Thank You, Kei-Yong Khoo (3-31-87)
376 acall pstr ;"begin sending file <ESC> to abort"
378 CJNE A, #27, DWLD0 ; Test for escape
379 dwldesc:mov dptr,#dwlds2
380 acall pstr ;"download aborted."
385 CJNE a, #0x3A, DWLD0a ; wait for ':'
388 MOV R0, A ; R0 = # of data bytes
391 MOV DPH, A ; High byte of load address
394 MOV DPL, A ; Low byte of load address
395 ACALL ghex ; Record type
397 CJNE A, #1, DWLD1 ; End record?
399 acall pstr ;"download went ok..."
403 DWLD1: INC R0 ; adjust for repeat loop
405 DWLD2: ACALL ghex ; Get data byte
409 DWLD3: DJNZ R0, DWLD2
410 ACALL ghex ; Discard checksum
414 INIT: ;Note, this is a modified version of the
415 ;auto baud rate detection routine from
416 ;MDP/51. Thank You, Kei-Yong Khoo (3-31-87)
417 orl PCON,#10000000b ; set double baud rate
419 MOV SCON,#01010000b ; Set Serial for mode 1 &
421 ORL TCON,#01010010b ; Start timer 1 both timer
432 sjmp autoend ;baud rate is known from last time...
433 AUTO: CLR TR1 ; Stop timer 1
434 MOV TH1, #0 ; Clear timer 1
436 JB RXD, * ; Wait for start bit
437 JB RXD,AUTO ; make sure it's not just noise
441 JNB RXD, * ; skip start bit
446 JNB RXD, * ; Count 3 more bits
449 MOV A, TL1 ; divide TH1-TL1 by 128
454 INC A ; 2's complement
455 mov b,a ; store the reload value four times
456 mov 7Bh,a ;so that it might be there later
457 xrl a,#01010101b ;we'll store the reload value
458 mov 7Ah,a ;four times, just to be safe
467 mov tmod,#00100001b ;now it's 8 bit auto-reload
478 help0: movc a,@a+dptr
487 movc a,@a+dptr ;(high)
491 movc a,@a+dptr ;(low)
505 help_2: mov dptr,#help2txt
519 mov dptr,#abort ;if they press <ESC>
524 run1: cjne a,#'?',run3
525 mov dptr,#help3txt ;if they pressed ?
534 run2: mov dptr,#help4txt
541 run3: cjne a,#'S',run4
545 run4: mov dptr,#runstd
547 mov dptr,#prompt8 ;run the user's program
577 ret ;<-- actually jumps to user's program
580 ssrun: mov dptr,#prompt8 ;run single step
603 mov dptr,#sserr1 ;give error msg if int1 not grounded
608 ssrun2: mov dptr,#prompt9 ;ask for priority
618 ssrun3: cjne a,#'L',ssrun4
621 ssrun4: mov ip,#00000100b
622 ssrun5: mov dptr,#ssmsg ;tell 'em it now time, remind to
623 acall pstr ;to hit <RET> for next inst
650 mov r2,#16 ;number of lines to print
652 dump1: mov r0,#20h ;pointer to memory to store bytes
658 dump2: clr A ;<--acquire 16 bytes
659 movc a,@a+dptr ;and store from 20 to 2F
668 mov r0,#20h ;now we'll print it in ascii
670 anl a,#01111111b ;avoid unprintable characters
683 djnz r2,dump1 ;loop back up to print next line
704 newloc1:mov dptr,#abort
711 edit: ;edit external ram...
739 edit2: mov dptr,#edits2
745 list: ;prints out dis-assembly list of memory
746 mov r2,#18 ;# of lines to list
750 acall disasm ;this obviously does all the work
762 JNB RI,cin ; wait for character
767 COUT: ;note, improved... much faster transmission
768 jnb ti,* ;wait if a character is still sending
770 CLR TI ;note: hardware will set ti when the
771 RET ; character finishes sending...
773 esc: ;checks to see if <ESC> is waiting on serial port.
774 ;C=clear if no <ESC>, C=set if <ESC> pressed, buffer flushed
792 g1hex: ;gets one character. Converts to hex and places in Acc
793 ;C=1 if <ESC> pressed, 0 otherwise
794 ;PSW.5=1 if <RET> pressed, 0 otherwise
795 ;PSW.2=1 if backspace or delete, 0 otherwise (not yet)
804 g1hex2: cjne a,#27,g1hex2a
807 g1hex2a:cjne a,#8,g1hex2c
810 g1hex2c:cjne a,#127,g1hex3
815 jc g1hex4 ;they typed a bad char, so go back
824 ghex: ; gets an 8-bit hex value from keyboard, returned in A.
825 ; C=1 if <ESC> pressed, 0 otherwise
826 ; PSW.5 if <RET> pressed w/ no input, 0 otherwise
852 ghex16: ; gets a 16-bit hex value from keyboard, returned in DPTR.
853 ; C=0 if normal <RET>, C=1 if <ESC> pressed
864 ghex16a:acall g1hex ;get first character
869 ghex16e:acall g1hex ;get second character
877 ghex16i:acall g1hex ;get third character
885 ghex16m:acall g1hex ;get fourth character
893 ghex16s:mov dph,#0 ;one digit entered
896 ghex16t:mov dph,#0 ;two digit entered
902 ghex16u:mov dph,r0 ;three digit entered
908 ghex16v:mov a,r0 ;all four digit entered
916 ghex16z:pop acc ;exit, at last...
941 .DB "0123456789ABCDEF"
943 asc2hex: ;carry set if invalid input
955 anl a,#11110000b ;just in case...
962 upper: ;converts the ascii code in Acc to uppercase, if it is lowercase
967 jc upper1; not a lowercase character
1002 jnb ti,* ;wait for last character to finish sending
1017 disasm: ;prints out instruction @dptr, and advances dptr
1018 acall phex16 ;they'd like to know the address...
1025 mov dptr,#mnot ;mnot=mnunonic offset table
1029 mov dptr,#opot ;opot=operand offset table
1031 mov r6,a ;these 2 tables are a bitch to enter!!!
1045 movc a,@a+dptr ;fetch 2nd byte (if nec)
1052 movc a,@a+dptr ;fetch 3rd byte (if nec)
1055 disasm1:acall disasm4 ;prints the bytes+spaces
1058 mov dptr,#mnu_tbl ;mnu_tlb: table with actual text...
1059 acall disasm5 ;prints the mnenonic+spaces
1066 mov r6,a ;(high) in case of ajmp or acall or rel
1073 mov b,#dasm2 & 0xff ;(low)
1075 mov b,#dasm2 / 256 ;(high)
1077 mov dptr,#oprt ;oprt=operand routine table
1084 disasm4:mov a,#':' ;print bytes and some punctuation
1106 disasm5:mov r0,#7+1 ;prints the mnunonic+spaces
1121 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1122 ; 2k page boundry must exist between these dividers ;
1123 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1126 prompt1:.db ">Loc=",0
1127 prompt2:.db ": (Version 1.0) Command>",0
1128 prompt3:.db "Location (",0
1129 prompt4:.db "=Default): ",0
1130 prompt5:.db "New memory pointer location: ",0
1131 prompt6:.db "\rS=Single Step, N=Normal (default), ?=Help >",0
1132 prompt7:.db "Press any key: ",0
1133 prompt8:.db "\r\rRun from memory loaction (",0
1134 prompt9:.db "\r\rInterrupt priority> "
1135 .db "L=Low, H=High (default): ",0
1136 prompt10:.db ") New Value: ",0
1137 abort: .db " Command Aborted!\r",0
1140 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1141 ; 2k page boundry must exist between these dividers ;
1142 ;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-;
1145 oprt: ajmp opcd1 ;addr11
1147 ajmp opcd3 ;A,direct
1150 ajmp opcd6 ;direct,A
1151 ajmp opcd7 ;direct,#data
1154 ajmp opcd10 ;A,direct,rel
1155 ajmp opcd11 ;A,#data,rel
1156 ajmp opcd12 ;Rn,#data,rel
1157 ajmp opcd13 ;@Ri,#data,rel
1165 ajmp opcd21 ;direct,rel
1168 ajmp opcd24 ;bit,rel
1170 ajmp opcd26 ;@A+DPTR
1173 ajmp opcd29 ;Rn,direct
1174 ajmp opcd30 ;Rn,#data
1175 ajmp opcd31 ;direct,Rn
1176 ajmp opcd32 ;direct,direct
1177 ajmp opcd33 ;direct,@Ri
1179 ajmp opcd35 ;@Ri,direct
1180 ajmp opcd36 ;@Ri,#data
1182 ajmp opcd38 ;DPTR,#data16
1183 ajmp opcd39 ;A,@A+DPTR
1184 ajmp opcd40 ;A,@A+PC
1185 ajmp opcd41 ;A,@DPTR
1186 ajmp opcd42 ;@DPTR,A
1187 ajmp opcd43 ; <nothing>
1211 pdir1: mov dptr,#sfrmnu
1237 mov dptr,#bitptr ;it's a Special Function Reg.
1247 pbit1: mov a,r0 ;it's between 20h and 2Fh
1281 opcd1: mov a,r6 ;addr11 done
1297 opcd3: ;A,direct done
1305 opcd5: ;A,#data done
1312 opcd6: ;direct,A done
1317 opcd7: ;direct,#data done
1334 opcd10: ;A,direct,rel done
1337 opcd10a:acall pcomma
1342 opcd11: ;A,#data,rel done
1344 opcd11a:acall pcomma
1349 opcd12: ;Rn,#data,rel done
1352 opcd13: ;@Ri,#data,rel done
1364 opcd17: ;direct done
1375 opcd20: ;Rn,rel done
1380 opcd21: ;direct,rel done
1389 opcd24: ;bit,rel done
1395 opcd26: ;@A+DPTR done
1407 opcd29: ;Rn,direct done
1412 opcd30: ;Rn,#data done
1415 opcd31: ;direct,Rn done
1420 opcd32: ;direct,direct done
1431 opcd33: ;direct,@Ri done
1441 opcd35: ;@Ri,direct done
1446 opcd36: ;@Ri,#data done
1454 opcd38: ;DPTR,#data16 done
1458 opcd27: mov a,r4 ;addr16 done
1463 opcd39: ;A,@A+DPTR done
1471 opcd40: ;A,@A+PC done
1481 opcd41: ;A,@DPTR done
1486 opcd42: ;@DPTR,A done
1491 opcd43: ret ;<nothing> done
1493 pat: ;prints the '@' symbol
1497 pcomma: ;prints a comma
1502 plb: ;prints the '#' symbol
1529 clr psw.3 ;set for register bank 0 (init needs it)
1532 setb ti ;ti is normally set in this program
1533 clr ri ;ri is normallt cleared
1553 lCALL CIN ;GET THE INPUT CHARACTER
1557 MOV DPTR,#CMD_TBL ;BEGIN SEARCH THRU THE TABLE
1560 JZ MENU3 ;JUMP IF END OF TABLE REACHED
1561 CJNE A,CHAR,MENU2 ;JUMP IF THIS IS NOT THE COMMAND TYPED
1562 INC DPTR ;OK, SO THIS IS THE RIGHT ONE...
1574 lCALL PSTR ;PRINT THE COMMAND NAME
1595 RET ;SIMULATED CALL TO THE ROUTINE
1597 MENU2: INC DPTR ;SKIP THIS TABLE ENTRY
1603 MENU3: POP DPH ;NOW WE TELL 'EM THEY TYPED
1604 POP DPL ;AN ILLEGAL CHARACTER
1609 ;this prints the instructions for status and skip in single-step
1610 inst: mov a,r1 ;r0 must point to pc
1624 mov dph,@r0 ;put pc into dptr for disasm
1647 ;---------------------------------------------------------;
1649 ; Here begins the data tables and strings: ;
1651 ;---------------------------------------------------------;
1654 .db 12,"Welcome to the new and possibly even "
1655 .db "improved 8031 monitor/debugger\r"
1656 .db "by Paul Stoffregen on 14-OCT-91 "
1657 .db "for no good reason whatsoever...\r\r"
1658 ;columbs 1234567890123456789012345678901234567890
1659 .db "These are some of the features offered "
1660 .db "by this particular debugger:\r\r"
1661 .db " Download programs from PC "
1662 .db "User-Friendliness!!!!!\r"
1664 .db "Uses no external RAM\r"
1665 .db " (Normal, or single-step) "
1666 .db "<ESC> key is supported\r"
1667 .db " List assemble code from memory "
1668 .db "automatic baud rate detection\r"
1669 .db " Hex Dump and Edit external RAM "
1670 .db "On-line help (type '?')\r"
1671 .db "\rHowever, you don't get somethin' for "
1672 .db "nothin'... The code for this debugger\r"
1673 .db "requires quite a bit more room than is "
1674 .db "typical for a debugger, but it will all\r"
1675 .db "fit into a 2764 (8K x 8) EPROM.\r"
1676 .db "\rNO Copyright!! Please distribute freely. "
1677 .db "Make as many copies as you want.\r\r\r",0
1679 mnu_tbl:.db "ACAL",'L'+128 ;comma is ok
1680 .db "AD",'D'+128,' '
1725 bitmnu: .db 'P','0'+128
1743 sfrmnu: .db 0xE0,"AC",'C'+128
1744 .db 0x81,'S','P'+128
1745 .DB 0x82,"DP",'L'+128
1746 .DB 0x83,"DP",'H'+128
1747 .DB 0x80,'P','0'+128
1748 .DB 0x90,'P','1'+128
1749 .DB 0xA0,'P','2'+128
1750 .DB 0xB0,'P','3'+128
1751 .DB 0x99,"SBU",'F'+128
1752 .DB 0xCD,"TH",'2'+128
1753 .DB 0xC8,"T2CO",'N'+128
1754 .DB 0xCC,"TL",'2'+128
1755 .DB 0xCB,"RCAP2",'H'+128
1756 .DB 0xCA,"RCAP2",'L'+128
1757 .DB 0x8C,"TH",'0'+128
1758 .DB 0x8A,"TL",'0'+128
1759 .DB 0x8D,"TH",'1'+128
1760 .DB 0x8B,"TL",'1'+128
1761 sfr1: .db 0xF0,'B'+128 ;5
1762 sfr2: .db 0xD0,"PS",'W'+128 ;7
1763 sfr3: .DB 0xA8,'I','E'+128
1764 sfr4: .DB 0xB8,'I','P'+128
1765 sfr5: .DB 0x89,"TMO",'D'+128 ;8
1766 sfr6: .DB 0x88,"TCO",'N'+128 ;8
1767 sfr7: .DB 0x98,"SCO",'N'+128 ;8
1768 sfr8: .DB 0x87,"PCO",'N'+128 ;8
1772 mnot: ;mnunonic offset table (gives offset into above table)
1774 .db 5Ah,0Eh,48h,73h,2Bh,2Bh,2Bh,2Bh
1775 .DB 2Bh,2Bh,2Bh,2Bh,2Bh,2Bh,2Bh,2Bh ;INC
1776 .DB 30h,00h,43h,75h,21h,21h,21h,21h
1777 .DB 21h,21h,21h,21h,21h,21h,21h,21h ;DEC
1778 .DB 2Eh,0Eh,67h,6Eh,06h,06h,06h,06h
1779 .DB 06h,06h,06h,06h,06h,06h,06h,06h ;ADD
1780 .DB 38h,00h,6Ah,70h,0Ah,0Ah,0Ah,0Ah
1781 .DB 0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah,0Ah ;ADDC
1782 .DB 33h,0Eh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh
1783 .DB 5Dh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh,5Dh ;ORL
1784 .DB 3Bh,00h,12h,12h,12h,12h,12h,12h
1785 .DB 12h,12h,12h,12h,12h,12h,12h,12h ;ANL
1786 .DB 41h,0Eh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh
1787 .DB 8Fh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh,8Fh ;XLR
1788 .DB 3Eh,00h,5Dh,35h,4Ch,4Ch,4Ch,4Ch
1789 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1790 .DB 7Ch,0Eh,12h,4Fh,24h,4Ch,4Ch,4Ch
1791 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1792 .DB 4Ch,00h,4Ch,4Fh,80h,80h,80h,80h
1793 .DB 80h,80h,80h,80h,80h,80h,80h,80h ;SUBB
1794 .DB 5Dh,0Eh,4Ch,2Bh,57h,92h,4Ch,4Ch
1795 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1796 .DB 12h,00h,1Ch,1Ch,15h,15h,15h,15h
1797 .DB 15h,15h,15h,15h,15h,15h,15h,15h ;CJNE
1798 .DB 63h,0Eh,19h,19h,84h,88h,88h,88h
1799 .DB 88h,88h,88h,88h,88h,88h,88h,88h ;XCH
1800 .DB 60h,00h,78h,78h,1Fh,27h,8Bh,8Bh
1801 .DB 27h,27h,27h,27h,27h,27h,27h,27h ;DJNZ
1802 .DB 53h,0Eh,53h,53h,19h,4Ch,4Ch,4Ch
1803 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1804 .DB 53h,00h,53h,53h,1Ch,4Ch,4Ch,4Ch
1805 .DB 4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch,4Ch ;MOV
1807 bitptr: .db 00h,02h,06h,08h,0Ch,0Eh,10h,12h
1808 .db 14h,16h,1Bh,1Eh,20h,23h,24h,25h
1810 opot: ;opcode offset table (gives #bytes for the instruction
1811 ;and the number of the routine to print the operands)
1813 .db 43*4+1,1*4+2,27*4+3,14*4+1 ;00
1814 .db 14*4+1,17*4+2,18*4+1,18*4+1
1815 .db 89,89,89,89,89,89,89,89 ;inc
1816 .db 24*4+3,1*4+2,27*4+3,14*4+1 ;10
1817 .db 14*4+1,17*4+2,18*4+1,18*4+1
1818 .db 89,89,89,89,89,89,89,89 ;dec
1819 .db 24*4+3,1*4+2,43*4+1,14*4+1 ;20
1820 .db 5*4+2,3*4+2,4*4+1,4*4+1
1821 .db 9,9,9,9,9,9,9,9 ;add
1822 .db 24*4+3,1*4+2,43*4+1,14*4+1 ;30
1823 .db 5*4+2,3*4+2,4*4+1,4*4+1
1824 .db 9,9,9,9,9,9,9,9 ;addc
1825 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;40
1826 .db 5*4+2,3*4+2,4*4+1,4*4+1
1827 .db 9,9,9,9,9,9,9,9 ;orl
1828 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;50
1829 .db 5*4+2,3*4+2,4*4+1,4*4+1
1830 .db 9,9,9,9,9,9,9,9 ;anl
1831 .db 25*4+2,1*4+2,6*4+2,7*4+3 ;60
1832 .db 5*4+2,3*4+2,4*4+1,4*4+1
1833 .db 9,9,9,9,9,9,9,9 ;xrl
1834 .db 25*4+2,1*4+2,8*4+2,26*4+1 ;70
1835 .db 5*4+2,7*4+3,36*4+2,33*4+2
1836 .db 122,122,122,122,122,122,122,122 ;mov
1837 .db 25*4+2,1*4+2,34,40*4+1 ;80
1838 .db 19*4+1,32*4+3,33*4+2,33*4+2
1839 .db 126,126,126,126,126,126,126,126 ;mov
1840 .db 38*4+3,1*4+2,37*4+2,39*4+1 ;90
1841 .db 5*4+2,3*4+2,4*4+1,4*4+1
1842 .db 9,9,9,9,9,9,9,9 ;subb
1843 .db 9*4+2,1*4+2,8*4+2,23*4+1 ;A0
1844 .db 19*4+1,43*4+1,35*4+2,35*4+2
1845 .db 118,118,118,118,118,118,118,118 ;mov
1846 .db 9*4+2,1*4+2,16*4+2,15*4+1 ;B0
1847 .db 11*4+3,10*4+3,13*4+3,13*4+3
1848 .db 51,51,51,51,51,51,51,51 ;cjne
1849 .db 17*4+2,1*4+2,16*4+2,15*4+1 ;C0
1850 .db 14*4+1,3*4+2,4*4+1,4*4+1
1851 .db 9,9,9,9,9,9,9,9 ;xch
1852 .db 17*4+2,1*4+2,16*4+2,15*4+1 ;D0
1853 .db 14*4+1,21*4+3,4*4+1,4*4+1
1854 .db 82,82,82,82,82,82,82,82 ;djnz
1855 .db 41*4+1,1*4+2,4*4+1,4*4+1 ;E0
1856 .db 14*4+1,3*4+2,4*4+1,4*4+1
1857 .db 9,9,9,9,9,9,9,9 ;mov
1858 .db 42*4+1,1*4+2,34*4+1,34*4+1 ;F0
1859 .db 14*4+1,6*4+2,34*4+1,34*4+1
1860 .db 113,113,113,113,113,113,113,113 ;mov
1862 edits1: .db "\rEditing External RAM...<ESC> to quit\r",0
1863 edits2: .db " Editing finished, this location unchanged\r\r",0
1864 dwlds1: .db "\r\rBegin ascii transmission of "
1865 .db "Intel HEX format file, "
1866 .db "or <ESC> to abort\r\r",0
1867 dwlds2: .db "Download aborted by user\r\r",0
1868 dwlds3: .db "\r\r\r\rDownload completed\r\r",0
1869 runstd: .db "Run normally",0
1870 runs1: .db "\rNow running the program...\r\r",0
1871 runss: .db "Run in single step mode",0
1872 sserr1: .db "\r\rThe single step run feature will not function"
1873 .db " unless INT1 (pin #13) is\r"
1874 .db "connected to ground or otherwise held low.\r\r",0
1875 ssmsg: .db "\rNow running in single step mode: "
1876 .db "<RET>=default, ?=Help\r\r",0
1877 sskip1: .db "Skipping ------>",0
1878 sskip2: .db "Next will be -->",0
1879 ssdmps1:.db "\rLoc: Internal Ram Memory Contents\r",0
1880 chaccs1:.db "New Acc Value: ",0
1881 squit: .db "\rQuit single step mode, now running normally.\r\r",0
1905 CMD_run:.db " Run program",0
1906 CMD_new:.db " New memory location",0
1907 CMD_dmp:.db " HEX Dump Memory to the Screen",0
1908 CMD_lst:.db " List assembly code",0
1909 CMD_hlp:.DB " Help???",0
1910 CMD_dwl:.Db " Download program from PC",0
1911 CMD_edt:.db " Edit external ram",0
1913 .db 12,"These commands are currently "
1914 .db "supported:\r\r",0
1916 ; 1234567890123456789012345678901234567890
1917 .db "\rAll numerical values are shown in hex. "
1919 .db "Pressing <ESC> key will exit the\r"
1920 .db "current command, even while listing/dumping. "
1921 .db "Most prompts require a\r"
1922 .db "single character, typically the first letter "
1923 .db "of the desired option.\r\rFor information "
1924 .db "regarding the single-step run feature,\r"
1925 .db "type '?' when asked 'Single-step/Normal' "
1926 .db "before running the program.\r\r",0
1928 ; 1234567890123456789012345678901234567890
1929 .db 12,"The single step run feature allows you "
1930 .db "to execute your program from memory\r" ;1
1931 .db "one instruction at a time, while monitoring "
1932 .db "the registers and instructions.\r" ;2
1933 .db "It it NOT a simulation, the program is "
1934 .db "executed by the 8031/51 processor.\r" ;3
1935 .db "External Interrupt #1 must be held low "
1936 .db "to make the single step function.\r" ;4
1938 .db "Despite attempts to make the single "
1939 .db "step run compatible with all programs,\r" ;6
1940 .db "there will always be some basic limitations "
1941 .db "due to its nature:\r\r" ;7 8
1942 .db " 1- External Interrupt #1 must not be"
1943 .db " disabled, e.g. MOV IE,#81h\r" ;9
1944 .db " 2- Timer #1 must be correctly generating "
1945 .db " the baud rate for the serial port\r" ;10
1946 .db " 3- TI and RI will not work normally, "
1947 .db "e.g. 2003: JNB RI,2003, use skip...\r" ;11
1948 .db " 4- Interrupts will not get service "
1949 .db "or will interrupt the single step\r" ;12
1950 .db " 5- About 30 bytes of space must be "
1951 .db "left available on the stack!\r" ;13
1952 .db " 6- ??? Other problems may also "
1953 .db "exist, (this program is FREE, you know)\r" ;14
1954 ; 1234567890123456789012345678901234567890
1956 .db "Perhaps the worst limitation of the "
1957 .db "single step run is that it takes a\r" ;16
1958 .db "very long time to execute even short "
1959 .db "pieces of code. It is recommended that\r" ;17
1960 .db "a normal run be attempted first to "
1961 .db "estimate where the program goes astray,\r" ;18
1962 .db "the attempt a single step at the beginning "
1963 .db "of the questionable code, with a\r" ;19
1964 .db "hardcopy of the assembly listing file "
1965 .db "on-hand for memory location reference.\r\r",0 ;20 21
1968 ; 1234567890123456789012345678901234567890
1970 .db 12,"Between steps, the monitor uses absolutely "
1971 .db "NO internal or external memory.\r"
1972 .db "However, about 30 bytes of stack space "
1973 .db "must be left available...\r\r"
1974 .db "During a single step run, pressing RETURN "
1975 .db "repeatedly will be the usual course\r"
1976 .db "of action. However, other options are "
1977 .db "available.\r\r"
1979 .db "Typing '?' will display this help screen\r\r",0
1982 .db "Single Step Commands:\r\r"
1983 .db " <RET> Print Status and execute "
1984 .db "the next instruction\r"
1985 .db " <SPACE> Execute next instruction w/out status lines\r"
1986 .db " '?' Display this on-line help\r"
1987 .db " 'R' Print out Special Function Registers\r"
1988 .db " 'H' Hex dump internal ram\r"
1989 .db " 'S' Skip this instruction\r"
1990 .db " 'A' Change the Accumulator's value\r"
1991 .db " 'Q' Quit Single Step, continue executing normally\r"