Search found 383 matches

by John West
Fri Mar 27, 2026 7:35 am
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

It's not clear to me what the difference is between INT and CINT, but it may be subtle.

It's described in the manual: CINT returns an integer, INT returns an integer-valued single precision floating point number. Both are floor operations, so they'll both choose the same integer if it's in the ...
by John West
Sat Mar 14, 2026 6:31 pm
Forum: Hardware
Topic: 74HC670 4x4 Register File IC Info'?
Replies: 10
Views: 629

Re: 74HC670 4-bit Register File IC Info'?

I don't see a 16V8 being suitable at all - it has only 8 flip-flops, all of which are directly connected to pins. The '670 has 16 bits of state, with four multiplexed onto each output. A CPLD like the ATF1502 should be able to do it if you wanted to go that route.

Or alternatively, use the 74HC670 ...
by John West
Fri Mar 13, 2026 8:05 am
Forum: General Discussions
Topic: Custom chips at $100 each (or $30, or $20 at quantity)
Replies: 13
Views: 1642

Re: Custom chips at $100 each (or $30, or $20 at quantity)

(As noted upthread, it feels to me like an attractive approach would be a multi-design which can somehow be configured as one of a number of 40-pin chips. You'd need at least one spare pin to manage the configuration, if you want it static.)

That sort-of exists in the form of Tiny Tapeout https ...
by John West
Thu Feb 26, 2026 1:04 am
Forum: General Discussions
Topic: The 7561 chip in Commodore calculators is 6502 based.. ?
Replies: 14
Views: 854

Re: The 7561 chip in Commodore calculators is 6502 based..

It makes me wonder how those single chip scientific calculators of that era were made.

Ken Shirriff of course has a good write-up of the Sinclair scientific calculator https://static.righto.com/calculator/sinclair_scientific_simulator.html . There's a commented disassembly of the code (in a ...
by John West
Sun Dec 28, 2025 12:12 am
Forum: Hardware
Topic: How does the PET develop its #INIT signal?
Replies: 2
Views: 494

Re: How does the PET develop its #INIT signal?

It's also connected to a test point. It's possible that it's always high under normal operation, but can be pulled low during testing to put the system into a known state. That would require the circuit it's attached to (which looks like video generation) not minding that various flip-flops are in ...
by John West
Wed Dec 17, 2025 7:27 am
Forum: Programming
Topic: Local Labels
Replies: 13
Views: 1192

Re: Local Labels

I use { } to introduce new scopes, as you suggest. It works very well.

What assembler are you using for that?


My own. Doesn't everyone write their own assembler? :-)

It does support a 65C02 target, but I use it mostly for the 65020. A consequence of designing your own processor is that no one ...
by John West
Tue Dec 16, 2025 7:20 am
Forum: Programming
Topic: Local Labels
Replies: 13
Views: 1192

Re: Local Labels

I use { } to introduce new scopes, as you suggest. It works very well. I can have meaningful labels that don't have to change as code is added, and those labels don't need ugly (to me) annotations to say that they're local. Most labels are local, and I don't like having to do extra for the common ...
by John West
Sat Nov 22, 2025 9:13 pm
Forum: Hardware
Topic: An Improved MENSCH™ Microcomputer
Replies: 218
Views: 21483

Re: An Improved MENSCH™ Microcomputer

I believe Mouser shipped me a 0.0360 Mhz crystal

That sounds very unlikely to me. Vishay make crystals at exactly 32.768KHz, and they make them at a range of frequencies from 3.579545MHz upwards. They do not, as far as I can tell, offer a 36KHz crystal. That's the sort of frequency you'd have to ...
by John West
Fri Nov 07, 2025 6:13 am
Forum: Newbies
Topic: Glue questions
Replies: 48
Views: 4551

Re: Glue questions

Does the PIC have an option to change the drive speed (rise/fall times) of the output like STM parts do?

Quickly looking at the datasheet, I think the SLRCON* "Slew Rate Control" registers might do that. They default to 1, which means slow. And reading further (in the I/O and CLKOUT Timing ...
by John West
Fri Oct 31, 2025 6:27 pm
Forum: General Discussions
Topic: SBC #0?
Replies: 7
Views: 1317

Re: SBC #0?

It would be a lot easier to help if you could post the code you're looking at.

I found a binary of the Atari 400 BASIC cartridge at https://www.atarimania.com/utility-atari-400-800-xl-xe-basic_13284.html and disassembled that (attached). It's in CART format, which I know nothing about - I just ...
by John West
Fri Oct 10, 2025 1:11 pm
Forum: Programming
Topic: fast 24 bit PRNG
Replies: 14
Views: 2148

Re: fast 24 bit PRNG

If the PRNG is any good, messing with it in an attempt to introduce "more randomness" (without theory or testing) is only going to make it worse. Almost certainly much worse. If you want non-determinism, use it when you're selecting the seed and then leave it alone.

In this case, there is a cycle ...
by John West
Mon Oct 06, 2025 2:07 pm
Forum: General Discussions
Topic: SBC #0?
Replies: 7
Views: 1317

Re: SBC #0?

ADC and SBC both add the carry flag to the sum. So ADC #0 will either leave A as it is, or add 1 to it, and SBC #0 will either subtract 1 or leave A unchanged. Without seeing the code you're looking at, my guess would be that these instructions follow other ADC or SBC instructions, and are used to ...
by John West
Mon Sep 15, 2025 9:27 pm
Forum: Programming
Topic: Coding for a modular synthesizer keyboard help
Replies: 23
Views: 3344

Re: Coding for a modular synthesizer keyboard help

So with both the doubly linked list and a singly linked list (both of which are basically just a FIFO (queue) instead of a FILO (stack)) you still effectively have a gap problem.

Press A, Press B, Press C, release B....

You now have a gap in the middle of the list

Not with the system I was ...
by John West
Mon Sep 15, 2025 5:36 pm
Forum: Programming
Topic: Coding for a modular synthesizer keyboard help
Replies: 23
Views: 3344

Re: Coding for a modular synthesizer keyboard help

If I'm understanding the problem correctly, the way I'd do it would be to maintain a doubly-linked list of currently held keys. When a key is pressed, it is inserted at the head of the list. When released, it is removed from the list. That's two arrays of 76 bytes: one holding the "next" pointer for ...
by John West
Tue Aug 26, 2025 8:47 pm
Forum: Programming
Topic: IN SEARCH OF A NAME
Replies: 33
Views: 4010

Re: IN SEARCH OF A NAME


It is correct—I’ve used the algorithm in several places.

I don't think it's right either. Have a closer look - it does not do what you're claiming. If o_di_end is not a multiple of 16, it's adding o_di_end/16. That's only going to give you a multiple of 16 for a few values, by coincidence ...