added a couple C examples
This commit is contained in:
parent
47d91da1fa
commit
47b0b509dc
0
.gitignore
vendored
Normal file → Executable file
0
.gitignore
vendored
Normal file → Executable file
|
|
@ -8,23 +8,26 @@ CONFIG LVP = OFF ; Low-Voltage Programming off
|
|||
CONFIG MCLRE = OFF ; MCLR pin disabled, RE3 input enabled
|
||||
R1 EQU 0x020
|
||||
R2 EQU 0x021
|
||||
TEMP EQU 0x22
|
||||
|
||||
ORG 0x00 ; Program starts at address 0
|
||||
ORG 0x00 ; Program starts at address 0
|
||||
|
||||
Start:
|
||||
; Initialize PORTB
|
||||
CLRF TRISD ; Set all PORTB pins as output
|
||||
CLRF LATD ; Clear PORTB outputs
|
||||
|
||||
CLRF LATB
|
||||
BCF INTCON2, 7
|
||||
movlw 0fh ; Set all pins to digital I/0
|
||||
movwf ADCON1
|
||||
MOVLW 0xFF
|
||||
MOVLW 0fh ; Set all pins to digital I/0
|
||||
MOVWF ADCON1
|
||||
MOVLW 0xF0
|
||||
MOVWF TRISB
|
||||
CLRF LATB
|
||||
;MOVLW 0x0E
|
||||
;MOVWF PORTB
|
||||
|
||||
loop:
|
||||
movff PORTB, PORTD
|
||||
goto loop
|
||||
|
||||
loop: ; Read first nibble of port D and print it to the second nibble
|
||||
MOVFF PORTB, PORTD
|
||||
|
||||
END ; End of program
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
:020000040000FA
|
||||
:10000000956A8C6A8A6AF19E0F0EC16EFF0E936E1E
|
||||
:0800100081CF83FF08EF00F02F
|
||||
:10000000956A8C6AF19E0F0EC16EF00E936E8A6A2D
|
||||
:0400100081CF83FF1A
|
||||
:020000040030CA
|
||||
:04000000000C1F1EB3
|
||||
:02000500038175
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user