Maker Pro
Maker Pro

MC6802 "WAI" Instruction

Hi,
In the attached disassembled ROM there are various WAI instructions, as I understand it the only way to move the program forward is with a interrupt?

What I can't work out is at the starting address 7000 there is a SEI instruction that masks the interrupts. As far as I can see the mask is not cleared in the program at any point.

Am I missing something that clears the mask??

Thanks for your help.
 

Attachments

  • Fire_Cracker.pdf
    110 KB · Views: 136
If the 6802 works like a 6809 ( a fair possibility) the WAI is being used as a synchronizer: it waits for a signal that WOULD interrupt, but for the SEI. Execution continues from that point with only 1-3 cycles(#?) of jitter.
It's useful if you have only a few time-critical inputs.
 
Hi,
In the attached disassembled ROM there are various WAI instructions, as I understand it the only way to move the program forward is with a interrupt?

What I can't work out is at the starting address 7000 there is a SEI instruction that masks the interrupts. As far as I can see the mask is not cleared in the program at any point.

Am I missing something that clears the mask??

Thanks for your help.

Yes you are:

The NMI (non maskable interrupt)is the key here .
It's service routine is at 7508 from which jumps to 750F and go on.

BTW,
what is this code of?


6802-boot.jpg
 
Yes you are:

The NMI (non maskable interrupt)is the key here .
It's service routine is at 7508 from which jumps to 750F and go on.

BTW,
what is this code of?


View attachment 22743


Ah of course the NMI, thank you. The NMI comes from a zero cross detection circuit which pulses the NMI every 10ms. There are triacs on the output board so I am guessing it's all to do with the timing of the triac fire pulse.

All very early days for me this ROM disassemble but I am trying to work out what bits of code do what.

The code is of a fruit machine (Slot machine or one arm bandit), it dates from 1980 and is driven by a MC6802. Being used to relay logic of the older machines this microprocessor stuff is very daunting but as I only do it as a hobby it makes it interesting. Just got to work out what all the code does now LOL.
 
Glad to be of help,
Reminds me of the days I did some assembly language code for the Intel 808x and 8018x for hardware debugging,I sure don't miss those days...:rolleyes:
BTW,
If you find out how the Bandit cheats(and it does) that would be interesting stuff ...
 
Glad to be of help,
Reminds me of the days I did some assembly language code for the Intel 808x and 8018x for hardware debugging,I sure don't miss those days...:rolleyes:
BTW,
If you find out how the Bandit cheats(and it does) that would be interesting stuff ...


In what way do you think it cheats?
 
Making sure the players have a very bad win ratio...
they didn't name it "the one hand Bandit" for nothing, didn't they?
 
Top