
















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
duins hsdyubhsjd huygfvyuediu kjsamcomx nchdsyuc skj ckxmciosjmks klxmop
Typology: Essays (university)
1 / 24
This page cannot be seen from the preview
Don't miss anything!

















PIC mid range ALU
Instruction format
โ (^) Examples: ADDWF 0x21, 0 SUBLW 0x MOVWF 0x
Instruction Set โ Three categories:
Instruction Set โ Three categories:
Example โ (^) Describe briefly the operation of the following instructions:
Example โ Write instructions to perform the following calculation and store the result in location 0x 0x11 + 0x32 โ 0x2E MOVLW 0x ADDLW 0x MOVWF 0x MOVLW 0x2E SUBWF 0x25, 1
Another Example โ (^) Write instructions to swap (exchange) the values stored in locations 0x20 and 0x
Assembler โ (^) For the MCU to understand the instruction, it has to be translated to machine language โ Example: translate the following instruction to machine language:
Assembler โ (^) Example: translate the following machine language instruction to
Microchip Assembler format
โ (^) LABEL: any word (except mnemonics) โ (^) The label is optional, it is a reference point in the program โ (^) The MNEMONIC cannot start on the first character on a line โ (^) semi-colon used for comments โ (^) Ex. loop ADDWF 0x33, 1 Label MNEMONIC Operands
Example โ What does the following code do?
Assembler directives โ
โ
โ
โ
โ
Assembler Directive: EQU โ
โ
โ
age EQU 0x0F MOVLW D'23' MOVWF age MOVLW D'23' MOVWF 0x0F equivalent instructions