1335RE: [cosmacelf] Re: Programming Help
- Sep 1, 2003Josh,
First off I must say thanks so very much for the help.
I spent the afternoon experimenting with the code you sent. For whatever
reason I had a few problems getting it to work, but came up with the below
solution that seams to work just fine.
I added the following:
FFC0 F8 C7 A3 ; set up R3
FFC3 F8 FF B3 ;
FFC6 D3 ; set R3 as PC
FFC7 3F ; wait for In press
FFC9 37 ; wait for In release
FFCB 30 D3 ; jump to program
FFD3 7B ; set Q for Effect
Added 2 additional FE (shl) in the loop such that the program moves only 4K
into RAM (this should work, right???).
Added 7A 00 ; Clear Q and just sit there
A cycle of the 'RUN' switch and the program is at 0x0000 ready to run.
So far I have tested the Netronics Tiny Basic and TMSI Tiny Basic and both
relocate down to RAM and both Run Fine.
All I have to work with are the document "A Short Course in Programming" by
Tom Pittman, an original blue RCA 1800 Instruction Summary card, and source
listings of various programs. The programming Guide to the 1802 sure would
be handy. I have spent many years writing assembly code for the Zilog Z8
microcontroller family, but the 1802 is quite a bit different.
To answer your question, my EPROM program is a Needham's Electronics EMP-20,
and the Emulator is an ER3 EconoRom-III by Tech-Tools.
I will continue 'tinkering' with your move program and get my final EPROM
loaded with the applications next.
From: joshbensadon [mailto:joshbensadon@...]
Sent: Monday, September 01, 2003 7:51 AM
Subject: [cosmacelf] Re: Programming Help
> I then attempted placing a small patch of code at 0xF4F0 to set theprogram
> counter to R3 as the program assumes it to be already set. I wouldthen
> execute the program by jumping to F4F0 from the Monitor ROM.This code will branch you to 0xF0F4, is that where you want to go?
> F4F0 F8 F4 A3 R3.0 = F4
> F4F3 F8 F0 B3 R3.1 = F0
> F4F6 D3 PC = R3
Where is this relocator?
Here, try this code... I entered it in HEX, your favorite.
It's the same code I posted earlier, except this time
in machine language. It basically moves memory to ram until
16k ram is full. It does not modify any code along the way.
The table must start at xx00, but the stored programs can
start at any location. Jump to FFE6 to run it.
Change FFEA to any page to relocate this code.
FF00 80 00 pgmtable .dw $8000 start of program 0
FF02 82 00 .dw $8200 start of program 1
FF04 86 45 .dw $8645 start of program 2
FFE6 6C inp 4
FFE7 FE shl ;x2 for address words
FFE8 AD plo rd ;Table must start at xx02
FFE9 F8 FF ldi pgmtable/256 ;rD points to table
FFEB BD phi rd
;set starting write address
FFEC F8 00 ldi 0 ;Write to 0000
FFEE AE plo rE
FFEF BE phi rE ;rE points to destination
FFF0 4D lda rd ;get address of first 2 pages
FFF1 BC phi rc
FFF2 4D lda rd
FFF3 AC plo rc ;rC points to source
FFF4 4C RRLoop lda rc ;read a source byte (and advance)
FFF5 5E str rE ;write a destination byte
FFF6 1E INC rE ;(and advance)
FFF7 9E ghi rE ;Test for end of RAM
FFF8 FE shl ;x2
FFF9 FE shl ;x4 for 16K ram check
FFFA 3B F4 bnf RRLoop
FFFC C0 00 00 lbr 0000
> The above did not seam to work either. I do not have originalbinary or any
> better than what was in the .PDF.What are you programming your eeprom with?
Good luck, the code is as small and simple as possible.
Visit the COSMAC ELF website at http://www.cosmacelf.com, or view the
Wiki/FAQ at http://1802.bitting.com/
To unsubscribe from this group, send an email to:
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
- << Previous post in topic Next post in topic >>