你看看反汇编代码就知道了,32767时,是按正常汇编语言代码来编制的延时程序,如果是32768则不然,“无符号”在程序代码处理方式上有很大不同的。
当为32767时,代码如下:
C:0x0003 E4 CLR A
C:0x0004 FF MOV R7,A
C:0x0005 FE MOV R6,A
C:0x0006 0F INC R7
C:0x0007 BF0001 CJNE R7,#0x00,C:000B
C:0x000A 0E INC R6
C:0x000B BE7FF8 CJNE R6,#0x7F,C:0006
C:0x000E BFFFF5 CJNE R7,#0xFF,C:0006
C:0x0011 22 RET
当为32768时代码如下:
C:0x0003 900000 MOV DPTR,#0x0000
C:0x0006 AF82 MOV R7,DP0L(0x82)
C:0x0008 AE83 MOV R6,DP0H(0x83)
C:0x000A E4 CLR A
C:0x000B FC MOV R4,A
C:0x000C FD MOV R5,A
C:0x000D FB MOV R3,A
C:0x000E 7A80 MOV R2,#P0(0x80)
C:0x0010 F9 MOV R1,A
C:0x0011 F8 MOV R0,A
C:0x0012 D3 SETB C
C:0x0013 12001C LCALL C?SLCMP(C:001C)
C:0x0016 4003 JC C:001B
C:0x0018 A3 INC DPTR
C:0x0019 80EB SJMP C:0006
C:0x001B 22 RET
C?SLCMP:
C:0x001C EB MOV A,R3
C:0x001D 9F SUBB A,R7
C:0x001E F5F0 MOV B(0xF0),A
C:0x0020 EA MOV A,R2
C:0x0021 9E SUBB A,R6
C:0x0022 42F0 ORL B(0xF0),A
C:0x0024 E9 MOV A,R1
C:0x0025 9D SUBB A,R5
C:0x0026 42F0 ORL B(0xF0),A
C:0x0028 EC MOV A,R4
C:0x0029 6480 XRL A,#P0(0x80)
C:0x002B C8 XCH A,R0
C:0x002C 6480 XRL A,#P0(0x80)
C:0x002E 98 SUBB A,R0
C:0x002F 45F0 ORL A,B(0xF0)
C:0x0031 22 RET
|