var x1,y1,x2,y2:word;
pocet:word;
pomX,pomY:word;
k:word;
cf:word;
retez:string;
i:byte;
procedure pause;assembler;
asm
xor ah,ah
int 16h
end;
procedure outstring (retezec:string;cislo:byte);assembler;
asm
PUSH DS {ulo₧ DS, budeme ho m∞nit}
LDS di,retezec
mov cx,6 {vynuluju}
add di,cx
mov byte ptr ds:[di],'$'
@tuuuu:
mov byte ptr ds:[di-1],'0'
dec di
loop @tuuuu
mov byte ptr ds:[di],6 {string 65535= 6 pozic=[delka]+'65535+'$'}
{ xor di,di}
{ mov cx,6 {max cislo 65535 ..5mist+'$'}
mov bh,48 {o 48 zvetseni -> char (#3)+48 = '3'}
xor ah,ah
mov al,cislo
aaa
add ah,bh {pouzivam pricitani registru ..rychlejsi nez primy operand 48}
add al,bh {prevod na ascii}
add di,5
mov byte ptr ds:[di],al
mov byte ptr ds:[di-1],ah
MOV AH,$09 {nastav hodnotu podslu₧by}
LDS DI,retezec {Φti adresu °et∞zce}
MOV DX,DI {vlo₧ ji do registru DX pro podslu₧bu}
INC DX {zvyÜ adresu a₧ za informaci o dΘlce}
XOR BH,BH {nuluj BH}
MOV BL,[DI] {do BL vlo₧ dΘlku °et∞zce}
MOV BYTE PTR [DI+BX+1],'$'{na konec °et∞zce dosa∩ ukonΦovacφ znak}
INT $21 {volej slu₧by DOSu}
POP DS {vra¥ DS}
end;
procedure test(cop:string;znak,delka:byte);assembler;
asm
nop
pushA
xor di,di
mov al,delka
inc al
les di,cop
stosb
mov al,znak
xor cx,cx
mov cl,delka
dec cx
rep stosb
mov al,'$'{to je pro assembler ,tam maj retezce tvar pro
dosovske vypsani retezce fci int 21h > .......$
narozdil od paskalu kde to je > [delka N]......N}
inc di
stosb
{mov byte ptr es:[di+1],'d'
mov byte ptr es:[di+2],'5'
mov byte ptr es:[di+3],'.'
}
nop
popA
end;
procedure tst_AND;assembler; asm
mov ax,01001b
mov cx,01001b
nop
cmp ax,cx
mov ax,01001b
mov cx,00001b
nop
cmp ax,cx
mov ax,01001b
mov cx,01001b
nop
and ax,cx
mov ax,01001b
mov cx,00001b
nop
and ax,cx
mov ax,01001b
mov cx,01001b
nop
or ax,cx
mov ax,01001b
mov cx,00001b
nop
or ax,cx
mov ax,01001b
mov cx,01001b
nop
xor ax,cx
mov ax,01001b
mov cx,00001b
nop
xor ax,cx
end;
begin
tst_and;
writeln('sssssssssssssssssssssss');
retez:='-------';
test(retez,58{:},3);
writeln(retez);
writeln(#13,#10);
i:=3;
outstring(retez,i);
writeln(#13,#10);
end.