diff --git a/ethernet/Makefile b/ethernet/Makefile index 81ea0bc6..16f9a796 100644 --- a/ethernet/Makefile +++ b/ethernet/Makefile @@ -2,7 +2,10 @@ DOS33 = ../dos33fs-utils/dos33 TXT2BAS = ../asoft_basic-utils/tokenize_asoft MAKEB = ../dos33fs-utils/make_b -all: ethernet.dsk +all: ethernet.dsk memcpy.o + +memcpy.o: memcpy.s + ca65 -o memcpy.o memcpy.s -l memcpy.lst SETUP.BAS: setup.bas $(TXT2BAS) < setup.bas > SETUP.BAS @@ -26,4 +29,4 @@ ethernet.dsk: SETUP.BAS \ $(DOS33) -y ethernet.dsk BSAVE -a 0x4000 ./c/vmw_logo.png clean: - rm -f *~ *.BAS R.TXT + rm -f *~ *.BAS R.TXT *.o *.lst diff --git a/ethernet/memcpy.s b/ethernet/memcpy.s new file mode 100644 index 00000000..03990e76 --- /dev/null +++ b/ethernet/memcpy.s @@ -0,0 +1,20 @@ +.define EQU = + +PTR EQU $06 + + lda #0 + sta PTR + lda #$40 + sta PTR+1 + + ldx #8 + ldy #0 +copy_loop: + lda (PTR),y + sta $5000 + iny + bne copy_loop + dex + bne copy_loop + + rts diff --git a/ethernet/memcpy.txt b/ethernet/memcpy.txt new file mode 100644 index 00000000..27cff51b --- /dev/null +++ b/ethernet/memcpy.txt @@ -0,0 +1,46 @@ +Test 1: + 5 FOR J=1 to 1000: NEXT J + 10 PRINT CHR$(7) + 20 FOR I=16384 to 20479 + 30 POKE 20480,PEEK(I) + 40 NEXT I + 100 PRINT CHR$(7) + + Time (linapple2) 38s + +All one one line + + 5 FOR J=1 to 1000: NEXT J + 10 PRINT CHR$(7) + 20 FOR I=16384 to 20479 + 30 POKE 20480,PEEK(I) + 40 NEXT I + 100 PRINT CHR$(7) + + Time (linapple2) 37s + +Assembly language: + + PTR EQU $06 + + lda #0 + sta PTR + lda #$40 + sta PTR+1 + + ldx #8 + ldy #0 +copy_loop: + lda (PTR),y + sta $5000 + iny + bne copy_loop + dex + bne copy_loop + + rts + +Runs more or less instantaenously + + +