!"#$"%&&'(!L3M(2/"(0"#1'22'/"((3!4567,-2(
(
Programme""assembleur"du"PGCD"(a,b)"
"
"
start":"
NOR"" " allone;"" " " Accu"="X"NOR"11111111="0"
NOR"" " b;" " " " Accu"="not (b)"
ADD"" " one";""""Accu"="not (b)"+"1="H"b"
ADD"" " a";""""Accu"="a"-"b"
JCC"" " neg;""""si"carry="0"alors"neg""sinon"carry=0"
STA"" " a;" " " " a=Accu;"
ADD"" " allone;"""Accu"="Accu"+”11111111”"d’où"carry"=1"sauf"si"a=0;"
JCC"" " end";" " " " si"carry="0"alors"end"sinon"carry=0"
""""""""""""JCC"" " start;""""carry=0"donc"start"
"
neg!:!
NOR" " "zero;"""""Accu"="Accu"NOR"00000000="not"(Accu)"
ADD"" " one;" " " " Accu"="Accu + 1"
STA"" " b;" " " " b=Accu"
JCC" " start;"""""si"carry="0"alors"start!sinon"carry=0"
"
end!:!
JCC"" " end!;&&&&carry=0"donc"end!"(le"résultat"est"en"b)"
"
"