- the idea of
task1
is to extract each letter in an8-bit register
and effectively encode it by collecting the step data value in theregister
- the idea in
task2
part 1 is to find the line on which the points are located, (check if the x or y coordinates are equal) and decreasing the remaining coordinates - the idea in
task2
part 2 is to call the function from part 1 and add it to a vector of distances,then increasing its address - the idea in
task2
part 3 is to take an index and find out its square using eitherloop
orjump
, then the comparison with the element in the distance vector
- the idea of
task3
is similar to that oftask1
, both letters are taken from plain and key and using an algorithm resulting from thetabular matrix
, add the resulting letter inenc_string
.
The algorithm can be presented as follows:
- if the letter in
plain < key
, it is subtracted in theascii code
key - plain and 65 is added - if the letter in
plain >
key, their difference is subtracted from 26 and 65 is added. - also, an area is needed to
refresh
and forget the address of the key in case the string is longer than this
- the idea of
task4
is to generate the indexes corresponding to thespiral matrix
by using jumps in4 areas
where the spiral matrix is traversed (top side
area, thenright side
, thenbottom side
,left side
and thenrepeat
). - a
zone
must also be implemented that decreases the number of steps taken to traverse the zones, because the more the spiral progresses, the more it decreases in "dimension". - then it is taken from the address where the
key matrix
is with the generated index and adding it to theletter plain
, everything is put at the address where the string must be encoded.