ID:EP087833
QUESTION 7
EEEB373
SECTION 3B
ASSIGNMENT 1
PN AYUNIZA
ASM FILE
#include<p18F458.inc>
;program start template
count set 0x0 ;NUMBER OF DATA READ i set 0x1 ;NUMBER OF DATA AS
TOT_EL4 set 0x100 org 0x00 goto start org 0x08 retfie org 0x18 retfie org 0x250
;main program
start movlw 0x00 movwf TBLPTRU movlw 0x01 movwf TBLPTRH movlw 0x50 movwf TBLPTRL CLRF i,A CLRF count,A BRANCH1 INCF count,F,A MOVLW 0X96 CPFSGT count,A BRA BRANCHTABLE BRA FINISH BRANCHTABLE TBLRD*+ BTFSC TABLAT,0,A BRA BRANCH1 ; NOT ZERO(1) BRA BRANCH2 ; ZERO(0)
BRANCH2 BTFSC TABLAT,1,A BRA BRANCH1 ; NOT ZERO(1) BRA BRANCH3 ; ZERO(0)
BRANCH3 BTFSS TABLAT,7,A BRA BRANCH1 ; ZERO(0) BRA RESULT ; NOT ZERO(1)
RESULT INCF i,F,A MOVFF i,0X100 BRA BRANCH1
FINISH NOP
org 0x150 radix dec
DATA_ARR db 3,97,4,88,120,14,63,0,165,26 db 28,118,149,80,0,107,171,8,162,25 db 96,110,11,6,77,0,29,196,123,88 db 10,57,49,188,20,24,63,0,165,216 db 12,170,242,119,0,23,52,50,155,81 db 16, 74,69,01,13,0,89,198,64,53 db 36,0,211,61,177,0,9,196,123,88 db 14,70,255,119,0,0,52,150,55,191 db 6,174,0,01,133,0,9,18,22,188 db 60,200,131,22,59,0,66,19,173,0 db 20, 78,73,05,138,4,94,202,68,57 db 42,215,0,0,81,5,14,200,127,98 db 18,78,205,19,100,60,02,50,0,0 db 65, 74,70,0,33,0,89,108,220,08 db 36,20,0,212,159,0,06,119,173,152
END
LST FILE
MPASM 5.41 FINAL.ASM 7-22-2013 14:57:23 PAGE 1
LOC OBJECT CODE LINE SOURCE TEXT VALUE
00001 #include<p18F458.inc> 00001 LIST 00002 00003