CEGMON has some minimal debugging facilities.
The code I am trying to run is on the previous log. The command line for cl65 is:
cl65 --start-addr 0x300 -Wl -D,__HIMEM__=$2000,-D,__STACKSIZE__=$0200 -t osic1p -vm -m OSISDOS.map -o OSISDOS.o OSISDOS.c
This generates a verbose map file. The map file has addresses for each of the functions. The relevant functions are:
_exit 000315 LA _init 000300 LA _issueSDCardCommand 0003DC LA _main 000327 RLA _readBlock 000371 LA _readByteFromSDCard 00041C LA _setLBA0 000341 LA _setLBA1 000351 LA _setLBA2 000361 LA _waitSDCardRcvDataReady 0003FC LA _waitSDCardReady 0003EC LA _waitSDCardTxDataEmpty 00040C LA _writeBlock 00044B LA _writeByteToSDCard 000438 LA
CEGMON has the ability to load code, run code and set a breakpoint in the code. CEGMON can also display memory.
To load code:
- Connect to the serial port on Multicomp using Putty (115,200 baud, XON/XOFF handshake)
- Boot the Multicomp C1P
- Select M on the C1P keyboard the for Machine Code monitor
- Enter L on the C1P keyboard
- Copy/paste the .c1p file into a terminal window
- The code will start to run at 0x0300
- Should the program return to the monitor when the code is complete?
To run code enter the address (4-digits) then G for Go.
Debug Using Breakpoints
To debug code, insert a breakpoint at the address to stop at by entering Zaaaa where aaaa is the address to insert the breakpoint at. Then enter 0300G for Go at address 0x0300. The program will run until it hits the breakpoint and then will return to the Monitor prompt and display 00E0/aa. From the CEGMON manual:
At this point another breakpoint can be set using the Zaaaa as above.
Enter R to (re)start running from the breakpoint.
To dump a block of memory, use Taaaa,bbbb where aaaa is the start address and bbbb is the end address. CEGMON will insert the comma between the two numbers.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.