' Library sample from : Per Svensson
'                       Monolitsystem AB
'                       PS@monolitsystem.se


'=====================  BASIC PROGRAM Bin2BCD16.BAS =======================
'Test program for BIN to BCD Calculations

'define external user library
$lib "bcd.lbx"
'define used function/sub
$external Bin2bcd16

'this is needed so the parameters will be placed correct on the stack
Declare Function Bin2bcd16(binval As Word) As Long

Dim S As Word
Dim A As Long
Dim Temp As Word
S = &H8765
A = &HEDCB
Temp = 1234

A = Bin2bcd16(temp)                       'call function from lib
S = Temp
End