URL
https://opencores.org/ocsvn/m16c5x/m16c5x/trunk
Subversion Repositories m16c5x
[/] [m16c5x/] [trunk/] [Code/] [MPLAB/] [M16C5x_Tst.lst] - Rev 2
Compare with Previous | Blame | View Log
MPASM 5.50 M16C5X_TST.ASM 6-22-2013 10:14:54 PAGE 1LOC OBJECT CODE LINE SOURCE TEXTVALUE00001 ;**************************************************************************00002 ; M16C5x_Tst.ASM00003 ;00004 ; This sample program runs on most all PIC devices. To ensure00005 ; proper execution, replace the processor specified in the LIST directive00006 ; with your target processor.00007 ;00008 ; Program execution starts at location H'50'. The loop routine executes00009 ; seven times. The routines Reduce and Double execute one time for each00010 ; loop.00011 ;00012 ; After the loop executes seven times, the program repeats execution from00013 ; the beginning.00014 ;00015 ;00016 ; Variable Initial Description00017 ; Value00018 ;--------------------------------------------------------------------------00019 ; CountDown 255 Decreases to 128 by subtracting Doubler00020 ; Doubler 1 Increases to 128 by adding to itself00021 ; OuterLoop 7 Decrements by one to 000022 ;00023 ;00024 ; The program generates the following values:00025 ;00026 ; Cycle # CountDown Doubler OuterLoop00027 ; 0 255 1 700028 ; 1 254 2 600029 ; 2 252 4 500030 ; 3 248 8 400031 ; 4 240 16 300032 ; 5 224 32 200033 ; 6 192 64 100034 ; 7 128 128 000035 ;00036 ;**************************************************************************0003700038 LIST P=16F59, R=DEC0003900040 ;--------------------------------------------------------------------------00041 ; Set ScratchPadRam here. If you are using a PIC16C5X device, use:00042 ;ScratchPadRam EQU 0x1000043 ; Otherwise, use:00044 ;ScratchPadRam EQU 0x2000045 ;--------------------------------------------------------------------------0004600000010 00047 ScratchPadRam EQU 0x100004800049 ;--------------------------------------------------------------------------00050 ; Variables00051 ;--------------------------------------------------------------------------0005200000010 00053 CountDown EQU ScratchPadRam+0MPASM 5.50 M16C5X_TST.ASM 6-22-2013 10:14:54 PAGE 2LOC OBJECT CODE LINE SOURCE TEXTVALUE00000011 00054 Doubler EQU ScratchPadRam+100000012 00055 OuterLoop EQU ScratchPadRam+2000560005700058 ;--------------------------------------------------------------------------00059 ; Program Code00060 ;--------------------------------------------------------------------------00061 ;--------------------------------------------------------------------------00062 ; Set the reset vector here. If you are using a PIC16C5X device, use:00063 ; ORG <last program memory location>00064 ; Otherwise, use:00065 ; ORG 000066 ;--------------------------------------------------------------------------0006707FF 00068 ORG H'7FF'Message[306]: Crossing page boundary -- ensure page bits are set.07FF 0A50 00069 GOTO Start0007000071 ;--------------------------------------------------------------------------00072 ; Main Program00073 ;--------------------------------------------------------------------------000740050 00075 ORG H'50'000760050 00077 Start0050 0CFF 00078 MOVLW 255 ; Initialize the variables to0051 0030 00079 MOVWF CountDown ; their starting values.0052 0C01 00080 MOVLW 10053 0031 00081 MOVWF Doubler0054 0C07 00082 MOVLW 70055 0032 00083 MOVWF OuterLoop0056 00084 Loop0056 095A 00085 CALL Reduce ; Perform the inner portion of0057 02F2 00086 DECFSZ OuterLoop,f ; the loop.0058 0A56 00087 GOTO Loop000880059 0A50 00089 GOTO Start ; Repeat the whole thing.0009000091 ;--------------------------------------------------------------------------005A 00092 Reduce005A 03B1 00093 SWAPF Doubler,f ; Reduce CountDown by the005B 0391 00094 SWAPF Doubler,w ; value of Doubler. Then005C 03B1 00095 SWAPF Doubler,f ; call the doubling routine.005D 00B0 00096 SUBWF CountDown,f005E 0960 00097 CALL Double005F 0800 00098 RETLW 00009900100 ;--------------------------------------------------------------------------0060 00101 Double0060 03B1 00102 SWAPF Doubler,f ; Double the value of Doubler0061 0391 00103 SWAPF Doubler,w ; by adding it to itself.0062 03B1 00104 SWAPF Doubler,f0063 01F1 00105 ADDWF Doubler,fMPASM 5.50 M16C5X_TST.ASM 6-22-2013 10:14:54 PAGE 3LOC OBJECT CODE LINE SOURCE TEXTVALUE0064 0800 00106 RETLW 00010700108 ENDMPASM 5.50 M16C5X_TST.ASM 6-22-2013 10:14:54 PAGE 4SYMBOL TABLELABEL VALUECountDown 00000010Double 00000060Doubler 00000011Loop 00000056OuterLoop 00000012Reduce 0000005AScratchPadRam 00000010Start 00000050__16F59 00000001__DEBUG 1MEMORY USAGE MAP ('X' = Used, '-' = Unused)0040 : ---------------- XXXXXXXXXXXXXXXX XXXXX----------- ----------------07C0 : ---------------- ---------------- ---------------- ---------------XAll other memory blocks unused.Program Memory Words Used: 22Program Memory Words Free: 2026Errors : 0Warnings : 0 reported, 0 suppressedMessages : 1 reported, 0 suppressed
