Shop OBEX P1 Docs P2 Docs Learn Events
TIA - An interactive inline assembler for TAQOZ - Page 4 — Parallax Forums

TIA - An interactive inline assembler for TAQOZ

124»

Comments

  • Peter, there should be plenty in Media.fth to get me writing inline words. I'll make notes as I go.

  • Christof Eb.Christof Eb. Posts: 1,197
    edited 2021-09-05 16:56

    Hi,
    has anyone managed to load a piece of assembler as a block into cog ram?

    I have the following short loop ( a DDS sine generator) and would like to load it as a module into the cog.

    long ampl
    32767 ampl !
    long dangle
    5.000.000 dangle !
    
    code sineAsm ( d:ampladr c:dangleadr b:offset a:angle -- ampladr dangleadr offset angle )
        BEGIN:
            rdlong xx,d '\ get amplitude
            qrotate xx,a '\ calculate sine
            rdlong xx,c '\ get delta angle
            add a,xx '\ new angle        
            getqy xx '\ get sine result
            add xx,b '\ add offset
            wypin xx,#0 '\ output to pin 0
        AGAIN:
    end  
    
    : sineAsmTask
        0 PIN
        1650 mV
        ampl dangle 32767 0
        sineAsm
    ;
    
    ' sineAsmTask 6 RUN
    

    Thanks for some hints!

Sign In or Register to comment.