35072121

Basic and Machine Language

Moderator: Moderators

Post Reply
User avatar
Jeff-20
Denial Founder
Posts: 5761
Joined: Wed Dec 31, 1969 6:00 pm

35072121

Post by Jeff-20 »

Why does this number crash the VIC? The computer can count higher with the use of exponents. However, this particular number gives it trouble?

If you haven't tried it yet. Just type 35072121 on an empty line.

Similarly, the PRINT""+-0 crash also makes me wonder...

Any theories?
Thomas Hechelhammer
Vic 20 Dabbler
Posts: 79
Joined: Thu Jun 09, 2005 11:51 pm
Location: Germany

Post by Thomas Hechelhammer »

I would like to point to Commodore Trivia 15A.

"What happens when you type 35072121 in direct mode on the C64 and hit return?"

Short answer: There is an error in the PETSCII number to binary conversion routine (LINGET)

The problem with the PRINT-Statement is pointed out in Commodore Trivia 12A.

"What will happen if you type ?""+-0 into the CBM BASIC interpreter on the PET series, the 64 series, or the 128 series?"

Short answer: Due to a bug in the interpreter, you get a wrong stack-pointer and the CPU mostly runs into a $00 (=break) instruction.

For more detailled answers, please check out the trivia-pages.

http://www.c64trivia.co.uk/

Probably, someone could help me attaching files in my postings here ... this is more important for me. :roll:

-- Thomas
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

phpBB has no such thing as attachments. You can include images, quotes or bits of code, but not as an attachment.
Anders Carlsson

Image Image Image Image Image
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Just to be complete, this error occurs when a 6 digit or greater line number is entered and the first 6 digits indicate a number in the range 35072-35327 ($8900-$89ff). Also, it appears the error occurs on the VIC-20, but I didn't completely verify it. It would be interesting to note if the error is found on all version of CBM BASIC.
Based on VICE behavior, this error occurred all the way since 8K PET 2001, and also on the Basic 3.5 in Plus/4. It was however fixed in Basic 7 on the C128.
Anders Carlsson

Image Image Image Image Image
Post Reply