Title induction cooker controller
;OSC:16.000MHz
Chip SN8P1706
//{{SONIX_CODE_OPTION
.Code_Option OSG Enable
.Code_Option High_Clk 12M_X’tal
.Code_Option High_Clk/2 DISAble
.Code_Option Security Enable
.Code_Option LVD Enable
.Code_Option Watch_Dog Enable
//}}SONIX_CODE_OPTION
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\
InitPort macro
MOV a,#01110000b ;p4.7,p4.3 as A/D input
b0 MOV P4M,a
MOV a,#00111111b
b0 MOV P5M,a
MOV a,#0xff
b0 MOV P2M,a
MOV a,#11000000b
b0 MOV P1M,a
@set_pur 0x23
clr P1
clr P2
clr P4
clr P5
MOV a,#0x44
b0 MOV TC1M,a
MOV a,#225 ;225
b0 MOV TC1R,a
b0bset FTC1OUT ;buzzer on
b0bset FTC1ENB
MOV a,#11110101b ;1:16 16uS
b0 MOV TC0M,a
MOV a,#0xff
b0 MOV TC0R,a
MOV a,#11110000b ;1:2 1uS
b0 MOV T0M,a
MOV a,#00010000b
b0 MOV INTEN,a
clr INTRQ
endm
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;*****************************
;clear ram (00h-->7fh)
;*****************************
ClearRam macro
clr Y
b0 MOV Z,#0x7f
Clear_Ram01:
clr @YZ
decms Z
jmp Clear_Ram01
endm
;\\\\\\\\\\\\\\\\\\\\\\
BuzzerActive macro
b0bts1 BuzzerEnable
jmp BuzzerStop
b0 MOV a,BuzNumber
b0bts0 FZ
jmp BuzzerStop
b0bts1 BuzzerShort
jmp BuzNormal01
MOV a,#50
jmp BuzNormal02
BuzNormal01:
MOV a,#100
BuzNormal02:
sub a,TimerBuz
b0bts0 FC
jmp BuzzerRet
;else buzzer time over
BuzzerTimeOver:
clr TimerBuz
b0bts1 BuzzerIsOn
jmp BuzzerTimeOver01
b0bclr BuzzerIsOn ;buzzer on
b0bset BUZZER
jmp BuzzerTimeOver02
BuzzerTimeOver01:
b0bclr BUZZER ;buzzer off
b0bset BuzzerIsOn
BuzzerTimeOver02:
b0bts0 BuzzerIsOn
jmp BuzzerRet
decms BuzNumber
jmp BuzzerRet
BuzzerStop:
b0bclr BuzzerEnable
b0bclr BuzzerIsOn
BuzzerRet:
endm
;*****************************
include define.asm
.CODE
org 0x00
jmp Reset
org 0x08
jmp Interrupt
org 0x10
;*******************
MultiplICation:
; b0 MOV a,CurrentL
b0 MOV a,VoltageL
mul a,VoltageL
b0 MOV ELO,a
b0 MOV a,R
b0 MOV ALO,a
; b0 MOV a,CurrentH
b0 MOV a,VoltageH
mul a,VoltageL
add a,ALO
b0 MOV EHI,a
b0 MOV a,R
b0 MOV DLO,a
b0bts0 FC
incms DLO
nop
clr DHI
; b0 MOV a,CurrentL
b0 MOV a,VoltageL
mul a,VoltageH
b0 MOV CLO,a
b0 MOV a,R
b0 MOV ALO,a
; b0 MOV a,CurrentH
b0 MOV a,VoltageH
mul a,VoltageH
add a,ALO
b0 MOV CHI,a
b0 MOV a,R
b0 MOV BLO,a
b0bts0 FC
incms BLO
nop
b0bclr FC
b0 MOV a,CLO
adc EHI,a
b0 MOV a,CHI
adc DLO,a
b0 MOV a,BLO
adc DHI,a
b0 MOV a,ELO
mul a,CurrentH
b0 MOV CLO,a
b0 MOV a,R
b0 MOV ALO,a
b0 MOV a,EHI
mul a,CurrentH
add a,ALO
b0 MOV CHI,a
b0 MOV a,R
b0 MOV ALO,a
b0 MOV a,DLO
mul a,CurrentH
add a,ALO
b0 MOV BLO,a
b0 MOV a,R
b0 MOV BHI,a
b0 MOV a,ELO
mul a,CurrentL
b0 MOV ELO,a
b0 MOV a,R
b0 MOV ALO,a
b0 MOV a,EHI
mul a,CurrentL
add a,ALO
b0 MOV EHI,a
b0 MOV a,R
b0 MOV ALO,a
b0 MOV a,DLO
mul a,CurrentL
add a,ALO
b0 MOV DLO,a
b0 MOV a,R
b0 MOV DHI,a
b0bclr FC
b0 MOV a,CLO
adc EHI,a
b0 MOV a,CHI
adc DLO,a
b0 MOV a,BLO
adc DHI,a
b0bts0 FC
incms BHI
nop
ret
;;;;;====================================
Mpy16: ;;;INPUT (BY MULTIPLIER)AHI,ALO;(MULTIPLIER)BHI,BLO
;;;OUT DHI,DLO,EHI,ELO
;;;======================================
MOV a,#10h
b0 MOV counter,a
clr DHI
clr DLO
b0bclr FC
;;;;;
Mpyloop:
rrcm BHI
rrcm BLO
b0bts1 FC
jmp Notadd
;;;;
MOV a,ALO
add DLO,a
b0bts0 FC
incms DHI
nop
MOV a,AHI
add DHI,a
;;;;
Notadd:
rrcm DHI
rrcm DLO
rrcm EHI
rrcm ELO
decms counter
jmp Mpyloop
ret
;;==========================================
Div32: ;;;INPUT :(DIVID)AHI,ALO;(BY DIVID)DHI,DLO,EHI,ELO
;;;OUTPUT :(RESULT)BHI,BLO;(REST)CHI,CLO
;;==========================================
MOV a,#20h
b0 MOV counter,a
clr BHI
clr BLO
clr CHI
clr CLO
;;;;;;;;;;;
Divloop:
b0bclr FC
rlcm ELO
rlcm EHI
rlcm DLO
rlcm DHI
rlcm CLO
rlcm CHI
b0 MOV a,CHI
sub a,AHI
b0bts1 FZ
jmp Nochk
b0 MOV a,CLO
sub a,ALO
b0bts1 FC
jmp Nogo
jmp Nochk01
Nochk:
b0bts1 FC
jmp Nogo
b0 MOV a,CLO
sub a,ALO
b0bts1 FC
decms CHI
nop
Nochk01:
b0 MOV a,CLO
sub a,ALO
b0 MOV CLO,a
b0 MOV a,CHI
sub a,AHI
b0 MOV CHI,a
b0bset FC
Nogo:
rlcm BLO
rlcm BHI
decms counter
jmp Divloop
ret
;*********
;***************************
CalculatePower:
; CLR AHI
; MOV a,#0xdc
; b0 MOV ALO,a ;220V
; b0 MOV a,CurrentL
; b0 MOV BLO,a
; b0 MOV a,CurrentH
; b0 MOV BHI,a
; call Mpy16
b0 MOV a,CurrentH
sub a,#3
b0bts1 FC
; jmp $+5
; b0 MOV a,CurrentL
; sub a,#0xf0
; b0bts1 FC
jmp CalculatePowerError
clr errorcounter1
b0bclr CurrentError
call Multiplication
b0 MOV a,BHI
b0bts1 FZ
jmp DecTime
b0 MOV a,DHI
sub a,PowerBufferHH
b0bts1 FZ
jmp NotAdj
b0 MOV a,DLO
sub a,PowerBufferH
b0bts1 FZ
jmp NotAdj
AdjMiddle:
b0 MOV a,EHI
sub a,PowerBufferM
b0bts1 FZ
jmp NotAdj
AdjLow:
b0 MOV a,ELO
sub a,PowerBufferL
NotAdj:
b0bts1 FC
jmp IncTime
DecTime:
b0 MOV a,TimerDrvH
sub a,#0x30
b0bts1 FC
ret
decms TimerDrvH
nop
ret
IncTime:
b0 MOV a,TimerDrvH
sub a,#0xf0
b0bts0 FC
ret
incms TimerDrvH
nop
ret
CalculatePowerError:
b0 MOV a,errorcounter1
sub a,#250
b0bts0 FC
jmp $+3
incms errorcounter1
ret
b0bset CurrentError
ret
;****************************
BuzShort_10:
b0bset BuzzerShort
MOV a,#10
jmp BuzActive
BuzLong_5:
b0bclr BuzzerShort
MOV a,#5
jmp BuzActive
BuzShort_3:
MOV a,#3
jmp $+2
BuzShort_1:
MOV a,#1
b0bset BuzzerShort
BuzActive:
b0 MOV BuzNumber,a
b0bset BuzzerIsOn
clr TimerBuz
b0bclr BUZZER
b0bset BuzzerEnable
ret
;****************************
;Test temperature subroutine
;****************************
TestTemperature:
; b0bclr TestTemperatureEnable
b0bclr FADLEN
MOV a,#0x93
b0 MOV ADM,a
MOV a,#0x20
b0 MOV ADR,a
b0bset FADS
b0bts1 FEOC
jmp $-1
b0 MOV a,
ADB b0 MOV resultH,a
b0 MOV a,ADR
and a,#00001111b
b0 MOV resultL,a
swap resultH
and a,#11110000b
or resultL,a
swapm resultH
MOV a,#00001111b
and resultH,a
b0 MOV a,resultH
b0bts1 FZ
jmp $+5
b0 MOV a,resultL
sub a,#0x10
b0bts1 FC
jmp TestTemperature01
b0 MOV a,resultH
sub a,#0x0f
b0bts0 FC
jmp TestTemperature01
clr errorcounter
b0bclr TempError
ret
TestTemperature01:
b0 MOV a,errorcounter
sub a,#5
b0bts0 FC
jmp $+3
incms errorcounter
ret
b0bset TempError
ret
;****************************
;Test current subroutine
;****************************
TestCurrent:
b0bclr FADLEN
MOV a,#0x97
b0 MOV ADM,a
MOV a,#0x20
b0 MOV ADR,a
b0bset FADS
b0bts1 FEOC
jmp $-1
b0 MOV a,
ADB b0 MOV CurrentH,a
b0 MOV a,ADR
and a,#00001111b
b0 MOV CurrentL,a
swap CurrentH
and a,#11110000b
or CurrentL,a
swapm CurrentH
MOV a,#00001111b
and CurrentH,a
ret
;****************************
;Test voltage subroutine
;****************************
TestVoltage:
b0bclr FADLEN
MOV a,#0x91
b0 MOV ADM,a
MOV a,#0x20
b0 MOV ADR,a
b0bset FADS
b0bts1 FEOC
jmp $-1
b0 MOV a,
ADB b0 MOV VoltageH,a
b0 MOV a,ADR
and a,#00001111b
b0 MOV VoltageL,a
swap VoltageH
and a,#11110000b
or VoltageL,a
swapm VoltageH
MOV a,#00001111b
and VoltageH,a
ret
;*********************
SystemTimerEnd:
b0bclr F4mS
incms TimerBuz
nop
incms Timer
nop
b0bclr Flash
b0 MOV a,Timer
sub a,#125
b0bts1 FC
jmp SystemTimerEnd01
b0bset Flash
b0 MOV a,Timer
sub a,#250
b0bts1 FC
jmp SystemTimerEnd01
clr Timer
b0bts1 FanActive
jmp $+5
decms FanTime
jmp $+3
b0bclr FanActive
b0bclr Fan
b0bts1 Timering
jmp SystemTimerEnd01
incms Second
nop
b0 MOV a,Second
sub a,#60
b0bts1 FC
jmp SystemTimerEnd01
clr Second
decms Minute
nop
SystemTimerEnd01:
incms TestTemperatureTime
nop
b0 MOV a,TestTemperatureTime
sub a,#125
b0bts1 FC
jmp $+3
clr TestTemperatureTime
b0bset TestTemperatureEnable
incms TestCurrentTime
nop
MOV a,TestCurrentTime
sub a,#10
b0bts1 FC
jmp $+3
clr TestCurrentTime
b0bset TestCurrentEnable
incms KeySCANTime
nop
MOV a,KeyScanTime
sub a,#10
b0bts1 FC
jmp $+3
clr KeyScanTime
b0bset KeyScanEnable
DisplayScan:
clr P2
call TimeDisplay
incms commbuffer
nop
b0 MOV a,commbuffer
sub a,#0x05
b0bts1 FC
jmp DisplayScan01
clr commbuffer
; clr keyactivebuffer
DisplayScan01:
b0 MOV a,commbuffer
cmprs a,#1
jmp $+2
jmp DisplayScan03
cmprs a,#2
jmp $+2
jmp DisplayScan04
cmprs a,#3
jmp $+2
jmp DisplayScan05
cmprs a,#4
jmp $+2
jmp DisplayScan06
DisplayScan02:
b0bset COM0
b0 MOV a,data0
jmp DisplayScanEnd
DisplayScan03:
b0bset COM1
b0 MOV a,data1
jmp DisplayScanEnd
DisplayScan04:
b0bset COM2
b0 MOV a,data2
jmp DisplayScanEnd
DisplayScan05:
b0bset COM3
b0 MOV a,data3
jmp DisplayScanEnd
DisplayScan06:
b0bset COM4
b0bts0 On
jmp DisplayScan07
b0bclr DisplayOnOff
b0bts0 Flash
b0bset DisplayOnOff
DisplayScan07:
b0 MOV a,data4
DisplayScanEnd:
xor a,#0xff
b0 MOV displaybuffer,a
MOV a,#10001111b
and P4,a
MOV a,displaybuffer
and a,#01110000b
or P4,a
b0bclr P5.0
b0bts0 displaybuffer.0
b0bset P5.0
ret
;***************************
;interrput subroutine
;*********************
Interrupt:
b0bset FWDRST
push
b0 MOV aCCbuf,a
b0bclr FGIE
b0bts0 FT0IRQ
jmp SystemTimer
b0bts0 FP02IRQ
jmp IntZero
b0bts0 FP01IRQ
jmp IntTest
clr INTRQ
jmp InterruptEnd
;*********************
SystemTimer:
b0bclr FT0IRQ
MOV a,#192 ;156 ;50uS
b0 MOV T0C,a
incms Timer200uS
nop
b0 MOV a,Timer200uS
sub a,#125 ;64
b0bts1 FC
jmp SystemTimer01
clr Timer200uS
b0bset F4mS
SystemTimer01:
b0 MOV a,TimerDrv
b0bts0 FZ
jmp SystemTimer02
decms TimerDrv
nop
jmp InterruptEnd
SystemTimer02:
b0bts1 Fdrv
jmp SystemTimer03
b0bclr Fdrv
b0 MOV a,TimerDrvH
b0 MOV TimerDrv,a
b0bset DRV
jmp InterruptEnd
SystemTimer03:
b0bclr DRV
InterruptEnd:
b0 MOV a,accbuf
pop
reti
;**********************************
IntTest:
b0bclr FP01IRQ
clr TestTime
jmp InterruptEnd
;**********************************
IntZero:
b0bclr FP02IRQ
b0bclr DRV
b0bset Fdrv
MOV a,#0xff
sub a,TimerDrvH
b0 MOV TimerDrv,a
jmp InterruptEnd
;\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
;***************
KeyScan:
b0 MOV a,P1
xor a,#0xff
b0 MOV buffer,a
rrcm buffer
rrcm buffer
b0 MOV a,buffer
and a,#00001111b
b0 MOV keybuffer,a
b0 MOV buffer,a
clr keycounter2
MOV a,#4
b0 MOV keycounter1,a
KeyScan01:
rrcm buffer
b0bts0 FC
incms keycounter2
decms keycounter1
jmp KeyScan01
b0bclr KeyActive
MOV a,keycounter2
b0bts0 FZ
jmp KeyScan02
cmprs a,#1
ret
b0 MOV a,keybuffer
cmprs a,keyactivebuffer
jmp $+2
ret
b0bset KeyActive
b0 MOV a,keybuffer
b0 MOV keyactivebuffer,a
ret
KeyScan02:
clr keyactivebuffer
clr keybuffer
ret
;*****************
DataVerify:
clr Y
b0 MOV Z,#0x0e
MOV a,#0x00
DataVerify01:
add a,@YZ
decms Z
jmp DataVerify01
add a,@YZ
ret
;******************
TimeDisplay:
clr data0
clr data1
b0 MOV a,Minute
b0bts0 FZ
ret
sub a,#11
b0bts1 FC
jmp D10
b0 MOV a,Minute
sub a,#21
b0bts1 FC
jmp D20
b0 MOV a,Minute
sub a,#31
b0bts1 FC
jmp D30
b0 MOV a,Minute
sub a,#41
b0bts1 FC
jmp D40
b0 MOV a,Minute
sub a,#51
b0bts1 FC
jmp D50
D60:
b0bset DisplayTime60
ret
D50:
b0bset DisplayTime50
ret
D40:
b0bset DisplayTime40
ret
D30:
b0bset DisplayTime30
ret
D20:
b0bset DisplayTime20
ret
D10:
b0bset DisplayTime10
ret
;***************
;Main program
;****************
Reset:
b0bclr FGIE
InitPort
call DataVerify
cmprs a,sumbuffer
jmp Init02
b0 MOV Z,#0eh
Init01:
b0 MOV a,@YZ
b0bts1 FZ
jmp Init06
decms Z
jmp Init01
Init02:
ClearRam
clr flag0
b0bset BUZZER
b0bclr DRV
call BuzShort_3
;******
;******
Init06:
b0 MOV a,port1copy
b0 MOV P1,a
b0 MOV a,port2copy
b0 MOV P2,a
b0 MOV a,port4copy
b0 MOV P4,a
b0 MOV a,port5copy
b0 MOV P5,a
b0bset FGIE
clr INTRQ
Main:
b0bset FWDRST
call DataVerify
b0 MOV sumbuffer,a
b0 MOV a,P1
b0 MOV port1copy,a
b0 MOV a,P2
b0 MOV port2copy,a
b0 MOV a,P4
b0 MOV port4copy,a
b0 MOV a,P5
b0 MOV port5copy,a
BuzzerActive
b0bts0 F4mS
call SystemTimerEnd
b0bts0 CurrentError
jmp $+10
b0bts0 TempError
jmp $+8
b0bts1 Timering
jmp $+8
b0 MOV a,Minute
b0bts1 FZ
jmp $+5
call BuzLong_5
jmp $+2
call BuzShort_10
jmp OnOff01
b0bts1 KeyScanEnable
jmp NotKeyScan
b0bclr KeyScanEnable
call KeyScan
NotKeyScan:
b0bts0 KeyActive
jmp ReadKey
b0bts1 On
jmp Main
b0bts1 TestTemperatureEnable
jmp NotTestTemperature
call TestTemperature
b0bclr TestTemperatureEnable
b0 MOV a,resultH
sub a,TemperatureH
b0bts1 FZ
jmp $+3
b0 MOV a,resultL
sub a,TemperatureL
b0bts1 FC
jmp $+6
b0bclr DRV
b0bset Off
b0bclr FP02IEN
b0bclr FP02IRQ
jmp Main
b0bts1 Off
jmp NotTestTemperature
b0bclr Off
b0bset FP02IEN
MOV a,#0x40
b0 MOV TimerDrvH,a
jmp Main
NotTestTemperature:
; b0bts1 On
; jmp Main
b0bts1 TestCurrentEnable
jmp Main
call TestCurrent
b0bclr TestCurrentEnable
call TestVoltage
call CalculatePower
NotTestCurrent:
jmp Main
;************
ReadKey:
b0bclr KeyActive
b0bts0 Konoff
jmp OnOff
b0bts1 On
jmp Main
call BuzShort_1
b0bts0 Kmode
jmp Mode
b0bts0 Kpower
jmp Power
;*******************
Time:
incms TimeBuffer
nop
b0 MOV a,TimeBuffer
sub a,#7
b0bts1 FC
jmp Time01
clr TimeBuffer
Time01:
MOV a,TimeBuffer
b0 MOV Y,#TimeTable$m
b0 MOV Z,#TimeTable$l
add Z,a
MOV c
b0 MOV Minute,a
clr Second
b0bset Timering
b0 MOV a,TimeBuffer
b0bts0 FZ
b0bclr Timering
jmp Main
;****************************
OnOff:
call BuzShort_1
b0bts1 On
jmp OnOff02
OnOff01:
b0bclr On
b0bclr Timering
call Close
clr data0
clr data1
clr data2
clr data3
clr data4
clr ModeBuffer
clr PowerBuffer
clr TimeBuffer
clr Minute
clr errorcounter
b0bclr TempError
b0bclr CurrentError
clr errorcounter1
b0bclr FP02IEN
b0bclr FP01IEN
jmp Main
OnOff02:
b0bset On
call Open
b0bset DisplayOnOff
b0bset DisplayMode1
b0bset DisplayPower3
MOV a,#3
b0 MOV ModeBuffer,a
b0 MOV PowerBuffer,a
clr TimeBuffer
b0bset FP02IEN
b0bset FP01IEN
MOV a,#0x80
b0 MOV TimerDrvH,a
; MOV a,#100
; b0 MOV TimerDrv,a
jmp Mode01
;****************************
Mode:
incms ModeBuffer
nop
b0 MOV a,ModeBuffer
sub a,#6
b0bts1 FC
jmp Mode01
MOV a,#1
b0 MOV ModeBuffer,a
Mode01:
b0bclr DisplayMode1
b0bclr DisplayMode2
b0bclr DisplayMode3
b0bclr DisplayMode4
b0bclr DisplayMode5
MOV a,ModeBuffer
cmprs a,#1
jmp $+2
jmp Mode1
cmprs a,#2
jmp $+2
jmp Mode2
cmprs a,#3
jmp $+2
jmp Mode3
cmprs a,#4
jmp $+2
jmp Mode4
Mode5:
b0bset DisplayMode5
MOV a,#5
jmp ModeEnd
Mode1:
b0bset DisplayMode1
MOV a,#3
jmp ModeEnd
Mode2:
b0bset DisplayMode2
MOV a,#3
jmp ModeEnd
Mode3:
b0bset DisplayMode3
MOV a,#3
jmp ModeEnd
Mode4:
b0bset DisplayMode4
MOV a,#4
ModeEnd:
b0 MOV PowerBuffer,a
jmp Power01
;****************************
Power:
incms PowerBuffer
nop
b0 MOV a,PowerBuffer
sub a,#7
b0bts1 FC
jmp Power01
MOV a,#1
b0 MOV PowerBuffer,a
Power01:
clr data2
b0bclr DisplayPower6
b0bclr DisplayPower5
MOV a,PowerBuffer
cmprs a,#1
jmp $+2
jmp Power1
cmprs a,#2
jmp $+2
jmp Power2
cmprs a,#3
jmp $+2
jmp Power3
cmprs a,#4
jmp $+2
jmp Power4
cmprs a,#5
jmp $+2
jmp Power5
Power6:
b0bset DisplayPower6
Power5:
b0bset DisplayPower5
Power4:
b0bset DisplayPower4
Power3:
b0bset DisplayPower3
Power2:
b0bset DisplayPower2
Power1:
b0bset DisplayPower1
b0 MOV a,PowerBuffer
b0 MOV Y,#PowerTable$m
b0 MOV Z,#PowerTable$l
add Z,a
MOV c
b0 MOV PowerBufferL,a
b0 MOV a,R
b0 MOV PowerBufferM,a
b0 MOV a,PowerBuffer
b0 MOV Y,#PowerTableH$m
b0 MOV Z,#PowerTableH$l
add Z,a
MOV c
b0 MOV PowerBufferH,a
b0 MOV a,R
b0 MOV PowerBufferHH,a
b0 MOV a,PowerBuffer
b0 MOV Y,#TemperatureTable$m
b0 MOV Z,#TemperatureTable$l
add Z,a
MOV c
b0 MOV TemperatureL,a
b0 MOV a,R
b0 MOV TemperatureH,a
jmp Main
;**************
Close:
b0bset FanActive
MOV a,#120
b0 MOV FanTime,a
ret
;**************
Open: b0bset FAN
b0bclr FanActive
ret
PowerTable:
; dw 0x0000,0x45d1,0x8342,0xc0b2,0xfe23,0x3b94,0x7904
dw 0x0000,0x0ed6,0x8601,0xfd2c,0x7457,0xeb85,0x62ad
PowerTableH:
; dw 0x00,0x17,0x21,0x2b,0x35,0x40,0x4a
dw 0x0000,0x4a6b,0x6b29,0x8be7,0xaca6,0xcd64,0xee23
TimeTable:
dw 0x00,10,20,30,40,50,60
TemperatureTable:
; dw 0x0000,0x013e,0x03a2,0x0674,0x0940,0x0b5c,0x0c4b
dw 0x0000,0x00e7,0x02e3,0x0578,0x085c,0x0ad0,0x0bdb