نوشته اصلی توسط
vishtasp
salam
dada f ye motaghayere 1 byte hastesh ke addresesh 0x20 hastesh
0x23 ham ye motaghayere dgast
movf 0x20,w
in khat omade meghdare motaghayere f ro rikhte to w
xorwf 0x23,W
in khat meghdare motaghayere 0x23 ro ba meghdare w ke hamon meghdare f bashe xor karde natije ro rikhte to w
xorwf 0x23,F
in khat omade dobare meghdare 0x23 ro ba meghdare w xor karde rikhte toye 0x23
xorwf 0x23,W
inja bazam omade meghdare 0x23 ro ba w xor karde rikhte to w
movwf 0x20
natijeye nahaee rikhte shode to 0x20 ya hamon f
// swap the inner bytes
movf 0x21,W
in khat meghdare addresse 0x21 ro mirize to w
xorwf 0x22,W
inja meghdare addrese 0x22 ro ba w xor mikone mirize to w
xorwf 0x22,F
inja miad meghdare w ro ba meghdare addresse 0x22 xor mikone mirize to f
xorwf 0x22,W
inja ham miad meghdare addresse 0x22 ro ba w xor mikone mirize to w
movwf 0x21
inja natijeye nahaee ke to w hastesh ro mirize to addresse 0x21
rlf 0x21
inja bit haye addresse 0x21 ro yebar shift mide be chap
rlf 0x20
inja ham addresse 0x20 ro shift mide be chap
rrf 0x21
inja addresse 0x21 ro shift mide be rast
masalan age 0x21 = 10000010 bashe
(C=0)
unvaght shift dadan mishe:
00000100
age 0x22=11010101
shiftesh mishe:
10101010
(chon bit 7 az 0x21 =0 bode inja ham bite 0 mishe 0)
hala chon bite 7 0x22=1 bode shifte raste 0x21 mishe:
10000010
rlcf 0x21
rlcf 0x20
rrcf 0x21
in se khato haghighatesh nadidam nemidonam chian
vase inke befahmi chikar karde bayad yekam assembly balad bashi ziad sakht nist ye nega benzdaz yad migiri rahat