Changes

ACU March 1985 - Type-ins

8,426 bytes removed, 13:38, 24 January 2010
Return to [[ACU Type Ins|ACU Type-Ins]]
 
__TOC__
=Downloads=
[[media:Acu_march_1985acu8503.zip|Disk Image]] =Cover Imageimage=[[image:Acu_march_1985_coveracu8503.png]] 
=Boolean operations demonstration=
RUN"BOOLEAN"<br/>
[[image:Acu_Boolean1acu8503boolean1.png|192px384px]][[image:Acu_Boolean2acu8503boolean2.png|192px384px]] 
=Electric Eddy=
RUN"EDDY"<br/>
[[image:Acu_Eddy1acu8503eddy1.png|192px384px]][[image:Acu_Eddy2acu8503eddy2.png|192px384px]]<br/><br/>[[image:Acu_Eddy3acu8503eddy3.png|192px384px]][[image:Acu_Eddy4acu8503eddy4.png|192px384px]]<br/><br/>[[image:Acu_Eddy5acu8503eddy5.png|192px384px]][[image:Acu_Eddy6acu8503eddy6.png|192px384px]]<br/><br/>[[image:Acu_Eddy7acu8503eddy7.png|192px384px]][[image:Acu_Eddy8acu8503eddy8.png|192px384px]] 
=Electric Fencing=
RUN"FENCING"<br/>
[[image:Acu_Fencing1acu8503fencing1.png|192px384px]][[image:Acu_Fencing2acu8503fencing2.png|192px384px]]<br/><br/>[[image:Acu_Fencing3acu8503fencing3.png|192px384px]][[image:Acu_Fencing4acu8503fencing4.png|192px384px]] 
=Flashman=
RUN"FLASHMAN"<br/>
[[image:Acu_Flash1acu8503flash1.png|192px384px]][[image:Acu_Flash2acu8503flash2.png|192px384px]]<br/><br/>[[image:Acu_Flash3acu8503flash3.png|192px384px]][[image:Acu_Flash4acu8503flash4.png|192px384px]]<br/><br/>[[image:Acu_Flash5acu8503flash5.png|192px384px]][[image:Acu_Flash6acu8503flash6.png|192px384px]] 
=Jeremy Vine's music routine=
RUN"MUSIC"<br/>[[image:Acu_Music1.png|192px]] 
=Machine code fill routine and demonstration=
RUN"MCFILL"<br/>
[[image:Acu_Mcfill1acu8503mcfill1.png|192px384px]][[image:Acu_Mcfill2acu8503mcfill2.png|192px384px]]<br/><br/>[[image:Acu_Mcfill3acu8503mcfill3.png|192px384px]][[image:Acu_Mcfill4acu8503mcfill4.png|192px384px]] 
=Manipulating the Amstrad CPC464 Screen Display=
The Z80 assembler code for the "Manipulating the Amstrad CPC464 Screen Display" File(s) associated with this article.:<br/>See Amstrad Computer User, March 1985, page 103 for more details- SCREEN1.<br/>ASM<br/>Routine 1<pre> ORG &8000 - SCREEN2.start LD HL,XXXX ; address of top left corner of area LD DE,XXXX ; address of store area LD B,8 .loop1 PUSH BC PUSH HL LD B,8 ; number of horizontal lines .loop2 LD A,(HL) LD (DE),A INC DE INC HL DJNZ loop2 POP HL LD BC,&0000 ; add &0800 to screen address ADD HL,BC JR NC,loopend ; jump if total not more than &FFFF LD BC,&3FB0 AND A ; else subtract &3FB0 SBC HL,BC .loopend POP BC DJNZ loop1 RETASM<br/pre>Routine 2<pre> ORG &4000 .pixstr DEFB 0 .start LD HL,&C000 ; Address of top-left corner of screen LD E,&88 ; mask for left-most pixel in byte LD B,200 ; number of pixel lies in screen SCREEN3.loop1 PUSH BC PUSH HL ; save address of first byte on stack LD A,(HL) ; get first screen byte AND E ; mask off all pixels except left-most LD (pixstr),A ; store pixel for later CPL AND (HL) ; blank out pixel LD (HL),A ; update screen RLC (HL) ; rotate screen byte left LD B,79 ; number of bytes in line minus one .loop2 INC HL ; next byte LD A,(HL) AND E ; mask off all pixels except left-most LD D,A ; save pixel for later CPL AND (HL) ; blank out pixel LD (HL),A ; update screen RLC (HL) ; rotate screen byte left LD A,D ; recover pixel .loop3 RRC E ; rotate mask right one bit JR C,out1 ; jump out when mask bit rotates out SRL A ; else shift pixel right JR loop3 ; and repeat .out1 DEC HL ; back to previous byte OR (HL) LD (HL),A ; insert pixel into screen byte INC HL ; restore screen address DJNZ loop2 ; jump back unless finished with line LD A,(pixstr) ; recall stored pixel .loop4 RRC E ; rotate mask right one bit JR C,out2 ; jump out when mask bit rotates out SRL A ; else shift pixel right JR loop4 ; and repeat .out2 OR (HL) LD (HL),A ; insert pixel into screen byte POP HL LD BC,&0800 ADD HL,BC ; next line down JR NC,end ; jump if total not greater than &FFFF AND A LD BC,&3FB0 SBC HL,BC ; else subtract &3FB0 .end POP BC DJNZ loop1 ; jump back unless finished RETASM<br/pre>Routine 3<pre> ORG &4000 .pixstr DEFB 0 .start LD HL,&C04F ; Address of top-left corner of screen LD E,&11 ; mask for left-most pixel in byte LD B,200 ; number of pixel lies in screen SCREEN4.loop1 PUSH BC PUSH HL ; save address of first byte on stack LD A,(HL) ; get first screen byte AND E ; mask off all pixels except left-most LD (pixstr),A ; store pixel for later CPL AND (HL) ; blank out pixel LD (HL),A ; update screen RRC (HL) ; rotate screen byte left LD B,79 ; number of bytes in line minus one .loop2 DEC HL ; next byte LD A,(HL) AND E ; mask off all pixels except left-most LD D,A ; save pixel for later CPL AND (HL) ; blank out pixel LD (HL),A ; update screen RRC (HL) ; rotate screen byte left LD A,D ; recover pixel .loop3 RLC E ; rotate mask right one bit JR C,out1 ; jump out when mask bit rotates out SLA A ; else shift pixel right JR loop3 ; and repeat .out1 INC HL ; back to previous byte OR (HL) LD (HL),A ; insert pixel into screen byte DEC HL ; restore screen address DJNZ loop2 ; jump back unless finished with line LD A,(pixstr) ; recall stored pixel .loop4 RLC E ; rotate mask right one bit JR C,out2 ; jump out when mask bit rotates out SLA A ; else shift pixel right JR loop4 ; and repeat .out2 OR (HL) LD (HL),A ; insert pixel into screen byte POP HL LD BC,&0800 ADD HL,BC ; next line down JR NC,end ; jump if total not greater than &FFFF AND A LD BC,&3FB0 SBC HL,BC ; else subtract &3FB0 .end POP BC DJNZ loop1 ; jump back unless finished RETASM<br/pre>Routine 4<pre> ORG &4000 - SCREEN5.start LD HL,&C000 ; top left corner of screen address LD B,200 ; number of pixel lines .loop1 PUSH BC PUSH HL ; save line start address on stack XOR A ; zero accumulator and clear carry flag LD B,80 ; number of bytes in line .loop2 RR (HL) ; rotate right, carry to d7, d0 to array INC HL ; next byte DJNZ loop2 ; loop until finished with line POP HL ; recover address of first byte in line RRA ; rotate last bit from carry into A OR (HL) LD (HL),A ; insert pixel into first byte LD BC,&0800 ADD HL,BC ; next pixel line JR NC,end ; jump if total not greater than &FFFF AND A LD BC,&3FB0 SBC HL,BC ; else subtract &3FB0 .end POP BC DJNZ loop1 ; loop unless finished RETASM<br/pre>Routine 5<pre> ORG &4000 .start LD HLSee Amstrad Computer User,&C04F ; top left corner of screen address LD BMarch 1985,200 ; number of pixel lines page 103 for more details.loop1 PUSH BC PUSH HL ; save line start address on stack XOR A ; zero accumulator and clear carry flag LD B,80 ; number of bytes in line .loop2 RL (HL) ; rotate right, carry to d7, d0 to array DEC HL ; next byte DJNZ loop2 ; loop until finished with line POP HL ; recover address of first byte in line RLA ; rotate last bit from carry into A OR (HL) LD (HL),A ; insert pixel into first byte LD BC,&0800 ADD HL,BC ; next pixel line JR NC,end ; jump if total not greater than &FFFF AND A LD BC,&3FB0 SBC HL,BC ; else subtract &3FB0 .end POP BC DJNZ loop1 ; loop unless finished RET</pre> 
=Number Sort routine=
RUN"SORT"<br/>
[[image:Acu_Sort1acu8503sort1.png|192px384px]][[image:Acu_Sort2acu8503sort2.png|192px384px]]<br/><br/>[[image:Acu_Sort3acu8503sort3.png|192px384px]][[image:Acu_Sort4acu8503sort4.png|192px384px]] 
=Prime Numbers (1)=
RUN"PASCAL3"<br/>
[[image:Acu_Pascal3_1acu8503pascal1.png|192px384px]][[image:Acu_Pascal3_2acu8503pascal2.png|192px384px]] 
=Prime Numbers (2)=
RUN"PASCAL4"<br/>
[[image:Acu_Pascal4_1acu8503pascal3.png|192px384px]][[image:Acu_Pascal4_2acu8503pascal4.png|192px384px]] =Screen Dump =File(DMP1s)=associated with this article:<br/>- DMPDMP1.ASM contains the Z80 assembler code for the "Events & Screen Dumps" article<br/>- DMPEPSON.ASM<br/>- DMPDMP1.BIN<br/>- DMPEPSON.BIN<br/>- DMPLIST2.BAS and <br/>- DMPLIST4.BAS contain the related BASIC code.<br/>
See Amstrad Computer User, March 1985, page 90 for more details.
 
=Screen Dump (Epson)=
DMPEPSON.ASM contains the Z80 assembler code for the "Events & Screen Dumps" article.<br/>
DMPLIST2.BAS and DMPLIST4.BAS contain the related BASIC code.<br/>
See Amstrad Computer User, March 1985, page 90 for more details.
 
=Sum Numbers=
RUN"PASCAL5"<br/>[[image:Acu_Pascal5_1.png|192px]][[image:Acu_Pascal5_2.png|192px]] 
=Trench=
RUN"TRENCH"<br/>
[[image:Acu_Trench1acu8503trench1.png|192px384px]][[image:Acu_Trench2acu8503trench2.png|192px384px]]<br/><br/>[[image:Acu_Trench3acu8503trench3.png|192px384px]][[image:Acu_Trench4acu8503trench4.png|192px384px]]<br/><br/>[[image:Acu_Trench5acu8503trench5.png|192px384px]][[image:Acu_Trench6acu8503trench6.png|192px384px]]<br/><br/>[[image:Acu_Trench7acu8503trench7.png|192px384px]] 
=Unerase=
The Z80 assembler code for David Link'File(s Unerase program) associated with this article:<br/>- UNERASE.ASM<br/>See Amstrad Computer User, March 1985August/September 1984, page 40 for more details.<pre> ; Unerase a file in CP/M - 04/11/84 ; Copyright David Link 1984  ; A program to unerase a file that has been accidentally ; erased. Should be used immediately after erasing the ; file since if user later, some blocks may have been re-used.  ; Format is - UNERA filename DEFCB EQU &5C fnamelen EQU 8extlen EQU 3extent EQU 12dirlen EQU 32  ; CP/M BDOS call numbers OPEN EQU 15CLOSE EQU 16SEARCH EQU 17SRCH_AGAIN EQU 18MAKE EQU 22SETDMA EQU 26  ; Default workspace for file reads tbuff EQU 128  ; Macro to call CP/M setting DE and C DOS MAC LD DE,=0 LD C,=1 CALL Dos ENDM  ; Macro to call CP/M setting C. SDOS MAC LD C,=0 CALL Dos ENDM  ; COM files begin at &100  ORG &100  LD SP,(6) ; set stack to top of TPA DOS DEFCB,SEARCH ; Does file exist? INC A JP NZ,0 ; File exists, return to CCP LD HL,FCBSPACE ; Initialise pointer to current FCB LD (FCBPTR),HL DOS tbuff,SETDMA ; set disc I/O to tbuff DOS DUMFCB,SEARCH ; and search for the first entry in directory More_Search INC A JR Z,End_of_Directory ; No more entries  ; Compare found filename with the required filename Continue DEC A ; adjust because we INCed it ADD A,A ; multiply by dirlen to get postion ADD A,A ; of entry in catalogue ADD A,A ADD A,A ADD A,A LD D,0 LD E,A LD HL,tbuff ; point to found file ADD HL,DE Again PUSH HL ; and compare it with required filename INC HL LD B,fnamelen+extlen ; both name and type (8, name : 3, type) LD DE,DEFCB+1 ; filename starts at FCB + 1 Match LD A,(DE) LD C,(HL) RES 7,C ; some CP/Ms set bits on filename CP C ; so make sure top bit is reset for comparison INC HL INC DE JR NZ,NoMatch ; not this one DJNZ Match ; good so far... keep going  ; Match found  POP HL ; filename match, but... PUSH HL LD A,(HL) ; ... is it erased? CP &E5 ; e% in first byte of directory = erased JR NZ,NoMatch ; not erased... so search some more LD (HL),0 ; it was erased, so unerase it LD DE,(FCBPTR) ; and store the FCB information in LD BC,dirlen ; our temporary table LDIR LD (FCBPTR),DE ; updating our table pointer afterwards  ; Search for another entry NoMatch POP HL DOS DUMFCB,SRCH_AGAIN ; search for next entry in directory JR More_Search  ; we have now exhausted the directory search and built ; up our table of directory entries for the required file End_of_Dir LD DE,FCBSPACE ; start processing table of matched ; directory entriesMAIN_LOOP LD HL,(FCBPTR) ; have we reached end of table? OR A SBC HL,DE JP Z,0 ; finished, so return PUSH DE ; save table pointer LD HL,extent ; address extent byte ADD HL,DE LD A,(HL) ; make an extent of new, LD (DEFCB+extent),a ; unerased file... DOS DEFCB,MAKE POP DE ; recover pointer to FCB... SDOS CLOSE ; and close it LD HL,dirlen ADD HL,DE ; have we reached end of table? EX DE,HL JR MAIN_LOOP Dos PUSH HL PUSH DE PUSH BC CALL 5 POP BC POP DE POP HL RET FCBPTR DEFS 2 DUMFCB DEFM "????????????" DEFW 0,0 DEFS 16 DEFW 0,0 FCBSPACE EQU $</pre> 
[[Category:Type Ins]]
3,699
edits