• LOOKUP.pbp

    PICBASIC PRO program to demonstrate LOOKUP & RANDOM commands. Converts numeric value to ASCII hexadecimal equivalents.
    ' Name        : LOOKUP.pbp
    ' Compiler    : PICBASIC PRO Compiler 2.6
    ' Assembler   : PM or MPASM
    ' Target PIC  : 12F, 16F or 18F
    ' Hardware    : PC serial connection & terminal for result display
    ' Oscillator  : 4MHz internal or external
    ' Keywords    : LOOKUP, RANDOM, SEROUT
    ' Description : PICBASIC PRO program to demonstrate  LOOKUP & RANDOM commands.
    ' Converts numeric value to ASCII hexadecimal equivalents.
    '
    
    Include "bs1defs.bas"  ' Include BS1 variable and serial definitions
    
    SO Con 0               ' Define serial out
    
    mainloop:
       W6 = W0 : Gosub HexW    ' Print W0
       Serout SO,N2400,[13,10] ' Print end of line
       Random W0		   ' Randomize W0
       Goto mainloop           ' Do this forever!!!
    
       ' Send W6 as XXXX (Uses W5)
    
    HexW:
       Gosub HexB13            ' Print MSB
       B13 = B12               ' Print LSB
    
    HexB13:
       B11 = B13 / 16          ' Print MSB
       Gosub HexB11
       B11 = B13 & 15
    
    HexB11:
       Lookup B11,["0123456789ABCDEF"],B10 ' B10 = HEX$(B11)
       Serout SO,N2400,[B10]
       Return
    
       End
    
               
    Download the file lookup.pbp
  • Recent Forum Posts

    peterthegrate

    pbpinc edit

    Thanks for the response - it does compile OK with the pbpinc file edit that you have suggested.

    peterthegrate 7 Hours Ago Go to last post
    richard

    Installation help!

    +1
    I bought my mcspx in 2012 and reinstalled it last year after w10 botched everything , there were no issues with the key . was I lucky ?

    richard 14 Hours Ago Go to last post
    Henrik Olsson

    Installation help!

    Can you clarify that please? Are you saying that if I need to reinstall the copy (license) of MCSPX I've bought and payed for I need to re-purchase the

    Henrik Olsson 14 Hours Ago Go to last post
    Ramius

    Thanks Charles

    Thanks Charles!
    Yes I do keep my old software in the case of some software upgrades require verification of a previous purchase. I think I need

    Ramius 16 Hours Ago Go to last post
    mpgmike

    Daryl Taylor Interrupt Routine for K40

    I revamped the DT_INTS-18 code to work with the new K40 chips. Great, except it only works on K40 28/40 pin processors. I attempted to revamp the original

    mpgmike 16 Hours Ago Go to last post