Shop OBEX P1 Docs P2 Docs Learn Events
P2 - Replacing the ROM Monitor/Debugger and calling from Spin or PASM — Parallax Forums

P2 - Replacing the ROM Monitor/Debugger and calling from Spin or PASM

Cluso99Cluso99 Posts: 18,069
edited 2020-05-02 05:48 in Propeller 2
Here is an example of replacing the ROM Monitor/Debug code so that it now uses the alternate registers $120-$12F instead of $1E0-$1EF which are now required by spin2.
Version 1.3 is the ROM version, and Version 1.4 is the soft-loaded version.

There are two examples. They run consecutively because of course there is only one smartpin block per pin. The Spin code runs first (accessing the Monitor), then the PASM code runs.
Each example calls the Monitor after printing/dumping using the Monitor calls. To return from the monitor, enter "Q<cr>" where Q is Quit. While in the monitor you can use any of the usual ROM commands.

Here is a sample of the output to the serial terminal program PST
P2-Monitor V1.4
Hi
Spin
43211234
01A00: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A10: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A20: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A30: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A40: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A50: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A60: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A70: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A80: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A90: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AA0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AB0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AC0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AD0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AE0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AF0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
00100: 5F AB 07 0B  E2 AB 43 07  12 9E 63 FD  11 A8 63 FD   '_.....C...c...c.'
00110: 88 0C 80 FD  A4 0C 80 FD  13 D0 63 FD  D5 A9 03 F6   '..........c.....'
00120: 5F AB 07 FB  D5 A9 8B F1  2D 00 64 5D  F7 D1 03 F1   '_.......-.d]....'
00130: E8 01 78 0C  D0 D1 03 F1  E8 01 78 0C  28 04 64 FD   '..x.......x.(.d.'
  000: 10 AC 03 F6  11 AE 03 F6  CC 0C A0 FD  28 1E 64 FD   '............(.d.'
  004: 00 00 6C FC  28 1E 60 FD  0D 00 68 FC  28 02 64 FD   '..l.(.`...h.(.d.'
  008: 0E 18 60 FC  28 1C 60 FD  06 00 00 FF  50 41 EC FC   '..`.(.`.....PA..'
  00C: F8 0F 00 00  C8 17 60 00  E8 17 00 00  07 01 00 00   '......`.........'
  010: FB 28 4D 01  40 DC B3 11  28 27 08 E0  D1 87 65 80   '.(M.@...('....e.'
  014: 0C 15 7A 04  B4 0C F8 0C  00 0D 9C 0D  B4 0D BC 0D   '..z.............'
  018: E0 0D 04 0E  04 0E 38 0E  38 0E 34 0E  34 0E 30 0E   '......8.8.4.4.0.'
  01C: 30 0E 20 0F  28 0F 68 0F  68 0F B0 0F  C4 0F 00 00   '0. .(.h.h.......'
P2-Monitor V1.4
*0-
  000: 10 AC 03 F6  11 AE 03 F6  CC 0C A0 FD  28 1E 64 FD   '............(.d.'
*q
S

P2-Monitor V1.4
Ho
Pasm
43211234
01A00: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A10: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A20: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A30: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A40: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A50: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A60: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A70: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A80: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01A90: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AA0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AB0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AC0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AD0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AE0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
01AF0: 00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00   '................'
00100: 5F AB 07 0B  E2 AB 43 07  12 9E 63 FD  11 A8 63 FD   '_.....C...c...c.'
00110: 88 0C 80 FD  A4 0C 80 FD  13 D0 63 FD  D5 A9 03 F6   '..........c.....'
00120: 5F AB 07 FB  D5 A9 8B F1  2D 00 64 5D  F7 D1 03 F1   '_.......-.d]....'
00130: E8 01 78 0C  D0 D1 03 F1  E8 01 78 0C  28 04 64 FD   '..x.......x.(.d.'
  000: 40 EA 7F E7  48 B1 7F 28  02 B1 3D B5  49 C9 38 E1   '@...H..(..=.I.8.'
  004: 53 90 01 01  04 70 2A 5B  4C DF 62 FF  2B D2 16 F0   'S....p*[L.b.+...'
  008: A0 77 18 68  90 AA DD 4A  1B 3E 3F A4  EE AB 3E 6A   '.w.h...J.>?...>j'
  00C: F7 4E 34 51  0F F0 33 57  6A CE 7B 1A  1F D6 2A 5E   '.N4Q..3Wj.{...*^'
  010: E2 1E 87 77  ED 9E 44 02  2B F6 F2 95  92 E8 0F AB   '...w..D.+.......'
  014: 78 6E 1C 5D  ED 6F 89 FB  08 AD 92 3A  CA EE F6 AB   'xn.].o.....:....'
  018: BA 60 D2 54  AC 15 AE 06  58 32 C9 93  10 7E FE A8   '.`.T....X2...~..'
  01C: 66 84 34 D5  D5 27 C5 8B  38 5C 41 BF  9D 7F 46 9B   'f.4..'..8\A...F.'
P2-Monitor V1.4
*0-
  000: 40 EA 7F E7  48 B1 7F 28  02 B1 3D B5  49 C9 38 E1   '@...H..(..=.I.8.'
*q
P
PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

Note: When calling the Monitor from PASM, you must use the absolute calling method " call #\mon.<routine>"
Sign In or Register to comment.