Академический Документы
Профессиональный Документы
Культура Документы
SOFTWARE
5
: .
: . . TI-155
: .
2017
..
5.6
Debug
INCLUDE Irvine32.inc
.data
mes db 0ah,0dh,'String - ',0
mas db 10 dup (?),0 ;
i db 0
.code
main proc
mov ecx,10
mov esi,0
show:
movsx eax,mas[esi] ; esi
call WriteInt
inc esi
loop show
quit:
call crlf
exit
main ENDP
END main
00000000 .data
00000000 0A 0D 53 74 72 mes db 0ah,0dh,'String - ',0
69 6E 67 20 2D
20 00
0000000C 0000000A [ mas db 10 dup (?),0
00
] 00
00000017 00 i db 0
00000000 .code
00000000 main proc
INCLUDE Irvine32.inc
.data ;
; :
mes1 db ' ne raven 0!',0ah,0dh,0
mes2 db ' raven 0!',0ah,0dh,0
mes3 db 0ah,0dh,'Element ',0
mas dw 2,7,0,0,1,9,3,6,0,8 ;
.code
main proc
xor eax,eax ; ax
prepare:
mov ecx,10 ; ecx
mov esi,0 ; esi
compare:
mov dx,mas[esi*2] ; dx
cmp dx,0 ; dx c 0
je equal ;, , zf=1
not_equal: ;
mov edx,OFFSET mes3
call WriteString ;
mov eax,esi;
call WriteDec ;
inc esi ;
dec ecx ;
jecxz quit ; ecx=0
jmp compare ;
equal: ; 0
mov eax,esi
call WriteDec
inc esi ;
dec ecx ; ?
jecxz quit
jmp compare
quit:
call crlf
exit
main ENDP
END main ;
00000000 .data
00000000 20 6E 65 20 72 mes1 db ' ne raven 0!',0ah,0dh,0
61 76 65 6E 20
30 21 0A 0D 00
0000000F 20 72 61 76 65 mes2 db ' raven 0!',0ah,0dh,0
6E 20 30 21 0A
0D 00
0000001B 0A 0D 45 6C 65 mes3 db 0ah,0dh,'Element ',0
6D 65 6E 74 20
00
00000026 0002 0007 0000 mas dw 2,7,0,0,1,9,3,6,0,8
0000 0001 0009
0003 0006 0000
0008
00000000 .code
INCLUDE Irvine32.inc
.data ;
N=5 ;
mas byte 5 dup (3 dup (0))
.code ;
main proc ;
movsx eax,mas[esi]
call WriteDec
add esi,3 esi+3
loop show
quit:
call crlf
exit ;
main ENDP
END main ;
00000000 .data
= 00000005 N=5
00000000 00000005 [ mas byte 5 dup (3 dup (0))
00000003 [
00
]
]
00000000 .code
00000000 main proc
5.7
1. , ,
. .
INCLUDE Irvine32.inc
loop1:
mov al,[esi]
cmp al,simv
je loop2
inc esi
jmp endl
loop2:
mov al,[esi + 1]
cmp al,simv
je equal
inc esi
jmp endl
loopne loop1 ;
ENDM
.data
mas1 db "xxxxe x yt xx xxxcfxx xxzs i.pxxl",0
mas2 db 30 dup(0)
len equ lengthof mas1
simv db 'x'
msg1 db "Your string: ", 0
msg2 db "xx = ",0
.code
main PROC
lea edx, msg1
call WriteString
lea edx, mas1
call WriteString
call Crlf
mov ebx, 0
search ebx
exit
main ENDP
END main
loop1:
mov al,[esi]
cmp al,simv
je loop2
inc esi
jmp endl
loop2:
mov al,[esi + 1]
cmp al,simv
je equal
inc esi
jmp endl
loopne loop1
ENDM
00000000 .data
00000000 78 78 78 78 65 mas1 db "xxxxe x yt xx xxxcfxx xxzs i.pxxl",0
20 78 20 79 74
20 78 78 20 78
78 78 63 66 78
78 20 78 78 7A
73 20 69 2E 70
78 78 6C 00
00000022 0000001E [ mas2 db 30 dup(0)
00
]
= 00000022 len equ lengthof mas1
00000040 78 simv db 'x'
00000041 59 6F 75 72 20 msg1 db "Your string: ", 0
73 74 72 69 6E
67 3A 20 00
0000004F 78 78 20 3D 20 msg2 db "xx = ",0
00
00000000 .code
exit
00000069 6A 00 * push +000000000h
0000006B E8 00000000 E * call ExitProcess
00000070 main ENDP
END main
2. , ,
.
. .
INCLUDE Irvine32.inc
ENDM
.data
seq1 byte 'Sequence1 : ', 0
seq2 byte 'Sequence2 : ', 0
seq3 byte 'Sequence3 : ', 0
fin_seq byte 'Final Sequence : ', 0
s1 byte 'Assembler', 0
s2 byte 'is', 0
s3 byte 'awesome', 0
s4 byte 30 dup(?)
.code
main PROC
cld
mov edx, offset seq1
call WriteString
mov edx, offset s1
call WriteString
call Crlf
copy1 : movsb
loop copy1
procedure s4
copy2: movsb
loop copy2
mov ecx, LENGTHOF s3
procedure s4
copy3: movsb
loop copy3
mov edi, offset s4
mov ecx, lengthof s4
mov al, ' '
cld
c1:
scasb
je c2
cmp ecx, 0
jz quit
loop c1
c2:
cld
sub edi, 1
stosb
jmp c1
quit:
mov ecx, LENGTHOF s4
mov esi, OFFSET s4
mov ebx, 0
cycle:
mov al, [esi]
jmp exl
exl:
movsb
loop cycle
mov edx, offset fin_seq
call WriteString
mov edx, offset s4
call WriteString
call Crlf
call ReadKey
call ReadChar
exit
main ENDP
END main
:
.
.
2 :
, $,
.
, ,
, .