Search found 181 matches

by jgharston
Thu Mar 26, 2026 1:49 pm
Forum: Hardware
Topic: 6502 + 6845 + SRAM
Replies: 3
Views: 155

Re: 6502 + 6845 + SRAM

I believe the boxes represent some buffers/latches, like the 74LS244 and the upper being bidirectional like the 74LS245. Yes, I thought the triangles made it obvious. :)

As your drawing shows that you'll be using SRAM as a graphic display, perhaps using a single 128KB SRAM might be useful, as you ...
by jgharston
Wed Mar 25, 2026 11:44 pm
Forum: Hardware
Topic: 6502 + 6845 + SRAM
Replies: 3
Views: 155

6502 + 6845 + SRAM

I've been teaching myself how to use KiCAD over the last couple of weeks. After fighting to stop component pads overlapping tracks and trying to turn snap-to-grid off, I realised I'd set my board to be 35mm instead of 35cm.... All those decimal places bypassed my brain - who uses 0.01mm PCB ...
by jgharston
Fri Mar 20, 2026 10:08 am
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

This reminds me that I have some code that has to fit in a 16K ROM, but is actually copied to RAM to be executed. The issue is the code is about 18.5K but must live in the 16K ROM. I've been trying to find some simple quick decompression code to expand it on fetching it to RAM. Most of the code I've ...
by jgharston
Thu Mar 19, 2026 9:32 pm
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

Ah, I did get confused at one point thinking the code was squeezing into an 8K ROM, then comments talking about overwriting after executing.... ;)
by jgharston
Tue Mar 17, 2026 9:54 pm
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

Do you need ROUND() ? It's typically done by the programmer with INT(x+0.5) rather than the interpreter.
by jgharston
Tue Mar 17, 2026 9:43 pm
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

You've got lots of bits like this:
load_fp1:
ldx #FP1
bne load_fp
load_fp0:
ldx #FP0
You could do:
load_fp1:
ldx #FP1
equb $2C ; BIT xxxx, skip next instruction
load_fp0:
ldx #FP0
This is a common trick to save bytes by executing an instruction that uses the skipped instruction as its ...
by jgharston
Tue Mar 17, 2026 9:21 pm
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

start_message: .byte "VC83 BASIC "
.include "version.inc"
.byte " <> "
start_length = * - start_message

free_message: .byte " BYTES FREE"
free_length = * - free_message

initialize:
jsr initialize_target
ldax #start_message
ldy #start_length
jsr write

You might find zero-terminated string ...
by jgharston
Tue Mar 17, 2026 9:13 pm
Forum: Programming
Topic: A contest to reduce code size
Replies: 26
Views: 1066

Re: A contest to reduce code size

If you have any ideas about how to save space, don't tell me, wait for the contest. :-)
Is there any stuff your Basic is doing that the OS should be doing instead? Eg, instead of:
loop:
LDA kbdstatus
BPL loop
LDA kbddata
you should be doing:
JSR MOS_RDCH

Instead of:
LDX posnX
LDY posnY
JSR calc ...
by jgharston
Wed Mar 04, 2026 12:20 am
Forum: Hardware
Topic: RISCY-V02
Replies: 34
Views: 11661

Re: RISCY-V02

Vector table (2-byte spacing; IRQ last for inline handler):
Vector ID Address Trigger
RESET $0000 RESB rising edge
NMI $0002 NMIB falling edge, non-maskable
BRK $0004 BRK instruction, unconditional
IRQ $0006 IRQB low, level-sensitive, masked by I=1

It's more useful to have the NMI last so it can be ...
by jgharston
Tue Mar 03, 2026 11:58 pm
Forum: Programming
Topic: Announcing VC83 BASIC, a BASIC interpreter for the 6502
Replies: 21
Views: 1607

Re: Announcing VC83 BASIC, a BASIC interpreter for the 6502

Your BASIC shouldn't target the hardware. Your operating interface should target the hardware.
by jgharston
Sat Feb 28, 2026 12:19 am
Forum: Programming
Topic: Buffer indirection
Replies: 18
Views: 1132

Re: Buffer indirection

As I was typing my post a couple of days ago, my typing seemed very familiar. It was, it's a routine in some demo code for a simple text mode screen display , copies a line from (),Y to (),X down to either meeting 0 first:
.SCROLL
STY CCTEMP
TXA
TAY
LDA (CCWORK),Y
LDY CCTEMP
STA (CCWORK),Y ...
by jgharston
Wed Feb 25, 2026 2:30 am
Forum: Programming
Topic: Buffer indirection
Replies: 18
Views: 1132

Re: Buffer indirection

When I absolutely must run a bit of code in RAM I push it onto the stack and call it there.
by jgharston
Mon Feb 23, 2026 1:37 am
Forum: Programming
Topic: Buffer indirection
Replies: 18
Views: 1132

Re: Buffer indirection

Yah, the annoying omission of (zp),X. What I end up with is:

loop:
STY tmpY
TXA
TAY
LDA (zp1),Y
LDY tmpY
STA (zp2),Y
INY
INX
BR_some_condition loop

If you can push/pop X and Y, you can do:
loop:
PHY
TXA
TAY
LDA (zp1),Y
PLY
STA (zp2),Y
INY
INX
BR_some_condition loop
by jgharston
Fri Feb 20, 2026 8:35 pm
Forum: General Discussions
Topic: Firmware and infrastructure for a 6502 portable
Replies: 26
Views: 3771

Re: Firmware and infrastructure for a 6502 portable

The overall aesthetic of the text-mode user interface will be influenced by dialup BBS design, which may help explain the design strategy. Data sent from the 65C02 to the terminal display will be parsed for ANSI escape sequences, which will be translated into commands to the TFT driver, e.g., to ...
by jgharston
Sun Feb 15, 2026 4:36 pm
Forum: General Discussions
Topic: Need tips on hacking NOS Fujitsu FKB1406 keyboard
Replies: 30
Views: 8882

Re: Need tips on hacking NOS Fujitsu FKB1406 keyboard

All this talk about keyboard decoding hardware reminded me of a chip I bought awhile back for this purpose, the KR9600-PRO . This is a 9 row by 10 column keyboard encoder in a wide DIP-40 package.
I don't like that that's called an "encoder". The output is purely the X*Y matrix address:
Output ...