關(guān)于非接觸式IC智能(射頻)卡及其讀寫設(shè)備內(nèi)核技術(shù)的研究與應(yīng)用開發(fā)(連載12)
文章出處:http:// 作者:張敏 人氣: 發(fā)表時(shí)間:2011年11月01日
;----------------- the 1st sector --------------------
COMPARE_04: CJNE A,#04H,COMPARE_05
lcall sector_01_common
MOV 78h,#04h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_05: CJNE A,#05H,COMPARE_06
lcall sector_01_common
MOV 78h,#05h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_06: CJNE A,#06H,COMPARE_07
lcall sector_01_common
MOV 78h,#06h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_07: CJNE A,#07H,COMPARE_08
lcall sector_01_common
MOV 78h,#07h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
;----------------- the 2nd sector --------------------
COMPARE_08:
CJNE A,#08H,COMPARE_09
lcall sector_02_common
MOV 78h,#08h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_09:
CJNE A,#09H,COMPARE_0A
lcall sector_02_common
MOV 78h,#09h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_0A: CJNE A,#10H,COMPARE_0B
lcall sector_02_common
MOV 78h,#0ah ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_0B: CJNE A,#11H,COMPARE_0C
lcall sector_02_common
MOV 78h,#0bh ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
;-----------------the 3rd sector -------------------
COMPARE_0C: CJNE A,#12H,COMPARE_0D
lcall sector_03_common
MOV 78h,#0ch ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_0D: CJNE A,#13H,COMPARE_0E
lcall sector_03_common
MOV 78h,#0dh ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_0E: CJNE A,#14H,COMPARE_0F
lcall sector_03_common
MOV 78h,#0eh ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
COMPARE_0F: CJNE A,#15H,COMPARE_10
lcall sector_03_common
MOV 78h,#0fh ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
;---------------- the 4th sector------------------------
COMPARE_10: CJNE A,#16H,COMPARE_11
lcall sector_04_common
MOV 78h,#10h ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
(省略COMPARE_11 至COMPARE_3E 之程序,基本同上)
COMPARE_3f: CJNE A,#63H,read_x_block_exit
lcall sector_15_common
MOV 78h,#3fh ;READ'S Sect. NO.
lcall read_x_block
ljmp read_x_block_exit
;------------------------ end of 0--63 block setup ----------------------
;---------------- exit ------------------------
read_x_block_exit:
ret
;--------------------------------
;------------------------ DISP_BUF_right_MOVE -------------------------------
DISP_BUF_right_MOVE:
MOV 32H,33H
MOV 33H,34H
MOV 34H,35H
MOV 35H,37H
MOV 37H,38H
MOV 38H,39H
MOV 39H,3AH
RET
;--------------------- read_x_block--------------------------
read_x_block:
setb p2.5 ;MCM ON (-RST=1)
clr p2.4 ;MCM ON (-CS=0)
MOV R2,#01H ;SELECT REQUEST_STD
;MOV R2,#00H
lcall request ;request
lcall display
lcall h_display
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
lcall anticollision ;anticollision
lcall display
lcall h_display
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
lcall select ;select
lcall display
lcall h_display
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
lcall load_key ;load_key
lcall display
lcall h_display
lcall d500ms
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
mov 7eh,79h ;sel keyset0
mov 7dh,7ah ;
mov 7ch,#60h ;auth_1a instr. code
lcall authentication ;authentication
lcall display
lcall h_display
lcall d500ms
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
mov 7dh ,#50h ;the address for storing reading_data
mov 7ch,78h ;read sector & block
lcall read ;read
lcall display
lcall h_display
lcall d500ms
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
lcall halt ;halt
lcall display
lcall h_display
lcall d500ms
clr p2.6
lcall init_disp_buf
lcall display
lcall h_display
lcall disp_rd_blk ;display the reading_value
lcall clear_disp_rd_blk_in_cpu
clr p2.6
MOV A,#80H ;SOFTWARE_RESET MCM
MOV R0,#01H
MOVX @R0,A
LCALL D500MS
ret
;---------------------end of “read_x_block” ----------------------
;-----------------------------------------------------
sector_01_common:
MOV 7fh,#0AaH
MOV 7eh,#00H
MOV 7dh,#01h
MOV 7ch,#47H
MOV 79h,#80H
MOV 7ah, #81h
MOV 7bh, #60H
ret
;-----------------------------------------------------
sector_02_common:
MOV 7fh,#0AbH
MOV 7eh,#00H
MOV 7dh,#02h
MOV 7ch,#60H
MOV 79h,#80H
MOV 7ah, #82h
MOV 7bh, #60H
ret
;----------------------------------------------------
(省略sector_03_common 至sector_14_common 之程序,基本同上)
;----------------------------------------------------
sector_15_common:
MOV 7fh,#0AaH
MOV 7eh,#00H
MOV 7dh,#0fh
MOV 7ch,#60H
MOV 79h,#80H
MOV 7ah, #8fh
MOV 7bh, #60H
ret
;----------------------------------------------------
;end of this program.
END
;====================== End of This Program =========================
結(jié) 束 語(yǔ)
智能IC卡片及其讀寫設(shè)備之技術(shù)正處于成熟/發(fā)展其間,只要我們中國(guó)自己的微電子技術(shù)再提高一步,相信我國(guó)將能實(shí)現(xiàn)真正意義上的“金卡工程”,因?yàn)閷?shí)現(xiàn)這一工程的軟件和硬件完全可以“自給自足”, 金融,郵電,公交等國(guó)家主干行業(yè)將能抵御外國(guó)“侵略”,不依賴進(jìn)口。筆者相信在國(guó)內(nèi)ICC界同行的共同努力下,在國(guó)家金卡工程辦公室領(lǐng)導(dǎo)小組的正確領(lǐng)導(dǎo)下,我國(guó)的國(guó)民經(jīng)濟(jì)將在得益于“金卡工程”的前提下,高速增長(zhǎng)。
(全文完)