⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bios.asm

📁 辞典 dict3.asm.grammar.asm,newword.asm 学习 learn.asm 名片 userinf.asm 备忘 userinf.asm 提醒 userinf
💻 ASM
📖 第 1 页 / 共 3 页
字号:
; ***************************************************************************
; *     Project : Electronic Dictionary                                     *
; *        Date : 2003.9                                                    *
; *   File Name : BIOS.ASM                                                  *
; ***************************************************************************

        pw      128
        case    off
        externs on

        include st2202.def      ;;; Include ST2202 I/O define.
        include st2202.mac
        include xyhaddr.h

        include Data.def
        include DataBank.def
        include KeyDef.def
        include Graph.def
        include Graphics.old
        include bios.h
        include Debug.h
        public  copy_ram_data_to_flash
        public  copy_special_ram_buffer_to_flash
        public  copy_flash_data_to_flash
        public  clear_flash_buffer
        public  any_key_to_deldata_reset
        public  cdata_decide_updatescreen
        public  cdata_decide_write_flash
        public  cdata_decide_ChipErase
        public  cdata_decide_SectorErase
;        public  start_rom_checksum
        public  cdata_decide_lmainu
        public  cdata_decide_lmain
        public  popc3x
        public  SetMode5
        public  reset_ok
        public  delay_xxx
        public  sysmin
        public  setio
        public  ds0_getweek
        public  CalOSC
;        public  Main_5000
        public  Main_yh
;        public  Mainu_5000
        public  Mainu_yh
        public  vs0_end
        public  vs0_start
        public  ljbx_end
        public  ljbx_start
        public  ds0_updatescreen
        public  ds0_blockinvert
        public  bios_call_ext
        public  longgo_prg
        public  longgo_prg_end
        public  EntPowOff_xx
        public  EntPowOff_x
        public  initio
        public  bios_to_deldata_tab
        public  version_information
        public  power_on_reset
        public  gocoolstartup
        public  coolstartup
        public  reset_init
        public  inia5
        public  eventtab
        public  menueventtab
        public  ceflagtab
        public  poweroffprc
        public  entpowoff
        public  LongGo
        public  LRTS
        public  LJSR
        public  Main
        public  MainU
        public  SetTimer
        public  Adc60
        public  Adc24
        public  IncDate
        public  IncMonth
        public  NxAdc
        public  NxAdc1
        public  NxINS           ;; INS += 1.
        public  NxSeed          ;;
        public  SetMode         ;; Set mode .
        public  InitAll         ;; Initial all RAM for mode exchange.
        public  ExitHelp        ;; Exit help process .
        public  EntClkMode      ;; Entry clock mode.
        public  Main33
        public  GetDays                 ;;      Get days procedure.(For alarm mode)
        public  GetDays1                ;;      Get days procedure.(For alarm mode)
        public  CheckLeapYear           ;;      Check leap-year procedure.
        public  CLeapYear1              ;;      Check leap-year procedure 1.
        public  ds0_bios_to_test        ;;      Check leap-year procedure 1.
        public  write_y_bytes_to_flash
        public  ExMode
        
        public  FunKTab
        public  SubExModeMulTab
        
OSCFreq         equ     CData+9
CheckSum1       equ     CData+11
CheckSum2       equ     CData+12
CheckSum3       equ     CData+13
CheckSum4       equ     CData+14
drr_bak   equ   85h
addrl     equ   87h
addrh     equ   88h

;;=====================================================
Sec30   equ     30              ;; Second 30.
Minu1   equ     60              ;; Auto. power off time for alarm sound.
Minu3   equ     60*3            ;; Auto. power off time .
Minu5   equ     60*5            ;; Auto. power off time .
Minu10  equ     60*10           ;; Auto. power off time .

EventNo equ     9               ;; Event numbers.

;;=====================================================
DS0     .SECTION
;;=========================================
version_information:
       db      'HB  TD-2.0',0
ver_string:
        db      0dh,'版本: ',0

EventTab:
        dw      Catalogevent    ;;总目录		0
;        dw      LibEvent        ;; 资料事件处理向量表 8
        dw      Catalogevent    ;;总目录                1

        dw      clockEvent      ;; 时间事件处理向量表	2
        dw      CardEvent       ;; 名片簿事件处理向量表	14
;        dw      clockEvent      ;; 时间事件处理向量表   3

        dw      newEnChEvent    ;; 英翻中事件处理向量表。       4
        dw      DicChEnEvent    ;; 中翻英事件处理向量表。     5

        dw      CalculatorEvent ;; 计算机事件处理向量表。 6
        dw      StudyEvent      ;; 学习事件处理向量表。   7

        dw      LibEvent        ;; 资料事件处理向量表	8
	dw      OtherEvent      ;; Other事件处理向量表	9

	dw	0		;power key 占去了
	dw	0		;
        
	dw      NetEvent        ;;			12
        dw      GameEvent       ;; Game事件处理向量表	13

        dw      CardEvent       ;; 名片簿事件处理向量表	14
        dw      RemarkEvent     ;; 备忘事件处理向量表	15

        dw      AlarmEvent      ;; 闹铃事件处理向量表	16
	dw      fu_lu_event      ;;		17

	dw      card_bak_Event   ;;	18
	dw      alarm_bak_event  ;;	19
        
MenuEventTab:
        dw      MenuEvent       ;; 目录事件处理向量表。20
        dw      HelpEvent       ;; 帮助(求助)事件处理向量表。21
        dw      AlarmViewEvent  ;; 测试Mode事件处理向量表。22
        dw      DelDataEvent    ;; Delete data mode23
;;;;;//////////////////////////////////////////////////////////
;        dw      LowBatEvent	;24
        dw      ChangeEvent     ;; 换算事件处理向量表。         24
	dw	CH_Dic_Event	;;	25
	dw	CH_Idiom_Event	;;	26
;        dw      0ffffh,0ffffh
;;;;;//////////////////////////////////////////////////////////
;;=======================================================
;;       Event mask table.
;;=======================================================
CEFlagTab:
        db      11111110b
        db      11111101b
        db      11111011b
        db      11110111b
        db      11101111b
        db      11011111b
        db      10111111b
        db      01111111b

;;=======================================================
;;       Extera mode index look-up table.
;;=======================================================
SubExModeMulTab:
        db      0*(EventNo*2+2)
        db      1*(EventNo*2+2)
        db      2*(EventNo*2+2)
        db      3*(EventNo*2+2)
        db      4*(EventNo*2+2)
        db      5*(EventNo*2+2)
        db      6*(EventNo*2+2)
        db      7*(EventNo*2+2)

LowArdTab:
        db      Sec
        db      Min
        db      Day
        db      Month

LowDatTab:
        db      60h     ;; Sec
        db      60h     ;; Min
        db      32h     ;; Day
        db      13h     ;; Month

bios_to_deldata_normal:
        dw      DelDataBank
        dw      deldata_Load-1
bios_to_deldata_tab:
        dw      DelDataBank
        dw      jmp_deldata_2-1
ds0_ChkSCData:
        dw      AlarmBank
        dw      ChkSCData-1
ds0_check_secret:
        dw      OTherBank
        dw      check_if_secret-1
ds0_LowBatDetect:
        dw      testbank
        dw      LowBatDetect-1
ds0_bios_to_test:
        dw      testbank
        dw      TestTLoad-1
ds0_EntPowOff_process:
        dw      testbank
        dw      EntPowOff_process-1
ds0_EntPowon_process:
        dw      testbank
        dw      EntPowon_process-1
ds0_lupdate_all_icon:
        dw      testbank
        dw      if_update_5000icon_or-1
ds0_blockinvert:
        dw      testbank
        dw      invert_5000_or-1
ds0_updatescreen:
        dw      testbank
        dw      updatescreen_5000_or-1
ds0_JIntXInt:
        dw      testbank
        dw      JIntXInt_in_ds0-1
ds0_srx_int:
        dw      testbank
        dw      srx_int_in_ds0-1
ds0_stx_int:
        dw      testbank
        dw      stx_int_in_ds0-1
ds0_lcd_int:
        dw      testbank
        dw      lcd_int_in_ds0-1

ds0_fontgame_load_5000:
        dw      fontgame_bank
        dw      fontgame_load_5000-1

ds0_fontgame_load_yh:
        dw      fontgame_bank
        dw      fontgame_load_yh-1

ds0_GetWeek:
        dw      ClockBank
        dw      bios_GetWeek-1

ds0_select_ic:
        dw      DelDataBank
        dw      select_ic-1
ds0_warm_up_start_last:
        dw      testbank
        dw      warm_up_start_last-1

;;=======================================================
;FunKTab:
;        db      caltalogkey     ;; 0
;        db      timekey         ;; 7       
;        db      newenchkey      ;; 14
;        db      JiSuanKey             ;; 51        
;        db      libKey             ;; 51        
;        db      PowerKey             ;; 51        
;        db      netkey             ;; 51        
;        db      7fh             ;; 51        
;        db      HelpKey         ;; 51        
;        db      NullKey        

;;=======================================================
FunKTab:
        db      caltalogkey     ;; 0
        db      timekey         ;; 7       
        db      newenchkey      ;; 14
        db      JiSuanKey             ;; 51        
        db      libKey             ;; 51        
        db      PowerKey             ;; 51        
        db      netkey             ;; 51        
        db      CardKey             ;; 51        
        db      HelpKey         ;; 51        
        db      NullKey        
reserve_ds0_data:
        dw      0ffffh,0ffffh,0ffffh
;;=====================================================
;;=====================================================
;;       Bank #0 interrupt vector.
LJB0:   .SECTION
ljbx_start:
	db	0f7h
LRTS:
        pla
LongGo:
        pha
        stx     x_temp_bak
        ldx     #longgo_prg_end-longgo_prg-1
?2:
        lda     longgo_prg,x
        sta     bank_trans_ram,x
        dex
        bpl     ?2
        ldx     x_temp_bak
        jmp     bank_trans_ram

bank_trans_in_ram:
        lda     (<LJInx),y
        tax
        dey
        lda     (<LJInx),y

        sta     <prrl
        stx     <prrh
        lda     <AReg
        ldy     <YReg
        ldx     x_temp_bak
        rts
bank_trans_in_ram_end:

longgo_prg:
        pla
        sta     <PRRl
        pla
        sta     <prrh
        rts
longgo_prg_end:

ljsr:
        sta     <AReg
        lda     <prrh
        pha                     ;; Push the bank register.
        lda     <prrl
        pha                     ;; Push the bank register.

        lda     #>LRTS-1        ;; Set long return address.
        pha
        lda     #<LRTS-1
        pha

        stx     x_temp_bak
        clc
        tsx
        lda     100h+5,x
        sta     <LJInx
        adc     #4
        sta     100h+5,x
        lda     100h+6,x
        sta     <LJInx+1
        adc     #0
        sta     100h+6,x        ;; Return address +=3.

        sty     <YReg
        ldy     #4
to_read_other_bank_sub_program:
        lda     (<LJInx),y       ;; Get high address.
        pha
        dey
        lda     (<LJInx),y       ;; Get low address.
        pha
        dey
;;=========================
        ldx     #bank_trans_in_ram_end-bank_trans_in_ram-1
?1:
        lda     bank_trans_in_ram,x
        sta     bank_trans_ram,x
        dex
        bpl     ?1
        jmp     bank_trans_ram

ljbx_end:
;==========================================
LJB2:   .SECTION
ljb2_section_start:
        include ljbx.asm
LJB3:   .SECTION
ljb3_section_start:
        include ljbx.asm
LJB4:   .SECTION
ljb4_section_start:
        include ljbx.asm
LJB5:   .SECTION
ljb5_section_start:
        include ljbx.asm
LJB6:   .SECTION
ljb6_section_start:
        include ljbx.asm
LJB7:   .SECTION
ljb7_section_start:
        include ljbx.asm
LJB8:   .SECTION
ljb8_section_start:
        include ljbx.asm
LJB9:   .SECTION
ljb9_section_start:
        include ljbx.asm
LJB0a:   .SECTION
ljb0a_section_start:
        include ljbx.asm
LJB0b:   .SECTION
ljb0b_section_start:
        include ljbx.asm
LJB0D:   .SECTION
ljb0D_section_start:
        include ljbx.asm
;;=====================================================
;;=====================================================
PS0     .SECTION
BankNo  equ     BiosBank
st2202ver:
        dw      0002

ATPTab: dw      -Minu3
        dw      -Minu5
;;=============================================
JIntXInt:
srx_int:
stx_int:
lcd_int:
reserved_add:
NullInt:
        rti

;;======================================================
;;       复位后程式从这里开始!
;;======================================================
power_on_reset:
Init:
        sei                     ;; Disable all interrupt.
        stz     <prrh
        stz     <prrl
        ldx     #0ffh
        txs                     ;; Set SP to stack's top.
        cld                     ;; Set Hex. mode.
        stz     <misc           ;;不使能WDT
        nop
        nop
        nop
        nop
        nop
        nop
        nop
        nop

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -