أريد كود keypad

السلام عليكم أرجو تزويدي ببرنامج بيسك يعمل كما يلي:
pic-keypad(portB),lcd(portD)
عندما نضغط على رقم يظهر على الشاشة

السلام عليكم
هذا كود على Pic 16 f 628a

The LCD is connected to port b and keypad to port a(a0 to a7) and we use the internal Oscillator and neglect the MCLR
this code by Picbasic plus editor
device 16f628a
xtal 4
all_digital=1
clear
trisa=%11110000
dim e as byte
dim k as byte

e=5
print at 1,1,"Key:"
start:
gosub kk
print at 1,e,dec1 k
delayms 200
e=e+1
goto start
kk:
high porta.0
low porta.1
low porta.2
low porta.3
if porta.4=1 then
k=1
return
endif
if porta.5=1 then
k=4
return
endif
if porta.6=1 then
k=7
return
endif
if porta.7=1 then
k=15
return
endif

low porta.0
high porta.1
low porta.2
low porta.3
if porta.4=1 then
k=2
return
endif
if porta.5=1 then
k=5
return
endif
if porta.6=1 then
k=8
return
endif
if porta.7=1 then
k=0
return
endif

low porta.0
low porta.1
high porta.2
low porta.3
if porta.4=1 then
k=3
return
endif
if porta.5=1 then
k=6
return
endif
if porta.6=1 then
k=9
return
endif
if porta.7=1 then
k=14
return
endif

low porta.0
low porta.1
low porta.2
high porta.3
if porta.4=1 then
k=10
return
endif
if porta.5=1 then
k=11
return
endif
if porta.6=1 then
k=12
return
endif
if porta.7=1 then
k=13
return
endif
end