; ****************************************************************************** ; Binary to Seven-Segment display routine ; Author:Zafar Ullah ; Written: 98/7/30 ; ;****************************************************************************** ; ;****** Assembler directives ; ; uses: SX28AC, 2 pages of program memory, 8 banks of RAM, high speed osc. ; operating in turbo mode, with 8-level stack & extended option reg. ; DEVICE pins28,pages2,banks8,oschs DEVICE turbo,stackx,optionx ID 'Seven-Se' ;program ID label RESET reset_entry ;set reset/boot address FREQ 50000000 ; ; ; ; ORG 100h ; ; Program execution begins here on power-up or after a reset ; reset_entry MOV M, #0ドルF ;set the mode registar. MOV !RB, #$FF ; Set Port B as Input MOV !RC, #00ドル ; Set the port C as Output :LOOP MOV W, RB ; Read Port B AND W, #0ドルF ; Masking significant bits CALL CHECK_TABLE ; Go to look up table MOV RC, W ; Output the value to port C NOP NOP JMP :LOOP ORG 10h CHECK_TABLE JMP PC+W ; Look up table RETW 40,ドル$F9,24,ドル30,ドル19,ドル12,ドル02,ドル78,ドル00,ドル18,ドル08,ドル03,ドル46,ドル21,ドル06,ドル0ドルE
.