Publish VCC Plus OSS source distribution for 3.6.2 build 60

This commit is contained in:
Brian Holman committed 2026-11-13 00:14:03 -07:00
commit c652a5276d
1192 files changed
+272368

No files matched your search

+2
View File
@@ -0,0 +1,2 @@
section code load 3f00
entry start
+32
View File
@@ -0,0 +1,32 @@
; Dispatch: entry, display and data. The copy routine lives in receive.asm.
CHROUT equ $a002 ; ROM's indirect character-output vector
section code
export start
import receive
start leax packet,pcr
leay received,pcr
ldb #expected-packet ; number of bytes before the checksum
jsr receive ; LWLINK supplies the other module's address
inspect cmpa expected,pcr
bne damaged
leax received,pcr
bra print
damaged leax badmsg,pcr
print lda ,x+
beq finish
bsr emit
bra print
finish lda #13
bsr emit
rts ; hand control back to BASIC
emit pshs x ; the print loop needs X after the ROM call
jsr [CHROUT]
puls x,pc
packet fcc "ORB"
expected fcb $e3
received fcb 0,0,0,0 ; the fourth byte terminates the printed string
badmsg fcc "CHECK"
fcb 0
endsection
+14
View File
@@ -0,0 +1,14 @@
; Contract: X = input, Y = output, B = positive number of bytes.
; Returns A = sum modulo 256. Both pointers advance and B reaches zero.
section code
export receive
receive clra
next adda ,x
pshs a
lda ,x+
sta ,y+
puls a
decb
bne next
rts
endsection
@@ -0,0 +1,5 @@
{
"main": "main.asm",
"modules": ["receive.asm"],
"linkScript": "layout.link"
}
@@ -0,0 +1,11 @@
; PIXEL-MASK.ASM -- follow one byte from a register into ordinary RAM.
; This scratch byte belongs to the program. You can examine it without
; changing the live display. Later you will look for a byte on a video page.
org $3f00
start leax sample,pcr ; X points to our one-byte sample.
lda #$81 ; Two end bits are set: %10000001.
shift lsra ; Shift right. Which bit goes into carry?
store sta ,x ; Set a breakpoint here, before the write.
done rts ; Return to the caller with the byte stored.
sample fcb $00 ; Assembling and running reloads this zero.
end start
+26
View File
@@ -0,0 +1,26 @@
; BANKWALK.ASM -- a reversible mapping experiment for a fresh 512 KB Disk BASIC.
; Before running, verify MMU enabled, task 0, block 2 = $3A in the debugger.
; Begin at the BASIC prompt with no unsaved program or active devices.
bank2 equ $ffa2 ; task 0, logical $4000-$5fff
window equ $4123 ; offset $0123 into block 2
org $3f00 ; code and scratch live in block 1
start pshs cc,a ; preserve incoming flags and A
orcc #$50 ; hold IRQ and FIRQ until restored
lda bank2
anda #$3f ; 512 KB supplies six bank bits
sta oldbank,pcr
lda #1
sta bank2 ; window now sees physical $02123
lda window
sta oldbyte,pcr ; keep the byte even on a fresh machine
lda #$a5
sta window
inspect lda oldbyte,pcr ; pause BEFORE this instruction
sta window ; put the borrowed byte back
lda oldbank,pcr
sta bank2 ; restore the original translation
restored puls cc,a,pc ; flags restored, return to BASIC
oldbank fcb 0
oldbyte fcb 0
end start
+6
View File
@@ -0,0 +1,6 @@
; BYTE.ASM -- Watch register A while the processor counts up one step.
org $3f00
start lda #$29 ; Load the number $29 (decimal 41) into A.
inca ; Add one. What will A hold after this step?
done rts ; Return to BASIC with the result still in A.
end start
+21
View File
@@ -0,0 +1,21 @@
; CHOICE.ASM -- Press 1 for E (Earth) or 2 for M (Mars).
POLCAT equ $a000 ; Keyboard polling vector. Returns a key in A.
CHROUT equ $a002 ; Character-output vector.
CR equ 13
org $3f00
start lda #'? ; Show that the program is waiting for a key.
jsr [CHROUT]
choose jsr [POLCAT] ; Check the keyboard without waiting for Enter.
cmpa #'1
beq earth ; A matching comparison sets the Z flag.
cmpa #'2
bne choose ; No key or an unexpected key: try again.
mars lda #'M
bra printit ; Skip the Earth path.
earth lda #'E
printit jsr [CHROUT] ; Both paths meet here with one letter in A.
lda #CR
jsr [CHROUT]
rts
end start
+44
View File
@@ -0,0 +1,44 @@
; DISPATCH.ASM -- receive a three-byte station code and check its sum.
; Disk BASIC, MC6809 or HD6309. Run a personal copy from the assembly editor.
CHROUT equ $a002 ; indirect ROM character-output vector
org $3f00
start leax packet,pcr ; X walks the incoming bytes
leay received,pcr ; Y walks a separate writable buffer
ldb #size
bsr receive
inspect cmpa expected,pcr ; stop here to inspect A and the copy
bne damaged
leax received,pcr
bra print
damaged leax badmsg,pcr
print lda ,x+
beq finish ; both text paths end with a zero byte
bsr emit
bra print
finish lda #13 ; put the BASIC prompt on its own line
bsr emit
rts
; Input: X source, Y destination, B positive byte count.
; Output: A = sum modulo 256. X and Y advance; B ends at zero.
receive clra
next adda ,x ; add this byte, leave X at it for the copy
pshs a ; keep the running sum while moving the byte
lda ,x+
sta ,y+
puls a
decb
bne next
rts
emit pshs x ; caller still needs its position after ROM I/O
jsr [CHROUT]
puls x,pc
packet fcc "ORB"
size equ *-packet
expected fcb $e3 ; $4F + $52 + $42 = $E3
received fcb 0,0,0,0 ; fourth byte stays zero for printing
badmsg fcc "CHECK"
fcb 0
end start
+22
View File
@@ -0,0 +1,22 @@
; DISPATCH6309.ASM -- copy a station code with the HD6309 block move.
; Choose the HD6309 guest and assembly target. Start in Disk BASIC.
CHROUT equ $a002
org $3f00
start leax packet,pcr
leay received,pcr
ldw #size ; W counts the bytes left to transfer
copy tfm x+,y+ ; move from X to Y and increment both
inspect leax received,pcr ; stop here to inspect W, X, Y and RAM
next lda ,x+
beq finish
pshs x
jsr [CHROUT]
puls x
bra next
finish lda #13
jsr [CHROUT]
rts ; no change to the guest's processor mode
packet fcc "ORB"
size equ *-packet
received fcb 0,0,0,0
end start
+11
View File
@@ -0,0 +1,11 @@
; LETTER.ASM -- Give one byte to BASIC's character output routine.
CHROUT equ $a002 ; Address of the ROM character-output vector.
CR equ 13 ; Carriage return starts a fresh line.
org $3f00
start lda #'A ; Load this character's ASCII code into A.
jsr [CHROUT] ; Call the routine whose address is at CHROUT.
lda #CR
jsr [CHROUT] ; Leave the next BASIC prompt on its own line.
rts ; Return to the caller in BASIC.
end start
+11
View File
@@ -0,0 +1,11 @@
; MODE.ASM -- a bounded HD6309 experiment for Disk BASIC at reset mode.
; Run on a fresh HD6309 guest, with MD=0. Both stops are before instructions.
org $3f00
start pshs cc ; remember BASIC's interrupt masks
orcc #$50 ; mask IRQ and FIRQ for the short experiment
ldmd #1 ; select 6309 native mode
native ldw #$1234 ; inspect MD, then step and read E and F
ldmd #0 ; restore reset mode before calling BASIC
restored puls cc ; restore the caller's condition codes
rts
end start
+15
View File
@@ -0,0 +1,15 @@
; RETURN.ASM -- A subroutine advances one letter, then returns to its caller.
CHROUT equ $a002 ; Address of the ROM character-output vector.
CR equ 13
org $3f00
start lda #'A ; Begin with the letter A ($41).
call jsr nextletter ; Save the address of 'display' on the S stack.
display jsr [CHROUT] ; The subroutine has left the new letter in A.
lda #CR
jsr [CHROUT]
rts ; Finish the main program and return to BASIC.
nextletter inca ; ASCII B follows ASCII A.
back rts ; Retrieve the saved address and resume at display.
end start
+31
View File
@@ -0,0 +1,31 @@
; SOFTIRQ.ASM -- install, call and remove a BASIC RAM SWI trampoline.
; Fresh CoCo 3 Disk BASIC, MC6809 or HD6309 in emulation mode only.
; From a debugger stop, Continue through cleanup before returning to BASIC.
hook equ $0106 ; three-byte RAM stub reached via $FFFA
org $3f00
start pshs cc,d,x ; preserve the caller's flags, D and X
orcc #$50 ; keep IRQ & FIRQ out during this experiment
lda hook
ldx hook+1
sta oldop,pcr
stx oldaddr,pcr
lda #$7e ; extended JMP opcode
leax handler,pcr
stx hook+1
sta hook ; JMP handler now complete
clr visits,pcr
lda #$4f ; known bytes to locate in the stack frame
ldb #$52
trigger swi ; CPU stacks state and follows the SWI vector
returned lda oldop,pcr ; breakpoint to compare S after RTI
sta hook
ldx oldaddr,pcr
stx hook+1
restored puls cc,d,x,pc ; restore flags, D and X, return to BASIC
handler inc visits,pcr ; memory survives the return
rti ; reload the stacked context, including PC
oldop fcb 0
oldaddr fdb 0
visits fcb 0
end start
+57
View File
@@ -0,0 +1,57 @@
; PLANET.ASM -- A 40-column CoCo 3 program for Disk Extended Color BASIC.
; Start at the BASIC prompt. In VCC Plus, open this file and choose Run.
POLCAT equ $a000 ; ROM vector: poll keyboard, ASCII key in A
CHROUT equ $a002 ; ROM vector: print the character in A
WIDTH equ $f643 ; CoCo 3 ROM: set text width to B columns
ATTR equ $fe08 ; Attribute BASIC uses for the next character
BG6 equ $ffb6 ; GIME background palette slot 6
CR equ 13 ; ASCII carriage return starts a new line
org $3f00
start ldb #40
jsr WIDTH ; Use the CoCo 3 lowercase-capable text display.
ldx #menu
bsr puts
choose jsr [POLCAT] ; Poll until we get ASCII '1' or '2'.
cmpa #'1
beq earth
cmpa #'2
bne choose ; No key (or a different key)? Try again.
mars ldb #$25 ; Warm red background, visible on RGB and CMP.
ldx #redmsg
bra greet
earth ldb #$0a ; Cool blue background.
ldx #bluemsg
greet stb BG6 ; Choose the tint for the greeting only.
lda #%00011110 ; White foreground (3), background slot 6.
sta ATTR
bsr puts ; X points to the selected greeting.
clr ATTR ; Back to BASIC's usual text colors.
lda #CR
jsr [CHROUT]
rts ; Return to BASIC, just as puts returns to us.
; Print the zero-terminated string at X. X+ advances to the next byte.
puts lda ,x+
beq done
pshs x ; Keep our place across the ROM call.
jsr [CHROUT]
puls x
bra puts
done rts ; Return to the caller of puts.
menu fcc "What planet do you live on?"
fcb CR
fcc "1) Earth"
fcb CR
fcc "2) Mars"
fcb CR,0
bluemsg fcc "Hello Nice Blue Dot World!"
fcb 0
redmsg fcc "Hello Cold Red Dot World!"
fcb 0
end start ; DECB execution address for Run or EXEC.