asm1: lab1
This commit is contained in:
parent
8577ab66d8
commit
f9a5e49d29
16
asm1/lab1/nasm.asm
Normal file
16
asm1/lab1/nasm.asm
Normal file
|
@ -0,0 +1,16 @@
|
|||
section .data
|
||||
s: db 'HELLO WORLD', 10 ; 10 = '\n'
|
||||
|
||||
section .text
|
||||
global _start ; adding _start name to object code
|
||||
|
||||
_start:
|
||||
mov eax, 4 ; system call 'write'
|
||||
mov ebx, 1 ; write to stdout
|
||||
mov ecx, s ; string adr
|
||||
mov edx, 12 ; string len
|
||||
int 80h
|
||||
|
||||
mov eax, 1 ; system call 'exit'
|
||||
mov ebx, 0 ; exit code
|
||||
int 80h
|
16
asm1/lab1/tasm.asm
Normal file
16
asm1/lab1/tasm.asm
Normal file
|
@ -0,0 +1,16 @@
|
|||
.model small ; small memory model (64 KB)
|
||||
.stack 100h ; reserve 100h bytes for stack
|
||||
.data
|
||||
message db 'HELLO WORLD', 13, 10, '$' ; 13 = \r, 10 = \n, string must be terminated with $
|
||||
.code
|
||||
start:
|
||||
mov ax, @data ; unable to put in ds directly
|
||||
mov ds, ax
|
||||
mov dx, offset message ; offset of the message (0)
|
||||
mov ah, 09h ; display string ds:dx
|
||||
int 21h ; main system interrupt
|
||||
|
||||
mov al, 0 ; return code 0
|
||||
mov ah, 4Ch ; terminate with return code
|
||||
int 21h
|
||||
end start
|
BIN
asm1/lab1/лаб1_отчёт.docx
Normal file
BIN
asm1/lab1/лаб1_отчёт.docx
Normal file
Binary file not shown.
BIN
asm1/lab1/лабораторная 1.1.docx
Normal file
BIN
asm1/lab1/лабораторная 1.1.docx
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user