Code: Alles auswählen
./20-03-20/00001.ASM
.MODEL Small
.STACK 100h
.DATA
msg DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov dx, OFFSET msg
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-20/00002.ASM
.MODEL Small
.STACK 100h
.DATA
msg DB "GGSHMQROCIEZYBDAC$"
.CODE
start: mov ax, @data
mov ds, ax
mov dx, OFFSET msg
mov si, dx
mov dx, dx
add dx, 16
loopa: cmp si, dx
jge enda
mov di, si
inc di
loopb: cmp di, dx
jge endb
mov ah, [di]
mov al, [si]
cmp ah, al
jge goon
mov bh, ah
mov ah, al
mov al, bh
mov [di], ah
mov [si], al
goon: inc di
jmp loopb
endb:
inc si
jmp loopa
enda:
sub dx, 16
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
; for (i = 0; i < n; i++) {
; for (j = i+1; j < n; j++) {
; if ( a[i] > a [j]) ...
;
;
l }
Code: Alles auswählen
./20-03-20/00003.ASM
.MODEL Small
.STACK 100h
.DATA
msg DB "GGSHMQROCIEZYBDAC$"
.CODE
start: mov ax, @data
mov ds, ax
mov dx, OFFSET msg
mov si, dx
mov dx, dx
add dx, 16
loopa: cmp si, dx
jge enda
mov di, si
inc di
loopb: cmp di, dx
jge endb
mov ah, [di]
mov al, [si]
cmp ah, al
jge goon
mov [di], al
mov [si], ah
goon: inc di
jmp loopb
endb:
inc si
jmp loopa
enda:
sub dx, 16
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
; for (i = 0; i < n; i++) {
; for (j = i+1; j < n; j++) {
; if ( a[i] > a [j]) ...
;
;
l }
Code: Alles auswählen
./20-03-20/00004.ASM
.MODEL small
.STACK 100h
.DATA
prsstr DB "(((5+6)*2)+1)*4$";
.CODE
start: mov ax, @data
mov ds, ax
call expr
expr:
call term
; pop ax
mov dl, [si]
cmp dl, 43
jnl exprend
inc si
call expr
pop ax
pop bx
add ax, bx
push ax
ret
exprend:
Code: Alles auswählen
./20-03-20/00005.ASM
.MODEL Small
.STACK 100h
.DATA
STR1 DB "Hallo Welt$"
STR2 DB "Hallo Welt!$"
STR3 DB "Hallo Welt!!!$"
STR4 DB "123$"
.CODE
Start: mov ax, @data
mov ds, ax
mov si, OFFSET STR1
call strlen
mov si, OFFSET STR2
call strlen
mov si, OFFSET STR3
call strlen
mov si, OFFSET STR4
call strlen
mov ah, 4Ch
int 21h
strlen PROC NEAR
strlena:
mov cx, 00h
cmp [si], '$'
je loopend
inc si
inc cx
jmp strlena
loopend:
ret
strlen ENDP
END START
Code: Alles auswählen
./20-03-20/00006.ASM
.MODEL Small
.STACK 100h
.DATA
STR1 DB "Hallo Welt$"
.CODE
Start: mov ax, @data
mov ds, ax
mov si, OFFSET STR1
mov cx, 00h
loopa: cmp [si], '$'
je loopend
inc si
inc cx
jmp loopa
loopend:
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-20/INT01.ASM
.MODEL SMALL
.STACK 100h
.CODE
mov ax, 00h
mov [0000:0d2h], ax
mov ax, 32*1024
mov [0000:0d0h], ax
mov ax, cx
mov ds, ax
lea ax, msg
mov si, ax
mov ax, 32*1024
mov es, ax
mov di, 00h
loop1: lea ax, endi
cmp si, ax
jge endloop
mov ax, [ds:si]
mov [es:di], ax
inc di
inc si
jmp loop1
endloop:
mov ah, 4Ch
int 21h
MSG DB "Hello World$"
.CODE
start: mov ax, 32*1024
mov ds, ax
mov dx, OFFSET MSG
mov ah, 09h
int 21h
endi: iret
END
Code: Alles auswählen
./20-03-20/INTEST01.ASM
.model small
.stack 100h
.data
.code
start: int 34h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT/INT00.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 34h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT2/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT2/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT2/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT3/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT3/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT3/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT3/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 0a000h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT4/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT4/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT4/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 80h
mov ah, 00h
int 21h
END start
Code: Alles auswählen
./20-03-21/INT4/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 0a000h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT5/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT5/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT5/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT5/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 0a000h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT6/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT6/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT6/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov ax, 0500h
mov ss, ax
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT6/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 0a000h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT7/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT7/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT7/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov ax, 0500h
mov ss, ax
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT7/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 03c2h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT8/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./20-03-21/INT8/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./20-03-21/INT8/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov ax, 0500h
mov ss, ax
int 80h
int 80h
int 80h
int 80h
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT8/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 03c2h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/HASH.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT01.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
int 34h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/INT02.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov dx, OFFSET Message
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/ITOSTR.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/SORT.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "hnajkasduihaghabdhghawedasldnajchhigwbxansadhagqyedhasmcpdpsdfaudjasacasba$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET Message
loop1:
mov dl, [si]
cmp dl, '$'
je endloop1
mov di, si
inc di
loop2:
mov dl, [di]
cmp dl, '$'
je endloop2
mov ah, [si]
mov al, [di]
cmp ah, al
jle cond1
mov [si], al
mov [di], ah
cond1:
inc di
jmp loop2
endloop2:
inc si
jmp loop1
endloop1:
mov dx, OFFSET Message
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/STRLEN.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/STRSTR2.ASM
.MODEL Small
.STACK 100h
.DATA
Str1 DB "Hello World!!!", 13, 10, '$'
Str2 DB "World$"
Msg1 DB "Die Zeichenkette konnte nicht gefunden werden$"
Msg2 DB "Die Zeichenkette wurde gefunden$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET Str1
mov di, OFFSET Str2
loop1:
mov bl, [si]
cmp bl, '$'
je no
mov di, OFFSET Str2
loop2:
mov bl, [si]
mov bh, [di]
cmp bh, '$'
je yes
cmp bh, bl
jne endloop2
inc si
inc di
jmp loop2
endloop2:
inc si
jmp loop1
endloop1:
no:
mov dx, OFFSET MSG1
jmp outmsg
yes:
mov dx, OFFSET MSG2
outmsg:
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./20-03-21/STRSTR.ASM
.MODEL Small
.STACK 100h
.DATA
Str1 DB "Hello World, sagt David Vajda$"
Str2 DB "World$"
Msg1 DB "Die Zeichenkette konnte nicht gefunden werden$"
Msg2 DB "Die Zeichenkette wurde gefunden$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET Str1
mov di, OFFSET Str2
loop1:
mov dl, [si]
cmp dl, '$'
je no
mov di, OFFSET Str2
loop2:
mov dh, [di]
cmp dh, '$'
mov dl, [si]
je yes
cmp dh, dl
jne endloop2
inc si
inc di
jmp loop2
endloop2:
inc si
jmp loop1
endloop1:
no:
mov dx, OFFSET MSG1
jmp outmsg
yes:
mov dx, OFFSET MSG2
outmsg:
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-22/ITOSTR.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-22/SORTSTRA.ASM
.MODEL Small
.STACK 100h
.DATA
Msg1 DB "Der erste String ist groesser$"
Msg2 DB "Der zweite String ist groesser$"
Msg3 DB "Beide Strings sind gleich$"
Msg4 DB "Beide Strings sind gleich, aber der erste ist laenger$"
Msg5 DB "Beide Strings sind gleich, aber der zweite ist laenger$"
Str1 DB "abcdefghijklmn$"
Str2 DB "abcdefghijklmno$"
a DB "Dora $", "Heinrich$", "Kaufmann$", "Berta $", "Emil $", "Dora $", "Anton $", "Caesar $", "Gustav $"
SWPBUF DB " "
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov cx, 9
mov dx, OFFSET a
straout:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je goon
jmp straout
goon:
mov si, OFFSET Str1
mov di, OFFSET Str2
main: mov dx, OFFSET a
mov ch, 9
loopmain:
mov bx, dx
;add bx, 9
mov cl, 9
innerloop:
add bx, 9
push bx
push dx
call STRCMP
pop ax
cmp ax, 0
jg noswap
push bx
push dx
call STRSWP
noswap:
dec cl
cmp cl, 0
je innerloopend
jmp innerloop
innerloopend:
add dx, 9
dec ch
cmp ch, 0
je final
jmp loopmain
final: mov cx, 9
mov dx, OFFSET a
finalloop:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je thefinal
jmp finalloop
thefinal:
mov ah, 4Ch
int 21h
STRCMP PROC NEAR
pop si
pop di
push bx
push cx
push dx
push sp
push bp
push si
push di
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
mov ax, 0
push ax
jmp prgend
labellngr:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
mov ax, -1
push ax
jmp prgend
labelshrtr:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
mov ax, 1
push ax
jmp prgend
labelle:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
mov ax, -2
push ax
jmp prgend
labelge:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
mov ax, 2
push ax
prgend:
ret
STRCMP ENDP
STRSWP PROC NEAR
pop si
pop di
push di
push si
mov di, OFFSET SWPBUF
STRLP1:
mov al, [si]
mov [di], al
mov al, '$'
cmp [si], al
je STRLPEND1
inc si
inc di
jmp STRLP1
STRLPEND1:
pop si
pop di
push di
push si
STRLP2:
mov al, [si]
mov [di], al
mov al, '$'
cmp [si], al
je STRLPEND2
inc si
inc di
jmp STRLP2
STRLPEND2:
pop si
pop di
push di
push si
mov si, OFFSET SWPBUF
STRLP3:
mov al, [si]
mov [di], al
mov al, '$'
cmp [si], al
je STRLPEND3
inc si
inc di
jmp STRLP3
STRLPEND3:
ret
STRSWP ENDP
END start
Code: Alles auswählen
./21-03-22/SORTSTRB.ASM
.MODEL Small
.STACK 100h
.DATA
Msg1 DB "Der erste String ist groesser$"
Msg2 DB "Der zweite String ist groesser$"
Msg3 DB "Beide Strings sind gleich$"
Msg4 DB "Beide Strings sind gleich, aber der erste ist laenger$"
Msg5 DB "Beide Strings sind gleich, aber der zweite ist laenger$"
Str1 DB "abcdefghijklmn$"
Str2 DB "abcdefghijklmno$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov si, OFFSET Str1
mov di, OFFSET Str2
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
mov ah, 09h
mov dx, OFFSET Msg3
int 21h
jmp prgend
labellngr:
mov ah, 09h
mov dx, OFFSET Msg4
int 21h
jmp prgend
labelshrtr:
mov ah, 09h
mov dx, OFFSET Msg5
int 21h
jmp prgend
labelle:
mov ah, 09h
mov dx, OFFSET Msg1
int 21h
jmp prgend
labelge:
mov ah, 09h
mov dx, OFFSET Msg2
int 21h
prgend:
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-22/STRCMP.ASM
.MODEL Small
.STACK 100h
.DATA
Msg1 DB "Der erste String ist groesser$"
Msg2 DB "Der zweite String ist groesser$"
Msg3 DB "Beide Strings sind gleich$"
Msg4 DB "Beide Strings sind gleich, aber der erste ist laenger$"
Msg5 DB "Beide Strings sind gleich, aber der zweite ist laenger$"
Str1 DB "abcdefghijklmn$"
Str2 DB "abcdefghijklmno$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov si, OFFSET Str1
mov di, OFFSET Str2
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
mov ah, 09h
mov dx, OFFSET Msg3
int 21h
jmp prgend
labellngr:
mov ah, 09h
mov dx, OFFSET Msg4
int 21h
jmp prgend
labelshrtr:
mov ah, 09h
mov dx, OFFSET Msg5
int 21h
jmp prgend
labelle:
mov ah, 09h
mov dx, OFFSET Msg1
int 21h
jmp prgend
labelge:
mov ah, 09h
mov dx, OFFSET Msg2
int 21h
prgend:
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-23/ITOSTR.ASM
.MODEL Small
.STACK 100h
.DATA
Message DB "Hello World$"
.CODE
start: mov ax, @data
mov ds, ax
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-23/SORTSTRA.ASM
.MODEL Small
.STACK 100h
.DATA
Msg1 DB "Der erste String ist groesser$"
Msg2 DB "Der zweite String ist groesser$"
Msg3 DB "Beide Strings sind gleich$"
Msg4 DB "Beide Strings sind gleich, aber der erste ist laenger$"
Msg5 DB "Beide Strings sind gleich, aber der zweite ist laenger$"
Str1 DB "abcdefghijklmn$"
Str2 DB "abcdefghijklmno$"
a DB "Dora $", "Heinrich$", "Kaufmann$", "Berta $", "Emil $", "Dora $", "Anton $", "Caesar $", "Gustav $"
SWPBUF DB " "
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov cx, 9
mov dx, OFFSET a
straout:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je goon
jmp straout
goon:
mov si, OFFSET Str1
mov di, OFFSET Str2
main: mov dx, OFFSET a
mov ch, 9
loopmain:
mov bx, dx
;add bx, 9
mov cl, 9
innerloop:
add bx, 9
mov si, bx
mov di, dx
call STRCMP
cmp ax, 0
jg noswap
mov si, bx
mov di, dx
call STRSWP
noswap:
dec cl
cmp cl, 0
je innerloopend
jmp innerloop
innerloopend:
add dx, 9
dec ch
cmp ch, 0
je final
jmp loopmain
final: mov cx, 9
mov dx, OFFSET a
finalloop:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je thefinal
jmp finalloop
thefinal:
mov ah, 4Ch
int 21h
STRCMP PROC NEAR
push bx
push cx
push dx
push sp
push bp
push si
push di
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
mov ax, 0
jmp prgend
labellngr:
mov ax, -1
jmp prgend
labelshrtr:
mov ax, 1
jmp prgend
labelle:
mov ax, -2
jmp prgend
labelge:
mov ax, 2
prgend:
pop di
pop si
pop bp
pop sp
pop dx
pop cx
pop bx
ret
STRCMP ENDP
STRSWP PROC NEAR
push di
mov di, OFFSET SWPBUF
call STRCPY
pop di
call STRCPY
push si
mov si, OFFSET SWPBUF
call STRCPY
pop si
ret
STRSWP ENDP
STRCPY PROC NEAR
push si
push di
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
jmp STRCPYLOOP
STRCPYEND:
pop di
pop si
ret
STRCPY ENDP
END start
Code: Alles auswählen
./21-03-23/SORTSTRB.ASM
.MODEL Small
.STACK 100h
.DATA
ptr DW DUP (9)
a DB "Dora $", "Heinrich$", "Kaufmann$", "Berta $", "Emil $", "Dora $", "Anton $", "Caesar $", "Gustav $"
SWPBUF DB " "
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov cx, 9
initloop:
cmp cx, 0
je endinitloop
endin
mov ah, 09h
int 21h
mov dx, OFFSET a
straout:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je goon
jmp straout
goon:
mov si, OFFSET Str1
mov di, OFFSET Str2
main: mov dx, OFFSET a
mov ch, 9
loopmain:
mov bx, dx
;add bx, 9
mov cl, 9
innerloop:
add bx, 9
mov si, bx
mov di, dx
call STRCMP
cmp ax, 0
jg noswap
noswap:
dec cl
cmp cl, 0
je innerloopend
jmp innerloop
innerloopend:
add dx, 9
dec ch
cmp ch, 0
je final
jmp loopmain
final: mov cx, 9
mov dx, OFFSET a
finalloop:
mov ah, 09h
int 21h
add dx, 9
dec cx
cmp cx, 0
je thefinal
jmp finalloop
thefinal:
mov ah, 4Ch
int 21h
STRCMP PROC NEAR
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
mov ax, 0
jmp prgend
labellngr:
mov ax, -1
jmp prgend
labelshrtr:
mov ax, 1
jmp prgend
labelle:
mov ax, -2
jmp prgend
labelge:
mov ax, 2
prgend:
ret
STRCMP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
ret
STRCPY ENDP
END start
Code: Alles auswählen
./21-03-23/STRCMP.ASM
.MODEL Small
.STACK 100h
.DATA
Msg1 DB "Der erste String ist groesser$"
Msg2 DB "Der zweite String ist groesser$"
Msg3 DB "Beide Strings sind gleich$"
Msg4 DB "Beide Strings sind gleich, aber der erste ist laenger$"
Msg5 DB "Beide Strings sind gleich, aber der zweite ist laenger$"
Str1 DB "abcdefghijklmn$"
Str2 DB "abcdefghijklmno$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov si, OFFSET Str1
mov di, OFFSET Str2
loop1: mov ah, '$'
cmp [si], ah
je l1end
mov ah, '$'
cmp [di], ah
je l1end
mov ah, [di]
cmp [si], ah
jg labelle
mov ah, [di]
cmp [si], ah
jl labelge
inc si
inc di
jmp loop1
l1end: mov ah, [di]
cmp [si], ah
je labeleq
mov ah, '$'
cmp [si], ah
je labelshrtr
mov ah, '$'
cmp [di], ah
je labellngr
labeleq:
mov ah, 09h
mov dx, OFFSET Msg3
int 21h
jmp prgend
labellngr:
mov ah, 09h
mov dx, OFFSET Msg4
int 21h
jmp prgend
labelshrtr:
mov ah, 09h
mov dx, OFFSET Msg5
int 21h
jmp prgend
labelle:
mov ah, 09h
mov dx, OFFSET Msg1
int 21h
jmp prgend
labelge:
mov ah, 09h
mov dx, OFFSET Msg2
int 21h
prgend:
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-23/STRSWP.ASM
.MODEL Small
.STACK 100h
.DATA
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
END start
Code: Alles auswählen
./21-03-24/SORTCH.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "ashasdhajsdnasdbkhgsdbasdkasdkqhwlasdnkabsda$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET str1
loop1: mov di, si
loop2: mov ah, [si]
cmp [di], ah
jge noswap
mov ah, [si]
mov al, [di]
mov [di], ah
mov [si], al
noswap:
inc di
mov ah, '$'
cmp [di], ah
jne loop2
inc si
mov ah, '$'
cmp [si], ah
jne loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-25/SORTCH.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "ashasdhajsdnasdbkhgsdbasdkasdkqhwlasdnkabsda$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET str1
loop1: mov di, si
loop2: mov ah, [si]
cmp [di], ah
jge noswap
mov ah, [si]
mov al, [di]
mov [di], ah
mov [si], al
noswap:
inc di
mov ah, '$'
cmp [di], ah
jne loop2
inc si
mov ah, '$'
cmp [si], ah
jne loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-25/SORTSTRA.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "ashasdhajsdnasdbkhgsdbasdkasdkqhwlasdnkabsda$"
.CODE
start: mov ax, @data
mov ds, ax
mov si, OFFSET str1
loop1: mov di, si
loop2: mov ah, [si]
cmp [di], ah
jge noswap
mov ah, [si]
mov al, [di]
mov [di], ah
mov [si], al
noswap:
inc di
mov ah, '$'
cmp [di], ah
jne loop2
inc si
mov ah, '$'
cmp [si], ah
jne loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-25/STRSWP2.ASM
.MODEL Small
.STACK 100h
.DATA
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
Stra DB "Caesar$ ", "Anton$ ", "Gustav$ ", "Berta$ ", "Dora$ ", "Friedrich$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov si, OFFSET stra
mov di, OFFSET stra
mov cx, 6
mov si, OFFSET stra
LOOP1:
mov di, si
mov bx, cx
LOOP2:
push di
push si
push bp
push sp
push dx
push cx
push bx
push ax
mov dx, si
mov bx, di
call STRSWP
mov dx, si
mov ah, 09h
int 21h
pop ax
pop bx
pop cx
pop dx
pop sp
pop bp
pop si
pop di
add di, 10
dec bx
cmp bx, 0
jne LOOP2
add si, 10
dec cx
cmp cx, 0
jne LOOP1
mov dx, OFFSET stra
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
STRCMP PROC NEAR
STRCMPLOOP:
mov al, [si]
mov dl, [di]
cmp al, '$'
jz STRCMPLOOPEND2
cmp dl, '$'
jz STRCMPLOOPEND2
sub dl, al
jnz STRCMPLOOPEND
inc si
inc di
jmp STRCMPLOOP
STRCMPLOOPEND:
ret
STRCMPLOOPEND2:
mov dl, 0
ret
STRCMP ENDP
END start
Code: Alles auswählen
./21-03-25/STRSWP3.ASM
.MODEL Small
.STACK 100h
.DATA
stck DB 100h DUP (?)
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
Stra DB "Caesar$ ", "Anton$ ", "Gustav$ ", "Berta$ ", "Dora$ ", "Friedrich$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov si, OFFSET stra
mov di, OFFSET stra
mov cx, 6
mov si, OFFSET stra
LOOP1:
mov di, si
mov bx, cx
LOOP2:
push di
push si
push bp
push dx
push cx
push bx
push ax
mov dx, si
mov bx, di
call STRSWP
pop ax
pop bx
pop cx
pop dx
pop bp
pop si
pop di
mov dx, si
mov ah, 09h
int 21h
add di, 10
dec bx
cmp bx, 0
jne LOOP2
add si, 10
dec cx
cmp cx, 0
jne LOOP1
mov dx, OFFSET stra
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
STRCMP PROC NEAR
STRCMPLOOP:
mov al, [si]
mov dl, [di]
cmp al, '$'
jz STRCMPLOOPEND2
cmp dl, '$'
jz STRCMPLOOPEND2
sub dl, al
jnz STRCMPLOOPEND
inc si
inc di
jmp STRCMPLOOP
STRCMPLOOPEND:
ret
STRCMPLOOPEND2:
mov dl, 0
ret
STRCMP ENDP
END start
Code: Alles auswählen
./21-03-25/STRSWP4.ASM
.MODEL Small
.STACK 100h
.DATA
stck DB 100h DUP (?)
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
Stra DB "Caesar$ ", "Anton$ ", "Gustav$ ", "Berta$ ", "Dora$ ", "Friedrich$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov si, OFFSET stra
mov di, OFFSET stra
mov cx, 6
mov si, OFFSET stra
LOOP1:
mov di, si
mov bx, cx
LOOP2:
push di
push si
push bp
push dx
push cx
push bx
push ax
call STRCMP
cmp dl, 0
jle NOSWP
pop ax
pop bx
pop cx
pop dx
pop bp
pop si
pop di
push di
push si
push bp
push dx
push cx
push bx
push ax
mov bx, si
mov dx, di
call STRSWP
NOSWP:
pop ax
pop bx
pop cx
pop dx
pop bp
pop si
pop di
add di, 10
dec bx
cmp bx, 0
jne LOOP2
add si, 10
dec cx
cmp cx, 0
jne LOOP1
mov dx, OFFSET stra
mov cx, 6
OUTPRINT:
mov ah, 09h
int 21h
add dx, 10
dec cx
cmp cx, 0
jg OUTPRINT
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
STRCMP PROC NEAR
STRCMPLOOP:
mov al, [si]
mov dl, [di]
cmp al, '$'
jz STRCMPLOOPEND2
cmp dl, '$'
jz STRCMPLOOPEND2
sub dl, al
jnz STRCMPLOOPEND
inc si
inc di
jmp STRCMPLOOP
STRCMPLOOPEND:
ret
STRCMPLOOPEND2:
mov dl, 0
ret
STRCMP ENDP
END start
Code: Alles auswählen
./21-03-25/STRSWP.ASM
.MODEL Small
.STACK 100h
.DATA
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
Stra DB "Caesar$ ", "Anton$ ", "Gustav$ ", "Berta$ ", "Dora$ ", "Friedrich$"
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov si, OFFSET stra
mov di, OFFSET stra
mov cx, 6
mov si, OFFSET stra
LOOP1:
mov di, si
mov bx, cx
LOOP2:
mov dx, di
mov ah, 09h
int 21h
add di, 10
dec bx
cmp bx, 0
jne LOOP2
add si, 10
dec cx
cmp cx, 0
jne LOOP1
mov dx, OFFSET stra
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
STRCMP PROC NEAR
STRCMPLOOP:
mov al, [si]
mov dl, [di]
cmp al, '$'
jz STRCMPLOOPEND2
cmp dl, '$'
jz STRCMPLOOPEND2
sub dl, al
jnz STRCMPLOOPEND
inc si
inc di
jmp STRCMPLOOP
STRCMPLOOPEND:
ret
STRCMPLOOPEND2:
mov dl, 0
ret
STRCMP ENDP
END start
Code: Alles auswählen
./21-03-26/INT8/INSTALL.ASM
.MODEL Small
.STACK 100h
.DATA
.CODE
Start: mov ax, @data
mov ds, ax
mov ax, 00h
mov es, ax
mov di, 100h
mov [es:di], 400h
inc di
inc di
mov [es:di], 0f000h
mov ah, 4Ch
int 21h
END Start
Code: Alles auswählen
./21-03-26/INT8/INT00.ASM
.MODEL tiny
.CODE
start:
mov ah, 02h
mov dl, 'h'
int 21h
mov ah, 02h
mov dl, 'a'
int 21h
mov ah, 02h
mov dl, 'l'
int 21h
END start
Code: Alles auswählen
./21-03-26/INT8/INT03.ASM
.MODEL Small
.STACK 100h
.DATA
Stck DB 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ax, 0500h
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
int 80h
int 80h
int 80h
int 80h
int 80h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-26/INT8/PORT.ASM
.MODEL SMALL
.STACK 100h
.DATA
.CODE
start: mov ax, @data
mov ds, ax
mov dx, 03c2h
mov al, 'd'
out dx, al
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-26/EXPR.ASM
.MODEL SMALL
.STACK 100h
.DATA
Stck DB 100h DUP (?)
SrcCde DB "(4+((8+2)*3))*7$"
ErrMsg DB "Fehler$"
.CODE
Start:
mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET SrcCde
call Expr
mov ah, 4Ch
int 21h
Expr PROC NEAR
call Term
push bx
mov al, '+'
cmp [si], al
jne ExprEnd
inc si
call Expr
pop dx
add bx, dx
ret
ExprEnd:
pop bx
ret
Expr ENDP
Term PROC NEAR
call Fact
push bx
mov al, '*'
cmp [si], al
jne TermEnd
inc si
call Term
pop dx
mov ax, bx
mul dx
mov bx, ax
ret
TermEnd:
pop bx
ret
Term ENDP
Fact PROC NEAR
mov al, '('
cmp [si], al
jne Fact2
inc si
call Expr
push bx
mov al, ')'
cmp [si], al
je Fact3
mov dx, OFFSET ErrMsg
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
Fact3: inc si
jmp Fact4
Fact2: mov al, '0'
cmp [si], al
jl Fact5
mov al, '9'
cmp [si], al
jg Fact5
mov al, [si]
sub al, '0'
mov ah, 00h
push ax
inc si
jmp Fact4
Fact5: mov dx, OFFSET ErrMsg
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
Fact4:
pop bx
ret
Fact ENDP
END Start
Code: Alles auswählen
./21-03-26/SORTA.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "aisdhuoasdhzuqweghasdhahkqwsdiawdbkasdwshkadgasdda$"
stck DB 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov ss, ax
mov si, OFFSET str1
LOOP1:
mov ah, '$'
cmp [si], ah
je LOOP1END
mov di, si
LOOP2:
mov ah, '$'
cmp [di], ah
je LOOP2END
mov ah, [di]
mov al, [si]
cmp ah, al
jl GOON
mov [di], al
mov [si], ah
GOON:
inc di
jmp LOOP2
LOOP2END:
inc si
jmp LOOP1
LOOP1END:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-26/STRSWP5.ASM
.MODEL Small
.STACK 100h
.DATA
stck DB 100h DUP (?)
Str1 DB "Heute ist auch ein Tag$ "
Str2 DB "Hallo Welt, sagt David Vajda$ "
SWPBUF1 DB " "
SWPBUF2 DB " "
Stra DB "Caesar$ ", "Anton$ ", "Gustav$ ", "Berta$ ", "Dora$ ", "Friedrich$"
ptrx DW 10h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov es, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov dx, OFFSET str1
mov bx, OFFSET str2
call STRSWP
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov dx, OFFSET str2
mov ah, 09h
int 21h
mov si, OFFSET stra
mov di, OFFSET stra
mov cx, 6
mov di, OFFSET ptrx
mov si, OFFSET stra
mov cx, 6
INITLP:
mov [di], si
add si, 10
inc di
inc di
dec cx
cmp cx, 0
jg INITLP
mov si, OFFSET ptrx
mov cx, 6
PRNTLP1:
mov dx, [si]
mov ah, 09h
int 21h
inc si
inc si
dec cx
cmp cx, 0
jg PRNTLP1
mov cx, 6
mov si, OFFSET ptrx
LOOP1:
mov di, si
mov bx, cx
LOOP2:
push di
push si
push bp
push dx
push cx
push bx
push ax
mov dx, [si]
mov bx, [di]
mov si, dx
mov di, bx
call STRCMP
cmp dl, 0
jle NOSWP
pop ax
pop bx
pop cx
pop dx
pop bp
pop si
pop di
push di
push si
push bp
push dx
push cx
push bx
push ax
mov ax, [di]
mov bx, [si]
mov [si], ax
mov [di], bx
NOSWP:
pop ax
pop bx
pop cx
pop dx
pop bp
pop si
pop di
inc di
inc di
dec bx
cmp bx, 0
jne LOOP2
inc si
inc si
dec cx
cmp cx, 0
jne LOOP1
mov si, OFFSET ptrx
mov cx, 6
OUTPRINT:
mov dx, [si]
mov ah, 09h
int 21h
inc si
inc si
dec cx
cmp cx, 0
jg OUTPRINT
mov ah, 4Ch
int 21h
STRSWP PROC NEAR
mov si, dx
mov di, OFFSET SWPBUF1
call STRCPY
mov si, bx
mov di, OFFSET SWPBUF2
call STRCPY
mov di, dx
mov si, OFFSET SWPBUF2
call STRCPY
mov di, bx
mov si, OFFSET SWPBUF1
call STRCPY
ret
STRSWP ENDP
STRCPY PROC NEAR
STRCPYLOOP:
mov al, '$'
cmp [si], al
je STRCPYEND
mov al, [si]
mov [di], al
inc si
inc di
jmp STRCPYLOOP
STRCPYEND:
mov al, '$'
mov [di], al
ret
STRCPY ENDP
STRCMP PROC NEAR
STRCMPLOOP:
mov al, [si]
mov dl, [di]
cmp al, '$'
jz STRCMPLOOPEND2
cmp dl, '$'
jz STRCMPLOOPEND2
sub dl, al
jnz STRCMPLOOPEND
inc si
inc di
jmp STRCMPLOOP
STRCMPLOOPEND:
ret
STRCMPLOOPEND2:
mov dl, 0
ret
STRCMP ENDP
END start
Code: Alles auswählen
./21-03-27/FAC.ASM
.MODEL SMALL
.STACK 100h
.DATA
outbuf db " $"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov dx, OFFSET stck
add dx, 100h
mov sp, dx
mov ax, 5
call FAC
mov di, OFFSET outbuf
LOOP1: mov dx, 0
mov cx, 10
div cx
add dx, '0'
mov [di], dx
inc di
cmp ax, 0
jg LOOP1
mov ah, '$'
mov [di], ah
dec di
mov si, OFFSET outbuf
LOOP2: cmp si, di
jge GOON
mov al, [si]
mov ah, [di]
mov [si], ah
mov [di], al
inc si
dec di
jmp LOOP2
GOON:
mov dx, OFFSET outbuf
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
FAC PROC NEAR
mov dl, al
mov al, 1
call FAC2
ret
FAC ENDP
FAC2 PROC NEAR
cmp dl, 0
jle FAC2END
mul dl
dec dl
call FAC2
FAC2END:
ret
FAC2 ENDP
END start
Code: Alles auswählen
./21-03-27/ITOSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
outbuf db " $"
.CODE
start: mov ax, @data
mov dx, ax
mov ax, 6273
mov di, OFFSET outbuf
LOOP1: mov dx, 0
mov cx, 10
div cx
add dx, '0'
mov [di], dx
inc di
cmp ax, 0
jg LOOP1
mov ah, '$'
mov [di], ah
dec di
mov si, OFFSET outbuf
LOOP2: cmp si, di
jge GOON
mov al, [si]
mov ah, [di]
mov [si], ah
mov [di], al
inc si
dec di
jmp LOOP2
GOON:
mov dx, OFFSET outbuf
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-03-28/STRSUB.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck DB 100h DUP (?)
str1 "abcd efgh abcd ijkl abcd klop abcd$"
str2 "abcd$"
str3 "1234$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, stck
mov si, OFFSET str1
mov cx, 0
loop1: mov di, OFFSET str2
mov ah, [di+cx]
cmp [si+cx], ah
je
in c cx
cmp [di+cx], '$'
je
mov di, OFFSET str3
mov cx, 0
loop2: mov ah, [di+cx]
mov [si+cx], ah
mov ah, '$'
cmp [si+cx], ah
je goon1
inc cx
jmp loop2
goon1:
mov dx, OFFST str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-02/COUNTER.ASM
.MODEL SMALL
.STACK 100h
.DATA
outbuf db " $"
endbuf db 10, 13, "$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov ax, 0
FOR: push ax
call ITOSTR
pop ax
inc ax
cmp ax, 20h
jng FOR
mov ah, 4Ch
int 21h
ITOSTR PROC NEAR
mov di, OFFSET outbuf
LOOP1: mov dx, 0
mov cx, 10
div cx
add dx, '0'
mov [di], dx
inc di
cmp ax, 0
jg LOOP1
mov ah, '$'
mov [di], ah
dec di
mov si, OFFSET outbuf
LOOP2: cmp si, di
jge GOON
mov al, [si]
mov ah, [di]
mov [si], ah
mov [di], al
inc si
dec di
jmp LOOP2
GOON:
mov dx, OFFSET outbuf
mov ah, 09h
int 21h
mov dx, OFFSET endbuf
mov ah, 09h
int 21h
ret
ITOSTR ENDP
END start
Code: Alles auswählen
./21-04-02/ITOSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
outbuf db " $"
.CODE
start: mov ax, @data
mov dx, ax
mov ax, 6273
mov di, OFFSET outbuf
LOOP1: mov dx, 0
mov cx, 10
div cx
add dx, '0'
mov [di], dx
inc di
cmp ax, 0
jg LOOP1
mov ah, '$'
mov [di], ah
dec di
mov si, OFFSET outbuf
LOOP2: cmp si, di
jge GOON
mov al, [si]
mov ah, [di]
mov [si], ah
mov [di], al
inc si
dec di
jmp LOOP2
GOON:
mov dx, OFFSET outbuf
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-02/SORTA.ASM
.MODEL SMALL
.DATA
str1 db "ashdjasdhah2hajweasdhasdahsklsd$"
stck db 100h DUP (?)
.STACK 100h
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
LOOP1:
mov ah, '$'
cmp [si], ah
je LOOP1END
mov di, si
LOOP2:
mov ah, '$'
cmp [di], ah
je LOOP2END
mov ah, [si]
mov al, [di]
cmp ah, al
jg GOON
mov [si], al
mov [di], ah
GOON:
inc di
jmp LOOP2
LOOP2END:
inc si
jmp LOOP1
LOOP1END:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-02/WUNDER.ASM
.MODEL SMALL
.STACK 100h
.DATA
outbuf db " $"
endbuf db 10, 13, "$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov ax, 22
FOR:
mov cl, 2
div cl
cmp al, 1
je FOREND
cmp ah, 0
jne ODD
mov cl, al
mov ch, 0
mov ax, cx
jmp XYZ
ODD:
mov cl, al
mov ch, 0
mov ax, cx
mov cl, 3
mul cl
add ax, 1
XYZ:
push ax
call ITOSTR
pop ax
jng FOR
FOREND:
mov ah, 4Ch
int 21h
ITOSTR PROC NEAR
mov di, OFFSET outbuf
LOOP1: mov dx, 0
mov cx, 10
div cx
add dx, '0'
mov [di], dx
inc di
cmp ax, 0
jg LOOP1
mov ah, '$'
mov [di], ah
dec di
mov si, OFFSET outbuf
LOOP2: cmp si, di
jge GOON
mov al, [si]
mov ah, [di]
mov [si], ah
mov [di], al
inc si
dec di
jmp LOOP2
GOON:
mov dx, OFFSET outbuf
mov ah, 09h
int 21h
mov dx, OFFSET endbuf
mov ah, 09h
int 21h
ret
ITOSTR ENDP
END start
Code: Alles auswählen
./21-04-03/SORTSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "ahsdjasdhalsdhasjkhdajksdhalsdlasdjlhasdjaldslhusdsdjfsdvnmiopw$"
stck DB 100h DUP (?)
.CODE
start:
mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
LOOP1: mov ah, '$'
cmp [si], ah
je LOOP1END
mov di, si
LOOP2:
mov ah, '$'
cmp [di], ah
je LOOP2END
mov ah, [di]
mov al, [si]
cmp ah, al
jng GOON
mov [di], al
mov [si], ah
GOON:
inc di
jmp LOOP2
LOOP2END:
inc si
jmp LOOP1
LOOP1END:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-04/SORTSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck DB 100h DUP (?)
str1 db "a9dahsdkbvnhjlasdhajabdhgczilgzupweiasjghhjwaagsd,ncyxkwamvny$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
LOOP1: mov ah, '$'
cmp [si], ah
je LOOP1END
mov di, si
LOOP2:
mov ah, '$'
cmp [di], ah
je LOOP2END
mov ah, [si]
mov al, [di]
cmp ah, al
jng GOON
mov [si], al
mov [di], ah
GOON:
inc di
jmp LOOP2
LOOP2END:
inc si
jmp LOOP1
LOOP1END:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-08/SORTSTR.ASM
.MODEL SMALL
.DATA
.STACK 100h
str1 db "hjahbkcbhjljqwduerpuohjsdao081734e12jhadhalsdha$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
LOOP1:
mov ah, '$'
cmp [si], ah
mov di, si
je LOOP1END
LOOP2:
mov ah, '$'
cmp [di], ah
je LOOP2END
mov al, [si]
mov ah, [di]
cmp al, ah
jng GOON
mov [si], ah
mov [di], al
GOON:
inc di
jmp LOOP2
LOOP2END:
inc si
jmp LOOP1
LOOP1END:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-10/SORTSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "HAsdjasdhajsdsahsdagshj8iqowjadklsdlajsd$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov di, si
mov ah, '$'
cmp [si], ah
je loop1end
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [si], ah
mov [di], al
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-11/BINCONV.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "00000000$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ss, ax
mov ds, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov ax, OFFSET str1
add ax, 7
mov di, ax
mov ax, 37
mov cl, 2
loop1: div cl
add ah, '0'
mov [di], ah
dec di
cbw
cmp ax, 0
jne loop1
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-12/SORTSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "hjasdabsjouyxHZCX:YMCYUJQPWEIASK:C$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
sortloop1: mov di, si
mov ah, '$'
cmp [si], ah
je sortloop1end
sortloop2:
mov ah, '$'
cmp [di], ah
je sortloop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jnl goon
mov [di], al
mov [si], ah
goon:
inc di
jmp sortloop2
sortloop2end:
inc si
jmp sortloop1
sortloop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-13/SORTSTR.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "hasjnasdjnnmcykllqajsdakncy$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jnl goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-16/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "jasrkdhmlkwjyxcmjhal,schjhjfsd$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jnl goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-20/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "Hajsdhfjjkasdhhmyxkhjadhj$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jnl goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-21/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "jaskdhmcnyxmhjkjasdnmkjasdkkmnyxnkzhckm$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-22/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hasjdhmcynmysdhawmmycxnmwqklycmasdkj$"
.CODE
start: mov ax, @data
mov ss, ax
mov ds, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-23/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hjasjdhbycmajdmhyclasdjhnb$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET str1
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], OFFSET ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jnl goon
mov [si], ah
mov [di], al
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-24/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hasjdhasdncmyx,xcjsjkwq$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-25/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "ahsdkjasbasDYXKNMYDJKAS;M$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET str1
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jnl goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-04-28/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hmyx1kanmyxnmalkauisdnmyxvjasdjk$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-01/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "hasjdhasdjahdmycklqadmnm$"
stck db 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [di], ah
mov [si], al
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-04/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hasdjahdmyc2njawjkajmnmsnmc$"
.CODE
start: mov ax, @data
mov ss, ax
mov ds, ax
mov ax, OFFSET str1
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-05/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck db 100h DUP (?)
str1 db "hjascmyxoqmsjasmychjak$"
.CODE
start: mov ax, @data
mov ss, ax
mov ds, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp ah, [si]
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp ah, [di]
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-08/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "hjasdhlasdhajdsdhasdnbmxljhadas$"
stck DB 100h DUP (?)
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp ah, [di]
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-16/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 DB "hasdjhnmaschjaduilcynmashhj$"
stck DB 100h DUP (?)
.CODE
start:
mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp ah, [si]
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp ah, [di]
je loop2end
mov ah, [si]
mov al, [di]
cmp ah, al
jng goon
mov [si], al
mov [di], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-05-21/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
stck DB 100h DUP (?)
str1 DB "hjasdhjhasdjkcymqiosfdkjsvdj$"
.CODE
start: mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET stck
mov ss, ax
mov ds, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp ah, [si]
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp ah, [di]
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov ah, 09h
mov dx, OFFSET str1
int 21h
mov ah, 4Ch
int 21h
END start
Code: Alles auswählen
./21-06-02/STRSRT.ASM
.MODEL SMALL
.STACK 100h
.DATA
str1 db "hasjdaljsdb ,nmsjlhasdb mnnmylasdhjs$"
stck db 100h DUP (?)
.CODE
start:
mov ax, @data
mov ds, ax
mov ss, ax
mov ax, OFFSET str1
add ax, 100h
mov sp, ax
mov si, OFFSET str1
loop1: mov ah, '$'
cmp [si], ah
je loop1end
mov di, si
loop2:
mov ah, '$'
cmp [di], ah
je loop2end
mov ah, [di]
mov al, [si]
cmp ah, al
jng goon
mov [di], al
mov [si], ah
goon:
inc di
jmp loop2
loop2end:
inc si
jmp loop1
loop1end:
mov dx, OFFSET str1
mov ah, 09h
int 21h
mov ah, 4Ch
int 21h
END start