A
Allen Bong
Guest
Hi,
I have written a small 6502 program to buzz the piezo with morse code
message. I wish to make it onto a small PCB with a 12F629 mounted.
It will finally be fitted onto the back of my bicycle. While
translating the 6502 to PIC asm, I was stuck on the beginning
of the program. I know it's a piece of cake to the PIC expert here.
The code is as follows:
ORG $800
;using LISA 2.5 by Randy Hyde
JMP main
MESSAGE STR 'APPLE 2 FOREVER'
;str will generate the message in normal ASC with the number of
;characters as the first byte
MAIN LDX #1 ;POINT TO FIRST ASC
MESSLOOP:
LDA MESSAGE,X
CMP $32
BNE CONV
SPACE JSR INT_WORD_DLY ;DELAY 6 DOT ELEMENTS ~500MS
CLC
BCC SPACE_OK
CONV JSR CONVERT ;CONVERT ALPHA-NUMERIC TO INDEX
SPACE_OK:
INX
CPX #MESSAGE+1 ;END OF MESSAGE?
BCC MESSLOOP
RTS
How does the PIC get the address of the Message ? Do I need to use
FSR and INDF ? Can the message be stored in the program area or
should I bring it up the the eeprom area?
TIA,
Allen
I have written a small 6502 program to buzz the piezo with morse code
message. I wish to make it onto a small PCB with a 12F629 mounted.
It will finally be fitted onto the back of my bicycle. While
translating the 6502 to PIC asm, I was stuck on the beginning
of the program. I know it's a piece of cake to the PIC expert here.
The code is as follows:
ORG $800
;using LISA 2.5 by Randy Hyde
JMP main
MESSAGE STR 'APPLE 2 FOREVER'
;str will generate the message in normal ASC with the number of
;characters as the first byte
MAIN LDX #1 ;POINT TO FIRST ASC
MESSLOOP:
LDA MESSAGE,X
CMP $32
BNE CONV
SPACE JSR INT_WORD_DLY ;DELAY 6 DOT ELEMENTS ~500MS
CLC
BCC SPACE_OK
CONV JSR CONVERT ;CONVERT ALPHA-NUMERIC TO INDEX
SPACE_OK:
INX
CPX #MESSAGE+1 ;END OF MESSAGE?
BCC MESSLOOP
RTS
How does the PIC get the address of the Message ? Do I need to use
FSR and INDF ? Can the message be stored in the program area or
should I bring it up the the eeprom area?
TIA,
Allen