从8051到Microchip的汇编转换:快速参考
Whenmigratingassemblylanguageprogramsfrom
onefamilyofmicrocontrollerstoanother,thefirst
questionisalmostalways:“What’stheequivalent
opcode?”Someoperations,likeadditionand
subtraction,areself-evidentandpracticallyuniversal.
Otherinstructionsmayhavesomesubtledifferencesin
syntaxorspellingthatmakedirectconversionsabit
trickier.Occasionally,someinstructionssimplydon’t
haveadirectequivalentinthetargetset,oran
equivalentexistsbutisexplainedindifferentterms.
Anotherquestionthatarisesisthatofaddressing
modes.Typically,DirectandIndirectAddressing
modesarestandardinallarchitectures.However,they
tendtobedifferentinlimitationsandfeatureset.AN880Convertingfrom8051toMicrochipAssembler:AQuickReferenceItisimportanttorememberthatthisreferencelistisAuthor:GaurangKavaiyaMicrochipTechnologyInc.onlyastartingpointforcodeconversion.Thereareseveralconsiderationstokeepinmindwhenmovingcodefrom8-bit8051devicestoPICmicrodevices:1.Thebasicprocessorarchitectureissignificant