Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to convert .pbp to .asm

Status
Not open for further replies.

apekesmaster

Newbie level 3
Joined
Apr 30, 2010
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,370
i got a code .pbp but i don't know how to read it anybody can help me to convert this code to .asm code


'-----------------------------------------------------------------------------
'~~~ 245 LED PC-Programmable Moving Message Display By Trent Jackson ©2006 ~~~
'-----------------------------------------------------------------------------
' '
' Version: ßeta 0.1 '
' Project started: 20/05/06 '
' Finished: 21/05/06 '
' Bugs & Enquiries: trentjackson888@bigpond.com.au ' '
' '
'-----------------------------------------------------------------------------

'Target: PIC 16f628

Include "modedefs.bas" 'Include serial modes
Define OSC 10 '10MHz crystal
CMCON = 7 'Disable comparator, start up in digital mode, PortA

'----------------- Row Control ----------------

'PortA: Pin1, RA2 = ROW 1
'PortA: Pin2, RA3 = ROW 2
'PortB: Pin6, RB0 = ROW 3
'PortB: Pin7, RB1 = ROW 4
'PortB: Pin8, RB2 = ROW 5
'PortB: Pin9, RB3 = ROW 6
'PortB: Pin10, RB4 = ROW 7

'--------------- Column Control ---------------

'PortB: Pin11, RB5 = Master Reset 4017 Counters
'PortB: Pin12, RB6 = Clock Cascaded Counters

'--------------- Serial EEPROM ----------------

'PortA: Pin18, RA0 = Data Line
'PortA: Pin17, RA1 = Clock Line

'-------------- Communications ----------------

'PortB: Pin14, RB7 = RX Line
'PortA: Pin3, RA4 = Program Button & RX LED

'-----------------------------------------------------------------------------
Setup:
'-----------------------------------------------------------------------------

'Define port pins as inputs and outputs...
TRISA = %00000000
TRISB = %10000000

'Variables...
EEPROMAddress VAR WORD
MSGLength VAR WORD
ScaleTime VAR WORD
DataBuffer VAR BYTE
EEPROMConfig VAR BYTE
ColPosition VAR BYTE
ToggleLEDRate VAR BYTE
ShiftMSGSpeed VAR BYTE
CycleMSGTimes VAR BYTE
CycleCounter VAR BYTE

EEPROMDataPin VAR PORTA.0
EEPROMClockPin VAR PORTA.1
ClockColsCounter VAR PORTB.6
ResetColsCounter VAR PORTB.5
ROW1 VAR PORTA.2
ROW2 VAR PORTA.3
ROW3 VAR PORTB.4
ROW4 VAR PORTB.3
ROW5 VAR PORTB.0
ROW6 VAR PORTB.2
ROW7 VAR PORTB.1
ProgButton VAR PORTA.4
ActivityLED VAR PORTA.4

'Defaults
EEPROM [1,0,0,255,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

'Init
EEPROMConfig = %10100000
INPUT PORTA.4

'Load moving message speed rate - (user-definable in Windows GUI)
READ 0, ShiftMSGSpeed

'Load message length & cycle times
READ 1, MSGLength.BYTE0
READ 2, MSGLength.BYTE1
READ 3, CycleMSGTimes

'Reset 4017 counters
ResetColsCounter = 1
PAUSE 100
ResetColsCounter = 0

'Starting address
EEPROMAddress = 1

'-----------------------------------------------------------------------------
RunMessage:
'-----------------------------------------------------------------------------
'User pressed program button?
IF ProgButton = 0 THEN GOTO ProgramMessage

ColPosition = ColPosition + 1 'Inc
IF ColPosition = 37 THEN ColPosition = 1 'Reset

'Fetch data from EEPROM
I2CREAD EEPROMDataPin, EEPROMClockPin, EEPROMConfig, ((35 + EEPROMAddress) - ColPosition), [DataBuffer]

'Switch off all rows during the transition of the clock signal to the counters, this eliminates trailing
ROW1 = 0
ROW2 = 0
ROW3 = 0
ROW4 = 0
ROW5 = 0
ROW6 = 0
ROW7 = 0

'Clock cascaded counters
ClockColsCounter = 1
PAUSEUS 1
ClockColsCounter = 0

'Inc address, fetch next
IF ScaleTime = ShiftMSGSpeed THEN
EEPROMAddress = EEPROMAddress + 1
ScaleTime = 0
ENDIF

IF EEPROMAddress = MSGLength THEN
'A setting of 255 for the number of cycle periods denotes a continous loop
IF CycleMSGTimes <> 255 THEN CycleCounter = CycleCounter + 1

'Has the number of cycles been reached?
IF CycleCounter = CycleMSGTimes THEN

'Reset counters
ResetColsCounter = 1
PAUSE 50
ResetColsCounter = 0

'-----------------------------------------------------------------------------
MSGFinished:
'-----------------------------------------------------------------------------
'User pressed program button?
IF ProgButton = 0 THEN GOTO ProgramMessage

'Infinite loop until user hits reset button
PAUSE 200
GOTO MSGFinished
ENDIF
EEPROMAddress= 1 'Reset
ENDIF

'-----------------------------------------------------------------------------
OutputRowData:
'-----------------------------------------------------------------------------
'Logically AND retrieved data from EEPROM with row bit values and write to port asynchronously

IF DataBuffer & 1 THEN ROW1 = 1
IF DataBuffer & 2 THEN ROW2 = 1
IF DataBuffer & 4 THEN ROW3 = 1
IF DataBuffer & 8 THEN ROW4 = 1
IF DataBuffer & 16 THEN ROW5 = 1
IF DataBuffer & 32 THEN ROW6 = 1
IF DataBuffer & 64 THEN ROW7 = 1

'-----------------------------------------------------------------------------
'The multiplex rate is about 23Hz duty cycle is about 2.8%. Some deliberate flickering results
'from the low multiplex rate. This allows for extra birghtness from the LEDs. The duty cycle is so
'low that this lower than desirable rate is the only real option...
'-----------------------------------------------------------------------------

PAUSEUS 100

'Generate increments from the 100us delay to be used with the actual moving of the message speed
ScaleTime = ScaleTime + 1 'Inc
GOTO RunMessage 'Loop back

'-----------------------------------------------------------------------------
ProgramMessage:
'-----------------------------------------------------------------------------
'Make PORTA.4 an output so that the activity LED can be flashed
OUTPUT PORTA.4
ActivityLED = 0
EEPROMAddress = 1
DataBuffer = 0

'Switch off all rows
ROW1 = 0
ROW2 = 0
ROW3 = 0
ROW4 = 0
ROW5 = 0
ROW6 = 0
ROW7 = 0

'-----------------------------------------------------------------------------
WriteToEEPROM:
'-----------------------------------------------------------------------------
'Now, write contents received serially from the PC to the EEPROM
SERIN PORTB.7, N2400, ["a"], DataBuffer
IF DataBuffer = 255 THEN GOTO WriteMSGLength
'//
ToggleLEDRate = ToggleLEDRate + 1
If ToggleLEDRate = 4 THEN TOGGLE ActivityLED: ToggleLEDRate = 0
'//
I2CWRITE EEPROMDataPin, EEPROMClockPin, EEPROMConfig, EEPROMAddress, [DataBuffer]
EEPROMAddress = EEPROMAddress + 1
GOTO WriteToEEPROM

'-----------------------------------------------------------------------------
WriteMSGLength:
'-----------------------------------------------------------------------------
MSGLength = (EEPROMAddress - 35)
WRITE 1, MSGLength.BYTE0
PAUSE 5
WRITE 2, MSGLength.BYTE1

'-----------------------------------------------------------------------------
WriteCycleTimes:
'-----------------------------------------------------------------------------
PAUSE 5
SERIN PORTB.7, N2400, ["a"], DataBuffer
'//
'Save cycle times
WRITE 3, DataBuffer
PAUSE 5
'//
'Now load it
READ 3, CycleMSGTimes

'-----------------------------------------------------------------------------
WriteCycleSpeed:
'-----------------------------------------------------------------------------
PAUSE 5
SERIN PORTB.7, N2400, ["a"], DataBuffer
'//
'Save cycle times
WRITE 0, DataBuffer
PAUSE 5
'//
'Now load it
READ 0, ShiftMSGSpeed

'-----------------------------------------------------------------------------
NoMoreDataToWrite:
'-----------------------------------------------------------------------------
'Reset and return to main routine
ClockColsCounter = 0
ResetColsCounter = 1
PAUSE 100
ResetColsCounter = 0
'//
EEPROMAddress = 1
DataBuffer = 0
ColPosition = 0
CycleCounter = 0
ScaleTime = 0
'//
INPUT PORTA.4
GOTO RunMessage

END




:cry::?::cry::cry::?::cry::cry::cry::cry::cry::cry:
 

adnan_merter

Full Member level 3
Joined
Jan 23, 2008
Messages
160
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Location
The most beautiful city of the world
Activity points
2,524
as far as i know there is no way to convert pbp to asm

they are different languages, if you want to convert, you have to know both languages.

i don't know pic basic pro but i think it is the easiest language, you should find a e-book and take a look at,
you will figure out easily.

take a look at this

**broken link removed**

good luck
 

jamshid.dastur

Member level 4
Joined
Sep 14, 2007
Messages
77
Helped
15
Reputation
30
Reaction score
5
Trophy points
1,288
Activity points
1,829
What you can do is use pbp compiler for example, PicBasicPro or Proton IDE, and compile the code, the output will generate a Hex file along with an equivalent ASM file as well...The asm generated will be a bit more complex then what a human would code...but still it will be your asm.

Best Regards
Jamshid
 

BobK

Member level 1
Joined
Mar 25, 2005
Messages
39
Helped
8
Reputation
16
Reaction score
3
Trophy points
1,288
Location
USA
Activity points
1,887
Hello apekesmaster,

Send me your email address and I will send you the files. Mention this forum in your email. I am unable to attach them here.

HTH,

BobK
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top