From 47b0b509dcd730bf83c596f91f8d8406cd5950a2 Mon Sep 17 00:00:00 2001 From: fernando Date: Mon, 24 Mar 2025 22:25:53 -0600 Subject: [PATCH] added a couple C examples --- .gitignore | 0 test/main.asm | 21 ++++++++++++--------- test/main.hex | 4 ++-- 3 files changed, 14 insertions(+), 11 deletions(-) mode change 100644 => 100755 .gitignore diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/test/main.asm b/test/main.asm index 49a861f..3609444 100755 --- a/test/main.asm +++ b/test/main.asm @@ -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: ; Read first nibble of port D and print it to the second nibble + MOVFF PORTB, PORTD -loop: - movff PORTB, PORTD - goto loop - END ; End of program diff --git a/test/main.hex b/test/main.hex index 23a177f..c5323ca 100755 --- a/test/main.hex +++ b/test/main.hex @@ -1,6 +1,6 @@ :020000040000FA -:10000000956A8C6A8A6AF19E0F0EC16EFF0E936E1E -:0800100081CF83FF08EF00F02F +:10000000956A8C6AF19E0F0EC16EF00E936E8A6A2D +:0400100081CF83FF1A :020000040030CA :04000000000C1F1EB3 :02000500038175