No ACL setup yet! Denying access to everyone.
en:edu:zmitac:s1:apl:lab:lab3

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:edu:zmitac:s1:apl:lab:lab3 [2024/12/03 11:21] – ktokarzen:edu:zmitac:s1:apl:lab:lab3 [2024/12/03 14:40] (current) – [Tasks to be done during laboratory] ktokarz
Line 39: Line 39:
 .data  .data 
 SourceDataString DB 'AGIKSZJ', 0FFH ; source string definition SourceDataString DB 'AGIKSZJ', 0FFH ; source string definition
-DestinBaseString DB '       ', 0FFH ; buffer for destination string +DestinBaseString DB '       ', 0; buffer for destination string, null terminated 
-DestinIndexString DB '       ', 0FFH ; buffer for destination string +DestinIndexString DB '       ', 0; buffer for destination string, null terminated 
-DestinDisplString DB '       ', 0FFH ; buffer for destination string+DestinDisplString DB '       ', 0; buffer for destination string, null terminated
  
 .code .code
Line 119: Line 119:
 </code> </code>
  
 +*def file*
 +<code>
 +LIBRARY JaAsm
 +EXPORTS CopyString_base
 +EXPORTS CopyString_base_index
 +EXPORTS CopyString_base_disp
 +</code>
 ===== Tasks to be done during laboratory ===== ===== Tasks to be done during laboratory =====
-  - Compile the example code and observe its behaviour. Set the breakpoint at the beginning of the code and see how the contents of the registers change with every loop pass.  +1. Compile the example code and observe its behaviour. Set the breakpoint at the beginning of the code and see how the contents of the registers change with every loop pass.\\ 
-  - Make the function more universal: define the string in a C++ file and pass its address as the parameter to the function. Pass the character as the second parameter. +2. Observe the content of the memory at the beginning address of the source string. Look if other strings are filled properly.\\ 
-  - Rewrite the search algorithm with vector instructions (SSE, or AVX). Suggest what to do if the string length is not a multiple of register size. +3. Write the version of the assembler function which copies the source to a destination string using chosen string instruction with repetition (use REP prefix). 
-  - Compare execution time for scalar (normal) instructions and vector instruction for the same string.+===== For the report ===== 
 +1. Put in the report a screenshot of the window with the results displayed (memory dump with copied texts).\\ 
 +2. Explain differences in addressing modes used in the functions. Explain what is the result of the line: 
 +<code> 
 +Address_difference EQU DestinDisplString - SourceDataString 
 +</code> 
 +3. Include the code of your new function written in assembler WITH COMMENTS. Also, add a screenshot of the window with the results displayed (copied texts). 
 + 
en/edu/zmitac/s1/apl/lab/lab3.1733221263.txt.gz · Last modified: by ktokarz