Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

How can I put these two assembly codes into one simplified code with subroutines? *******1st Code******* #include config OSC = INTIO67 config WDT = OFF

How can I put these two assembly codes into one simplified code with subroutines?

*******1st Code*******

#include

config OSC = INTIO67

config WDT = OFF

config LVP = OFF

config BOREN = OFF

InA equ 0x20

InC equ 0x21

Result equ 0x22

ORG 0x0000

START:

MOVLW 0x0F

MOVWF ADCON1

MOVLW 0xFF

MOVWF TRISA

MOVWF TRISB

MOVLW 0x00

MOVWF TRISC

MOVLW 0x00

MOVWF TRISE

MAIN_LOOP:

MOVF PORTA, W

ANDLW 0x0F

MOVWF InA

COMF InA, W

MOVWF Result

MOVFF Result, PORTC

GOTO MAIN_LOOP

END

**********Second Code**********

#include

config OSC = INTIO67

config WDT = OFF

config LVP = OFF

config BOREN = OFF

InA equ 0x20

InC equ 0x21

Result equ 0x22

ORG 0x0000

START:

MOVLW 0x0F

MOVWF ADCON1

MOVLW 0xFF

MOVWF TRISA

MOVWF TRISB

MOVLW 0x00

MOVWF TRISC

MOVLW 0X00

MOVWF TRISE

MAIN_LOOP:

MOVF PORTA, W

ANDLW 0x0F

MOVWF InA

COMF InA, W

MOVWF Result

MOVFF Result, PORTC

BCF PORTE, 2

BNZ JUMP

BSF PORTE, 2

JUMP:

GOTO MAIN_LOOP

END

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

PC Magazine Guide To Client Server Databases

Authors: Joe Salemi

1st Edition

156276070X, 978-1562760700

More Books

Students also viewed these Databases questions

Question

How many scores are included to compute the range?

Answered: 1 week ago

Question

Question Who can establish a Keogh retirement plan?

Answered: 1 week ago