PET / CBM (Basic 2) > Delay?

  • Hallo,


    ich habe bisher ein wenig Assembler auf dem C64 gelernt und bin nun stolzer Besitzer eines CBM 3032 mit Basic 2.


    Auf'm C64 habe ich ein Delay wie folgt programmiert (über ein Macro):


    .macro setDelay (time) {

    //Verzögerungsschleife

    ldy #time

    !loop:

    jsr $eeb3 //Verzögerung

    dey

    bne !loop-

    }


    $eeb3 ist also die wichtige Sprungadresse. Kennt jemand den richtigen Einsprung für den PET/CBM?

    Ich hatte an den Basic Befehl Wait gedacht ($d710), allerdings funktioniert es nicht wirklich. Gedankenfehler?


    Danke und Beste Grüße

    Marco

    Ich suche: Atari 800, MPF-IP

  • Ich wüsste nicht, dass der PET so eine Delay-Routine hat. Genau weiss ich das aber nicht.

    Das hier ist die Delay-Routine des C64:

    Code
    .,EEB3 8A       TXA             save X
    .,EEB4 A2 B8    LDX #$B8        set the loop count
    .,EEB6 CA       DEX             decrement the loop count
    .,EEB7 D0 FD    BNE $EEB6       loop if more to do
    .,EEB9 AA       TAX             restore X
    .,EEBA 60       RTS

    Diese paar Befehle kannst du doch einfach zu deinem eigenen Programm hinzufügen.

    • i-Telex 7822222 dege d

    • technikum29 in Kelkheim bei Frankfurt

    • Marburger Stammtisch

    Douglas Adams: "Everything, that is invented and exists at the time of your birth, is natural. Everything that is invented until you´re 35 is interesting, exciting and you can possibly make a career in it. Everything that is invented after you´re 35 is against the law of nature. Apply this list to movies, rock music, word processors and mobile phones to work out how old you are."

  • Schaut ma sich den Kernal des C64 an, dann ist Adresse $eeb3 wie folgt definiert: Verzögerung 1 ms

    Mit Deinem Loop "loope" ich nur wenige Taktzyklen. Wenn ich 500 mal $eeb3 aufrufe, weiß ich ziemlich genau das 0,5 sek rum sind. Ich hätte erwartet, das es im PET ROM auch so etwas gibt.

    Ich suche: Atari 800, MPF-IP

  • Das ist doch die Original-Routine aus dem 64er, die ich oben angegeben habe. Wenn du die 500 mal aufrufst hast du deine 0,5 Sekunden.

    Wie gesagt, ich kann mich nicht erinnern, dass der PET so eine Delay-Routine hat.

    • i-Telex 7822222 dege d

    • technikum29 in Kelkheim bei Frankfurt

    • Marburger Stammtisch

    Douglas Adams: "Everything, that is invented and exists at the time of your birth, is natural. Everything that is invented until you´re 35 is interesting, exciting and you can possibly make a career in it. Everything that is invented after you´re 35 is against the law of nature. Apply this list to movies, rock music, word processors and mobile phones to work out how old you are."