diff options
| author | Andrew <saintruler@gmail.com> | 2020-10-22 21:03:24 +0400 |
|---|---|---|
| committer | Andrew <saintruler@gmail.com> | 2020-10-22 21:03:24 +0400 |
| commit | 143f34d941f32e0808fc9344d4c4126ff530d64a (patch) | |
| tree | c79fcf309ad00e52100c0da544d96d3cc6ab6617 /sem2/lab3/Dump.asm | |
Добавил решения второго семестра
Diffstat (limited to 'sem2/lab3/Dump.asm')
| -rw-r--r-- | sem2/lab3/Dump.asm | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/sem2/lab3/Dump.asm b/sem2/lab3/Dump.asm new file mode 100644 index 0000000..93092f3 --- /dev/null +++ b/sem2/lab3/Dump.asm @@ -0,0 +1,80 @@ +;----------------------------------------
+OutChar macro char ;
+local l1,l2,loopCX
+push cx
+mov cx,2
+mov bh,char
+mov al,bh
+shr al,04
+
+loopCX:
+ cmp al,09h
+ jbe l1
+ add al,37h
+ jmp l2
+ l1:
+ add al,30h
+ l2:
+ mov es:[si],ax
+ mov al,bh
+ and al,00001111b
+ add si,2
+loop loopCX
+
+add di,01h
+pop cx
+endm
+;----------------------------------------
+ClrScr macro ;
+push ax
+push bx
+push cx
+push dx
+mov ah,06h ;AH 06 ()
+mov bh,07 ; (/)
+mov cx,0000 ;
+mov dx,184Fh ;
+int 10h ; BIOS
+pop dx
+pop cx
+pop bx
+pop ax
+endm
+;----------------------------------------------
+
+.model small
+.stack 100h
+.data
+.code
+start:
+.486
+mov ax,@DATA
+mov ds,ax
+
+mov ax,0b800h
+mov es,ax ; es
+mov si,0 ;
+mov di,0 ;
+mov ah,7h ;
+mov cx,offset exit
+sub cx,offset start ; - = !!!
+ClrScr
+
+CXne0:
+ mov al,cs:[di]
+ OutChar al
+loop Cxne0
+
+; input:
+; MOV dx,1900h
+; INT 10h
+
+ ; MOV ah,07h
+ ; INT 21h
+
+
+
+exit:
+mov ax,4C00h
+int 21h
+END start
|