• Please review our updated Terms and Rules here

Random Characters Issue on a COMMOODRE PET 2001

Hi Dwight,

I thought you were talking about generating the table to avoid entry errors. Sorry that I'm not quite following this thread all that well...
 
Hi Chuck
I don't know of a good way to generate the table
though. Just have to live with divides for that.
As I recall CRC32 was right shifts.
Dwight
 
Stéphane,
Yes the 6502 is great for learning the basic concepts of assembly programming. If you get your BASIC 4 system working, I can send you an EPROM toolkit to help with this.

I'm not sure how much help it would be in going to a Windows programming environment, that is a much tougher thing in assembly language and assembly is not really needed as high level languages for Windows are so powerful and fast.

Yes, you will need a storage device like a cassette recorder (C2N) or better yet a floppy drive (4040) for saving your code.

Yes it is accurate for both BASIC and assembly and useful as you could use the PC disk for storage until you get storage for the PET.
-Dave

Hi,

While my PET is being fixed, I have started learning the basic concepts of assembly programming using the great links I could get thru this post.
This is really very exciting and I am having a lot of fun ! ;-)

Dave you talked about an EPROM toolkit that could be very helpful with this.
Can you tell me more about it ?

I have received my cassette recorder (C2N) this morning ; (I would have prefered of course a floppy drive, but they are still very expensive ...)
Many people seem to be very attracted by PET stuff as collectors I guess ... And the prices are still very high.

Thank you.

Stéphane.
 
Stèphane, if you like I could make you a shipping quote for a 3040 drive with DOS V1. It works sometimes, but can be a bit tricky. Since I've already donated two identical drives to my friends, I would be willing to donate this one to you as well. However it is a 10+ kg item so perhaps one day you'd be lucky to find an IEEE drive locally for less.
 
Hi Chuck
I don't know of a good way to generate the table
though. Just have to live with divides for that.
As I recall CRC32 was right shifts.
Dwight

I'm not sure about that, unless you're talking about whole-byte shifting. I generally create the 256-entry coefficient table using a "short form" 8-entry table, thus:

Code:
        les     di,cs:CRC32_Table_Ptr
        xor     cx,cx                       ;  counter
InitCRC6:
        xor     ax,ax
        xor     dx,dx                       ;  clear accumulator
        lea     bx,word ptr CRC32_ShortForm
        mov     cl,ch
InitCRC8:
        test    cl,cl
        jns     InitCRC10               ;  if no bit
        xor     ax,cs:[bx]              ;  low order
        xor     dx,cs:[bx+2]            ;  high order
InitCRC10:
        add     bx,4
        shl     cl,1
        jnz     InitCRC8                ;  compute a term
        stosw                           ;  store low order
        mov     ax,dx
        stosw                           ;  store high order
        inc     ch
        jnz     InitCRC6                ;  loop...

If you have 32-bit registers, then the computation goes pretty quickly:

Code:
Make3866:
        movzx   ebx,byte ptr ds:[esi]
        inc     esi
        xor     bl,dl
        shr     edx,8
        xor     edx,es:[edi+ebx*4]
        loop    Make3866                ;  do it

No rights shifts except for the full-byte one.

If you're doing multiples of doublewords, it goes even faster:

Code:
;	EDI points to coefficient table
;	SI  points to souce
;	CX  has doubleword count

	lodsd
Make3862:
	movzx	ebx,al
	xor	bl,dl
	shr	edx,8
	xor	edx,es:[edi+ebx*4]
	movzx	ebx,ah
	shr	eax,16
	xor	bl,dl
	shr	edx,8
	xor	edx,es:[edi+ebx*4]
	movzx	ebx,al
	xor	bl,dl
	shr	edx,8
	xor	edx,es:[edi+ebx*4]
	movzx	ebx,ah
	xor	bl,dl
	shr	edx,8
	xor	edx,es:[edi+ebx*4]
	dec	cx
	lodsd				; prefetch the next doubleword
	jnz	Make3862		; loop for another pass

The curious thing is that most "software" CRC checks for files and whatnot reverse the bit ordering of that used by disk drives and devices that generate "hardware" CRCs. This can really throw you if you don't know to expect it.
 
Hi,

While my PET is being fixed, I have started learning the basic concepts of assembly programming using the great links I could get thru this post.
This is really very exciting and I am having a lot of fun ! ;-)
...
Stéphane.
If you haven't already downloaded it, I'd recommend "Machine Language (for the Commodore 64 and other Commodore computers)" by my late friend Jim Butterfield; he was not only one of the most knowledgeable but also among the best at explaining these concepts.

http://www.bombjack.org/commodore/books.htm

Scroll down to the Machine Language/Assembly Language section.

Do you have a good assembler?

Enjoy!
 
I'm not sure about that, unless you're talking about whole-byte shifting. I generally create the 256-entry coefficient table using a "short form" 8-entry table, thus:

Code:
        les     di,cs:CRC32_Table_Ptr
        xor     cx,cx                       ;  counter
InitCRC6:
        xor     ax,ax
        xor     dx,dx                       ;  clear accumulator
        lea     bx,word ptr CRC32_ShortForm
        mov     cl,ch
<SNIP>
[/QUOTE]That doesn't look like any PET/65xx assembler syntax I've ever seen... ;-)
 
Hi
It needs a little transformation. It is x86 code and
not 6502.
Still, it is a good example of the operations that
could be transformed to 6502.
Dwight
 
Mike,
Really great books. I remember some of them. Kudos to the person who saved them on the web. I am still looking for the Commodore/MOS Technology Assembler if you ever rummage through your stuff.
I have an original version of the Commodore PET assembler package, but that's probably not what you're looking for? Also the C64 Assembler package, PAL, and 2500AD commercial 6502 cross-assemblers for CP/M and the PC, all from the days when I did this for profit and not just for fun.
 
I have an original version of the Commodore PET assembler package, but that's probably not what you're looking for?

Mike,
Oh, OK, so it will not work on a BASIC 4 PET...:(

I had one in the old days, but the box of floppies is long gone.

I will have to use a shareware PC cross assembler that outputs in MOS Technology HEX format. BATPRO has a loader for that. Eventually I'd like to do everything on the PET.
-Dave
 
Mike,
Oh, OK, so it will not work on a BASIC 4 PET...:(
No, AFAIR there are two versions, BASIC 2 and BASIC 4; I can't test it right now because I just loaned it to Steve Gray to scan and archive since he's better equipped (and a nicer guy) than I.

When I said "original" I didn't mean the first ever version, I meant the original disk and manual as opposed to copies, but your saying you wanted a MOS version suggested you were looking for something older.

I expect Steve will put the code and docs up on his area in 6502.org when he's done; hope the disks are still OK.
 
Dave, if you are "stuck" with using a cross assembler, why not one that outputs a PET executable right away instead of HEX format that needs further processing to be executable? Personally I find cross assembly far better than working natively, but it depends on if you make small hacks or larger programs.
 
Hi,

@Mike :
- Thank you for your tutorial on "how to test the suspicious ROM chips".
- I will for sure give it a try to determine which ROMs are really dead!
- I have started the book : "Machine Language" that you kindly recommmended to me; it is indeed very instructive. Well, I still do not have a good assembler.

@Dave :
- Once the tests performed, I will send the V2 set from Ebay and the 2532 EPROMs and the extra graphics editor to Sweden. ;-)
- The BATPRO package looks really interesting ; is it possible to try it from VICE ?

@Anders :
- I would be more than interested by the 3040 drive with DOS V1, even with the shipping, as it has become very hard to find. Just let me know about the shipping cost.

Good day,
Stéphane.
 
Dave, if you are "stuck" with using a cross assembler, why not one that outputs a PET executable right away instead of HEX format that needs further processing to be executable? Personally I find cross assembly far better than working natively, but it depends on if you make small hacks or larger programs.

Anders,
Yes, I am just looking into an assembler called ACME by Marco Baye. It states that it has a "CBM mode" so I was wondering if it output .prg files? Which one would you recommend?

-Dave
 
Hi,
Well, I still do not have a good assembler.
Looks like you're going to be presented with a number of options: You could use a native PET assembler, either on the real PET or in an emulator, or cross-assemble, i.e. use an assembler that runs natively on a PC in DOS, Windows or Linux or even another platform and then export the resulting program(s) to the PET or an emulator.

Pros and cons, and whatever you think you'll find the easiest; looks like Dave's in the native assembler camp while Anders and I prefer to cross-assemble.

Maybe it's worth starting another thread? Sounds like we may get into a few related issues and discussions (pros and cons, file transfers, etc..)...
 
Back
Top