The following table represents a 64 byte long block of main memory being used to hold two data arrays, one starting at address $04 and the second at address $20. It is broken into to tables to fit on the screen/page. Addresses and contents of cells are expressed as hexadecimal values.

Segment 0 Segment 1
Line 0 Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 0 Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7
Mem
Addr
00 01 02 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
Data 37 01 f4 1b 17 b0 22 01 05 0b e2 dc b8 35 92 29 f0 3f cb 45 f1 3d ce 47 f2 3d 7e 79 f3 3c b4 99
Segment 2 Segment 3
Line 0 Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7 Line 0 Line 1 Line 2 Line 3 Line 4 Line 5 Line 6 Line 7
Mem
Addr
20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
Data 00 01 07 1f 02 03 09 1e 04 05 11 1d 06 07 31 dd                                

The data cache table is 2 cells by 8 lines, each cell holds 1 byte of data.
Only data is cached in this example (not instuctions).

For this example, assume a write to a non-cached memory location will first cause the memory to be loaded into the cache, i.e, first time STA $22 is executed, Line 0 of Segment 2 is moved into the cache before the Accumulator is stored.

Empty cache LDA $00 - Miss - 37ADC $0A - Miss - e2SBC $22 - Miss - 07
00h = 0000 000 0b
tag = 0, line = 0, byte = 0
0Ah = 0000 101 0b
tag = 0, line = 5, byte = 0
22h = 0010 001 0b
tag = 2, line = 1, byte = 0
LineTag  Data 
07    
06    
05    
04    
03    
02    
01    
00    
Shaded not part of cache
LineTag  Data 
07    
06    
05    
04    
03    
02    
01    
00 03701
Grey not part of cache
LineTag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01    
00 03701
Grey not part of cache
LineTag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01 2071f
00 03701
Grey not part of cache

ADC $01 - Hit - 01SBC $0B - Hit - dcADC $23 - Hit - 1f
01h = 0000 000 1b
tag = 0, line = 0, byte = 1
0Bh = 0000 101 1b
tag = 0, line = 5, byte = 1
23h = 0010 001 1b
tag = 2, line = 1, byte = 1
LineTag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01 2071f
00 03701
Grey not part of cache
LineTag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01 2071f
00 03701
Grey not part of cache
Line Tag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01 2071f
00 03701
Grey not part of cache

SBC $02 - Miss - f4ADC $0C - Miss - b8SBC $02 - Hit - f4
02h = 0000 001 0b
tag = 0, line = 1, byte = 0
0Ch = 0000 110 0b
tag = 0, line = 6, byte = 0
24h = 0010 010 0b
tag = 2, line = 2, byte = 0
Line Tag  Data 
07    
06    
05 0e2dc
04    
03    
02    
01 0f41b
00 03701
Grey not part of cache
Line Tag  Data 
07    
06 0b835
05 0e2dc
04    
03    
02    
01 0f41b
00 03701
Grey not part of cache
Line Tag  Data 
07    
06 0b835
05 0e2dc
04    
03    
02    
01 0f41b
00 03701
Grey not part of cache

ADC $03 - Hit - 1bSBC $0D - Hit - 35ADC $25 - Miss - 03
03h = 0000 001 1b
tag = 0, line = 1, byte = 1
0Dh = 0000 110 1b
tag = 0, line = 6, byte = 1
25h = 0010 010 1b
tag = 2, line = 2, byte = 1
Line Tag  Data 
07    
06 0b835
05 0e2dc
04    
03    
02    
01 0f41b
00 03701
Grey not part of cache
Line Tag  Data 
07    
06 0b835
05 0e2dc
04    
03    
02    
01 0f41b
00 03701
Grey not part of cache
Line Tag  Data 
07    
06 0b835
05 0e2dc
04    
03    
02 20203
01 0f41b
00 03701
Grey not part of cache