Connect with us

MC6802 "WAI" Instruction

Discussion in 'Microcontrollers, Programming and IoT' started by Danno, Oct 20, 2015.

Scroll to continue with content
  1. Danno

    Danno

    65
    2
    Aug 31, 2015
    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.
     

    Attached Files:

  2. JWHassler

    JWHassler

    80
    16
    Dec 22, 2014
    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.
     
  3. dorke

    dorke

    2,342
    665
    Jun 20, 2015
    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
     
  4. Danno

    Danno

    65
    2
    Aug 31, 2015

    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.
     
  5. dorke

    dorke

    2,342
    665
    Jun 20, 2015
    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 ...
     
  6. Danno

    Danno

    65
    2
    Aug 31, 2015

    In what way do you think it cheats?
     
  7. dorke

    dorke

    2,342
    665
    Jun 20, 2015
    Making sure the players have a very bad win ratio...
    they didn't name it "the one hand Bandit" for nothing, didn't they?
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-