||Joe
24-07-2001, 05:30 PM
Send me pic sources and schematics of dejan flasher 1.04 and i will send Dejan Flasher sources.
Main.a32
Look some code snippets:
;include calc.a32
include log.a32
include indicator.a32
include phone_id.a32
include iso.a32
include filefind.a32
include inkey.a32
include fls_ppm.a32
include box.a32
include file.a32
;****************************************************************************
;
;****************************************************************************
prog_start: call kurzoroff
call flash
ret
bit_count db 0
start_status db 0
stop_status db 0
data_reg db 0ffh
mbus_h: mov edx,378h
or byte ptr data_reg,10h
mov al,data_reg
out dx,al
ret
mbus_l: mov edx,378h
and byte ptr data_reg, not 10h
mov al,data_reg
out dx,al
ret
tx_h: mov edx,378h
or byte ptr data_reg,20h
mov al,data_reg
out dx,al
ret
tx_l: mov edx,378h
and byte ptr data_reg, not 20h
mov al,data_reg
out dx,al
ret
time_: push ecx
mov ecx,time_const
loop $
pop ecx
ret
time_const dd 800
boot db 'c:\nk_files\boot.bin',0
boot_size dd 0
boot_baf dd 0
flash_boot db 'c:\nk_files\*.fl',0
flash_boot_count dd 0
flash_boot_baf dd 0
fl_boot_baf dd 0
fl_boot_size dd 0
..........
........
....
..
--------------------
;================================================
get_phone_id: push eax
mov eax,500000
call set_work_time_const
pop eax
call box
call kurzoroff
call disp_main
call phone_on
_printm 7,0,1fh," Connect Phone to BOX, Turn ON phone and press Enter "
call tasterin
call phone_off
call disp_main
call send_init
jc bad_conn
;==========================================
; Get phone ID
;------------------------------------------
lea esi,test_data
mov ecx,end_td-test_data
call tx_rx_data
jc bad_conn
;---------------
lea esi,[edi+10]
pushad
lea edi,mcu_vb
call copy_asciiz
popad
mov edi,esi
xor ecx,ecx
z1nex_pr1: inc ecx
cmp [edi],byte ptr 0
je z1end_pr1
inc edi
cmp [edi-1],byte ptr 0ah
jne z1nex_pr1
mov [edi-1],byte ptr ' '
jmp z1nex_pr1
z1end_pr1:
lea edi,id_bafer
cmp ecx,60
jbe z1ok_szid
mov ecx,60
mov [id_bafer+4+ecx],byte ptr 0
z1ok_szid: mov eax,ecx
stosd
rep movsb
lea esi,id_bafer+4
_printm 1,0,1fh, 'MS SW:'
mov ax,108h
mov bl,1bh
call print
;---------------------------------
;)
Main.a32
Look some code snippets:
;include calc.a32
include log.a32
include indicator.a32
include phone_id.a32
include iso.a32
include filefind.a32
include inkey.a32
include fls_ppm.a32
include box.a32
include file.a32
;****************************************************************************
;
;****************************************************************************
prog_start: call kurzoroff
call flash
ret
bit_count db 0
start_status db 0
stop_status db 0
data_reg db 0ffh
mbus_h: mov edx,378h
or byte ptr data_reg,10h
mov al,data_reg
out dx,al
ret
mbus_l: mov edx,378h
and byte ptr data_reg, not 10h
mov al,data_reg
out dx,al
ret
tx_h: mov edx,378h
or byte ptr data_reg,20h
mov al,data_reg
out dx,al
ret
tx_l: mov edx,378h
and byte ptr data_reg, not 20h
mov al,data_reg
out dx,al
ret
time_: push ecx
mov ecx,time_const
loop $
pop ecx
ret
time_const dd 800
boot db 'c:\nk_files\boot.bin',0
boot_size dd 0
boot_baf dd 0
flash_boot db 'c:\nk_files\*.fl',0
flash_boot_count dd 0
flash_boot_baf dd 0
fl_boot_baf dd 0
fl_boot_size dd 0
..........
........
....
..
--------------------
;================================================
get_phone_id: push eax
mov eax,500000
call set_work_time_const
pop eax
call box
call kurzoroff
call disp_main
call phone_on
_printm 7,0,1fh," Connect Phone to BOX, Turn ON phone and press Enter "
call tasterin
call phone_off
call disp_main
call send_init
jc bad_conn
;==========================================
; Get phone ID
;------------------------------------------
lea esi,test_data
mov ecx,end_td-test_data
call tx_rx_data
jc bad_conn
;---------------
lea esi,[edi+10]
pushad
lea edi,mcu_vb
call copy_asciiz
popad
mov edi,esi
xor ecx,ecx
z1nex_pr1: inc ecx
cmp [edi],byte ptr 0
je z1end_pr1
inc edi
cmp [edi-1],byte ptr 0ah
jne z1nex_pr1
mov [edi-1],byte ptr ' '
jmp z1nex_pr1
z1end_pr1:
lea edi,id_bafer
cmp ecx,60
jbe z1ok_szid
mov ecx,60
mov [id_bafer+4+ecx],byte ptr 0
z1ok_szid: mov eax,ecx
stosd
rep movsb
lea esi,id_bafer+4
_printm 1,0,1fh, 'MS SW:'
mov ax,108h
mov bl,1bh
call print
;---------------------------------
;)