henrygr Posted April 7, 2007 Report Posted April 7, 2007 I know it's not chiristmas....... :PQBAS did me some superb code for a 9 by 18 matrix. However, I want to add other function to the code (as one does), but QBAS is an assembly man, and I'm not.Am I right in saying that the main.asm file in the assembly version should become the mios_wrapper.asm in the sdcc skeleton, and just copy all associated files into the mios_wrapper folder OR am I just as stupid as George Bush? ::)Project nearly finished, so photos etc on the way.....Mark. Quote
stryd_one Posted April 7, 2007 Report Posted April 7, 2007 George Bush isn't stupid and neither are you... But your guess was about as right as he is a good speaker ;DYou'll need to wrap the ASM that qbas sorted out into the main.c, using techniques like those at the How to mix C and ASM wiki page, or include the ASM file in your C project, using techniques like the using assembler in C - question about _ in front of macro names post :)Feel free to post/PM/email me for a hand. Quote
henrygr Posted April 7, 2007 Author Report Posted April 7, 2007 erk-- a lot of asm- lost, totallty lost.In the ucaaps there are great example blocks of code, like how to send cc values when a pot has been moved. Is there an ASM version of this anywhere. All I want to do is assign 20 slide pots set values, and never have to touch them again. AAny ideas? Quote
stryd_one Posted April 7, 2007 Report Posted April 7, 2007 Try this mate. As stolen from mb64 like a cowardly pirate, yargh. ;; -------------------------------------------------------------------------- ;; This function is called by MIOS when a pot has been moved ;; Input: ;; o Pot number in WREG and MIOS_PARAMETER1 ;; o LSB value in MIOS_PARAMETER2 ;; o MSB value in MIOS_PARAMETER3 ;; -------------------------------------------------------------------------- USER_AIN_NotifyChange ;; convert 10-bit value to 7-bit value rrf MIOS_PARAMETER3, F ; value / 2 rrf MIOS_PARAMETER2, F rrf MIOS_PARAMETER3, F ; value / 2 rrf MIOS_PARAMETER2, F rrf MIOS_PARAMETER3, F ; value / 2 rrf MIOS_PARAMETER2, F bcf MIOS_PARAMETER2, 7 ; clear 8th bit ;; now: pot number in MIOS_PARAMETER1 ;; 7-bit value in MIOS_PARAMETER2 ;; CC Ch 0 movlw 0xB0 call MIOS_MIDI_TxBufferPut ;; CC# = Pot# movf MIOS_PARAMETER1, W call MIOS_MIDI_TxBufferPut ;; CC Value = Pot Value movf MIOS_PARAMETER2, W call MIOS_MIDI_TxBufferPut Quote
henrygr Posted April 8, 2007 Author Report Posted April 8, 2007 Cheers Captain Hook. That would be the very thing!!! ;D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.