x86 assembly language for MS-DOS: Hello, world

preview_player
Показать описание
I do a demonstration on how to get started programming in x86 assembly language for the MS-DOS operating system using NASM and DOSBox-X. We write a "hello, world" program, assemble and run it, and then disassemble and analyze the executable COM file.

Рекомендации по теме
Комментарии
Автор

Programming languages were incomprehensible, then I saw Assembly. It's the only one that makes sense to me.

theJellyjoker
Автор

3:55 DOSBox-X does make a better job at emulating the machine and DOS environment than DOSBox without the x will do. The development scope of the latter is mainly for running games, thus its goal is not 100 % compatibility. DOSBox-X's goal is to try and achieve 100 % compatibility, thus more exotic DOS software will run on DOSBox-X than on DOSbox. And this is important for assembly programming.

OpenGLever
Автор

You made all that sound quite straight forward and approachable which is saying something when you're introducing assembly!

bernieman
Автор

Hint: We can also terminate a DOS based COM-programm with a "ret" instruction, if we do not corrupt the stack and the code segment. Because DOS place the instruction of an "int 20h" at the top of the PSP and it pushes a zero word to the stack just before it let the programm execute. If we execute at last the "ret" instruction, then the cpu return to the address of zero and continue executing the instruction of the "int 20h" inside of the PSP for terminating our programm.

But the default practice for terminating a DOS programm is to use the DOS function: AH=4Ch, AL=(DOS "ERRORLEVEL") of the int 21h.

maxmuster
Автор

Just found your channel and I'm really enjoying these!

bfth
Автор

I had to make a DOS emulator a while back the DPMI system (INT 31h) I found pretty interesting.

jaysistar
Автор

If i remember correctly one can generate COM files with the DOS debugger, too. No need for an assembler 😊

arturwiebe
Автор

It's been a few decades since I last worked with COM files. This was a nice refresher. I was not aware of DOSBox-X, so it was to be able to recreate a real mode DOS environment.

BTW Since you're already using NASM, why not use the built in disassembler ndisasm in favor of hexdump?

dono
Автор

We have the well known example of the "Hello World!" program. This was first run over 40 years ago on real IBM PC hardware and also run on many PC compatible computers. This was practically the simplest program that could be written for MS-DOS. Now unless we have a historic restored IBM PC or PC compatible computer we have to run it on a DOS emulator.

davidgrisez
Автор

Hi bro, I have a question that I would like you to answer if it’s possible
Look, I have like a test in a course where I’m using assembly, my professor ask to make that throw assembly receive the data in a serial port y show what’s sent in the console. Do you know if it’s possible to do it using dosbox and the same logic that you used in this video?

PD: English is not my main language, sorry if I have some grammar mistakes, but hope it’s understandable.

nery
Автор

I want to write an OS that sits atop MS-DOS that runs on ELF, similar to how Windows 3 uses NE.

Lol.

zzco
Автор

excelent video, i have a question, is there a form to read and write file through with AH=3F and AH=40??? is possible a video with this information? and the function to seek a specified position in a file "seek" wich is the AH=42? all interrupt 21. thank very much.

DKBZA
Автор

I am on an Android tablet with the Magic Dosbox Free app installed from the play store.

maxmuster
Автор

I tryied to post a new comment, but it is deleted in seconds.

maxmuster