A.C.Lab5 CerlatPavel FAF-192
A.C.Lab5 CerlatPavel FAF-192
Arhitectura Calculatoarelor
Lucrarea de Laborator NR.4
Tema:,,PRELUCRAREA SIRURILOR
UTILIZAREA TABELELOR PENTRU CONVERSII DE CODURI’’
loop show
quit:
call crlf
exit
main ENDP
END main
Listing:
INCLUDE Irvine32.inc
C ; Include file for Irvine32.lib (Irvine32.inc)
C
C ;OPTION CASEMAP:NONE
C
C INCLUDE SmallWin.inc
C .NOLIST
C .LIST
C
C INCLUDE VirtualKeys.inc
C ; VirtualKeys.inc
C .NOLIST
C .LIST
C
C
C .NOLIST
C .LIST
C
00000000 .data
= 00000005 N=5
00000000 00000005 [ mas byte 5 dup (3 dup (0))
00000003 [
00
]
]
00000000 .code
00000000 main proc
00000000 33 C0 xor eax,eax
00000002 BE 00000000 mov esi,0
00000007 B9 00000005 mov ecx,N
0000000C go:
0000000C 8A 96 00000000 R mov dl,mas[esi]
00000012 FE C2 inc dl
00000014 88 96 00000000 R mov mas[esi],dl
0000001A 83 C6 03 add esi,3
0000001D E2 ED loop go
0000001F BE 00000000 mov esi,0
00000024 B9 00000005 mov ecx,N
00000029 show:
.data
string1 byte 'String 1 : ', 0
string2 byte 'String 2 :', 0
string3 byte 'String 3 : ', 0
string_final byte 'String 4 : ', 0
.code
main PROC
cld
mov edx, offset string1
call WriteString
mov edx, offset str1
call WriteString
call Crlf
cond2 :
mov al, ' '
sub edi, 1
stosb
jmp c1
quit :
cld
mov ecx,LENGTHOF str4
mov esi,OFFSET str4
mov ebx,0
cycle:
mov al, [esi]
cmp al, '$'
jnz strdo
jmp exl
strdo:
holo str4, ebx
exl:
movsb
loop cycle
mov edx, offset string_final
call WriteString
mov edx, offset str4
call WriteString
call Crlf
call ReadChar
call ReadKey
exit
main ENDP
END main
Listing:
INCLUDE Irvine32.inc
C ; Include file for Irvine32.lib (Irvine32.inc)
C
C ;OPTION CASEMAP:NONE ; optional: make identifiers case-sensitive
C
C INCLUDE SmallWin.inc ; MS-Windows prototypes, structures, and constants
C .NOLIST
C .LIST
C
C INCLUDE VirtualKeys.inc
C ; VirtualKeys.inc
C .NOLIST
C .LIST
C
C
C .NOLIST
C .LIST
C
00000000 .data
00000000 53 74 72 69 6E string1 byte 'String 1 : ', 0
67 20 31 20 3A
20 00
0000000C 53 74 72 69 6E string2 byte 'String 2 :', 0
67 20 32 20 3A
00
00000017 53 74 72 69 6E string3 byte 'String 3 : ', 0
67 20 33 20 3A
20 00
00000023 53 74 72 69 6E string_final byte 'String 4 : ', 0
67 20 34 20 3A
20 00
00000000 .code
00000000 main PROC
00000000 FC cld
00000001 BA 00000000 R mov edx, offset string1
00000006 E8 00000000 E call WriteString
0000000B BA 0000002F R mov edx, offset str1
00000010 E8 00000000 E call WriteString
00000015 E8 00000000 E call Crlf
000000AA cond2 :
000000AA B0 20 mov al, ' '
000000AC 83 EF 01 sub edi, 1
000000AF AA stosb
000000B0 EB EC jmp c1
000000B2 quit :
000000B2 FC cld
000000B3 B9 0000001E mov ecx,LENGTHOF str4
000000B8 BE 0000004B R mov esi,OFFSET str4
000000BD BB 00000000 mov ebx,0
000000C2 cycle:
000000C2 8A 06 mov al, [esi]
000000C4 3C 24 cmp al, '$'
000000C6 75 02 jnz strdo
000000C8 EB 08 jmp exl
000000CA strdo:
holo str4, ebx
000000CA BF 0000004B R 1 mov edi,OFFSET str4
000000CF 03 FB 1 add edi, ebx
000000D1 43 1 inc ebx
000000D2 exl:
000000D2 A4 movsb
000000D3 E2 ED loop cycle
000000D5 BA 00000023 R mov edx, offset string_final
000000DA E8 00000000 E call WriteString
000000DF BA 0000004B R mov edx, offset str4
000000E4 E8 00000000 E call WriteString