Download as pdf
Download as pdf
You are on page 1of 4
BTagaclec6h 40116202 CSE-Ay Compiler Hesign Pores a & > ane o 2: A 9 3B > Adaess clescviptor 4 DB > getKeg 5. A ~» TRUE Payt-B 1. Register allocation; Tt is an importont Method tn -firel Stege OF the compiler. Registers one foster to access than cache memoy. Kegisteys ave available in Smatt Size ups few Aondved kb. So it is Necessary fo Use minimum nom ber of vegisters fer variable allocation. g. Tasues in Code generation: % Input to the code generator # Taget Pregiom x memory Monogement # Inatvuction dlection # Register allocation # Fralution Ordey 7B . we QSsignment ai = Ca-b)+ Cac) 4+¢a-c) Might Se fransiated ‘nto the Pollorsing Three addess code Sequence § Ss QW i402) + Ca-c) ee tz -C, vis btu ces view 4 he simple code! genevation algorithm generates target Code fey a sequence of thee ao099 code | Statements. the code generator algovr'th™ ewovks by “Consideving | Tratvidualty, ft the Gasic oacks. 5. \ ie ose of Machine xdioms: these ada oy Subtact ene from an Operand) Gcefere oy after Using #3 Salue . The we of “these Modes greatly improves “the ‘geality of Code. her) Pushing or popping a Steck a8 in parameter’ passing. vib poreo T agoume you dock an assenbler, eahich aoule Perform : conversion for yeu auitorrenticaliy you just ewant to expertence “the fun of Performing the task yourself + you waht to gain a better orderstanding of machine . , Language . yout the need manual He the target cpv architecture conich OPOIPS at : of the opcodes , operands , 66-7 Od —— Squences requived pr each One. ‘The encoding ine ells what “ther fodtruction uooks Like in Gi rary - .TA this case, ft always Starts with 5& ones, the dent ave bit, then. the “K's stands for the Mteral you oe aclding . The fivat few Gits are called an “opcode”, are unique for cach instruction, The ¢cPU Gasically teoks at the Opcote to see cofat instruchon ttis then it Knows to ‘decoue the “K'\ ad .a. number fo be: acked. Te ig tendiows , but net “that difficult encede are decate ~T had an onderqvad class cofere coe Fad to do tt % Gand in chasrag?> ' Tb actually. make an : executable file. yeu alse. Gave to ce =things Like allocate me Caoleulate Gvancf, offsets, ard put tt into a fovrat tike ELF, sepeostog en your operat ng Syotenn . a het's Suppose that "yeur pregyam microcontrollers and. You, have an STM BO xxx He, ‘eohich embeds @ Cortex - MO processor . “This preessor’s architectine 173 ARMy6é-m, Example: 1:19 the Label which Lets the Computer Knocg where © Gegin the opevatiOn. The “Mov” is the panemonic Command +0 move the number “3” Sato a Parte of the Compiler Processing edict Cam function os a vaviawe .“EAX, "EBX, and “ECx’ ave the Variables.

You might also like