Compiling ready-made programs

ZXNet echo conference «code.zx»

From Roman Fhyedorov To All 31 October 2005

Hello, CityAceE But I was too lazy to figure it out and did everything manually. well, for automation I used the alasma module savebas.h

From Stanislav Yudin To All 31 October 2005

Hello, All While I was still actively writing TRDN, it was for me to compile a new version whole meal: compile, compress, salivate the state sector, and add all this to the BASIC loader... And it’s a completely different matter for a more modern platforms - there, after compilation, you immediately get executable file. Dima Bystrov learned to do the same on the Spectrum, then there is everything that I did manually, assembling the next version of TRDN, AlCo completely automated... I would like to learn how to do the same... At least I could compile the next version of the commander, since I made changes to it, but at that time I was too lazy to put together a new version. But I look at the source code of the self-assembling AcEdit and there is ABSOLUTELY nothing in it I don’t understand :( I don’t understand how the program itself is assembled, how it launches compressor, how all this is connected to BASIC and a monoblock is made, etc. and etc. Surely someone other than AlCo has dealt with these things and can clearly explain how to do the same in your program! Share detailed recipe! I don’t think that this will be interesting only to me.

From Stanislav Yudin To All 31 October 2005

Hello, All While I was still actively writing TRDN, it was for me to compile a new version whole meal: compile, compress, salivate the state sector, and add all this to the BASIC loader... And it’s a completely different matter for a more modern platforms - there, after compilation, you immediately get executable file. Dima Bystrov learned to do the same on the Spectrum, then there is everything that I did manually, assembling the next version of TRDN, AlCo completely automated... I would like to learn how to do the same... At least I could compile the next version of the commander, since I made changes to it, but at that time I was too lazy to put together a new version. But I look at the source code of the self-assembling AcEdit and there is ABSOLUTELY nothing in it I don’t understand :( I don’t understand how the program itself is assembled, how it launches compressor, how all this is connected to BASIC and a monoblock is made, etc. and etc. Surely someone other than AlCo has dealt with these things and can clearly explain how to do the same in your program! Share detailed recipe! I don’t think that this will be interesting only to me.

From Semyon Dobrovolsky To All 31 October 2005

Hello, CityAceE Inferno Guide #5 -> code -> Auto Assemblers

From Andrey Bogdanovich To All 2 November 2005

Hello, captain cobalt I figured it out. In short: when you run mk*.b, it loads an alasma file in which intercepts the keyboard polling procedure and simulates pressing the "load" buttons project *.H, compile it", then again, using interception, takes it for itself control and loads the hrust2!4 packer from disk (it works in the on-screen area) and runs it, then saves the basic and code to disk and glues them together. I myself found such a system too cumbersome and for Quick assembly Commander I do this: The source contains the variable compile=0 and a subroutine (remake of SAVEBAS.H and SAVECOD.H from the Alasma kit): ┌─- CODE ─── IFN compile KUDABAS=#6000 KUDACOD=#7000 ORG #C000,1 ;load crunch packer to page #11 HRQC INCBIN "HRQC" ;#500 Hrust 2.1 packer, works from address #4000 HRQClen=$-HRQC ORG #5B00 QCSAVER D.I. LD BC,#7FFD LD A,#11 OUT(C),A LD HL,HRQC LD DE,#4000 LD BC,HRQClen LDIR LD HL,QCSTART LD DE,KUDACOD LD BC,QCLENGTH CALL #4000 ;PACK, output: HL-where is the packed block, BC-length PUSH BC ;TOTAL LENGTH ADD HL,BC XOR A LD (HL), A ; erase the garbage at the end with zeros INC HL INC H DEC H JR NZ,$-4 LD A,H INC L DEC L JR Z,$+3 INC ALD (LENGTH),A ;length of the code block for the bootloader LD HL,#5D3B ;the basic part of QC is compiled here LD DE,KUDABAS LD BC,#100 LDIR LD HL,BASNAME CALL SETNAME ;SAVE SYSTEM POINTERS PROG EQU #5C53 ;start of BASIC program SVARS EQU #5C4B ;end of program, start of variables E_LINE EQU #5C59 ;end of variables (beginning of line buffer) ARUN EQU #5CD1 ;Here TR-DOS stores the start line number LD HL,(SVARS) PUSH HL LD HL,(PROG) PUSH HL LD HL,(E_LINE) PUSH HL ;LEE REINITIALIZE THEM SO THAT AFTER ;HOW DOES TR-DOS CREATE A BUFFER FOR DIRECTORY OPERATIONS, ;THEY POINTED TO OUR PROGRAM, WHICH WE WERE RECORDING. LD HL,KUDABAS-#101 LD (PROG),HL LD HL,BASEND-#5D3B+KUDABAS-#101 LD (SVARS),HL INC HL LD (E_LINE),HL LD HL,1 LD (ARUN),HL LD C,#C CALL #3D13 ;LET'S RESTORING THE POINTERS TO THE OLD PROGRAM POP HL LD (E_LINE),HL POP HL LD (PROG),HL POP HL LD (SVARS),HL LD HL,CODNAME CALL SETNAME LD HL,KUDACOD POP DE ;length LD C,#B ;Create JP #3D13 BASNAME DB "QC B" ;name basic CODNAME DB "QC C" ;name code SETNAME LD C,#13 ;SET THE FILE NAME CALL #3D13 LD A,9 ;SEARCH BY 8+1 CHARACTERS LD (#5D06),ALD C,#A ;Find CALL #3D13 INC C LD C,#12 ;Delete CALL NZ,#3D13 RET DISPLAY "Warning! After RUN project have been saved." ENDIF └── CODE ─── (here the basic part is thrown out, it is considered that it is compiled in #5D3B, end marked BASEND). If I need to build QC, I set compile=1 in the source and compile, then I run (RUN) and the QC.B and QC.C files appear on the disk. Can be remade so that the candy bar appears immediately, but I needed exactly 2 files worked out. Why is this option convenient for me? Having corrected something in the source code, I pressed 2 buttons (A and R) I get the finished version on disk without leaving Alasma.