Pengaman rumah Via HP Siemens c45

Berikut Gambar Rangkaian 8951 dengan Handpone HP Siemens c45

List Program Assembly 8051 sebagai berikut :

buf_rx data 0ffh
buf_no data 0afh ;0a0h
buf_psn data 0a0h ;8ch
buf_psn_txt data 94h ;5ah
buf_no_pdu data 88h ;46h -20 +1
NO_DIAL DATA 73H ;74 ;32h -15 +2
no_sms data 62h -20 +3
;text_pdu data 4bh
;no_sms data 47h
ring1 data 12h
ket_smsc data 13h
d_ring data 14h
smscl data 15h
smsnl data 16h
octets data 17h
andbit data 18h
shlbit data 19h
orbit data 1ah
psnl data 1bh
DATA0 DATA 1CH
dr2 data 1dh
dr5 data 1eh
dr6 data 1fh
dr7 data 20h
DR4 DATA 21H ;*****
pintu data 22h
kontak data 23h
dr3 data 24h
ddr6 data 25h
ddr7 data 26h
dial_l data 27h
dkey data 28h
putar data 29h
slock data 2ah
panjang data 2bh
sms_ok data 2ch
ddpl data 2dh
ddph data 2eh
org 0ffh+1
jmp mulai
mulai:

; MOV PUTAR,#0
; ACALL SMS_REG_OK
; MOV R6,PUTAR
;JJJJ:
; AJMP JJJJ
; acall buf_res
; mov r0,#text_pdu
; mov @r0,#’1′
; dec r0
; mov @r0,#’2′
; dec r0
; mov @r0,#’3′
; dec r0
; mov @r0,#’4′
; dec r0
; acall texttopdu
;sss:
; ajmp sss
mov slock,#0
mov dkey,#0
mov putar,#0
mov ket_smsc,#0 ;1=mentari 2=im3 3=xl 4=telkomcel
mov pintu,#0
mov kontak,#0
mov p2,#0
mov ring1,#0
setb EA
mov TMOD,#20h
mov TH1,#0FDH
setb TR1
mov SCON,#50h
acall tunda
acall dial_FLEKSI

mov r1,#3
tunggu:
acall tunda
djnz r1,tunggu
acall cek_smsc
acall delay
HP:
acall tunda
acall cek_sms
clr c
mov a,psnl
jz hp_1
acall cek_key
clr c
mov a,dkey
jz hp_1
; acall cari_key
xx:
acall reg_ok
mov dptr,#reg_sukses
mov ddpl,dpl
mov ddph,dph
acall sms_reg_ok
mov a,sms_ok
clr c
subb a,#’K’
jz flk
mov a,sms_ok
clr c
subb a,#’R’
jz gsm
ajmp hp
flk:
acall tunda
mov dptr,#del_
acall coman
acall tunda
; acall dial_FLEKSI

ajmp hp
gsm:
ACALL tunda
mov dptr,#dial_
acall coman
acall tunda
ajmp hp
; acall dial_FLEKSI
;ll:
; ajmp ll
hp_1:
; acall cek_ring
hp_2:
ajmp hp

;+62855000000
; mov r0,#buf_RX
; mov @r0,#’+’
; DEC R0
; mov @r0,#’6′
; DEC R0
; mov @r0,#’2′
; DEC R0
; mov @r0,#’8′
; DEC R0
; mov @r0,#’5′
; DEC R0
; mov @r0,#’5′
; DEC R0
; mov @r0,#’0′
; DEC R0
; mov @r0,#’0′
; DEC R0
; mov @r0,#’0′
; DEC R0
; mov @r0,#’0′
; DEC R0
; mov @r0,#’0′
; DEC R0
; mov @r0,#’0′
; DEC R0
; acall cari_smsc
; MOV A,KET_SMSC
;DSDS:
; AJMP DSDS

;mov dptr,#sms1
;acall coman
;acall dial_up
; mov dptr,#sms1
; acall coman
acall tunda
acall dial_FLEKSI
; mov dptr,#sms1
; acall coman
acall tunda
; acall cek_sms
acall cek_smsc

;smsc_ul_c:
; mov a,ket_smsc
;
; clr c
; subb a,#1
; jz smsc_p1
; mov a,ket_smsc
; clr c
; subb a,#2
; jz smsc_p2
; mov dptr,#cxl
; ajmp smsc_p3
;smsc_p1:
; mov dptr,#cmtr
; ajmp smsc_p3
;smsc_p2:
; mov dptr,#cim3
;smsc_p3:
;
;smsc_ulang:
; acall atd
;smsc_ul:
; clr a
; movc a,@a+dptr
; cjne a,#0ah,smsc_ul1
; mov a,#’;’
; acall kirim
; acall ldelay
; mov dptr,#enter
; acall coman
; ajmp smsc_ul_c
;smsc_ul1:
; clr a
; movc a,@a+dptr
; inc dptr
; acall kirim
; acall ldelay
; ajmp smsc_ul
;
;

LILIK:
; mov a,#’a’
; acall kirim
; acall ldelay
; mov a,#’t’
; acall kirim
; acall ldelay
; mov a,#’d’
; acall kirim
; acall ldelay
acall atd
mov a,#’+’
acall kirim
acall ldelay
MOV R0,#BUF_NO
LILIK1:
clr c
MOV A,@R0
JZ LILIK2
MOV A,@R0
DEC R0
ACALL kirim
ACALL Ldelay
AJMP LILIK1
lilik2:
mov a,#’;’
acall kirim
acall ldelay
mov dptr,#enter
acall coman
ajmp LILIK

;call_smsc:
; mov dr2,dpl
; mov dr3,dph
; acall atd
; mov dpl,dr2
; mov dph,dr3
;call_smsc1:
; clr a
; movc a,@a+dptr
; cjne a,#0ah,call_smsc1_
; mov a,#’;’
; acall kirim
; acall ldelay
; ajmp call_smscx
;call_smsc1_:
; clr a
; movc a,@a+dptr
; inc dptr
; acall kirim
; acall ldelay
; ajmp call_smsc1
;call_smscx:
; mov dptr,#enter
; acall coman
; ret
;COBA_SMS:
; mov r0,#no_sms
; mov @r0,#’0′
; dec r0
; mov @r0,#’D’
; dec r0
; mov @r0,#’9′
; dec r0
; mov @r0,#’1′
; dec r0
; mov @r0,#’2′
; dec r0
; mov @r0,#’6′
; dec r0
; mov @r0,#’5′
; dec r0
; mov @r0,#’8′
; dec r0
; mov @r0,#’4′
; dec r0
; mov @r0,#’6′
; dec r0
; mov @r0,#’5′
; dec r0
; mov @r0,#’8′
; dec r0
; mov @r0,#’7′
; dec r0
; mov @r0,#’3′
; dec r0
; mov @r0,#’1′
; dec r0
; mov @r0,#’3′
; dec r0
; mov @r0,#’F’
; dec r0
; mov @r0,#’0′
; dec r0
; mov @r0,#0
; dec r0
; RET

SMS_REG_OK:
acall cmgs
; MOV KET_SMSC,#2
acall load_reg
ACALL DELAY
ret

load_reg:
mov a,ket_smsc
clr c
subb a,#1
jz load_reg_1
mov a,ket_smsc
clr c
subb a,#2
jz load_reg_2
mov a,ket_smsc
clr c
subb a,#3
jz load_reg_3
mov a,ket_smsc
clr c
subb a,#4
jz load_reg_4
ajmp load_reg_x
load_reg_1:
mov dptr,#smscmtr
ajmp load_reg_x
load_reg_2:
mov dptr,#smscim3
ajmp load_reg_x
load_reg_3:
mov dptr,#smscxl
ajmp load_reg_x
load_reg_4:
mov dptr,#smsctlkm
ajmp load_reg_x
load_reg_x:
acall no_enter
mov r0,#no_sms
acall bufer_no_enter
mov dpl,ddpl
mov dph,ddph
; mov dptr,#reg_sukses
acall no_enter
mov dptr,#CTRL_Z
acall no_enter
acall cek_at_ok
ret
cmgs:
acall tunda
mov dptr,#cmgs_
acall no_enter
acall sms_leng_ok
mov a,dr2
acall kirim
acall ldelay
mov a,dr3
acall kirim
acall ldelay
mov dptr,#enter
acall coman
acall delay
ret

SMS_LENG_OK:
; mov dptr,#reg_sukses
mov dpl,ddpl
mov dph,ddph
mov panjang,#4
sms_reg_1:
clr a
movc a,@a+dptr
inc panjang
inc dptr
cjne a,#0ah,sms_reg_1
dec panjang
mov r0,#no_sms
sms_reg_2:
mov a,@r0
dec r0
inc panjang
jnz sms_reg_2
dec panjang
clr c
mov a,panjang
mov b,#2
div ab
mov panjang,a
clr c
mov b,#0ah
div ab
mov panjang,a
mov a,b
add a,#’0′
mov dr3,a
mov a,panjang
add a,#’0′
mov dr2,a
mov r1,dr2
mov r2,dr3
ret

cari_key:
mov a,dkey
clr c
subb a,#1
jz cari_key1
mov a,dkey
clr c
subb a,#2
jz cari_key2
mov a,dkey
clr c
subb a,#3
jz cari_key3
mov a,dkey
clr c
subb a,#4
jz cari_key4
mov a,dkey
clr c
subb a,#5
jz cari_key5
ajmp cari_keyx
cari_key1:
;key1: db ‘UNLOCK’,0AH
mov slock,#0
ajmp cari_keyx
cari_key2:
;key2: db ‘LOCK’,0AH
mov slock,#1
ajmp cari_keyx
cari_key3:
;KEY3: db ‘REG’,0AH ;daftar nomer dial
acall reg_ok
ajmp cari_keyx
cari_key4:
;key4: db ‘ON POWER’,0AH ;
ajmp cari_keyx
cari_key5:
;key5: db ‘OFF POWER’,0ah ;
ajmp cari_keyx
cari_keyx:
mov dkey,#0
ret

cek_ring:
ret

reg_ok:
mov r0,#no_dial
mov r1,#20
reg_ok_ok:
mov @r0,#0
dec r0
djnz r1,reg_ok_ok
mov dr2,#buf_no
mov r0,#no_dial
mov @r0,#’+’
dec r0
mov r1,smsnl
reg_ok1:
mov data0,r0
mov r0,dr2
mov a,@r0
dec dr2
mov r0,data0
mov @r0,a
dec r0
djnz r1,reg_ok1
mov @r0,#’;’
dec r0
mov @r0,#0dh
dec r0
mov @r0,#0ah
dec r0
reg_ok2:
; acall atd
; mov r0,#no_dial
; acall coman_buf ;panggil
mov r0,#no_sms
mov r1,#22
reg_ok_ok_:
mov @r0,#0
dec r0
djnz r1,reg_ok_ok_

mov r0,#buf_no_pdu
mov dr2,#no_sms
no_sms_:
mov a,@r0
mov data0,r0
mov r0,dr2
mov @r0,a
mov r0,data0
dec r0
dec dr2
jnz no_sms_
ret

;dial_up:
; mov dptr,#dial_
; acall coman
; ret
cek_smsc:
ACALL LDELAY
ACALL LDELAY
ACALL BUF_RES
mov dptr,#smsc_ ;#dial
acall coman
mov r0,#buf_rx
cek_smsc1:
acall terima
; jnb ri,cek_smsc1
; mov A,sbuf
; clr ri
cjne a,#'”‘,cek_smsc1
cek_smsc2:
acall terima
; jnb ri,cek_smsc2
; mov A,sbuf
; clr ri
mov b,a
cjne a,#'”‘,cek_smsc3
ajmp cek_smsc4
cek_smsc3:
mov a,b
mov @r0,a
dec r0
ajmp cek_smsc2
cek_smsc4:
acall cari_smsc
ret

cari_smsc:
mov ket_smsc,#0
mov r1,#0
mov r0,#buf_rx
mov dptr,#cmtr ;mentari=1
cari_c1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cari_c2
ajmp cari_c3
cari_c2:
clr a
movc a,@a+dptr
cjne a,b,cari_c2_
inc r1
inc dptr
dec r0
ajmp cari_c1
cari_c2_:
mov r1,#0
inc dptr
ajmp cari_cc1_ ;cari_c1
cari_c3:
clr c
mov a,r1
jz cari_cc1_
mov ket_smsc,#1
ajmp cari_sms_x
cari_cc1_:
mov r1,#0
mov r0,#buf_rx
mov dptr,#cim3 ;im3=2
cari_cc1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cari_cc2
ajmp cari_cc3
cari_cc2:
clr a
movc a,@a+dptr
cjne a,b,cari_cc2_
inc r1
inc dptr
dec r0
ajmp cari_cc1
cari_cc2_:
mov r1,#0
inc dptr
ajmp cari_ccc1_ ;cari_cc1
cari_cc3:
clr c
mov a,r1
jz cari_ccc1_
mov ket_smsc,#2
ajmp cari_sms_x
cari_ccc1_:
mov r1,#0
mov r0,#buf_rx
mov dptr,#cxl ;xl=3
cari_ccc1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cari_ccc2
ajmp cari_ccc3
cari_ccc2:
clr a
movc a,@a+dptr
cjne a,b,cari_ccc2_
inc r1
inc dptr
dec r0
ajmp cari_ccc1
cari_ccc2_:
mov r1,#0
inc dptr
ajmp cari_cccc1_ ;cari_ccc1
cari_ccc3:
clr c
mov a,r1
jz cari_cccc1_
mov ket_smsc,#3
ajmp cari_sms_x
cari_cccc1_:
mov r1,#0
mov r0,#buf_rx
mov dptr,#ctlkm ;telkomsel=4
cari_cccc1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cari_cccc2
ajmp cari_cccc3
cari_cccc2:
clr a
movc a,@a+dptr
cjne a,b,cari_cccc2_
inc r1
inc dptr
dec r0
ajmp cari_cccc1
cari_cccc2_:
mov r1,#0
inc dptr
ajmp cari_ccccc1_ ;cari_cccc1
cari_cccc3:
clr c
mov a,r1
jz cari_ccccc1_
mov ket_smsc,#4
ajmp cari_sms_x
cari_ccccc1_:
cari_sms_x:
ret

cek_sms:
ACALL LDELAY
ACALL BUF_RES
MOV R0,#BUF_RX
LKLK:
mov dptr,#BACA_SMS ;#dial
acall coman
LLKK:
acall terima
; jnb ri,LLKK
; mov A,sbuf
; clr ri
mov b,a
clr c
subb a,#’K’
JZ CEK_SMS_X1
mov a,b
CJNE A,#’0′,LLKK
mov a,b
mov @r0,a
dec r0
LLK:
acall terima
; jnb ri,LLK
; mov A,sbuf
; clr ri
MOV B,A
MOV @R0,A
DEC R0
MOV A,B
clr c
subb a,#25h
jnc llk
ACALL NO_HP
ajmp cek_sms_x
cek_sms_x1:
mov smsnl,#0
mov psnl,#0
mov smscl,#0
cek_sms_x:
ret

dial_FLEKSI:
mov dptr,#FLEKSI
acall coman
ret
coman_buf:
SAS_buf:
mov a,@r0
acall kirim
acall ldelay
dec r0
cjne A,#0ah,SAS_buf

ret
bufer_no_enter:
clr c
mov a,@r0
jz bufer_no_enter_x
mov a,@r0
dec r0
acall kirim
acall ldelay
ajmp bufer_no_enter
bufer_no_enter_x:
ret
no_enter:

no_enter_1:
clr A
movc A,@A+DPTR ; ambil data
clr c
subb a,#0ah
jz no_enter_2
clr A
movc A,@A+DPTR ; ambil data
acall kirim
acall ldelay
inc dptr
ajmp no_enter_1
no_enter_2:

ret
coman:
SAS:
clr A
movc A,@A+DPTR ; ambil data
acall kirim
Inc DPTR
acall ldelay
cjne A,#0ah,SAS
ret

buf_res:
mov r0,#buf_rx
; mov r4,#0cfh
mov a,#buf_rx
mov b,#no_dial
clr c
subb a,b
dec a
mov r4,a
res_buf_:
mov @r0,#0
dec r0
djnz r4,res_buf_
ret
UPFONT:
MOV Dr4,A
CLR C
SUBB a,#’a’
jc upfont1
mov a,dr4
clr c
subb a,#20h
mov dr4,a
upfont1:
mov a,dr4
RET
terima:
jnb ri,terima
mov A,sbuf
clr ri
clr c
ret
cek_at_ok:
mov sms_ok,#0
load_1:
acall terima
;ima:
; jnb ri,ima
; mov A,sbuf
; clr ri
; clr c
mov b,a
subb a,#’K’
JZ LOAD_2
clr c
mov a,b
subb a,#’R’
jz load_3
ajmp load_1
load_2:
mov sms_ok,#’K’
ajmp load_4
load_3:
mov sms_ok,#’R’
load_4:

ret
kirim:
; INC PUTAR
; MOV R6,PUTAR
; MOV R7,A
; RET
;JDKSD:
clr scon.1
mov sbuf,a
txloop:
jnb scon.1,txloop
ret
ringing:
mov a,d_ring
cjne a,#’G’,ring_ok1
clr c
mov a,ring1
jz ring_1
mov ring1,#0
ajmp ring_x
ring_1:
mov ring1,#1
ajmp ring_x
ring_ok1:
mov a,d_ring
cjne a,#’g’,ring_x
clr c
mov a,ring1
jz ring_2
mov ring1,#0
ajmp ring_x
ring_2:
mov ring1,#1
ring_x:
clr c
mov a,ring1
jz off_
clr p2.0
ajmp ring_xx
off_:
setb p2.0
ring_xx:
ret
;– Routine delay —
Ldelay:
; ret
;jkdfl:
mov ddr7,r7
mov ddr6,r6
mov r6,#0
mov R7,#50
Ld1: djnz R6,$
djnz R6,$
djnz R7,Ld1
mov r7,ddr7
mov r6,ddr6
ret
DELAY:
mov ddr6,r1
mov R1,#50
Led1_:
ACALL LDELAY
djnz R1,LeD1_
mov r1,ddr6
RET
no_hp:

; mov dptr,#sms1
; clr A
; movc A,@A+DPTR ; ambil data
mov r0,#buf_rx
mov a,@r0
clr c
ACALL CHAR2DEC
mov b,a
; inc dptr
dec r0
; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

clr c
ACALL CHAR2DEC
add a,b
clr c
mov b,#2
mul ab
clr c
add a,#2
mov smscl,a
; inc dptr
dec r0

no_hp1:
dec a
;inc dptr
dec r0

jnz no_hp1
mov dr6,#buf_no_pdu

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0
mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6
ACALL CHAR2DEC
mov b,a
; inc dptr
dec r0

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6
ACALL CHAR2DEC
clr c
add a,b
mov smsnl,a

; inc dptr
dec r0

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6

; inc dptr
dec r0

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6

; inc dptr
dec r0

mov a,smsnl
mov b,a

; mov r0,#buf_no
mov dr7,#buf_no
no_hp2:
; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6

mov dr5,a
dec b

; inc dptr
dec r0

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

mov data0,r0
mov r0,dr6
mov @r0,a
mov r0,data0
dec dr6
mov r4,a

; inc dptr
dec r0

mov a,r4
mov data0,r0
mov r0,dr7
mov @r0,a
mov r0,data0
dec dr7
mov a,dr5
cjne a,#’F’,no_ok1
mov a,#0
no_ok1:
mov data0,r0
mov r0,dr7
mov @r0,a
mov r0,data0
dec dr7
clr c
mov a,b
dec b
clr c
subb a,#2
jnc no_hp2
mov r4,#18
no__:

; inc dptr
dec r0

djnz r4,no__
; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

call char2dec
mov b,a
; inc dptr
dec r0

; clr A
; movc A,@A+DPTR ; ambil data
mov a,@r0

call char2dec
clr c
add a,b
mov psnl,a
mov r6,a
clr c
mov b,#2
mul ab
mov r4,a
;mov r0,#buf_psn
mov dr3,#buf_psn
psn__:

; inc dptr
dec r0

; clr a
; movc a,@a+dptr
mov a,@r0

; acall char2dec
mov data0,r0
mov r0,dr3
mov @r0,a
mov r0,data0
dec dr3
djnz r4,psn__
; mov r4,a
; mov r0,#buf_psn
;teess:
; mov a,@r0
; dec r0
; djnz r4,teess
acall pdutotext
ret

;texttopdu:
; mov r0,#text_pdu
;textto_1:
; clr c
; mov a,@r0
; anl a,#127
; mov @r0,a
; dec r0
; jnz textto_1
; mov r0,#text_pdu
; mov shlbit,#7
;textto_1_:
; clr c
; mov a,shlbit
; jnz textto_2
; mov shlbit,#7
; ajmp textto_3
;textto_2:
; mov dr2,r0
; dec r0
; mov a,@r0 ;tmp[i+1]
; mov r2,shlbit
;slbit_1:
; rl a
; anl a,#0feh
; djnz r2,slbit_1
; mov orbit,a
; mov r0,dr2
; mov a,@r0
; orl a,orbit
; mov @r0,a
; dec r0
; mov a,#8
; clr c
; subb a,shlbit
; mov r2,a
; mov a,@r0
;slbit_2:
; rr a
; anl a,#7fh
; djnz r2,slbit_2
; mov @r0,a
; dec shlbit
;textto_3:
; jnz textto_1_
; mov r0,#text_pdu
;test_pdu:
; mov a,@r0
; acall text2hex
; mov r1,dr2
; mov r2,dr3
; dec r0
; jnz test_pdu
; ret
;text2hex:
; mov data0,a
; anl a,#0fh
; acall dec2CHAR
; mov dr3,a
; mov a,data0
; anl a,#0f0h
; rr a
; anl a,#7fh
; rr a
; anl a,#7fh
; rr a
; anl a,#7fh
; rr a
; anl a,#7fh
; acall dec2char
; mov dr2,a
; ret
atd:
mov dptr,#atd_
atd_1:
clr a
movc a,@a+dptr
clr c
subb a,#0ah
jz atd_x
clr a
movc a,@a+dptr
acall kirim
acall ldelay
inc dptr
ajmp atd_1
atd_x:
ret

cek_key:
mov dkey,#0
mov r0,#buf_psn_txt
mov r1,#0
mov dptr,#key1
cek_key1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cek_key2
ajmp cek_key3
cek_key2:
clr a
movc a,@a+dptr
cjne a,b,cek_key2_
inc r1
inc dptr
dec r0
ajmp cek_key1
cek_key2_:
mov r1,#0
inc dptr
ajmp cek_keyy1_ ;cek_key1
cek_key3:
clr c
mov a,r1
jz cek_keyy1_
mov dkey,#1
ajmp cek_key_x
cek_keyy1_:
mov dkey,#0
mov r0,#buf_psn_txt
mov r1,#0
mov dptr,#key2
cek_keyy1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cek_keyy2
ajmp cek_keyy3
cek_keyy2:
clr a
movc a,@a+dptr
cjne a,b,cek_keyy2_
inc r1
inc dptr
dec r0
ajmp cek_keyy1
cek_keyy2_:
mov r1,#0
inc dptr
ajmp cek_keyyy1_ ;cek_keyy1
cek_keyy3:
clr c
mov a,r1
jz cek_keyyy1_
mov dkey,#2
ajmp cek_key_x
cek_keyyy1_:
mov dkey,#0
mov r0,#buf_psn_txt
mov r1,#0
mov dptr,#key3
cek_keyyy1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cek_keyyy2
ajmp cek_keyyy3
cek_keyyy2:
clr a
movc a,@a+dptr
cjne a,b,cek_keyyy2_
inc r1
inc dptr
dec r0
ajmp cek_keyyy1
cek_keyyy2_:
mov r1,#0
inc dptr
ajmp cek_keyyyy1_ ;cek_keyyy1
cek_keyyy3:
clr c
mov a,r1
jz cek_keyyyy1_
mov dkey,#3
ajmp cek_key_x
cek_keyyyy1_:
mov dkey,#0
mov r0,#buf_psn_txt
mov r1,#0
mov dptr,#key4
cek_keyyyy1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cek_keyyyy2
ajmp cek_keyyyy3
cek_keyyyy2:
clr a
movc a,@a+dptr
cjne a,b,cek_keyyyy2_
inc r1
inc dptr
dec r0
ajmp cek_keyyyy1
cek_keyyyy2_:
mov r1,#0
inc dptr
ajmp cek_keyyyyy1_ ;cek_keyyyy1
cek_keyyyy3:
clr c
mov a,r1
jz cek_keyyyyy1_
mov dkey,#4
ajmp cek_key_x
cek_keyyyyy1_:
mov dkey,#0
mov r0,#buf_psn_txt
mov r1,#0
mov dptr,#key5
cek_keyyyyy1:
mov a,@r0
mov b,a
clr a
movc a,@a+dptr
cjne a,#0ah,cek_keyyyyy2
ajmp cek_keyyyyy3
cek_keyyyyy2:
clr a
movc a,@a+dptr
cjne a,b,cek_keyyyyy2_
inc r1
inc dptr
dec r0
ajmp cek_keyyyyy1
cek_keyyyyy2_:
mov r1,#0
inc dptr
ajmp cek_keyyyyyy1_ ;cek_keyyyyy1
cek_keyyyyy3:
clr c
mov a,r1
jz cek_keyyyyyy1_
mov dkey,#5
ajmp cek_key_x
cek_keyyyyyy1_:

cek_key_x:
ret
;test_smsc:
; clr c
; mov a,ket_smsc
; subb a,#1
; jz test_smsc1
; clr c
; mov a,ket_smsc
; subb a,#2
; jz test_smsc2
; clr c
; mov a,ket_smsc
; subb a,#3
; jz test_smsc3
; clr c
; mov a,ket_smsc
; subb a,#4
; jz test_smsc4
; ajmp test_smscx
;test_smsc1:
; mov dptr,#cmtr
; acall call_smsc
; ajmp test_smscx
;test_smsc2:
; mov dptr,#cim3
; acall call_smsc
; ajmp test_smscx
;test_smsc3:
; mov dptr,#cxl
; acall call_smsc
; ajmp test_smscx
;test_smsc4:
; mov dptr,#ctlkm
; acall call_smsc
; ajmp test_smscx
;test_smscx:
; ret

pdutotext:
;buf_psn_txt data 5ah
mov r0,#buf_psn
mov r4,psnl ;#8
mov shlbit,#7
mov dr6,#buf_psn_txt
pdutext_:
mov a,shlbit
cjne a,#7,pdu_1
mov orbit,#0
mov andbit,#127
mov shlbit,#0
pdu_1:
mov a,@r0
acall char2dec
rl a
rl a
rl a
rl a
anl a,#0f0h
mov b,a
dec r0
mov a,@r0
acall char2dec
orl a,b
mov octets,a
anl a,andbit
mov b,a
clr c
mov a,shlbit
jz shll_1
mov r3,a
mov a,b
shll_:
rl a
anl a,#11111110b
djnz r3,shll_
orl a,orbit
ajmp shl_2
shll_1:
mov a,b
orl a,orbit
shl_2:
mov dr2,a
MOV DATA0,R0
MOV B,dr6
MOV R0,B
mov @r0,a
MOV R0,DATA0
dec dr6
inc shlbit
mov a,andbit
rr a
anl a,#7fh
mov andbit,a
mov a,#8
mov b,shlbit
clr c
subb a,b
mov r1,a
mov a,octets
shl_3:
rr a
anl a,#7fh
djnz r1,shl_3
mov orbit,a
MOV a,shlbit
cjne a,#7,shl_4
mov a,orbit
MOV dr2,A
dec r4
MOV DATA0,R0
MOV B,dr6
MOV R0,B
mov @r0,a
MOV R0,DATA0
dec dr6
shl_4:
dec r0
clr c
mov a,r4
jz sshl_
djnz r4,pdutext_
sshl_:
MOV R0,#buf_psn_txt
MOV R1,PSNL
SHL_5:
MOV A,@R0
ACALL UPFONT
MOV @R0,A
DEC R0
DJNZ R1,SHL_5
MOV R0,#buf_psn_txt
MOV R1,PSNL
SHL_6:
MOV A,@R0
MOV @R0,A
DEC R0
djnz r1,SHL_6
mov r0,#buf_no
mov r1,smsnl
shl_7:
mov a,@r0
dec r0
djnz r1,shl_7
mov a,smsnl
mov b,#5
clr c
add a,b
mov r1,a
mov r0,#buf_no_pdu
shl_8:
mov a,@r0
dec r0
djnz r1,shl_8
ret
dec2char:
mov dr5,a
clr c
subb a,#0ah
jz a_
mov a,dr5
clr c
subb a,#0bh
jz b_
mov a,dr5
clr c
subb a,#0ch
jz c_
mov a,dr5
clr c
subb a,#0dh
jz d_
mov a,dr5
clr c
subb a,#0eh
jz e_
mov a,dr5
clr c
subb a,#0fh
jz f_
clr c
mov a,dr5
add a,#’0′
ajmp dec2charx
a_: mov a,#’A’
ajmp dec2charx
b_: mov a,#’B’
ajmp dec2charx
c_: mov a,#’C’
ajmp dec2charx
d_: mov a,#’D’
ajmp dec2charx
e_: mov a,#’E’
ajmp dec2charx
f_: mov a,#’F’
ajmp dec2charx
dec2charx:
ret

char2dec:
mov dr5,a
clr c
subb a,#’A’
jc _0
mov a,dr5
clr c
subb a,#’A’
jz _A
mov a,dr5
clr c
subb a,#’B’
jz _B
mov a,dr5
clr c
subb a,#’C’
jz _C
mov a,dr5
clr c
subb a,#’D’
jz _D
mov a,dr5
clr c
subb a,#’E’
jz _E
mov a,dr5
clr c
subb a,#’F’
jz _F
ajmp char2dec_x
_A:
MOV a,#10
ajmp char2dec_x
_B:
MOV a,#11
ajmp char2dec_x
_C:
MOV a,#12
ajmp char2dec_x
_D:
MOV a,#13
ajmp char2dec_x
_E:
MOV a,#14
ajmp char2dec_x
_F:
MOV a,#15
ajmp char2dec_x
_0:
MOV A,dr5
CLR C
subb a,#’0′
ajmp char2dec_x
char2dec_x:
ret
tunda:
mov dptr,#security_yes ;sms1
acall coman
ret
;==========
;DATA AREA
;==========
;Pesan: DB 0Dh,0Ah,0dh,0ah
; DB ‘Selamat Anda mempercayakan pada produksi ‘
; DB ‘dalam negeri, ide, saran, kritik sangat ‘
; DB ‘kami harapkan demi kemajuan kami ==> by ITS.’
; DB 0Dh,0Ah,0dh,0ah
; DB ‘******** LEMBAGA PENELITIAN DAN PENGABDIAN PADA MASYARAKAT ITS ********’
; DB 0
dial_: db ‘atd085648537310;’,0dh,0ah
fleksi: db ‘atd03170699472;’,0dh,0ah
clip_on: db ‘at+clip=1’,0dh,0ah
clip_of: db ‘at+clip=0’,0dh,0ah
ESC_: DB 1BH,1H
CTRL_Z: DB 1AH,2CH,0ah
ENTER: DB 0DH,0AH
;SMS: DB ‘06912612000010040C9126130796492700006080104110830003C8701A’,0ah
;SMS: DB ‘06912612000010040B818021593733F700006080104110830003C8701A’,0ah
; DB 0D,0AH
smscmtr: db ‘0591261816421100’,0ah ;62816124
cmtr: db ‘+62816124’,0ah
smscim3: db ‘07912658050000F01100’,0ah ;62855000000
cim3: db ‘+62855000000’,0ah
SMSCxl: DB ‘07912618485400F91100’,0ah ;621818445009
cxl: db ‘+621818445009’,0ah
smsctlkm: db ‘07912618010000F01100’,0ah
ctlkm: db ‘+62811000000’,0ah
;sms1: db ‘06912618168244040D91265858801812F10000608060907115820BD2F219D42EBBE961791A’,0ah
;sms2: db ‘06912612000010040C9126130796492700006080505104950024B0986C46ABD96EB85C583C2697CD67745ABD66B7DD6F785C3EA7D7ED777C5E0F’
key1: db ‘UNLOCK’,0AH
key2: db ‘LOCK’,0AH
KEY3: db ‘REG’,0AH ;daftar nomer dial
key4: db ‘ON POWER’,0AH ;
key5: db ‘OFF POWER’,0ah ;
BACA_SMS: DB ‘AT+CMGL=4’,0DH,0AH
atd_: DB ‘ATD’,0ah
smsc_: db ‘at+csca?’,0dh,0ah
;inbox: db ‘at+cmgl=0’,0dh,0ah
cmgs_: db ‘AT+CMGS=’,0ah
del_: db ‘at+cmgd=1’,0dh,0ah
;test_sms: db ‘07912658050000F011000D91265846587313F00000A711D2F2599E9ED3CEF334685A5FCFCB73’,1AH,2CH,0ah
;no_: db ‘0D91265846587313F0’,0ah
reg_sukses: db ‘0000A711D2F2599E9ED3C3F334685A5FCFCB73’,0ah
security_yes: db ‘0000A721D3F2B82E4FD3F3A0697E4E2FB741F9775D0E1A86E5A0F41C145CD3D366’,0ah
security_No: db ‘0000A724D3F2B82E4FD3F3A0697E4E2FB741F9775D0E1A86E5A0F41CE47C82826B7ADA0C’,0ah
end

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: