PLUS4-START-YOUR-MERLIN-CREATION-WITH-PROFESSIONAL-TOUCH --------------------------------------------------------------------------------------------------- TOOL: BASIC 3.5 and MERLIN 7501 ASSEMBLER and built-in ML-Monitor Language: BASIC and Assembly Extra: none Author: Misel Zivanovic Note: (C) 14th AUGUST 2026 - www.lived.ch, mzretro.ch --------------------------------------------------------------------------------------------------- Earlier lessons, we talked about a main program start with a few BASIC lines AFTER loading of the assembler code with LOAD"program",8,1 That is no problem with TURBO-ASSEMBLER-MACRO because that area is free and can be used for that purpose when TURBO-ASSEMBLER-MACRO is installed! HOWEVER, with MERLIN 7501 ASSEMBLER... Hmmm... That is a totally different story! ********************************* COLD MERLIN 7501 ASSEMBLER FACTS: ********************************* MERLIN 7501 ASSEMBLER which is {unfortunately} completely occupying the BASIC START area at $1000 and not just that, it's literally everywhere! @ $140 - 200$ and $2000 to $2100 and also $800d and up! Practically, there is no chance to make something clever to add the BASIC lines to your code with MERLIN 7501 ASSEMBLER for MERLIN 7501 ASSEMBLER! What could be done, is toss the $1000 area like 100 bytes up, to $1100. That way, we could create the BASIC lines to start our assembler program with RUN! And also add a loading routine to load the main program to the address where it must be. ===================================================================== No, too much work! Clever? Hmmm... I definitely won't sweat for that! ===================================================================== BOTTOM LINE IS: When you write an assembly program with MERLIN, you will not know where it goes when its loaded. You always need to have that information delivered separately and that can be exhausting. SYS 8448, SYS 9000, SYS 16384, SYS 4096 etc. etc. etc. --------------------------------------------------------------------------------------------------- ************************************* BUT HERE COMES THE ULTIMATE SOLUTION! ************************************* So why not use TURBO-ASSEMBLER-MACRO to make that loader/starter and use it later for loading of the MERLIN 7501 Assembler Programs {which MUST be called "mainprogram"} NOTE: which should start at $2100! The best start address for assembly programs created with MERLIN 7501 ASSEMBLER Sound strange, right, but it is so and it is doable! And we will do it! Well, it's actually already done! Ain't that colder than cool! --------------------------------------------------------------------------------------------------- WHAT IS THIS DOING? As first, you can find it on the disk as "starter" and it is the first thing what people using your creations must load {with load"*",8,1} to start any application you will do using the MERLIN 7501 ASSEMBLER! |---------------------------------------------------------------------------| |REMINDER: Your MERLIN 7501 Assembly Applications must start at $2100 | | and be named "mainprogram" | | File "mainprogram" is not a part of this package! | | That is jour job! | |---------------------------------------------------------------------------| { how that is achieved is described in my MERLIN 7501 ASSEMBLER Manual } { no magic involved, just a few POKE commands are needed after the MERLIN was loaded } { and before you start coding or load any MERLIN source codes! } This starter program will load and create a few BASIC lines! After the RUN, it will search for the file "mainprogram" on the disk and if found, it will load and execute it! If it isn't, it will bring a message on the screen! Now your MERLIN 7501 Assembly Programs can be started like a pro! --------------------------------------------------------------------------------------------------- Here is the source code {TURBO-ASSEMBLER-MACRO} for guys who wants to give it a personal touch! Or even use it for something else! --------------------------------------------------------------------------------------------------- *= $1055 ;dec 4181 ; ;color part lda #4+16 sta $ff15 sta $ff19 lda #4+80 sta $053b ;clear screen lda #147 jsr $ffd2 ; lda #$01 ;logic file 1 ldx #$08 ;floppy drive ldy #$01 ;relocated jsr $ffba ;setlfs lda #$0b ;name length ldx #name jsr $ffbd ;setnam lda #$00 ;load signal ldx #$00 ;low load to ldy #$21 ;high,$2100 jsr $ffd5 ;loadsp bcs error ;branch jsr $ffb7 ;status byte bne error ;branch jmp $2100 ;exe mainprg ; name .text "mainprogram" ; error ldx #$00 show lda msg,x jsr $ffd2 ;show msg inx cmp #$00 beq out bne show out rts msg .text "no binary " .text "merlin " .text "mainprogram" .byte $0d .text "at $2100 is " .text "existing " .text "on disk!!!" .byte $0d,$0d .text "fix this now!" .text " ...thanks!" .byte $0d, $00 --------------------------------------------------------------------------------------------------- AND YES! It can actually be used for any other ASSEMBLER which cannot place the code directly into the BASIC start area {$1000} And in case you would need another start address than $2100, just modify the code and adapt it to your own needs! HAVE FUN! ---------------------------------------------------------------------------------------------------