000
07.01.2005, 13:14 Uhr
FloSoft
Medialer Over-Flow (Administrator)
|
Hi, hab folgenden ASM Code:
C++: |
list P=PIC16C84
;Program to RX. MIDI data with 10Mhz clock ;MIDI controlled voice harmoniser ;Filename: Harmid1.asm ;Date: 23/01/1997
;******************************** ; Variable Assignment Addresses ;********************************
dlyreg equ 0C rcount equ 0D rcvreg equ 0E offsetreg equ 0F noteval1 equ 10 noteval2 equ 11 midich equ 12 note equ 13
;******************************** ; Constant Assignments ;******************************** CARRY equ 00 MSB equ 07 BORROW equ 00 LED equ 07 W equ 00 F equ 01 Z equ 02 C equ 00 dx equ 05
;******************************** ; Port Assignments ;******************************** PCL equ 02 STATUS equ 03 PORTA equ 05 PORTB equ 06
;************************************ ; PROGRAMME Reset Point ;************************************
org 0 goto INIT
;************************************* ; Subroutines ;*************************************
delay1 movlw .27 movwf dlyreg dly1 nop
decfsz dlyreg goto dly1 nop return
delay2 movlw .17 movwf dlyreg dly2 nop decfsz dlyreg goto dly2 nop return
rxdata btfsc PORTA,4 goto rxdata movlw .8 movwf rcount clrf rcvreg call delay1
rnext bcf STATUS,CARRY rrf rcvreg btfsc PORTA,4 bsf rcvreg,MSB call delay2 decfsz rcount goto rnext return
keysel call rxdata movf rcvreg,W andlw #$F0 sublw #$90 btfss STATUS,Z goto keysel call rxdata movlw .184 addwf rcvreg,W btfsc STATUS,CARRY goto keysel movlw .60 subwf rcvreg,W btfss STATUS,BORROW goto keysel movwf offsetreg
bcf PORTB,LED return
;************************************ ; Initialise Software ;************************************
INIT clrf PORTB movlw 00H TRIS PORTB ;MAKE PORTB ALL O/P'S
movlw #$F8 movwf PORTB
clrf PORTA movlw 0FFH TRIS PORTA ;make PORTA all I/P's
clrf noteval1 clrf noteval2
movf PORTA,W ; read midich. switches andlw #$0F movwf midich
;************************************** ; Main Programme Start ;**************************************
main call keysel
start call rxdata ; is it status? movf rcvreg,W andlw #$80 sublw #$80 btfss STATUS,Z goto start
midich? movf rcvreg,W ; correct MIDI Ch.? andlw #$0F subwf midich,W btfss STATUS,Z goto start
noteon? movf rcvreg,W andlw #$F0 sublw #$90 btfsc STATUS,Z goto noteon
movf rcvreg,W andlw #$F0 sublw #$80 btfsc STATUS,Z goto noteoff
goto start
noteon call rxdata ; check note range nrange movf rcvreg,W movwf noteval2 movf offsetreg,W sublw .184 addwf noteval2,W btfsc STATUS,C goto start movf offsetreg,W addlw .48 subwf noteval2,W btfss STATUS,BORROW goto start movwf note
vel call rxdata movf rcvreg,F btfsc STATUS,Z goto zerovel
movf note,W call convert movwf PORTB
val2to1 movf noteval2,W movwf noteval1
call rxdata ; status or note? movf rcvreg,W andlw #$80 sublw #$80 btfss STATUS,Z goto nrange goto midich?
zerovel movf noteval2,W subwf noteval1,F btfss STATUS,Z goto val2to1 movlw #$08 ; harm off movwf PORTB goto val2to1
noteoff call rxdata ; note value? match movf rcvreg,W subwf noteval2,W btfss STATUS,Z goto offvel
movlw #$08 ; harm off movwf PORTB
offvel call rxdata ; vel-off value
call rxdata ; status or note-off movf rcvreg,W andlw #$80 sublw #$80 btfss STATUS,Z goto match goto midich?
convert addwf PCL retlw 00 retlw #$08 retlw #$08 retlw #$01 retlw #$02 retlw #$03 retlw #$08 retlw #$04 retlw #$05 retlw #$06 retlw #$08 retlw #$07 retlw #$08 retlw #$09 retlw #$08 retlw #$0A retlw #$0B retlw #$0C retlw #$08 retlw #$0D retlw #$0E retlw #$0F retlw #$08 retlw #$08 retlw #$08
end
|
Das PRoblem sind die zeilen mit
kommando #$..
Der www.microchip.com - Assembler versteht die Zeilen nicht, und ich hab keine Ahnung was die bedeuten sollen -- class God : public ChuckNorris { }; |