*************** * DO SINGLE STEP SSTEP JSR PCRLF STEP LDS SP RESTORE PROGRAM STACK POINTER TSX LDAA ,X LOAD CC ANDA #$EF CLEAR INTERUPT MASK BIT STAA ,X SAVE CC LDAB #$1F STPWAI DECB WAIT FOR EVENTUAL SCI XFER CMPB #$00 BEFORE TIMER INIT BNE STPWAI LDX #STOP SET INTERRUPT VECTOR STX TMOFVEC+1 LDX #$FFED RESET COUNTER VALUE STX COUNTHI LDX TIMECON CLEAR INTERRUPT BIT IN TIMER CTRL REG LDAA #$04 ENABLE TIMER OVERFLOW INTERRUPT STAA TIMECON RTI *************** * SINGLE STEP INTERRUPT ENTRY STOP STS SP SAVE PROGRAM STACK POINTER LDX #INTSEQ RESTORE INTERRUPT VECTOR STX TMOFVEC+1 LDX TIMECON CLEARS INTERRUPT BIT IN TIMER CTRL REG LDAA #$00 DISABLE TIMER INTERRUPT STAA TIMECON LDX SP EXTRACT PROGRAM STOP ADDRESS LDAB #6 ABX LDX ,X CPX #$C000 BHI STEP NO STOP IN ROM STX XTEMP LDAB XTEMP CMPB #$7F BEQ STEP NO STOP IN PAGE $7F LDX #STOPTX JSR PDATA JMP PRTREG PRINT REGS AND GO TO PROMPTMonitor 1.4.1 ($C000-$C7E8) - source - listing - s19
2015-12-03 05:48 UTC
This is a minor bug-fix release of the 1.4 monitor improving stability of the the single step function and improves stack handling and coherency in printout. This is the correct single step code. Silly me forgot to clear the interrupt mask on stack before RTI.
by Grant B 2018-02-01 22:30 UTC
Hi, I'm just looking at the Single Step code and was wondering about one instruction in particular (at least at the moment). Actually it occurs twice here it seems: LDX TIMECON ;CLEAR INTERRUPT BIT IN TIMER CTRL REG Even in page 0, isn't LDX a 16-bit read? Aren't you going to read $08 and $09? Any issues there? Did you need to burn an extra cycle or something? Thanks, GB
by Daniel 2018-02-04 00:31 UTC
Hi Grant! Thank you for spotting this. Good find! You are absolutely right. The register is 8-bit wide. The timing for this routine is the result of some extended trial and error. I remember in SSTEP I needed an extra cycle so doing an LDX was an easy way. Why it appears in other places is probably a silly cut-and-past mistake :)
by Grant B 2018-02-05 03:29 UTC
OK cool. I'm going to try a few things and I will start with your implementation first since it works. Then I might try and do a variation where the free-running counter is not modified but instead the output compare is used and generates an interrupt on adding a fixed value and then on a match triggering an output compare. I haven't thought it out any further though so I don't know if that generates an interrupt by itself or if I need to tie the OC pin to NMI or something. My target system uses overflow so I want to mess with that as little as possible in the Monitor. We'll see.
by Allen Bong 2019-12-01 02:40 UTC
Hi, I want to build your MC3 computer after reading about your cool project. I do have some 68B03 chips but don't have any HD6303 from Hitachi. Are there any difference between two of them or I can just substitute the 6303 with 6803? From your link I also found that Mr Eric Klaus was also doing a similar project. I will later adapt his assembler and disassembler in monitor once I get the 68B03 working. I also have some 68B09 from the old AXE-10 exchange which was later replaced with NGN equipments. Did you have a project on 6809? Allen
by Allen Bong 2019-12-07 15:19 UTC
Hi Daniel, I just made a stripped down version of your MC3 computer with just MC6803, 74ls138, 74ls04, 2716 eprom and a 74ls374 for output port configured at $C000. The eprom is at $f800-$ffff. There is no RAM at the moment so I set up Mode 2 and used the inner 128 bytes of RAM. I made the stack pointer pointing at $00ff and wrote a simple program to step LEDs from LSB to MSB. The program works fine as I introduced a simple delay using subroutine. I'd make the proper MC3 computer when my PCB arrived from eBay. I also ordered 2 pieces of 68B50 for the better serial comms. Allen
by Daniel 2019-12-07 16:35 UTC
Hi Allen! That is so cool! The MC6803 is very similar to the HD6303. Main difference is power consumption and a few extra instructions. I think I use the XGDX operation once in the MCFS kernel but the MC3 monitor should run just fine on the 6803. Otherwise the HD6303 should more or less be a drop-in replacement for the MC6803. I have done a few 6809 hardware projects in the past but sadly none of them are online. At some point I hope to publish something 6809 related. I have experimented with a 6809 co-processor board for the MC3 that allows the 6303 and 6809 to run independently with the 6303 handling the I/O. Meanwhile check out Tom's HD6309 Single Board Computer at https://hackaday.io/project/345-hd6309-singleboard-computer