📄 prn_edit.asm
字号:
S_MPL equ 0x10 ;'M+'
S_MMI equ 0x11 ;'M-'
S_M2TL equ 0x12 ;'MIIT'
S_M2ST equ 0x13 ;'MIIS'
S_M2PL equ 0x14 ;'MII+'
S_M2MI equ 0x15 ;'MII-'
S_PER_K equ 0x16 ;' %' for function key(in box)
S_PRDS equ 0x17 ;'-%'
S_PRAD equ 0x18 ;'+%'
S_DLTA_K equ 0x19 ;delta+' ' for function key(in box)
S_PRDL equ 0x1a ;delta+'%'
S_DLAS equ 0x1b ;delta+'*'
S_PRMU equ 0x1c ;' %'
S_MKUP equ 0x1d ;'MU'
;S_RVS equ 0x1e ;' '+up/down allow
S_EUAS equ 0x1e ;'Euro *' V3.14
S_MTH equ 0x1f ;M V3.13
S_ROOT equ 0x20 ;'R '
S_TAX equ 0x21 ;'TX%'
;S_PRN equ 0x22 ;' S'
S_PAY equ 0x22 ;P V3.13
S_EUR equ 0x23 ;'K '(fcR)
;S_EUM equ 0x24 ;'K-'
S_EUROS equ 0x24 ;'Euro'
S_EUEQ equ 0x25 ;'Euro ='
S_COST equ 0x26 ;'C '
S_SELL equ 0x27 ;' S'
S_MARG equ 0x28 ;'M%'
S_TAXA equ 0x29 ;' T'
S_ICG equ 0x2a ;'G '
S_G equ 0x2a
S_ICM equ 0x2b ;' M '
S_M equ 0x2b
;V4.02S_LCL equ 0x2c ;home+waru 1450TE V1.01
;V4.02S_LCAS equ 0x2d ;home+* 1450TE V1.01
;V4.02S_FC equ 0x2e ;euro+ x 1450TE V1.01
;V4.02S_FCAS equ 0x2f ;euro+* 1450TE V1.01
S_DLTA equ 0x2c;V4.020x30 ;delta+' '
S_PER equ 0x2d;V4.020x31 ;delta+' '
;S_EQU_A equ ;0x32 ;
S_CPAY equ 0x2e;V4.020x32 ;P* V3.13
S_TXPL equ 0x2f;V4.020x33 ;TX+
S_TXMI equ 0x30;V4.020x34 ;TX-
S_TLMGT equ 0x31;V4.020x35 ;TL M+
S_TX1PL equ 0x32;V4.020x36 ;TX1+
S_TX1MI equ 0x33;V4.020x37 ;TX1-
S_TX2PL equ 0x34;V4.020x38 ;TX2+
S_TX2MI equ 0x35;V4.020x39 ;TX2-
S_TAX1 equ 0x36;V4.020x3a ;T1%
S_TAX2 equ 0x37;V4.020x3b ;T2%
;V4.02S_GPM equ 0x3c ;GPM(MU)
;V4.02S_GS equ 0x3d
;V4.02S_GT equ 0x3d ;GT
;V4.02S_GPL equ 0x3e ;G+ for sigama=% when TA mode V2.11
S_STAMN equ 0x55
S_STAS equ 0x56
S_STASTA equ 0x57
;V3.00S_GS equ 0x0f ;G dia GT subtotal
;V3.00S_GT equ 0x10 ;G * GT total
;V3.00S_PRM equ 0x11 ;- % percent minus
;V3.00S_PRP equ 0x12 ;+ % percent plus
;V3.00S_DLP equ 0x13 ;d + delta plus(for tax+)
;V3.00S_DLM equ 0x14 ;d - delta plus(for tax-)
;V3.00S_AM equ 0x15 ;A M time print
;V3.00S_PM equ 0x16 ;P M time print
;V3.00S_CST equ 0xb7;0x17 ;C * cost price
;V3.00S_SEL equ 0x26;0x18 ;S * selling price
;V3.00S_MAR equ 0xa1;0x19 ;M % margine %
;V3.00S_MU equ 0xa2;0x1a ;M _ mark up
;V3.00S_MUD equ 0x57;0x1b ;d * delta of mark up
;V3.00S_SET equ 0x27;0x1d ;_ * for rate,time set(* only)
;V3.00S_SHD equ 0x22;0x1c ;_ _ for #/D print(space)
;V3.00S_TLG equ 0x93;0x0a ;G + total key with GT position
;==============================================================================
;V3.00S_FED equ 0x00 ;fh+' '
;V3.00S_PWR equ 0x17 ;'C*'
;V3.00S_PLS equ 0x01 ;' +'
;V3.00S_MIN equ 0x02 ;' -'
;V3.00S_SPC equ 0x00 ;' '
;V3.00S_SHP equ 0x26 ;' <>'
;V3.00S_TL equ 0x22 ;' *'
;V3.00S_TLGT equ 0x3c ;'*+'
;V3.00S_TLMGT equ 0x3d ;'*+'
;V3.00S_ST equ 0x08 ;' <>'
;V3.00S_MUL equ 0x03 ;' X'
;V3.00S_DIV equ 0x04 ;' /'
;V3.00S_EQU equ 0x05 ;' ='
;V3.00S_AST equ 0x22 ;' *'
;V3.00S_CLR equ 0x07 ;'c '
;V3.00S_MTL equ 0x0e ;'M*'
;V3.00S_MST equ 0x0d ;'M<>'
;V3.00S_MPL equ 0x0b ;'M+'
;V3.00S_MMI equ 0x0c ;'M-'
;V3.00S_M2TL equ 0x10 ;'G*'
;V3.00S_STASTA equ 0x77 ;'**'
;V3.00S_M2ST equ 0x0f ;'G<>'
;V3.00S_STAS equ 0x76 ;'*S'
;V3.00S_M2PL equ 0x3e ;'G+'
;V3.00S_STAPL equ 0x73 ;'*+'
;V3.00S_PLSTA equ 0x37 ;'+*'
;V3.00S_M2MI equ 0x3f ;'G-'
;V3.00S_STAMN equ 0x70 ;'*-'
;V3.00S_M2TLV equ 0x97 ;'G*'
;V3.00S_M2STV equ 0x96 ;'G<>'
;V3.00S_M2PLV equ 0x3e ;'G+'
;V3.00S_M2MIV equ 0x3f ;'G-'
;V3.00S_PER equ 0x06 ;' %'
;V3.00S_STAPER equ 0x71 ;'*%'
;V3.00S_PRDS equ 0x01 ;'-%'
;V3.00S_PRAD equ 0x31 ;'+%'
;V3.00S_DLTAL equ 0x82 ;delta+' '
;V3.00S_DLTA equ 0x28 ;' "+delta V1.26
;V3.00S_PRDL equ 0x81 ;delta+'%'
;V3.00S_DLAS equ 0x87 ;delta+'*'
;V3.00S_PRMU equ 0x21 ;' %'
;V3.00S_MKUP equ 0xa2 ;'M '
;V3.00S_RVS equ 0x22 ;' '
;V3.00S_AVR equ 0x27 ;' *'
;V3.00S_ROOT equ 0x22 ;' '
;V3.00S_TAX equ 0x12 ;'% '
;V3.00S_PRN equ 0x62 ;'<> '
;V3.00S_EUR equ 0x22 ;' '
;V3.00S_EUEQ equ 0xc2 ;'= '
;V3.00S_COST equ 0x2b ;' C'
;V3.00S_SELL equ 0x26 ;' <>'
;V3.00S_M equ 0x2a ;' M'
;V3.00S_MARG equ 0xa1 ;'M%'
;V3.00S_PERMARG equ 0x1a ;'%M'
;V3.00S_TAXA equ 0x27 ;' *'
;V3.00S_ICG equ 0x29 ;' G'
;V3.00S_ICGV equ 0x29 ;' G'
;V3.00S_ICM equ 0x2a ;' M'
;V3.00S_ASM equ 0x7a ;'*M'
;V3.00S_ASC equ 0x7b ;'*C'
;V3.00S_ASDL equ 0x78 ;'*'+delta
;V3.00S_MIPL equ 0x03 ;'-+'
;V3.00S_MIMI equ 0x00 ;'--'
;V3.00S_MIST equ 0x06 ;'-S'
;V3.00S_MITL equ 0x07 ;'-T'
;V3.00S_EUROS equ 0x29 ;' euro'
;V3.00S_G equ 0x9f ;'G '
;V3.00S_GPL equ 0x93 ;'G+'
;V3.00S_GAST equ 0x97 ;'G*'
;==============================================================================
P_SPC equ 0x20 ;for print " "
;-----------------------------------------------------------
;interrupt enable flag set:
EF4 equ 4;(EIRL).4 /INT0
EF5 equ 5;(EIRL).5 INTTC1
EF6 equ 6;(EIRL).6 INT1
EF7 equ 7;(EIRL).7 INTTBT
EF8 equ 0;(EIRH).0 INTTC3
EF9 equ 1;(EIRH).1 INTSIO(High speed SIO interrupt)
EF10 equ 2;(EIRH).2 INTTC4
EF11 equ 3;(EIRH).3 INT3
EF12 equ 4;(EIRH).4 INT4
EF13 equ 5;(EIRH).5 INTTC2
EF14 equ 6;(EIRH).6 /INT5
EF15 equ 7;(EIRH).7 INTADC or INT2
;interrupt request flag set:
IL2 equ 2;(ILL).2 INTSWI
IL3 equ 3;(ILL).3 INTATRAP
IL4 equ 4;(ILL).4 /INT0
IL5 equ 5;(ILL).5 INTTC1
IL6 equ 6;(ILL).6 INT1
IL7 equ 7;(ILL).7 INTTB
IL8 equ 0;(ILH).0 INTTC3
IL9 equ 1;(ILH).1 INTSIO
IL10 equ 2;(ILH).2 INTTC4
IL11 equ 3;(ILH).3 INT3
IL12 equ 4;(ILH).4 INT4
IL13 equ 5;(ILH).5 INTTC2
IL14 equ 6;(ILH).6 /INT5
IL15 equ 7;(ILH).7 INTADC or /INT2
; DBR_LCD_RATE equ (0x0f33<<4)+5 ;LCD DBR matrix point for "RATE"
; DBR_LCD1235_RATE equ (0x0f33<<4)+3 ;LCD DBR matrix point for "RATE"
; DBR_LCD1297_RATE equ (0x0f33<<4)+4 ;LCD DBR matrix point for "RATE"
; DBR_LCD120_RATE equ (0x0f33<<4)+4 ;LCD DBR matrix point for "RATE"
; DBR_LCD1297_GT equ (0x0f32<<4)+2 ;LCD DBR matrix point for "GT"
; ;LCD_PRN equ (0x0f31<<4)+3 ;LCD DBR matrix point for "PRINT"
; ;LCD_FIN equ (0x0f30<<4)+3 ;LCD DEB matrix point for "FIN"
AUTOOFFTIME equ 31250;1500
$list
public wk_print,feed_1,kfeed_1,err_print,line_print,wkup_print,ic_print,sym_print_br,print_shpd,print_bk
public set_symbol,edit_prn,wk_print91,ic_print00,ic_to_avr,wk_print9,wk_print_alws
public test_prn,stg_print,stop_print
public message_edit ;v4.04
extern spc_prnbuf
extern w1_clear,ten_clear,function_end,w2_clear,w4_clear,w1_to_ten
extern ten_to_w1,prn_to_dt,dt_to_prn,stg_sfl49,spc_disp
extern key_feed,print,hex_to_dec;,cmpl_bc
extern RP_CT_P,F_REDBAK,RP_RPTR
ROM section code
;==============================================================================
; Test print (print all character)
;==============================================================================
test_prn:
;V4.03 ld b,0x20
;V4.03test_prnx:
;V4.03 call spc_prnbuf
;V4.03 ld hl,PRN_BUF
;V4.03 ld c,0
;V4.03test_prn0:
;V4.03 ld (hl+c),b
;V4.03 inc b
;V4.03 cmp b,0
;V4.03 j eq,test_prn9
;V4.03 inc c
;V4.03 cmp c,16
;V4.03 j lt,test_prn0
;V4.03 push b
;V4.03 call wk_print91
;V4.03 pop b
;V4.03 j test_prnx
;V4.03test_prn9:
;V4.03 call wk_print91
ret
;==============================================================================
; Item counter print
;==============================================================================
;
; input: hl<- item counter address
;
ic_print:
ld wa,SW_IC
test (SW_IC>>4).a ;bit -reverse-> jump status
j t,ic_print99 ;if jump status is 1 -> branch
;GT logic..........................................................
ic_print00:
ld ix,PRN_BUF_MSD_LTP
test (FLG_MODE).0
j f,ic_print01
ld ix,PRN_BUF ;V4.03
ic_print01: ;V4.03
push hl
call spc_prnbuf
call set_symbol
;V3.01 cmp (IC_SYM),P_SPC
;V3.01 j eq,ic_print09
;V3.01 cmp (IC_SYM),S_ICM
;V3.01 j ne,ic_print01
;V3.01 ld (ix+22),ps_m
;V3.01 j ic_print09
;V3.01ic_print01:
;V3.01 cmp (IC_SYM),S_ICG
;V3.01 j ne,ic_print02
;V3.01 ld (ix+22),ps_g
;V3.01ic_print02:
;GT logic..........................................................
;V3.00 @BBC (M_694,ic_print09)
; cmp (IC_SYM),S_ICA
;V3.00 cmp (IC_SYM),S_ICI
;V3.00 j ne,ic_print05
;V3.00 ld (ix+22),ps_i
;V3.00 j ic_print09
;V3.00ic_print05:
;V3.00 cmp (IC_SYM),S_ICII
;V3.00 j ne,ic_print09
;V3.00 ld (ix+22),CA_II ;"II"
;GT logic..........................................................
ic_print09:
pop hl
ld b,(hl) ;4th 3rd digit of item counter
ld c,(hl+1) ;2nd,1st digit of item counter
ld a,b
and a,0xf0
cmp a,0x90 ;9xxx?
j ne,ic_print20 ;no -> positive value
;V3.00 call cmpl_bc ;complement bc register if 4th digit is 9
ld (ix),ps_min ;top of PRN_BUF <- minus sign
ic_print20:
ld a,c ;2nd,1st digit
and a,0x0f
;V4.03 or a,0x30
ld (ix+2),a
ld a,c ;2nd,1st digit
swap a
and a,0x0f
;V4.03 or a,0x30
ld (ix+1),a
ld a,b ;3rd digit
and a,0x0f
;V4.03 or a,0x30
ld (ix),a
j wk_print9 ;print with check P_NP flag
ic_print99:
ret
ic_to_avr:
;V4.11 ld a,(hl+1)
;V4.11 ld (AVR_ITEM+1),a
;V4.11 ld a,(hl)
;V4.11 ld (AVR_ITEM),a
;V4.11 ret
ten_to_avr:
;V4.11 ld a,(TEN_LSD)
;V4.11 ld (AVR_ITEM+1),a
;V4.11 ld a,(TEN_LSD-1)
;V4.11 ld (AVR_ITEM),a
;V4.11 ret
ic_to_w2:
;V4.11 ld a,(TEN_LSD)
;V4.11 ld (W2_LSD),a
;V4.11 ld (W4+7),a
;V4.11 ld a,(TEN_LSD-1)
;V4.11 ld (W2_LSD-1),a
;V4.11 ld (W4+6),a
;V4.11 ld a,(TEN_S)
;V4.11 j eq,ic_exit
;V4.11 xor (W2_S),0x01
;V4.11 xor (W4),0x01
;V4.11ic_exit:
ret
set_icsym:
;V3.01 ld hl,tbl_symbol
set_icsym02:
;V3.01 ld c,(IC_SYM)
;V3.01 ld a,(hl+c)
;V3.01 ld (PRN_BUF_SYM),a
ret
;==============================================================================
; Fixed string print
;==============================================================================
stop_print:
;V4.13 ld hl,mes_stop
;V4.13 j stg_print
line_print:
;V4.13 ld hl,mes_line
;V4.13 j stg_print
err_print:
call spc_prnbuf ;V4.04
ld hl,mes_error
ld c,4 ;V4.04
ld wa,M_5514T
test (M_5514T>>4).a ;bit -reverse-> jump status
j t,stg_print ;if jump status is 1 -> branch
ld ix,PRN_BUF_MSD ;V4.07
err_5514_prt: ;V4.07
ld (ix),ps_dot ;v4.07
inc ix ;V4.07
cmp ix,PRN_BUF_LSD ;V4.07
j le,err_5514_prt ;V4.07
jp print_bk ;V4.07
stg_print:
call message_edit
j print_bk ;print with black color
mes_error:
;V4.02 db " ERROR"
db ps_e,ps_r,ps_r,ps_o,ps_r
mes_line:
;V4.02 db "- - - - - - - - - "
mes_stop:
;V4.02 db "-*-*-*-*-*-*-*-*-*"
message_edit:
;V4.04 ld c,4
ld iy,PRN_BUF_LSD_LTP+3
test (FLG_MODE).0
j f,message_p0
ld iy,PRN_BUF_LSD+3
message_p0:
ld a,(hl+c)
ld (iy),a
dec iy
dec c
;V4.05 cmp c,0
;V4.05 j lt,message_p0
j f,message_p0
ret
;==============================================================================
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -