26 AnswersNew Answer
i see you made efforts in trying to fix it. better than it was but still doesnt compile. i decided to help a bit. here is same code but with "GAS" syntax. https://code.sololearn.com/ciWbDOQ6u0O6/?ref=app i hope you notice all the differences.
i agree with martin 100% except for one thing: msdos no longer exists. retro dos games fanboys are outraged reading this. hhh
disclaimer: "please dont try this at home. these code stunts are performed by trained professionals"
Martin Taylor definitely install dosbox and start playing games. even better is to use Qemu and have an imaged harddrive onto which you install DOS (may it be freedos). While on DOS on QEMU you can also do some assembly there as well. one of my fav game these days is R.O.T.T, just for the sound track. DOS games had the best sounds IMO :)
꧁Ýąqůb꧂(New) you still didn't get it. C/C++ are just mediums he uses to access SL's command processor to get his hands on gcc to copile and run his codes.
well your code doesnt even compile. so i think you are missing many concept at this point, which could just take a bit of learning practice and experimentations. best to start slow.
not just for me but i did practice a lot you know, so probably best to take learning at a slow steady pace. one must learn to walk straight before he goes running.
Because here you are writing an assembler code and assuming that your compiler (which only understands C++) will understand it. Check out any of the ChillPill 's code for example. What he do is put the code in another file and use gcc to compile that code. And as he can't directly acess SL's server, thus uses C++'s system() function to "hackingly" access their command processor.
hhh. there are no fast way.
ChillPill ngl, I was literally laughing this whole thread (espcially his C code, no offence) ꧁Ýąqůb꧂(New) "But now I am going to fix the code" Calm down bruh. Stop with the assembly fetish bro, take a chill pill and start slow as ChillPill said. And where did you even get the assembly code? It's total rubbish for the GCC assembler.
Line 24 of your code has an unnecessary '}' character in it. It would also be beneficial to surround the code with an escape word to permit parenthesis within the code R"MASM( your code here. )MASM"; The main problem is that the assembly code you are using is 30 year old 16-bit MS-DOS Microsoft Macro Assembler (masm) code. You do know that 16-bit MS-DOS code is not supported on 64-bit machines? GCC probably doesn't like masm syntax either. The .model tiny masm directive is for informing the assembler that a 16-bit ms-dos .com format file is being requested. Modern systems use a flat memory model. The int 21h instruction is a software interrupt instruction to request an ms-dos function (which no longer exists). Int 21h, function 9 = write string to console in ms-dos. So it's not really surprising that the assembler refused to assemble your code. If you are so determined to use masm to learn ms-dos assembly language then you will need to install an ms-dos emulator such as dosbox and find an old copy of masm 5.1 for dos.
@ChillPill, Where did I say ms-dos exists? I informed the OP that the reason their code will not assemble is because it is 16-bit x86 MASM specific MS-DOS assembly language code that they are trying to pass to an x64 gnu assembler. Though dos is still available in the form of rom dos for embedded systems as well as FreeDOS and the DosBox emulator. https://www.datalight.com/products/rom-dos/ https://www.freedos.org/ https://www.dosbox.com/ I may have to install dosbox and dig out one of my old backup CDs for a nostalgic trip to masm and codeview land. I think the retro games fanboys wrote dosbox.
ChillPill I try it in my home without Trainer Now I am in Hospital 🏥😂
😂 So.. Assembly only for ChillPill
ChillPill gold words. But I choose hard way. Fast and experimental
😂 It didn't work out. Who did I lie to? I must learn more. But now I am going to fix code.
Sujan Paudel be careful with assembly
For me Turbo C++ with Tasm was a brilliant combination and allowed for so many hacks that otherwise would have either been impossible or very time consuming 🙂
I understood I must write this code in C compiler without any hacking compiler.
Agreed ChillPill ! 👍😄😅 The codes should be only used for learning purposes for those who aren't aware and trained to write such codes.