Programme TP n°1
Page 1 sur 1
Programme TP n°1
PROGRAMME ADDITION
; Variables (déclarations)
Solution1 equ 0x20
Solution2 equ 0x21
Solution3 equ 0x22
Solution4 equ 0x23
;---------------------------------------------------------------------------
; Debut du Programme
Org 0x00
Start ;
nop ; Initialisation ICD
goto Main ;
Service
retfie
;---------------------------------------------------------------------------
; Programme principal
Main
movlw 0xdd
movwf Solution1
movlw 0x44
addwf Solution1,F
movlw 0xcc
movwf Solution2
movlw 0x33
addwfc Solution2,F
movlw 0xbb
movwf Solution3
movlw 0x22
addwfc Solution3,F
movlw 0xaa
movwf Solution4
movlw 0x11
addwfc Solution4,F
Fin
goto Fin
end
;---------------------------------------------------------------------------
PROGRAMME ADDITION + DIVISION PAR 4
;---------------------------------------------------------------------------
; Projet : Travaux pratiques electronique programmable
; ICAM - TOULOUSE - Département Génie électrique
;---------------------------------------------------------------------------
; Module : Tp n°1 - Exercice n°1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Definitions liées au processeur
list p=18F452
#include p18F452.inc
;---------------------------------------------------------------------------
; Constantes (definitions)
;---------------------------------------------------------------------------
; Variables (déclarations)
Solution1 equ 0x20
Solution2 equ 0x21
Decimal equ 0x19
;---------------------------------------------------------------------------
; Debut du Programme
Org 0x00
Start ;
nop ; Initialisation ICD
goto Main ;
Service
retfie
;---------------------------------------------------------------------------
; Programme principal
Main
movlw .0
movwf Solution2
movlw .68
movwf Solution1
movlw .51
addwf Solution1,F
movlw .0
addwfc Solution2,F
movlw .80
addwfc Solution1,F
movlw .0
addwfc Solution2,F
movlw .131
addwfc Solution1,F
movlw .0
addwfc Solution2,F
movlw Solution1
bcf STATUS,0
rrcf Solution2,F
rrcf Solution1,F
rrcf Decimal
bcf STATUS,0
rrcf Solution2,F
rrcf Solution1,F
rrcf Decimal
Fin
goto Fin
end
; Variables (déclarations)
Solution1 equ 0x20
Solution2 equ 0x21
Solution3 equ 0x22
Solution4 equ 0x23
;---------------------------------------------------------------------------
; Debut du Programme
Org 0x00
Start ;
nop ; Initialisation ICD
goto Main ;
Service
retfie
;---------------------------------------------------------------------------
; Programme principal
Main
movlw 0xdd
movwf Solution1
movlw 0x44
addwf Solution1,F
movlw 0xcc
movwf Solution2
movlw 0x33
addwfc Solution2,F
movlw 0xbb
movwf Solution3
movlw 0x22
addwfc Solution3,F
movlw 0xaa
movwf Solution4
movlw 0x11
addwfc Solution4,F
Fin
goto Fin
end
;---------------------------------------------------------------------------
PROGRAMME ADDITION + DIVISION PAR 4
;---------------------------------------------------------------------------
; Projet : Travaux pratiques electronique programmable
; ICAM - TOULOUSE - Département Génie électrique
;---------------------------------------------------------------------------
; Module : Tp n°1 - Exercice n°1
;---------------------------------------------------------------------------
;---------------------------------------------------------------------------
; Definitions liées au processeur
list p=18F452
#include p18F452.inc
;---------------------------------------------------------------------------
; Constantes (definitions)
;---------------------------------------------------------------------------
; Variables (déclarations)
Solution1 equ 0x20
Solution2 equ 0x21
Decimal equ 0x19
;---------------------------------------------------------------------------
; Debut du Programme
Org 0x00
Start ;
nop ; Initialisation ICD
goto Main ;
Service
retfie
;---------------------------------------------------------------------------
; Programme principal
Main
movlw .0
movwf Solution2
movlw .68
movwf Solution1
movlw .51
addwf Solution1,F
movlw .0
addwfc Solution2,F
movlw .80
addwfc Solution1,F
movlw .0
addwfc Solution2,F
movlw .131
addwfc Solution1,F
movlw .0
addwfc Solution2,F
movlw Solution1
bcf STATUS,0
rrcf Solution2,F
rrcf Solution1,F
rrcf Decimal
bcf STATUS,0
rrcf Solution2,F
rrcf Solution1,F
rrcf Decimal
Fin
goto Fin
end
Page 1 sur 1
Permission de ce forum:
Vous ne pouvez pas répondre aux sujets dans ce forum
|
|