In this course, it is planned to analyze the main features of programming on the simplest assembler implementation - TASM. Personally, this knowledge was enough for me to pass the computer perfectly at the institute and finish all laboratory work. Many lessons will have homework based on them.
First, let's install our old compiler.
Link
Why vk.com?
I understand perfectly well that this is the same collective farm to share files through VK discussions, but who knows what this small group may turn into in the future.
After unpacking the files, I advise you to save them in the Asm folder on the C drive in order to have less discrepancies with the material presented here.
To run the compiler, we also need a DOSBox emulator. He will revive all our components. Download and install it!
Link
In the Asm folder, I specially left the code.asm file. It is on it that we will practice running our program. I advise you to keep a copy of it, because all the code is stored there, which in 99% of cases will be present in each of your projects.
code.asm
s_s segment
s_s ends
d_s segment
d_s ends
c_s segment
assume ss:s_s, ds:d_s, cs:c_s
begin:
mov ax, d_s
mov ds, ax
mov ax, 0
; Your code needs to be here
mov ah, 4ch
int 21h
c_s ends
end begin
So. We launch our DOSBox and see the following:
First, we need to mount the drive where you saved your Asm folder. I have this drive C, so I write the following command:
mount d: c:\asm
d: , . i s. C . .
, :
d:
dir, , . CODE ASM, .
! 20 , ? :
tasm code.asm
, OBJ.
:
tlink code.obj
β CODE.MAP CODE.EXE. assembler.
, , , . , , .
td code
. β¦
F7 fn + F7 1 . , . , . ββ . .
CS
Code segment β , turbo debug . β TD 16- . - β12β 18, 12 βCβ. CS βBegin end.β Pascal main.
DS
Data segment, , TD. (char) . βHello, worldβ, , ASCII. DS VAR, Pascal. , .
SS
Stack segment β . , . , .
ax, bx, cx, si, di, ss, cs . . β , . , . Pascal Assembler , , . , , . .
c, z, s, o, p .. . , , , . . , , , .
- , , . , .
. .ASM, , code.asm code.obj code.exe.
:
mount d: c:\asm β , β asm
d: -
tasm code.asm β
tlink code.obj β
td code β debug
F7 β
, Assembler. , - . Habr .