added a couple C examples

This commit is contained in:
Fernando 2025-03-24 22:25:53 -06:00
parent 47d91da1fa
commit 47b0b509dc
3 changed files with 14 additions and 11 deletions

0
.gitignore vendored Normal file → Executable file
View File

View File

@ -8,6 +8,7 @@ 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
@ -16,15 +17,17 @@ Start:
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

View File

@ -1,6 +1,6 @@
:020000040000FA
:10000000956A8C6A8A6AF19E0F0EC16EFF0E936E1E
:0800100081CF83FF08EF00F02F
:10000000956A8C6AF19E0F0EC16EF00E936E8A6A2D
:0400100081CF83FF1A
:020000040030CA
:04000000000C1F1EB3
:02000500038175