Skip to content

Instantly share code, notes, and snippets.

@draganczukp
Created April 16, 2018 07:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save draganczukp/90afdd079ca2a4722e39cafcaa4cabb8 to your computer and use it in GitHub Desktop.
Save draganczukp/90afdd079ca2a4722e39cafcaa4cabb8 to your computer and use it in GitHub Desktop.
.model tiny
.386
.data
pytanie db "Podaj liczbe: $"
newline db 10,13,'$'
mniejsze db 10,13,"a<b$"
wieksze db 10,13,"a>b$"
rowne db 10,13,"a=b$"
.stack 100h
.code
start:
mov ax, @data
mov ds, ax
; Pytaj
mov dx, offset pytanie
mov ah, 09h
int 21h
; Wczytaj
mov ah, 01h
int 21h
sub al, '0'
mov bl, 10
mul bl
mov cx,ax
mov ah, 01h
int 21h
sub al, '0'
mov bl, al
add cx, bx
mov dx, offset newline
mov ah, 09h
int 21h
; Pytaj
mov dx, offset pytanie
mov ah, 09h
int 21h
; Wczytaj
mov ah, 01h
int 21h
sub al, '0'
mov bl, 10
mul bl
mov dx,ax
mov ah, 01h
int 21h
sub al, '0'
mov bl, al
add dx, bx
cmp cx, dx
je _rowne
ja _wieksze
jb _mniejsze
_rowne:
mov dx, offset rowne
mov ah, 09h
int 21h
jmp koniec
_wieksze:
mov dx, offset wieksze
mov ah, 09h
int 21h
jmp koniec
_mniejsze:
mov dx, offset mniejsze
mov ah, 09h
int 21h
jmp koniec
koniec:
mov ah, 4Ch
int 21h
end start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment