›;STUFF.ACT - new stuff not installed›;WDA 12-14-85››;block moves:›; MVE_RT(to,from,size)›; BlockMove(to,from,size)››;value of an ASCII hex string:›; BYTE FUNC H_sub(char)›; BYTE FUNC HValB(string)›; CARD FUNC HValC(string)›; CARD FUNC CardFromString(string)›; (needs CHARTEST.ACT)››;move GR.0 cursor on screen:›; Tab(col)››;scroll colors until a key is hit:›; Scroll_colors()›››;*************************************›;Move block of memory from top down.›;Use if toad>fromad AND blocks overlap›;(library routine doesn't work right)›;FROM:"6502 Asmbly Lang Subrtns",p.201›; Leventhal&Saville,McGraw-Hill,1982›;written for Action! by WDA, 12-85›;(54 bytes relocateable code)›;*************************************››PROC MVE_RT=*(BYTE POINTER toadr,fromad› CARD blklen )›› [ 133 160 134 161 132 162 165 165 24› 101 163 133 163 165 165 24 101 161› 133 161 164 164 240 9 136 177 162› 145 160 192 0 208 247 166 165 240› 16 198 163 198 161 136 177 162 145› 160 192 0 208 247 202 208 240 96› ]››;*************************************›;Move a block of memory even if blocks›;overlap. (calls MoveBlock or MVE_RT)›;*************************************››PROC BlockMove(BYTE POINTER toadr,fromad› CARD blklen )›› IF ( (blklen + fromad) > toadr )› AND ( toadr > fromad )› THEN MVE_RT(toadr,fromad,blklen)› ELSE MoveBlock(toadr,fromad,blklen)› FI›RETURN››;*************************************›››;*************************************›;return val (0-15) of single hex digit›;note - letters A-F must be uppercase!›;*************************************››BYTE FUNC H_sub(CHAR c)› BYTE r› r=0› IF (c>='0) AND (c<='9)› THEN r=c-'0› ELSEIF (c>='A) AND (c<='F)› THEN r=10+(c-'A)› FI›RETURN(r)››;*************************************›;return CARD value of a hex string›; letters A-F must be uppercase!›;*************************************››CARD FUNC HValC(CHAR ARRAY str)› CARD result› BYTE i,j,T› CHAR ARRAY leg="0123456789ABCDEF"› i=SFindAny(str,leg)› IF i=0 THEN RETURN(0) FI› result=H_sub(str(i))› FOR j=1 TO 3› DO IF (i+j) > str(0) THEN EXIT FI› T=str(i+j)› IF InString(T,leg)=0› THEN EXIT› ELSE result==LSH 4› result==+H_sub(T)› FI› OD›RETURN(result)››;*************************************›;return BYTE value of a hex string›;*************************************››BYTE FUNC HValB(CHAR ARRAY str)› BYTE result› result=HValC(str)›RETURN(result)››;*************************************›;return a CARD value of any string›;string is either $hex or decimal›;*************************************››CARD FUNC CardFromString(CHAR ARRAY str)› BYTE i,j› CARD temp› temp=0› i=SFindAny(str,"0123456789")› j=CharPos(str,'$)› IF (str(0)=0) OR ( (i=0) AND (j=0) )› THEN RETURN(0)› FI› IF (j#0) AND ( (i>j) OR (i=0) )› THEN temp=HValC(str) ;hex› ELSE SRemove(str,1,i-1) ;decimal› temp=ValC(str)› FI›RETURN(temp)››;*************************************›››;*************************************›;move to column 0-39 on Gr.(0) screen›;*************************************››PROC Tab=*(BYTE c)›› [ 201 40 144 7 56 233 40 144 247› 176 245 133 85 169 0 133 86 96 ]››;*************************************›››;*************************************›;scroll colors until any key is hit›;(from DOS3TO2.ACT)›;*************************************››PROC Scroll_colors()›BYTE› wsync=54282, vcount=54283, clr=53272,› ctr, chgclr, incclr, ch=764›› ch=255 ;clear keypress› DO FOR ctr=1 TO 4› DO incclr=chgclr ; set base color to increment› DO wsync=0 ; wait for end of scan line› clr=incclr ; change displayed color› incclr==+1 ; change luminance› UNTIL vcount&128 ; end of screen test› OD› OD› chgclr==+1› UNTIL CH<>$FF› OD›RETURN››;*********************************›;*********************************››