richiebb
23rd April, 2018, 03:50 PM
some time ago I started to make some script for orange5, I know that many of you here know how to make them ................ for those who do not, here goes......
; Clio Mio Magneti Marelli / Sandero with 95020 tested in 2014 models
; comments for this sample script is based in 41200km
;---------------------------------------------------------------------------------------------------
;................................................. 41200 * 1000 = 41200000 ---------------------------------------
;................................................. 41200000 toHex = 02 74 A9 80 ----------------------------------
;................................................. 02 74 A9 80 Swap = 80 a9 74 02 --------------------------------
;................................................. first 4 bytes 80 A9 74 02 ---------------------------------------
;................................................. 80 A9 74 02 xor FF FF FF FF = 7F 56 8B FD (last four Bytes) -----
;---------------------------------------------------------------------------------------------------
ClioMio.hpl
;-------------------------------------------------------------------------------------------------------------------------------------------
[!#"Old KM"]
ADR=192;..................Set in position 192 decimal = hex 0x0c0
R6=1;.....................Put 1 in Registry R6
LOOP=(0,63){;.............Start a Loop 64 cycles
MARK=R6;..................Mark Current Position
ADR=+1;...................Increment in 1 Address
};........................end of loop
ADR=195;..................Set in position 195 decimal = 0x0c3
R6=DATA;..................Stored Current data Buffer(0x0c3) in Registry R6
ADR=-1;...................decrement in 1 Address
R7=DATA;..................Stored Current data Buffer(0x0c2) in Registry R7
ADR=-1;...................decrement in 1 Address
R8=DATA;..................Stored Current data Buffer(0x0c1) in Registry R8
ADR=-1;...................decrement in 1 Address
R9=DATA;..................Stored Current data Buffer(0x0c0) in Registry R9, asume for this sample 0x080
R6=<<24;..................move 6 nibble to left R6 Value. Sample R6 vale are 0x002 after move: 0x02000000
R7=<<16;..................move 4 nibble to left R7 Value. Sample R7 vale are 0x074 after move: 0x00740000
R8=<<8;...................move 2 nibble to left R8 Value. Sample R8 vale are 0x0a9 after move: 0x0000A900
R8=+R6;...................sum R8 Value to R6.....0x0000A900 + 0x02000000 = 0x0200A900
R8=+R7;...................sum R8 Value to R7.....0x0200A900 + 0x00740000 = 0x0274A900
R8=+R9;...................sum R8 Value to R9.....0x0274A900 + 0x00000080 = 0x0274A980
R8=/1000;.................divide by decimal 1000 R8 value....... 0x0274A980 / 1000 = 0x0A0F0
PRINT=("Current Mileage = %06lu km.",R8);..Print Rezult
[!#"New KM"]
R4=0;.....................Put 0 in Registry R6
GET=("Enter New KM",R4);..open Dialog Box and Request New Mileage end stored in R4...asume for this example 41200km
R4=*1000;.................multiply R4 registry by 1000 ......R4 * 1000 = 41200000
R9=1;.....................Put 1 in Registry R9
R3=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R3 registry (41200000)=(0x0274A980)
R5=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R5 registry (41200000)=(0x0274A980)
R6=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R6 registry (41200000)=(0x0274A980)
R3=&000000FFH;............make a AND Logical R3 by 0x0ff....... 0x0274A980 AND 0x000000FF = 0x00000080
R4=&0000FF00H;............make a AND Logical R4 by 0x0ff00..... 0x0274A980 AND 0x0000FF00 = 0x0000A900
R5=&000FF0000H;...........make a AND Logical R5 by 0x0ff0000... 0x0274A980 AND 0x00FF0000 = 0x00740000
R6=&0FF000000H;...........make a AND Logical R6 by 0x0ff000000. 0x0274A980 AND 0xFF000000 = 0x02000000
R4=>>8;...................move to right 2 nibble...0x0000A900 to 0x000000A9
R5=>>16;..................move to right 4 nibble...0x00740000 to 0x00000074
R6=>>24;..................move to right 6 nibble...0x02000000 to 0x00000002
ADR=192;..................Set in position 192 decimal = hex 0x0c0
LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x00000080 (80) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x000000A9 (A9) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x00000074 (74) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000002 (02) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+5;...................Increment in 5 address
}
R3=^0FFH;.................R3 xor 0xff....0x00000080 xor 0x000000ff = 7F
R4=^0FFH;.................R4 xor 0xff....0x000000A9 xor 0x000000ff = 56
R5=^0FFH;.................R5 xor 0xff....0x00000074 xor 0x000000ff = 8B
R6=^0FFH;.................R6 xor 0xff....0x00000002 xor 0x000000ff = FD
ADR=196;..................Set in position 196 decimal = hex 0x0c4
LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x0000007F (7F) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x00000056 (56) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x0000008B (8B) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000080 (FD) in current Position
MARK=R9;..................Markcurrent position
ADR=+5;...................Increment in 5 address
leave HPL file in attachment
for see in type menu......... must to add to CFG File:
Sample:
GROUP=Renault ; if not exist
CHIP=Clio Mio / Sandero 95020,256x8,"HPL_ROOT_DIRECTORY"\ClioMio.hpl
Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)
; Clio Mio Magneti Marelli / Sandero with 95020 tested in 2014 models
; comments for this sample script is based in 41200km
;---------------------------------------------------------------------------------------------------
;................................................. 41200 * 1000 = 41200000 ---------------------------------------
;................................................. 41200000 toHex = 02 74 A9 80 ----------------------------------
;................................................. 02 74 A9 80 Swap = 80 a9 74 02 --------------------------------
;................................................. first 4 bytes 80 A9 74 02 ---------------------------------------
;................................................. 80 A9 74 02 xor FF FF FF FF = 7F 56 8B FD (last four Bytes) -----
;---------------------------------------------------------------------------------------------------
ClioMio.hpl
;-------------------------------------------------------------------------------------------------------------------------------------------
[!#"Old KM"]
ADR=192;..................Set in position 192 decimal = hex 0x0c0
R6=1;.....................Put 1 in Registry R6
LOOP=(0,63){;.............Start a Loop 64 cycles
MARK=R6;..................Mark Current Position
ADR=+1;...................Increment in 1 Address
};........................end of loop
ADR=195;..................Set in position 195 decimal = 0x0c3
R6=DATA;..................Stored Current data Buffer(0x0c3) in Registry R6
ADR=-1;...................decrement in 1 Address
R7=DATA;..................Stored Current data Buffer(0x0c2) in Registry R7
ADR=-1;...................decrement in 1 Address
R8=DATA;..................Stored Current data Buffer(0x0c1) in Registry R8
ADR=-1;...................decrement in 1 Address
R9=DATA;..................Stored Current data Buffer(0x0c0) in Registry R9, asume for this sample 0x080
R6=<<24;..................move 6 nibble to left R6 Value. Sample R6 vale are 0x002 after move: 0x02000000
R7=<<16;..................move 4 nibble to left R7 Value. Sample R7 vale are 0x074 after move: 0x00740000
R8=<<8;...................move 2 nibble to left R8 Value. Sample R8 vale are 0x0a9 after move: 0x0000A900
R8=+R6;...................sum R8 Value to R6.....0x0000A900 + 0x02000000 = 0x0200A900
R8=+R7;...................sum R8 Value to R7.....0x0200A900 + 0x00740000 = 0x0274A900
R8=+R9;...................sum R8 Value to R9.....0x0274A900 + 0x00000080 = 0x0274A980
R8=/1000;.................divide by decimal 1000 R8 value....... 0x0274A980 / 1000 = 0x0A0F0
PRINT=("Current Mileage = %06lu km.",R8);..Print Rezult
[!#"New KM"]
R4=0;.....................Put 0 in Registry R6
GET=("Enter New KM",R4);..open Dialog Box and Request New Mileage end stored in R4...asume for this example 41200km
R4=*1000;.................multiply R4 registry by 1000 ......R4 * 1000 = 41200000
R9=1;.....................Put 1 in Registry R9
R3=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R3 registry (41200000)=(0x0274A980)
R5=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R5 registry (41200000)=(0x0274A980)
R6=R4;....................Stored Value enter in GET=("Enter New KM",R4) in R6 registry (41200000)=(0x0274A980)
R3=&000000FFH;............make a AND Logical R3 by 0x0ff....... 0x0274A980 AND 0x000000FF = 0x00000080
R4=&0000FF00H;............make a AND Logical R4 by 0x0ff00..... 0x0274A980 AND 0x0000FF00 = 0x0000A900
R5=&000FF0000H;...........make a AND Logical R5 by 0x0ff0000... 0x0274A980 AND 0x00FF0000 = 0x00740000
R6=&0FF000000H;...........make a AND Logical R6 by 0x0ff000000. 0x0274A980 AND 0xFF000000 = 0x02000000
R4=>>8;...................move to right 2 nibble...0x0000A900 to 0x000000A9
R5=>>16;..................move to right 4 nibble...0x00740000 to 0x00000074
R6=>>24;..................move to right 6 nibble...0x02000000 to 0x00000002
ADR=192;..................Set in position 192 decimal = hex 0x0c0
LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x00000080 (80) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x000000A9 (A9) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x00000074 (74) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000002 (02) in current Position
MARK=R9;..................Mark postion 194(c2)
ADR=+5;...................Increment in 5 address
}
R3=^0FFH;.................R3 xor 0xff....0x00000080 xor 0x000000ff = 7F
R4=^0FFH;.................R4 xor 0xff....0x000000A9 xor 0x000000ff = 56
R5=^0FFH;.................R5 xor 0xff....0x00000074 xor 0x000000ff = 8B
R6=^0FFH;.................R6 xor 0xff....0x00000002 xor 0x000000ff = FD
ADR=196;..................Set in position 196 decimal = hex 0x0c4
LOOP=(0,7){;..............Start a Loop 8 cycles
DATA=R3;..................set Value 0x0000007F (7F) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R4;..................set Value 0x00000056 (56) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R5;..................set Value 0x0000008B (8B) in current Position
MARK=R9;..................Markcurrent position
ADR=+1;...................Increment in 1 address
DATA=R6;..................set Value 0x00000080 (FD) in current Position
MARK=R9;..................Markcurrent position
ADR=+5;...................Increment in 5 address
leave HPL file in attachment
for see in type menu......... must to add to CFG File:
Sample:
GROUP=Renault ; if not exist
CHIP=Clio Mio / Sandero 95020,256x8,"HPL_ROOT_DIRECTORY"\ClioMio.hpl
Questions and Request made here: Question and Request for HPL Orange5 Scripts (http://www.digital-kaos.co.uk/forums/showthread.php/656401-Question-and-Request-for-HPL-Orange5-Scripts)