|
本帖最後由 xiaolaba 於 2014-2-25 11:04 PM 編輯
這個是抄來的, 用89C51 作的 ICE, 沒有源碼, 這是俺搭起來的棚架, 但是不能動作.
確定燒錄是沒問題的, 因為有測試用 BLINK P1.0 和 P2.0 接LED都會閃, 是正常的.
89s51ICE
據作者寫的資料,
MCU AT89C51 (俺用AT89S51 替代)
P3.3 / INT1 接 UART 的送來的資料
P3.5 / T1 送出資料给 UART
9600, N81
PC 端送出 0Xff, 0x00, 0x01, 並在時限內等待 ICE 的回應
它的 HEX 如下
- :020000000153AA
- :03000300021003E5
- :03000B0002100BD5
- :03001300021013C5
- :03001B0002101BB5
- :1000230002102383220200E9C0E074020200ED0003
- :10003300C0E074030200ED00C0E074040200ED00B0
- :10004300C0E074050200ED00C0E074060200ED009C
- :1000530075817053D0E775A8007E2B7D0190100049
- :10006300ED1126F0A30DDEF8907F8074007E13F06F
- :10007300A3DEFC907F907400F0A37410F0907F9245
- :100083007470F074FA907F93F0414C8E6E8F6F20F2
- :10009300B3FD7E47DEFE7F08A2B3137E2DDEFE0096
- :1000A300DFF6C3AF6FAE6E228E6E8F6FC2B57E2F3B
- :1000B300DEFE7F081392B57E2DDEFE00DFF6D2B59D
- :1000C3007E2FDEFEAF6FAE6E22046A0000000000DA
- :1000D300031200E938303531206D6F6E69746F7229
- :1000E3002056312E3200C0E07401C0A8C2AFC083D5
- :1000F300C082907F80F0A37400F0A3E5D0F0A3D07A
- :10010300E0F0A3D0E0F0A3D0E0F0A3D0E0F0A3E5CB
- :10011300F0F0A3718B907F80E0F8D0E0F9D0E0B8E5
- :10012300010524FD400119907F90F0A3E9F0A3E5B8
- :1001330081F0414C907F93118E40F9B4F70040F465
- :10014300F0A3118E40EEB46B0050E9F0A36009FEFA
- :10015300118E40E0F0A3DEF8118E40D8FD71782DAA
- :1001630070D2907F93E0FEA3E0CEA3B4FF0221A55B
- :10017300B4FE0221C3B4FD0221F1B4FC02414CB42C
- :10018300FB024173B4FA0241B6B4F90241ECB4F88C
- :1001930002612BB4F702613C74F0907F93F0740119
- :1001A3006154907F94741DF0A3FE7F00A882A983FD
- :1001B3009000CCEF930F88828983F0A3DEEE616019
- :1001C300A3E0F8A3E0F9A3E0FE907F94F0A3601C02
- :1001D300AA82AB8388828983B90003E68001E0A306
- :1001E300A882A9838A828B83F0A3DEE46160A3E003
- :1001F300F8A3E0F9A3EE24FD6047FEFFE0AA82AB7B
- :100203008388828983B90003F68001F0A3A882A9B9
- :10021300838A828B83A3DEE4907F96E0F8A3E0F9E0
- :10022300A3E0FEAA82AB8388828983B90003E680B8
- :1002330001E06E7010A3A882A9838A828B83A3DF57
- :10024300E07400800274016154907F807413FEA8EF
- :1002530082A983907F94F0A3AA82AB838882898347
- :10026300E0A3A882A9838A828B83F0A3DEEA61607C
- :10027300EE603EA3A3E05418F5F065D05418601166
- :10028300907F9D71A453D0E7E5F042D0907F9D719C
- :100293008B7880797F907F94E0FEA3E0A3AA82AB62
- :1002A3008388828983F0A3A882A9838A828B83DED1
- :1002B300EA414C907F92E0F581907F8871A4E0C081
- :1002C300E0A3E0C0E0907F85E0C0E0A3E0C0E0A34E
- :1002D300E0F5F0A3907F82E0F5D0A3E0C0E0A3E0D7
- :1002E300F583D082D0E0D0A822EE6032AA82AB831D
- :1002F300AC82AD838A828B83A3E0F8A3E0F9A3E009
- :10030300FFA3AA82AB8388828983E0F8EFF0E08CB5
- :10031300828D836F7008E8F0A31E1E1EDED2E58275
- :10032300246B907F94F06160E0F874E5F0A3E8F04B
- :10033300A37422F0127F956154E0F8A3A3E0F9744B
- :10034300F5F0A3E8F0A37422F0E9127F977400613B
- :1003530054F8907F947401F0A3E8F08000717864FE
- :10036300FF04F0907F94E02403FE907F93E011ABB1
- :10037300A3DEFA2137907F94E02402FE907F937FDF
- :1003830000E02FFFA3DEFA22E8F0A3E9F0A3EAF0EE
- :10039300A3EBF0A3ECF0A3EDF0A3EEF0A3EFF0A337
- :1003A30022E0F8A3E0F9A3E0FAA3E0FBA3E0FCA3B7
- :0A03B300E0FDA3E0FEA3E0FFA3229B
- :00005301AC
複製代碼 .
.
.
.
俺用這個工具, 看她反編譯的源碼, 好像沒有看到 INT1 VECTOR
http://www.8051projects.net/download-d11-8051-disassembler.html
反編譯結果是, P3.3 和 P3.5 好像都有程序, 但是看不到 INT1 VECTOR 指向這個 INT1 的服務
請教一下有經驗的大大, 是俺的反編譯結果不正確, 還是真的不能用的
原來買的 8051 ICE 運到祖國後沒有帶上, 所以現在沒有工具, 只能用猜的
.
.
RESET VECTOR
- ;===============================================================;
- ; Disassembled Using DIS8051 - (C)1989 Data Sync Engineering ;
- ;===============================================================;
- ;
- ;
- ;
- ORG 00000H
- ;
- AJMP L0053
- ;
- ;
- ORG 00003H
- ;
- LJMP L1003
- ;
- ;
- ORG 0000BH
- ;
- LJMP L100B
- ;
- ;
- ORG 00013H
- ;
- LJMP L1013
- ;
- ;
- ORG 0001BH
- ;
- LJMP L101B
- ;
- ;
- ORG 00023H
- ;
- LJMP L1023
複製代碼 .
.
.
.
P3.3 routine and P3.5 routine
- L008E: MOV 06EH,R6 ;; should be UART hand coded RxD rotuine
- MOV 06FH,R7
- ;
- L0092: JB P3.3,L0092 ;; P3.3 / INT1 pin, wait for start bit
- MOV R6,#047H
- ;
- L0097: DJNZ R6,L0097
- MOV R7,#008H
- ;
- L009B: MOV C,P3.3 ;; roll in Carry bit to assemble 8 bits data
- RRC A
- MOV R6,#02DH
- ;
- L00A0: DJNZ R6,L00A0
- NOP
- DJNZ R7,L009B
- CLR C
- MOV R7,06FH
- MOV R6,06EH
- RET
- ;
- ;
- L00AB: MOV 06EH,R6 ;; should be UART hand coded TxD rotuine
- MOV 06FH,R7
- CLR P3.5 ;; send start bit
- MOV R6,#02FH
- ;
- L00B3: DJNZ R6,L00B3
- MOV R7,#008H
- ;
- L00B7: RRC A
- MOV P3.5,C ;; roll out 8 bits data
- MOV R6,#02DH
- ;
- L00BC: DJNZ R6,L00BC
- NOP
- DJNZ R7,L00B7
- SETB P3.5 ;; send stop bit
- MOV R6,#02FH
- ;
- L00C5: DJNZ R6,L00C5
- MOV R7,06FH
- MOV R6,06EH
- RET
複製代碼 |
|