summaryrefslogtreecommitdiff
path: root/sem2/lab2/task3
diff options
context:
space:
mode:
authorAndrew <saintruler@gmail.com>2020-10-22 21:03:24 +0400
committerAndrew <saintruler@gmail.com>2020-10-22 21:03:24 +0400
commit143f34d941f32e0808fc9344d4c4126ff530d64a (patch)
treec79fcf309ad00e52100c0da544d96d3cc6ab6617 /sem2/lab2/task3
Добавил решения второго семестра
Diffstat (limited to 'sem2/lab2/task3')
-rw-r--r--sem2/lab2/task3/run.bat3
-rw-r--r--sem2/lab2/task3/task3.asm37
2 files changed, 40 insertions, 0 deletions
diff --git a/sem2/lab2/task3/run.bat b/sem2/lab2/task3/run.bat
new file mode 100644
index 0000000..1297bac
--- /dev/null
+++ b/sem2/lab2/task3/run.bat
@@ -0,0 +1,3 @@
+C:\TASM.EXE %1
+C:\TLINK.EXE %1
+%1
diff --git a/sem2/lab2/task3/task3.asm b/sem2/lab2/task3/task3.asm
new file mode 100644
index 0000000..0ef9e70
--- /dev/null
+++ b/sem2/lab2/task3/task3.asm
@@ -0,0 +1,37 @@
+.286
+.model tiny
+.data
+string db ?,?,' ',?,?,' ',?,?,0Ah,0Dh,'$'
+
+.code
+org 100h
+start:
+ MOV ah,1
+ INT 1Ah
+ CMP bx,dx
+ MOV ah,2
+ INT 1Ah
+ MOV ah,0
+ MOV al,ch
+ ROR ax,4
+ SHR ah,4
+ OR ax,'00'
+ MOV word ptr string,ax
+ MOV ah,0
+ MOV al,cl
+ ROR ax,4
+ SHR ah,4
+ OR ax,'00'
+ MOV word ptr string+3,ax
+ MOV ah,0
+ MOV al,dh
+ ROR ax,4
+ SHR ah,4
+ OR ax,'00'
+ MOV word ptr string+6,ax
+ MOV ah,9
+ MOV dx,offset string
+ INT 21h
+ MOV ax,4C00h
+ INT 21h
+end start