first asm program help first asm program help CppMaster (Programmer) (OP) 19 Apr 06 13:21 I started a book on assembly, but it's a bit old and I wasn't able to assemble the fist program :s. Here's the code:CODE.MODEL SMALL.STACK 64.DATA DATA1 DB 52H DATA2 DB 29H SUM DB ?.CODEMAIN PROC FAR MOV AL,DATA MOV DS,AL MOV AL,DATA1 MOV BL,DATA2 ADD AL,BL MOV SUM,AL MOV AH,4CH INT 21HMAIN ENDP END MAINWhat changes would need to be made for this program to work? Thank you. RE: first asm program help zeitghost (Programmer) 19 Apr 06 13:59 Which assembler program were you using for this? RE: first asm program help CppMaster (Programmer) (OP) 19 Apr 06 15:57 I'm on Windows and I tried doing compiling with MASM32. RE: first asm program help zeitghost (Programmer) 19 Apr 06 18:07 That code looks very much like 16 bit dos assembler to me.I'd bet that MASM32 wouldn't like it much, as you've found out.If you have a look through some of the threads in this forum, you'll see that various free assemblers are recommended that will cope very nicely with dos type programming.A86 is one that springs to mind.And there's one called NASM that gets recommended too.Some of these assemblers might need to be run from as dos prompt or command prompt.You'll also need a debugger to execute the code: debug is still supplied with Windoze but there are better debuggers available... like D86. RE: first asm program help CppMaster (Programmer) (OP) 19 Apr 06 18:22 Thanks, I'll look for NASM for 16-bit code. But I'd still like to know how I'd write it in win32 (I read an ebook by Dr. Paul Carter on win32 ASM, but he mixes it with C to make the actual program). Thank you very much. RE: first asm program help TessaBonting (TechnicalUser) 20 Apr 06 03:28 There is a bit of a problem if your writing codefor win32.The segment registers can't be changed the way as in 16 bitor real code assembly.The segment registers under win32 hold segment selectors and not real segment values.The selectors are read from a Global Discripter Table.So if you don't use DS ES FS gs or SS derecty you can runthe code with win32.Succes, Tessa RE: first asm program help lionelhill (TechnicalUser) 20 Apr 06 06:17 Don't misunderstand the statement:"So if you don't use DS ES FS gs or SS derecty you can run the code with win32". If you use an assembler that thinks it's writing 32-bit code, the product won't run in a 16-bit environment. There are all sorts of differences beyond the (very true) difference in segment registers. For instance, if the processor thinks it's in 32-bit mode then every reference to ax will involve a segment size override prefix byte that the assembler must put in. If it's in 16 bit mode there won't be an override prefix for ax, but there would be for eax. The assembler and the processor need to be in agreement about this!You don't need debug to run your program assuming you have an assembler that comes with some sort of linker and can therefore create a .exe (or .com) file. I can't speak for nasm or a86 being a tasm person, which comes with tlink. tasm produces the object file (.obj) and tlink turns it into an exe. RE: first asm program help CppMaster (Programmer) (OP) 20 Apr 06 07:30 Would it be possible for you to write me a skeleton that I could use to write 32 bit programs? Thank you.