Search the Community
Showing results for tags 'CLSN PL65 8-bit'.
Found 1 result
-
Hello dear friends! Please look at this pl65 code. It compiles and works like a charm. ! Inverse string assembly subroutine ! CONST minC=0,maxC=39,minR=0,maxR=23 CONST None=255,Esc=28 INT SAVMSC=$58,linAdr[24] INT _Adr=$C0 BYTE _Len=$C2 != Procedures & Functions ===========! !====================================! != Miscellaneous Procedures =========! !- Wait for Any Key Pressed ---------! FUNC readKey() CONST None=255 BYTE ch=764,res BEGIN WHILE ch=None DO res=ch ENDWHILE ch=None END res != Block Oriented Procedures ========! !- Initialization of DMA ------------! PROC initVid() INT j BEGIN FOR j=minR TO maxR DO linAdr[j]=j*40+SAVMSC NEXT END !- Inverse Screen Line --------------! !- Needs initialization of Globals --! !- i.e. _Adr & _Len = 0 -------------! PROC invLine(INT a BYTE l) BEGIN !- Move Parms to Globals ------------! _Adr=a _Len=l LDY #$00 :Loop LDA (_Adr),Y EOR #$80 STA (_Adr),Y INY CPY _Len BNE Loop END != Main Procedure ===================! MAIN() BYTE x,y,l,k INT a BEGIN initVid() x=0 y=0 a=linAdr[y]+x l=40 WHILE k<>Esc DO !- Is AnyKey pressed? -! k=readKey() invLine(a,l) ENDWHILE !- Clear Buffer -! k=None END I've tried to implement it in CLSN Pascal code. It compiles but do nothing at all. (*- Inverse string assembly sub --- *) program inv; const minR=0; maxR=23; type linT = array[0..39] of byte; var sMem: word absolute $58; _Adr: word absolute $c0; _Len: byte absolute $c2; linA: array[minR..maxR] of word; (*- Initialize Line Screen Access - *) procedure initVid; var j: byte; begin for j:=minR to maxR do begin linA[j] := j*40+sMem; end; end; (*- Inverse line of screen bytes -- *) procedure invLine(_Adr: word; _Len: byte); begin inline($a0/$00/ (* LDY #$00 *) (* --------------------- *) $b1/_Adr/ (* LOOP LDA (_Adr),Y *) $49/$80/ (* EOR #$80 *) $91/_Adr/ (* STA (_Adr),Y *) (* --------------------- *) $c8/ (* INY *) $cc/_Len/ (* CPY _Len *) $d0/$f2); (* BNE LOOP *) end; var x,y: byte; c: char; begin x := 0; y := 0; initVid; _Adr := linA[y]+x; _Len := 39; c := readkey; invLine(_Adr,_Len); c := readkey; end. Here you may find the attached disk image with my attempts . SpPrg_14.atr I've absolutely lost. Does anyone can help me? Many thanks in advance! zen.