Help a beginner with codes.

ZXNet echo conference «code.zx»

From Boris Krasnoperov To All 10 March 2006

Hello Black1980 Bla> I have this code, let's call it cod for playing the compiled one Bla> AY Mouzon: Bla> Bla> ORG 30000 Bla> CALL 40000 Bla> LOOP CALL 40006 Bla> HALT Bla> XOR A Bla> IN A,(#FE) Bla> CPL Bla> AND #1F Bla> JR Z,LOOP Bla> CALL 40000 Bla> RET Bla> Bla> Muzon is compiled in ProTracker with a player, let's call it muz. Bla> The BASIC loader of all this stuff is as follows: Bla> Bla> Bla> 5 CLEAR 29999 Bla> 10 RANDOMIZE USR 15619: REM: LOAD "cod" CODE 30000 Bla> 20 RANDOMIZE USR 15619: REM: LOAD "muz" CODE 40000 Bla> 30 RANDOMIZE USR 30000 Bla> Bla> Help, what's the catch??? Doesn't want to play on anything other than an emulator Bla> real Spectrum. Thanks in advance! The fact is that players usually do not play on their own, but are called from a loop, most often from the interrupt service loop. You have CALL 40000 - as far as I remember, the player is initializing? Then it begins loop, and in it the HALT command. The processor stops and waits for an interrupt. When In this case, it is in type 1 interrupt processing mode. Therefore, upon arrival of the interruption it goes to 38H. Those. command CALL 40006 You called once player, and that's it - the processor doesn't get there anymore. Just try it for fun remove HALT :). You need: 1) write some number into register I (this number will be the high byte of the address, where does the interrupt jump address come from? Low byte is always ff) For example, if I=EEH, the address to which interrupt control will be transferred will be taken from addresses EEFFh and EF00h 2) switch the processor to interrupt processing mode 2 (IM 2) 3) the program must be located at a specific address in memory, which determined in accordance with the number from p1. The use of interrupts in the book is described very well and in detail. "Programming in machine codes and assembly language", which is available on trd.speccy.cz. I highly recommend it, as well as other Inforcom books.

From Vyacheslav Kalinin To All 10 March 2006

Hello, Black1980 Bla> ORG 30000 Bla> CALL 40000 Bla> LOOP CALL 40006 Bla> HALT Bla> XOR A Bla> IN A,(#FE) Bla> CPL Bla> AND #1F Bla> JR Z,LOOP Bla> CALL 40000 Bla> RET ORG 30000 CALL 40000 EI LOOP HALT CALL 40006 XOR A IN A,(#FE) CPL AND #1F JR Z,LOOP JP 40000 Будет играть.

From Dmitry Kuzmin To All 10 March 2006

Hello, All I have this code, let's call it cod for playing the compiled AY Mouzon: ORG 30000 CALL 40000 LOOP CALL 40006 HALT XOR A IN A,(#FE) CPL AND #1F JR Z,LOOP CALL 40000 RET Muzon is compiled into ProTracker with a player, let's call it muz. The BASIC loader for all this stuff is as follows: 5 CLEAR 29999 10 RANDOMIZE USR 15619: REM: LOAD "cod" CODE 30000 20 RANDOMIZE USR 15619: REM: LOAD "muz" CODE 40000 30 RANDOMIZE USR 30000 Help, what's the catch??? Doesn't want to play on an emulator or on a real one Spectrum. Thanks in advance!

From Dmitry Kuzmin To All 10 March 2006

Hello Sinus Sin> by the way, judging by the playback address (START+6) this is PT2. Sin> IMHO it is better to compile Mouzons under 49152 (#C000) Sin> and the program itself under 32768 (#8000) PT2, ST and PT3 have the same addresses... You can’t say which is better before you can do it, so on the vernika...

From Slavik Tretiak To All 10 March 2006

Hello new art By the way, judging by the playback address (START+6) this is PT2. IMHO it’s better to compile Mouzons under 49152 (#C000) and the program itself under 32768 (#8000)

From Vyacheslav Kalinin To All 10 March 2006

Hello, Black1980 Bla> Hе работает... А так? ORG 30000 CALL 40000 LOOP EI HALT CALL 40006 XOR A IN A,(#FE) CPL AND #1F JR Z,LOOP JP 40000

From Dmitry Kuzmin To All 10 March 2006

Hello, newart new> ORG 30000 new> CALL 40000 new> EI new> LOOP HALT new> CALL 40006 new> XOR A new> IN A,(#FE) new> CPL new> AND #1F new> JR Z,LOOP new> JP 40000 new> new> Будет играть. Hе работает... :((

From Mikhail Tebenkov To All 10 March 2006

Hello Black1980 Bla> Doesn't work... :(( and so ORG 30000 CALL 40000 LOOP EI HALT CALL 40006 XOR A IN A,(#FE) CPL AND #1F JR Z,LOOP (there may be nz here - I don’t remember) JP 40000

From Slavik Tretiak To All 10 March 2006

Hello Black1980 Bla> PT2, ST and PT3 have the same addresses... You can’t say which is better, so Bla> do it, so on the vernika... PT2 play - START+6 for PT3 - START+5 for ST it depends on the compiler, I don’t remember exactly, but it seems like START+5 where START - where Mouzon was compiled (usually #C000 or 49152) And also, attach your music here, otherwise telepaths are on vacation.

From Dmitry Kuzmin To All 10 March 2006

Hello Sinus Sin> and also, attach your music here, otherwise telepaths are on vacation. No problem, Mouzon PT2... There are both Mouzon in the archive, compiled and not. File: music.rar http://zx.pk.ru/attachment.php?attachmentid=2814

From Dmitry Kuzmin To All 10 March 2006

Hello new art new> And so? new> new> ORG 30000 new> CALL 40000 new> LOOP new> EI new> HALT new> CALL 40006 new> XOR A new> IN A,(#FE) new> CPL new> AND #1F new> JR Z,LOOP new> JP 40000 Nope, in the emulator it says CPU HALTED, in the real one it’s just frozen, if change the line JR Z,LOOP to JR NZ,LOOP, the effect remains the same. :o

From Alexandr Sinyakov To All 10 March 2006

Hello Black1980 Bla> No problem, Mouzon PT2... There are both Mouzons in the archive, compiled and not. Wait, you said that he had a player... I don’t see the player at point-blank range. On my own no muzak will be played.

From Slavik Tretiak To All 10 March 2006

Hello Black1980 Black1980 there is no compiled music. if you take ProTracker v.2.101 from the Virtual TR-DOS website (http://zx.da.ru) upload music music AGATA.M (SONG: LOAD) there and compile it (COMPILE SONG) with the player (you must answer “Y” to the question “Include Player”) under the address (ENTER START CODE: ) 49152. then answer Y (IS THIS CORRECT Y/N?) and save under the name AGATA (then it will be saved as AGATA.C) then the following code (for the ALASM assembler) ┌─- code ─── ORG #C000 INCBIN "AGATA" ORG #8000 CALL #C000 LOOP HALT CALL #C006 XOR A IN A,(#FE) OR#E0 INC A JP Z,LOOP JP#C000 └── code ─── Mouzon will play.

From Gavrilov Vitaly To All 10 March 2006

Hello Sinus Sin> for ST depends on the compiler, I don’t remember exactly, but it seems like START+5 +6. Starting from pt3, the address was changed to +5. And one more thing. Players from this very pt3 have one feature - they work glitchy on im2 in bass. I came across such a disgrace at the dawn of my coding career activities. pt2&st is ok

From Dmitry Kuzmin To All 11 March 2006

Hello bpm bpm> Why are you saving from the debugger? Especially 1 byte. In 1 byte, bpm> of course, there is more benefit than 0, but less than (at least) two ;-) bpm> From the assembler must be saved. Tell me how, I searched everything, S only saves the original text, but no code. I went through all the documentation, back and forth, but didn't get anything... :(

From Vladimir Larkov To All 11 March 2006

Hello Black1980 Bla> In general, I do the following: I compiled Mouzon, and in Alasm I typed the code Bla> you brought it, I assemble it, I launch it, it plays. I go into the debugger, press S Bla> (to save), enter the name, it sets the address itself #8000, length Bla> #0001, I’m unsubscribing, I’m trying to launch the loader via BASIC at the address Bla> 32768, resets the computer... What am I doing wrong??? Why are you saving from the debugger? Especially 1 byte. In 1 byte, of course, more benefits than 0, but less than (at least) two ;-) From the assembler you need save.

From Dmitry Kuzmin To All 11 March 2006

Hello Sinus Sin> Black1980 Sin> there is no compiled music. Sin> if you take ProTracker v.2.101 from the Virtual TR-DOS website Sin> (http://zx.da.ru) Sin> load music AGATA.M (SONG: LOAD) there and compile it Sin> (COMPILE SONG) with a player (the question "Include Player" must be answered Sin> "Y") to the address (ENTER START CODE: ) 49152. then reply Y (IS THIS Sin> CORRECT Y/N?) and save it under the name AGATA (then it will be saved as Sin> AGATA.C) then the following code (for ALASM assembler) Sin> ┌─- code ─── Sin> Sin> ORG #C000 Sin> INCBIN "AGATA" Sin> Sin> ORG #8000 Sin> CALL #C000 Sin> Sin> LOOP HALT Sin> CALL #C006 Sin> XOR A Sin> IN A,(#FE) Sin> OR #E0 Sin> INC A Sin> JP Z,LOOP Sin> Sin> JP #C000 Sin> Sin> └── code ─── Sin> will play music. Please explain to the teapot what my problem is. In general, I do the following: I compiled Mouzon, in Alasm I typed the code you brought it, assemble it, run it, plays :) I go into the debugger, press S (for save), I enter the name, it sets the address itself #8000, length #0001, unsubscribe, I'm trying to run the bootloader via BASIC at address 32768, it resets the computer... What am I doing wrong??? P.S. Don't swear too much, I'm just learning! And I really want it... :)

From Dmitry Kuzmin To All 11 March 2006

Hello Black1980 In general, I was able to save it through a debugger with a normal length (156 bytes), now plays through the BASIC bootloader.... :) But I would really like find out if possible from the assembler itself (ALASM) save compiled code, then please tell me. :) THANK YOU ALL SO MUCH! And that's it After all, the spektrumist community is very friendly... ;)

From Slavik Tretiak To All 11 March 2006

Hello Black1980 from ALASM code can only be saved in the latest versions with AlCo perversions, and somehow cunningly through macros. but in most cases this is not necessary. I suppose I do this ┌─- code ─── ORG #8000 START .... your programm .... LAST DISPLAY "START=",START DISPLAY "LENGTH=",LAST-START └── code ─── and at the end it will output the data to save.

From Vyacheslav Kalinin To All 11 March 2006

Hello Black1980 Bla> So it turns out that you need to save from the debugger ( Bla> Alasm 5.03)... By the way, as far as I understand, the length is also possible in Real Bla> Commander look... Alasm IMHO is not the best option for beginners, better try Zasm (more clear) or Storm (relez forever!! =)

From Dmitry Kuzmin To All 11 March 2006

Hello Sinus Sin> from ALASM code can only be saved in the latest versions of Sin> AlCo-perversions, and it seems somehow cunning through macros. So, after all, it turns out that you need to save from the debugger (Alasm 5.03)... By the way, as far as I understand, the length is possible in Real Commander look...

From Dmitry Kuzmin To All 11 March 2006

Hello new art new> Alasm IMHO is not the best option for beginners, better try Zasm new> (more descriptive) or Storm (relez forever!! =) I started with Zasm, but it does not support the INCBIN command to load a file, and this as convenient as possible. If somehow you can upload a file in it, then it would be thanks for the tip...

From Vyacheslav Kalinin To All 12 March 2006

Hello Black1980 Bla> I started with Zasm, but it does not support the INCBIN command for loading Bla> file, and this couldn’t be more convenient. If somehow you can load it in it Bla> file, I would be grateful for the hint... Probably there is an abbreviation INCB? Look at the ASMA body in disasma, all the directives should be visible there.

From rasmer To All 12 March 2006

Hello Vitamin Vit> +6. This is starting from pt3, the address was changed to +5. Yeah, and Asm Mouzon Tama I think the initialization was + 11, and the playback was + 14 - but he is a scoundrel (player) who ate a bunch of bars....

From Vladimir Larkov To All 12 March 2006

Hello Black1980 Bla> Tell me how, I searched everything, only the original one is saved by S Bla> text, but no code. I went through all the documentation in dollar and back, nothing Bla> not on the snout... I've never used Alasm, I don't know. I'm used to ksas - assemble, then save code.

From Wladimir Bulchukey To All 12 March 2006

Hello Black1980 And I'm used to GENS4. This does not mean advice at all :) . Just in 1993 I made a 128K version of GENS with RAM disk support with all (absolutely!) functions compiler and use it without ever retraining for something newer ;). http://wlodeks.narod.ru/zxnet/soft/soft.htm

From Dmitry Kuzmin To All 12 March 2006

Hello bpm I’m sitting here deciding which assembler to use (I’m looking for advantages and disadvantages). It seems convenient in Alasma, but saving it in the debugger or in the tool is not that scary Everything is much clearer and simpler + saving from the assembler itself. In others if Honestly, I don’t really want to go in and bother myself. If I can figure it out (uploading files), then I’ll stay there, if not in Alasma I’ll continue my writing... :)

From Mikhail Tebenkov To All 12 March 2006

Hello Black1980 Bla> I started with Zasm, but it does not support the INCBIN command for loading Bla> file, and this couldn’t be more convenient. If somehow you can load it in it Bla> file, I would be grateful for the hint... and carefully read the instructions attached to the zasm - the directives are described there include and insert

From Vladimir Bovin To All 17 March 2006

Hello, Wlodek Wlo> And I'm used to GENS4. This does not mean advice at all :) . In the original, the thing is cool, but with the additives, and even more so, Wlodek’s efforts were not in vain. GENS4 is very easy to learn, it is clearly known in which addresses it sits, where the text to be typed is located, where the code is compiled and much more, necessarily download one of the "Sinclairist's primers": http://trd.speccy.cz/ section [book] "How to write a game in assembly language" ALASM is very convenient to work with in terms of text, almost full-fledged text editor, but with saving the code and addresses where it compiles the program (the text is not be sure to start with the ORG directive) it took me a long time to figure it out, not to mention saving object code. :) In general, to each his own. Each program is valuable and interesting in its own way (in vain did you?), so it’s useful to be able to work in all ASMAs (IMHO).

From Alexander Bondarenko To Wladimir Bulchukey 22 March 2006

*Hello, Wladimir!* Catch my ideas about the subject “Help a beginner with codes.”, about which your foot wrap to comrade cracked on March 12, 2006. All. WB> And I'm used to GENS4. This does not mean advice at all :) . Just in 1993 WB> year I made a 128K version of GENS with RAM disk support with everything WB> (absolutely!) functions of the compiler and I use it, but never WB> having retrained for something newer ;) This is what I understand - a tribute to tradition... ;) /That’s all, Wladimir, you can scroll further.../

From Dmitry Kuzmin To All 30 March 2006

Hello Vovoi Vov> GENS4 is very easy to learn I started with it, then decided to switch to more advanced programs... :) Vov> be sure to download one of the "Sinclairist primers": I don't need to download it, I have it alive... :)

From Rubts0FF To All 11 April 2006

Hello Black1980 Bla> If I figure out what to do with ssm (uploading files), then I’ll stay in it, no Bla> so in alasma I will continue my writing... :) Damn! INCLUDE - text, INSERT - code block!. here [http://zasm.nm.ru] and user manual and everything, everything. everything... mirror [http://zasm.hut1.ru] Use it. --- INSERT directive --- ~~~~~~~~~~~~~~~~ The insert "a:FileName.fnt" directive generates code read from disk file named FileName, which can contain arbitrary data (to approx. ru, prepared character generator). The buffer for INSERT is opened only when compiling to disk and is equal to buffer INCLUDE. When compiled into memory, the file is simply read into the address code locations.