Hallo
Dank erst mal an alle die zeit für mein Problem haben.
Ich möchte mein ASM-Files in Picbasic um schreiben und komme nun leider nicht weiter.
Das files geht in dieser weise erst mal aber ich möchte gern alle asm anweisungen noch weg haben.
Es wäre toll wenn noch jemand eine Idee hat.
Nehmt einfach meine Datei in euer Programm und dann seht ihr wie ich das gemeint habe.
Dank an alle die mir helfen wollen.
Hello
Need once your help one please.
Who can follow me at would cut off ASM.......ENDASM help there I not point as I can write the one pic Basic.
To Thanks onto all of them in advance.
Therefore everything what would like between ASM....and....Endasm I also still pic Basic have
S88.bas
;B_CLK var PORTB.0 ; B_CLK to PORTB.0
;B_OUT var PORTB.1 ; B_OUT to PORTB.1
;B_LED var PORTB.2 ; B_IN to PORTB.6
;B_IN var PORTB.6 ; B_IN to PORTB.6
;B_PS var PORTB.7 ; B_PS to PORTB.7
;R_DATEN var BYTE
asm
R_DATEN equ 20h ; fuer Speichern der Daten und Schieben
R_OLD equ 25h ; Register for old values
R_FLAG equ 26h ; Register for flags
F_PS_RDY equ d'1' ; Ready-Flag
A_X1 equ d'1' ; Port A7, X1
A_X2 equ d'0' ; Port A6, X2
A_X3 equ d'7' ; Port A5, X3
A_X4 equ d'6' ; Port A4, X4
A_X5 equ d'5' ; Port A3, X5
A_X6 equ d'4' ; Port A2, X6
A_X7 equ d'3' ; Port A1, X7
A_X8 equ d'2' ; Port A0, X8
B_CLK equ d'0' ; Port B, Clock
B_OUT equ d'1' ; Port B, Data-OUT
B_IN equ d'6' ; Port B, Data-IN
B_PS equ d'7' ; Port B, PS-Eingang
endasm
INTCON.0 =1 ;wenn RB0-Int(CLK) =1 dann
goto start ;gehe zu Start
INTCON.0 =0 ;wenn RB0-Int(CLK) =0 dann clear IR-Flag
;--------------------------------------------------------------------------------
asm
btfss R_DATEN,0 ; sofort Ausgabe des
bsf PORTB,B_OUT ; .. Bits #0 von
btfsc R_DATEN,0 ; .. R-Daten an
bcf PORTB,B_OUT ; .. DATA_OUT
endasm
;--------------------------------------------------------------------------------
If B_CLK <>1 then
B_LED =0
else
toggle B_LED
endif
If B_PS =0 then gosub lesen
;--------------------------------------------------------------------------------
asm
btfss PORTB,B_IN ; Bit am Eingang
bsf STATUS,C ; .. DATA-IN zum
btfsc PORTB,B_IN ; .. Nachschieben in
bcf STATUS,C ; .. Schieberegister in C
rrf R_DATEN,F ; Daten nachschieben (invertiert)
; ab hier sind die Daten in R_DATEN aktualisiert und fertig für
; die nächste pos. Flanke von CLK (#0 kann dann sofort an DATA_OUT
; weitergegeben werden).
endasm
;--------------------------------------------------------------------------------
start:
TRISB = %111110001 ' Set PORTB to output 0=Out 1=In
TRISA = %11111111 ' Set PORTA to input
CMCON = 7 ' PORTA to digital
OPTION_REG = $87 ' Konfiguration TIMER / WDT / Pull-Ups Disable PORTB pull-ups und PS2-PS0 Prescaler Rate Select bits
INTCON = $F0 ' Konfiguration INTERRUPT Disable PORTB pull-ups und PS2-PS0 Prescaler Rate Select bits
asm
loop
clrwdt ; Watchdog-Timer loeschen
btfsc PORTB,B_PS ; if PS = LOW
goto loop2
btfsc R_FLAG,F_PS_RDY ; and PS_RDY not set
goto loop
movf R_OLD,W ; .. the reload old values
movwf R_DATEN ;
bsf R_FLAG,F_PS_RDY ; .. set FLAG PS_RDY
goto loop
loop2
bcf R_FLAG,F_PS_RDY ; if PS = LOW reset PS_RDY
goto loop
endasm
lesen:
asm
read_input
clrf R_DATEN
btfss PORTA,A_X8
bsf R_DATEN,0
btfss PORTA,A_X7
bsf R_DATEN,1
btfss PORTA,A_X6
bsf R_DATEN,2
btfss PORTA,A_X5
bsf R_DATEN,3
btfss PORTA,A_X4
bsf R_DATEN,4
btfss PORTA,A_X3
bsf R_DATEN,5
btfss PORTA,A_X2
bsf R_DATEN,6
btfss PORTA,A_X1
bsf R_DATEN,7
movf R_DATEN,W
movwf R_OLD
endasm
return
end
Bookmarks