Created
March 21, 2023 15:10
-
-
Save amostyaev/d3194eabe2fb6380a8693d6f439c103a to your computer and use it in GitHub Desktop.
Семинар от 21 марта
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INCLUDE settings.inc | |
INCLUDE io2020.inc | |
.STACK 4096 | |
.DATA | |
FStr DB 'The program starts working.',0 | |
LStr DB 'The program has ended.',0 | |
X DQ 1h | |
S DB ? | |
N DD ? | |
.CODE | |
start: OUTSTR offset FStr | |
NEWLINE | |
; 4.10 | |
; ININT EAX | |
; MOV EBX, 10 | |
; MOV EDX, 0 | |
; DIV EBX | |
; OUTU EDX | |
; NEWLINE | |
; OUTU EAX | |
; NEWLINE | |
; 4.14 | |
; INCHAR AH | |
; ADD AH, -'A'+'a' | |
; OUTCHAR AH | |
; NEWLINE | |
; 5.10 | |
; MOV S, 1 | |
; CMP dword ptr X+4, 0 | |
; JGE L | |
; MOV S, -1 | |
; JMP OU | |
; L:JNE OU | |
; CMP dword ptr X, 0 | |
; JNE OU | |
; MOV S, 0 | |
; OU: MOV AL, S | |
; CBW | |
; CWDE | |
; OUTI EAX | |
; NEWLINE | |
; 5.24 | |
ININT N | |
MOV ECX, N | |
MOV EBX, 0 | |
L: | |
MOV EAX, N | |
MOV EDX, 0 | |
DIV ECX | |
CMP EDX, 0 | |
JNE P | |
INC EBX | |
P: | |
LOOP L | |
OUTI EBX | |
OUTSTR offset LStr | |
NEWLINE | |
EXIT | |
END start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment