until now I have been using DOSBox and TASM to compile, link and run my 8086 code. Whenever I wanted to use local labels I would have just added LABELS @@ at the start of each code file and used @@Label_Name. Now I want to change into emu8086. It should be compatible with TASM as their documeantation says, however, emu8086 doesn't understand LABELS @@ directive and I have no other way to allow local variables.
Asked
Active
Viewed 197 times
0
-
*Now I want to change into emu8086* - It's pretty old and has some bugs, and oddities, so I'm curious why you'd want to use a worse assembler. Just for its built-in debugger / IDE? IIRC, its emulator isn't as accurate as DOSBox's either, like maybe not supporting some stuff with interrupt handling / the IVT. – Peter Cordes Sep 27 '21 at 19:50
-
@PeterCordes Because DOSBox is really a pain. And also I am debugging using TD which is also a pain, the mouse keeps making problems and it is just not user friendly. Do you have any other suggestion? Or a way to solve the problem? – Algo Sep 27 '21 at 19:55
-
Fair enough; no I don't have other suggestions, other than to switch to 64-bit code (or 32-bit) that can run natively on your desktop (I use GNU/Linux). I've never found 16-bit real mode or DOS that interesting, but if you are working on a hobby project like a demo or something, or a 16-bit DOS codegolf answer, I guess you need it. (Although for my 16-bit https://codegolf.stackexchange.com/ answers that are just functions, I assemble them in 32-bit mode to test correctness with GDB, and in 16-bit mode for size.) – Peter Cordes Sep 27 '21 at 20:10
-
Well really I am just learning assembly for the sake of learning, figured it might help me getting into a nice unit in the army. What do you think about learning 32-bit assembly and running it using Visual Studio? – Algo Sep 27 '21 at 20:23
-
That would be easier and all around better, I think. And yeah, VS has a nice debugger, I've heard. The Windows 32-bit calling convention(s) are still pretty simple, without stack-alignment requirements or shadow space like x86-64 has. Also you're not wasting time learning about obsolete DOS and BIOS APIs that don't exist under modern OSes. See https://stackoverflow.com/tags/x86/info for some links, including some tutorials. Also [part of my answer on another Q&A](//stackoverflow.com/a/34918617) for more on why learning DOS is a silly way to learn asm: segmentation is *more* complicated – Peter Cordes Sep 27 '21 at 20:28
-
Wow! Thanks a lot for the useful insight. What do you recommend learning, 32 bit or 64 bit? And also could you add a good learning source? (Books, Videos, PDFS) – Algo Sep 27 '21 at 20:42
-
If you already understand the basic idea of stack args in a calling convention, and are ready to learn a function calling convention with more rule, you can start with x86-64. Otherwise probably learn 32-bit first because the calling convention rules are simpler, and 64-bit just extends it in some ways that make sense once you understand asm in general. https://stackoverflow.com/tags/x86/info has some links to tutorials. – Peter Cordes Sep 27 '21 at 20:47
-
1I'd recommend the free book "Programming from the Ground Up", linked in that tag wiki. It covers 32-bit x86 on Linux, not Windows, so you'd need a VM or WSL2, and if you only know Windows, you'd have a whole unfamiliar OS and command line environment to get used to. I don't have any personal recommendations for Windows tutorials. I learned x86 then x86-64 asm on Linux, then learned Windows calling conventions and stuff from seeing and researching/answering Stack Overflow questions about it. (Along with learning MIPS and ARM also from wanting to answer SO questions :P) – Peter Cordes Sep 27 '21 at 20:49
-
1Once you learn one ISA, others make a lot more sense; the fundamental ideas are the same (registers and memory, and a CPU that maintains the illusion of executing one instruction at a time in order), it's just a matter of mostly minor differences in what instructions are available and in stuff like calling conventions. – Peter Cordes Sep 27 '21 at 20:51