?? business_fn.mac
字號:
$nolist
;*******************************************************************************
;*******************************************************************************
;* *
;* (C)Copyright, CLOVER China Electronics Co.,LTD. *
;* All Rigits Reserved *
;* add:No.58-F Yang Dong Road, LuoFeng Demonstrative Zone Suzhou, China *
;* Tel: 0512-67261886 Fax:0512-67261882 *
;* http://www.clover.co.jp *
;* *
;*******************************************************************************
;*******************************************************************************
;
; OBS CPD3212T source program
; CPU: TOSHIBA TLC-870/C series TMP86CM74A
; RAM: 2Kbytes(0040h - 083Fh)
; ROM: 32Kbytes(8000h - FFFFh)
;
;
;Basic function............................
?trigger(@)
@include "symdef_ram.inc"
@include "symdef_sub.inc"
@include "macro.inc"
@include "define.inc"
$list
public tax_plus,tax_minus,cost_key,sell_key,margin_key,tax_save,tax_recall,kychk_clcsm;wk_prn_2L
public rate_key,euro_key,local_key,check_dp_over2,rate_ten_key;,keychk_amortize
public euro_display,eurate_minus_key,eurate_plus_key,init_rate_dispaly,fix_euro_to_ten
public tax2_plus,tax2_minus,tax_plus,tax_minus,tax_plus_a,tax12_plus,tax12_minus,tax_minus_a
public keep_ten_6dig,euro_rate_recall_x,euro_set_sub
extern function_end,no_operation,wk_round_0
extern mem2_plus,mem2_minus,move_to_ten
extern edit_prn ;V2.08
public tax_plus_x,tax_minus_x ;V2.18
public rate_ten_key_01,fix_euro_to_ten,euro_print
extern euro_fix_rate_tbl,wk_print9
public rate_ten_key_01 ;V4.12
ROM section code
RATE_HOLD_TIM equ 150
;===============================================================================
; RATE key
;===============================================================================
rate_ten_key:
cmp (KEYIN),K_ZERO2
j ge,no_operation
@BBC (F_TNKEY,rate_ten_key_00y)
ld hl,TENKEY ;V3.07
call _zerock ;V3.07
j eq,rate_ten_key_01 ;V3.07
rate_ten_key_00y:
@CLB (EURO_PROG) ;V4.12
@BBC (F_COUNTRY,rate_ten_key_0)
@CLB (F_COUNTRY)
;V4.18 ld w,(COUNTRY_TEN)
;V4.18 ld a,10
;V4.18 mul w,a
;V4.18 clr cf
ld a,(COUNTRY_TEN) ;V4.18
add a,(KEYIN)
ld (COUNTRY_TEN),a ;get country code
cmp (COUNTRY_TEN),17
j ge,rate_ten_key_00
@SEB (EURO_PROG)
@BBS (F_TNKEY,rate_ten_key_000)
cmp (COUNTRY_TEN),12
j ge,rate_ten_key_00x
call fix_euro_to_ten
jp rate_ten_key_001
rate_ten_key_00x:
ld a,(COUNTRY_TEN)
set cf
sub a,12
call ee_to_ten
call keep_ten_6dig
jp rate_ten_key_001
rate_ten_key_000:
cmp (COUNTRY_TEN),12
j lt,rate_ten_key_00
rate_ten_key_001:
call euro_display
jp rate_key_end
rate_ten_key_00:
ld a,(KEYIN)
ld (DISP+6),a
;V4.17 j rate_ten_key_01
j rate_ten_key_01x ;V4.17
rate_ten_key_0:
@BBS (F_TNKEY,rate_ten_key_0x)
ld a,(KEYIN)
jp rate_ten_key_0y
rate_ten_key_0x:
ld hl,TENKEY ;V3.06
call _zerock ;V3.06
j eq,rate_ten_key_01 ;V3.06
ld a,(KEYIN)
; cmp a,1
; j lt,rate_ten_key_01
rate_ten_key_0y:
ld (DISP+5),a
ld (DISP+6),D_SPC
ld w,a ;V4.18
ld a,10 ;V4.18
mul w,a ;V4.18
ld (COUNTRY_TEN),a ;V4.18
cmp a,17 ;V4.18
;V4.18 cmp a,2
j lt,rate_ten_key_1
j rate_ten_key_01x ;V4.17
rate_ten_key_01:
ld hl,TENKEY ;V4.12
call _zerock ;V4.12
j nz,rate_ten_key_01x ;V4.12
call ten_clear ;V4.12
; @CLB (F_TNKEY) ;V4.12
@CLB (F_DPIN) ;V4.12
; @CLB (F_MIN_TRA) ;V4.12
ld (TEN_CT),0 ;V4.12
ld (DT_CT),0 ;V4.12
call spc_disp ;V4.12
ld hl,TENKEY ;V4.12
call edit_disp ;V4.12
rate_ten_key_01x: ;V4.12
@SEB (F_CALER)
@SEB (ICON_E)
ld a,(KEYIN) ;V4.12a
ld (PRE_KEY),a ;V4.12a
j rate_key_end_99
rate_ten_key_1:
ld (COUNTRY_TEN),a
@SEB (F_COUNTRY)
j rate_key_end_99
;------------------------------
fix_euro_to_ten:
ld w,(COUNTRY_TEN)
ld a,8
mul w,a
ld c,a
ld b,0
ld ix,euro_fix_rate_tbl
clr cf
add ix,bc
call move_to_ten
ld hl,TENKEY
call stg_sfr49
ld hl,TENKEY
call stg_sfr49
ret
;====================================================================
rate_key:
ld a,(FLG_E) ;V3.04
or a,(FLG_C) ;V3.04
and a,0y01111111 ;V3.04
j ne,no_operation ;V3.04
cmp (PRE_KEY),K_PLS
j eq,no_operation
cmp (PRE_KEY),K_MIN
j eq,no_operation
@BBS (EURO_PROG,no_operation) ;V3.04
@BBS (F_COUNTRY,no_operation) ;V3.04
cmp (PRE_KEY),K_EURO_LOCAL_TAX_DUM
j ne,rate_key_0
call ten_clear
jp rate_key_enter_rate_mode
rate_key_0:
@BBS (F_TNKEY,rate_key_1)
ld hl,TENKEY
call _zerock
j ne,no_operation
ld a,(TENKEY+OFF_DP)
j ne,no_operation
@IS_5514_OFF(rate_key_1) ;V4.12
test (TEN_S).0 ;V4.12
j f,no_operation ;V4.12
;V3.01 call ten_clear ;V1.26
rate_key_1:
@SEB (F_RATE) ;V4.17
ld a,(TENKEY)
j ne,rate_key_2
call ten_to_w1
call w2_clear
ld (W2+4),0x01 ;set w2=1000000
xor (W2_S),1
call calc_add
test (W1_S).0
j f,rate_key_enter_rate_mode
rate_key_2:
@SEB (ICON_E)
@SEB (F_CALER)
call ten_clear
ld a,(KEYIN) ;V4.17
ld (PRE_KEY),a ;V4.17
jp rate_key_end_9
rate_key_enter_rate_mode:
@SEB (F_RATE)
call to_dec_ten_digit
;V3.01 @CLB (RATE_PROG) ;V1.09
;V3.01 @CLB (EURO_PROG) ;V1.09
;V4.13 @CLB (M_TX2) ;V2.07
;V4.13 @CLB (M_TX1) ;V2.07
;V1.30 @SEB (SW_RAT_RT)
ld (DW_CT),RATE_HOLD_TIM
;V1.09 @BBS (F_RATE,no_operation)
rate_key_end_9:
call spc_disp
ld hl,TENKEY
call edit_disp
rate_key_end_99:
ld (DISP+2),D_S
ld (DISP+3),D_E
ld (DISP+4),D_T
call disp_to_dbr
rate_key_end:
;V3.01 jp function_end
jp no_operation ;V3.01
;=============================================================================
keep_ten_6dig:
ld (TEN_CT),14
ld c,1
ld hl,TENKEY
keep_ten_6dig_x:
ld a,(hl+c)
and a,0xf0
j ne,keep_ten_6dig_0
dec (TEN_CT)
ld a,(hl+OFF_DP)
cmp a,(TEN_CT)
j ge,keep_ten_6dig_0
ld a,(hl+c)
and a,0x0f
j ne,keep_ten_6dig_0
dec (TEN_CT)
ld a,(hl+OFF_DP)
cmp a,(TEN_CT)
j ge,keep_ten_6dig_0
inc c
cmp c,8
j ge,keep_ten_6dig_0
jp keep_ten_6dig_x
keep_ten_6dig_0:
cmp (TEN_CT),6
j lt,to_inc_ten_digit
to_dec_ten_digit:
cmp (TEN_CT),7
j lt,keep_ten_6dig_end
j gt,to_dec_ten_digit_1
cmp (TEN_DP),6
j ne,to_dec_ten_digit_1
ld hl,TENKEY+1
call test_zero_before_dp
j cc,keep_ten_6dig_end
to_dec_ten_digit_1:
ld hl,TENKEY
call stg_sfr47
dec (TENKEY+8)
dec (TEN_CT)
j gt,to_dec_ten_digit
to_inc_ten_digit:
cmp (TEN_CT),6
j ge,keep_ten_6dig_end
ld hl,TENKEY
call stg_sfl47
inc (TENKEY+8)
inc (TEN_CT)
j to_inc_ten_digit
keep_ten_6dig_end:
ret
;-----------------------------------------
test_zero_before_dp:
ld c,0
ld w,14
test_zero_before_dp_s:
ld a,(hl+c)
and a,0xf0
j ne,test_zero_before_dp_1
dec w
cmp w,(hl+OFF_DP-1)
j eq,test_zero_before_dp_0
ld a,(hl+c)
and a,0x0f
j ne,test_zero_before_dp_1
dec w
cmp w,(hl+OFF_DP-1)
j eq,test_zero_before_dp_0
inc c
jp test_zero_before_dp_s
test_zero_before_dp_0:
clr cf
ret
test_zero_before_dp_1:
set cf
ret
;-----------------------------------------
;V2.08
check_dp_over_slid:
ld a,(hl+OFF_DP)
cmp a,(DP_POS)
check_dp_over_slid_0:
j ge,check_dp_over_slid_end
ld d,(hl+OFF_MSD)
@BBS (M14,check_dp_over_slid_1) ;V1.21
ld d,(hl+OFF_MSD12) ;V1.21
@BBC (M10,check_dp_over_slid_1) ;V1.21
ld d,(hl+OFF_MSD10) ;V1.21
check_dp_over_slid_1: ;V1.21
and d,0xf0
j nz,check_dp_over_slid_end
inc (hl+OFF_DP)
call stg_sfl47
jp check_dp_over_slid
check_dp_over_slid_end:
ret
;V2.08
;=================================
check_dp_over2:
cmp (hl+OFF_DP),2
check_dp_over2_0:
j ge,check_dp_over2_end
ld d,(hl+OFF_MSD)
@BBS (M14,check_dp_over2_1) ;V1.21
ld d,(hl+OFF_MSD12) ;V1.21
@BBC (M10,check_dp_over2_1) ;V1.21
ld d,(hl+OFF_MSD10) ;V1.21
check_dp_over2_1: ;V1.21
and d,0xf0
j nz,check_dp_over2_end
inc (hl+OFF_DP)
call stg_sfl47
jp check_dp_over2
check_dp_over2_end:
ret
keep_2dp:
ld a,(DP_POS)
push a
ld (DP_POS),2
call wk_round_0
pop a
ld (DP_POS),a
ret
;V2.06-----------------------------
fix_round_down_keep_2dp:
ld a,(MDFLG_1) ;V2.06 keep round flag
push a ;v2.06
@CLB (SW_RNDUP) ;V2.06
@CLB (SW_RND54) ;V2.06
call keep_2dp
pop a ;V2.06
ld (MDFLG_1),a ;V2.06 restore round flag
ret
fix_round_up_keep_2dp:
ld a,(MDFLG_1) ;V2.06 keep round flag
push a ;v2.06
@SEB (SW_RNDUP) ;V2.06
@CLB (SW_RND54) ;V2.06
call keep_2dp
pop a ;V2.06
ld (MDFLG_1),a ;V2.06 restore round flag
ret
;V2.06---------------------------------------
tax_mark_print:
;V3.00 @BBS (SW_V15,tax_mark_print_0) ;V2.07
ret ;V2.07
;V3.00tax_mark_print_0: ;V2.07
;V3.00 call spc_prnbuf
;V3.00 ld hl,PRN_BUF
;V3.00 ld a,0xcc
;V3.00 ld c,7
;V3.00 whic_tax_print_1:
;V3.00 ld (hl+c),a
;V3.00 dec c
;V3.00 cmp c,3
;V3.00 j f,whic_tax_print_1
;V3.00 ld a,0xfc ;only"." at right side
;V3.00 ld (hl+c),a
;V3.00 ld (PRN_BUF_SYM),S_SPC
;V3.00 ld (PRN_BUF+5),0xc1 ;for set_tax1_mark_print:
;V3.00 @BBC (M_TX2,whic_tax_print_end)
;V3.00 @BBC (M_TX1,to_tax2_mark_print) ;V2.07
;V3.00 ld (PRN_BUF+5),0x1b ;V2.07 '1,'
;V3.00 ld (PRN_BUF+6),0x2c ;V2.07 '2.'
;V3.00 jp whic_tax_print_end ;V2.07
;V3.00to_tax2_mark_print: ;V2.07
;V3.00 ld (PRN_BUF+5),0xc2 ;for set_tax2_mark_print:
;V3.00whic_tax_print_end:
;V3.00 call print_bk
;V3.00 ret
;----------------------------------------------------V2.06
;===============================================================================
tax2_plus:
;V4.11 @SEB (M_TX2)
;V3.00 @BBC (SW_V15,tax2_plus_x) ;v1.19\
;V3.00 ld (KEYIN),K_TAX ;V1.19|wait for acc_plus or acc_minus
;V3.00 @BBS (F_RATE,tax_plus_0) ;V1.20
;V3.00 jp tax_min91 ;V1.19/
tax2_plus_x: ;V1.19
jp tax_plus_a ;V1.17
;===============================================================================
; TAX+
;===============================================================================
tax_plus:
;V3.00 @BBC (SW_V15,tax_plus_x) ;V1.19\
;V3.00 @SEB (M_TX1) ;V2.07|
;V3.00 ld (KEYIN),K_TAX ;V1.19|will wait for [+] or [-] to perform [TAX+] or [TAX-]
;V3.00 @BBS (F_RATE,tax_plus_0) ;V1.20|--> is recall or set rate?
;V3.00 jp tax_min91 ;V1.19/
;V4.17 @IS_5514_OFF(tax_plus_x) ;V4.12
@IS_5514_ON(tax_plus_x) ;V4.17
@BBS (F_TNKEY,tax_plus_x) ;V4.17
ld a,(FLG_E) ;V4.12
and a,0y00000011 ;V4.12
j ne,no_operation ;V4.12
tax_plus_x:
@SEB (F_REVCAN) ;V4.07
@BBC (SW_EUTX,tax_plus_a) ;
ld (KEYIN),K_EURO ;need to perform euro logic?
jp euro_key_start
tax_plus_a:
@BBS (F_RATE,tax_plus_0)
tax_plus_y: ;V1.09\
call tax_equ
@BBS (F_CALER,tax_equ_end) ;V4.11
j cs,no_operation
call ten_to_w2dp ;V1.15|ten buffer write into W2
cmp (PRE_KEY),K_TXM ;V1.15\
j eq,tax_min00 ;V1.15/yes, jump to-->
jp tax_minus_yuan
;=================================================================================
;rate setting or rate recall
tax_plus_0:
@IS_5514_ON(tax_plus_0x) ;V4.12
@BBS (EURO_PROG,tax_plus_01)
tax_plus_0x: ;V4.12
@BBC (F_TNKEY,tax_plus_01) ;V1.13\
ld (KEYIN),0xff ;V1.13| is rate setting?
jp tax_plus_1 ;V1.13/
tax_plus_01: ;V1.13
call tax_recall
jp tax_plus_2
tax_plus_1: ;------------------------------------------tax rate set
call tax_save
tax_plus_2:
@CLB (RATE_PROG)
@CLB (EURO_PROG)
@CLB (F_RATE)
@CLB (F_TNKEY)
@CLB (F_DPIN)
ld (TEN_CT),0 ;
ld (DT_CT),0 ;
ld (DT_DOT_CNT),0 ;
ld (DT_CHR_CNT),0 ;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -