📄 dal_bus.lst
字号:
M
M endif
M exitm
0003 1205 00024 bcf DALLAS_BUS ;start of reset pulse
00025 Wait 580 Microsec,0 ; Trstl
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
0244 M variable cycles = ((580 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
0244 M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 6
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
0004 30BF M movlw ((cycles-5)/3)
0005 2??? M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
M
M exitm
0006 1605 00026 bsf DALLAS_BUS ;end of reset pulse
00027 Wait 60 Microsec,0 ; Tpdh
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
003C M variable cycles = ((60 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
003C M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 7
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
0007 3012 M movlw ((cycles-5)/3)
0008 2??? M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
M
M exitm
0009 1E05 00028 btfss DALLAS_BUS ;check for a presence pulse st:btfsC
000A 1400 00029 bsf PRESENCE_bit ;indicates presence
00030 Wait 420 Microsec,0 ; Trsth - Tpdh ( > Tpdl)
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
01A4 M variable cycles = ((420 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
01A4 M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 8
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M call longdelay
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
000B 308A M movlw ((cycles-5)/3)
000C 2??? M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
M
M exitm
000D 0008 00031 return
00032
00033 ;****************************************************************************
00034 ;*
00035 ;* Write a ONE on the Dallas bus
00036 ;*
00037 ;****************************************************************************
00038
000E 1605 00039 DSWriteaOne bsf DALLAS_BUS ;just in case it isn't
000F 0000 00040 nop
0010 1205 00041 bcf DALLAS_BUS ;start/sync edge
00042 Wait 2 Microsec,0 ; Tlow1
M radix dec
03E8 M variable instruct_time_ns = (( 1 Seconds ) / (Clock_Freq / 4 ))
0000 M local cycles
0002 M variable cycles = ((2 * D'1000') / instruct_time_ns) ;required delay in
M ;100ths of instructions
M
M if (cycles < (0) )
M messg NOTE - negative delay time with 0 cycles (no code)
M
M exitm
M else
0002 M variable cycles = (cycles - (0))
M endif
M
M if (cycles == 0)
M messg "WARNING - delay time less than 1 instructions"
M
M nop
M exitm
M endif
M
M if (cycles > (255*(256*3 + 6) + 2 + 3))
MPASM 03.80 Released DAL_BUS.ASM 11-20-2005 18:21:08 PAGE 9
LOC OBJECT CODE LINE SOURCE TEXT
VALUE
M messg "ERROR : Too long a wait for the WAIT macro at present!!"
M exitm
M endif
M
M ; messg Info - calculated number of cycles = #v(cycles)
M
M
M if (cycles > ((255*3)+5))
M
M movlw ((cycles-5)/(256*3+6))
M call longdelay
M
M ifndef INCLONGDELAY
M #define INCLONGDELAY
M endif
M
M exitm
M endif
M
M if ((cycles > 8 ) && (cycles < (255*3 + 5)))
M
M movlw ((cycles-5)/3)
M call shortdelay
M
M ifndef INCSHORTDELAY
M #define INCSHORTDELAY
M endif
M
M exitm
M endif
M
M if (cycles < 8)
M while ( cycles > 1 )
M
0011 2??? M goto $+1 ;two cycle nop
M
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -