Common Intermediate Language In Simp Lang Yeeng Voiss Sownd Chahrz Iz Kom Tween Lang Uv Thuh Common Language InfraSTrusTrucTure

III .1.1 Data Types 290
III .1.1.1 Numeric data types 291
III .1.1.2 Boolean data type 293
III.1.1.3 Character data type 293
I I I .1.1.4 Object references 293
I I I .1.1.5 Runtime pointer types 293

I I I .1.2 Instruction variant table 295
I I I .1.2.1 Opcode encodings 295

I I I .1.3 Stack transition diagram 301
I I I .1.4 English description 302
I I I .1.5 Operand type table 302
I I I .1.6 Impl ici t argument coercion 305

I I I .1.7 Res t r ict ions on CIL code sequences 306
I I I .1.7.1 The inst ruct ion st r eam 307
I I I .1.7.2 Val id branch targets 307
I I I .1.7.3 Except ion ranges 307
I I I .1.7.4 Mus t provide maxs tac k 308
I I I .1.7.5 Backward branch const r aint s 308
I I I .1.7.6 Branch ver i f icat ion cons t raint s 308

I I I .1.8 Ver i f iabi l i ty and cor r ectnes s 308
I I I .1.8.1 Flow cont rol rest r ict ions for ver i f iable CIL 309

III.1.9 Metadata tokens 313
I I I .1.10 Except ions thrown 314

III.2 Prefixes to instructions 315
I I I .2.1 const rained. – (pref ix) invoke a member on a value of a
var iable type 316
I I I .2.2 no. – (pr ef ix) pos s ibly skip a faul t check 318
I I I .2.3 readonly. (pr ef ix) – fol lowing inst ruct ion returns a cont rol led -
mutabi l i ty managed pointer 319
I I I .2.4 tai l . (pref ix) – cal l terminates cur rent method 320
I I I .2.5 unal igned. (pr ef ix) – pointer inst ruct ion might be unal igned 321
I I I .2.6 volat i le. (pref ix) – pointer reference is volat i le 322

I I I.3 Base inst ruct ions 323
I I I .3.1 add – add numer ic values 324
I I I .3.2 add.ovf .<signed> – add integer values wi th over f low check 325
I I I .3.3 and – bitwise AND 326
I I I .3.4 arglist – get argument list 327
I I I .3.5 beq.<length> – branch on equal 328
I I I .3.6 bge.<length> – branch on greater than or equal to 329
xiv © Ecma International 2012
I I I .3.7 bge.un.<length> – branch on greater than or equal to,
unsigned or unordered 330
I I I .3.8 bgt .<length> – branch on gr eater than 331
I I I .3.9 bgt .un.<length> – branch on greater than, uns igned or
unordered 332
I I I .3.10 ble.<length> – br anch on les s than or equal to 333
I I I .3.11 ble.un.<length> – branch on les s than or equal to, unsigned or
unordered 334
I I I .3.12 bl t .<length> – branch on les s than 335
I I I .3.13 bl t .un.<length> – branch on les s than, unsigned or unordered 336
I I I .3.14 bne.un<length> – br anch on not equal or unordered 337
I I I .3.15 br .<length> – uncondi t ional branch 338
I I I .3.16 break – breakpoint inst ruct ion 339
I I I .3.17 br false.<length> – br anch on false, nul l , or zero 340
I I I .3.18 br t rue.<length> – branch on non- false or non-nul l 341
I I I .3.19 cal l – cal l a method 342
I I I .3.20 cal l i – indi rect method cal l 344
I I I .3.21 ceq – compare equal 346
I I I .3.22 cgt – compar e greater than 347
I I I .3.23 cgt .un – compar e greater than, uns igned or unordered 348
I I I .3.24 ckf ini te – check for a f ini te real number 349
I I I .3.25 cl t – compare less than 350
I I I .3.26 cl t .un – compar e less than, uns igned or unorder ed 351
I I I .3.27 conv.<to type> – data conver s ion 352
I I I .3.28 conv.ovf .<to type> – data conver sion wi th over f low detect ion 353
I I I .3.29 conv.ovf .<to type>.un – unsigned data conver s ion wi th
over f low detect ion 354
I I I .3.30 cpblk – copy data f rom memory to memory 355
I I I .3.31 div – divide values 356
I I I .3.32 div.un – divide integer values, uns igned 357
I I I .3.33 dup – dupl icate the top value of the s tack 358
I I I .3.34 endf i l ter – end except ion handl ing f i l ter clause 359
I I I .3.35 endf inal ly – end the f inal ly or faul t clause of an except ion
block 360
I I I .3.36 ini tblk – ini t ial ize a block of memory to a value 361
III .3.37 jmp – jump to method 362
I I I .3.38 ldarg.<length> – load argument onto the stack 363
I I I .3.39 ldarga.<length> – load an argument addr ess 364
I I I .3.40 ldc.<type> – load nume r ic cons tant 365
I I I .3.41 ldf tn – load method pointer 366
I I I .3.42 ldind.<type> – load value indi rect onto the s tack 367
© Ecma International 2012 xv
I I I .3.43 ldloc – load local var iable onto the s tack 369
I I I .3.44 ldloca.<length> – load local var iable addr ess 370
I I I .3.45 ldnull – load a null pointer 371
I I I .3.46 leave.<length> – exit a protected region of code 372
I I I .3.47 localloc – allocate space in the local dynamic memory pool 373
I I I .3.48 mul – multiply values 374
I I I .3.49 mul .ovf .<type> – mul t iply integer values wi th over f low check 375
I I I .3.50 neg – negate 376
I I I .3.51 nop – no operat ion 377
I I I .3.52 not – bitwise complement 378
I I I .3.53 or – bitwise OR 379
I I I .3.54 pop – remove the top element of the stack 380
I I I .3.55 rem – compute remainder 381
I I I .3.56 rem.un – compute integer remainder, unsigned 382
I I I .3.57 ret – return f rom method 383
I I I .3.58 shl – shi f t integer lef t 384
I I I .3.59 shr – shi f t integer r ight 385
I I I .3.60 shr .un – shi f t integer r ight , unsigned 386
I I I .3.61 starg.<length> – stor e a value in an argument s lot 387
I I I .3.62 st ind.<type> – s tore value indi rect f rom s tack 388
I I I .3.63 st loc – pop value f rom s tack to local var iable 389
I I I .3.64 sub – subt ract numer ic values 390
I I I .3.65 sub.ovf .<type> – subt r act integer values, checking for
over f low 391
I I I .3.66 swi tch – table swi tch based on value 392
III.3.67 xor – bi twi se XOR 393

ObjecT ModeL InsTrucTions In Simp Lang Iz Ob Mod Akts

III.4 Object model instructions 394

III .4.1 box – convert a boxable value to its boxed form 394
I I I .4.2 callvirt – call a method as sociated, at runt ime, wi th an object 396
I I I .4.3 castclass – cast an object to a class 398
I I I .4.4 cpobj – copy a value from one address to another 399
I I I .4.5 initobj – initial ize the value at an addres s 400
I I I .4.6 isinst – test if an object is an instance of a class or inter face 401
I I I .4.7 ldelem – load element from array 402
I I I .4.8 ldelem.<type> – load an element of an array 403
I I I .4.9 ldelema – load address of an element of an array 405
I I I .4.10 ldf ld – load f ield of an object 406
I I I .4.11 ldf lda – load f ield addres s 407
I I I .4.12 ldlen – load the length of an ar r ay 408
I I I .4.13 ldobj – copy a value f rom an addr es s to the stack 409
xvi © Ecma International 2012
I I I .4.14 ldsf ld – load stat ic f ield of a clas s 410
I I I .4.15 ldsf lda – load s tat ic f ield address 411
I I I .4.16 ldst r – load a l i teral st r ing 412
I I I .4.17 ldtoken – load the runt ime representat ion of a metadata token 413
I I I .4.18 ldvi r t f tn – load a vi r tual method pointer 414
I I I .4.19 mkrefany – push a typed reference on the s tack 415
I I I .4.20 newar r – cr eate a zero -based, one -dimensional ar ray 416
I I I .4.21 newobj – create a new object 417
I I I .4.22 refanytype – load the type out of a typed refer ence 420
I I I .4.23 refanyval – load the addres s out of a typed reference 421
I I I .4.24 rethrow – rethrow the cur r ent except ion 422
I I I .4.25 sizeof – load the size, in bytes,of a type 423
I I I .4.26 stelem – store element to ar ray 424
I I I .4.27 stelem.<type> – store an element of an ar ray 425
I I I .4.28 st f ld – stor e into a f ield of an object 427
I I I .4.29 stobj – stor e a value at an addres s 428
I I I .4.30 stsf ld – stor e a stat ic f ield of a class 429
I I I .4.31 throw – throw an except ion 430
I I I .4.32 unbox – conver t boxed value type to i t s raw form 431
I I I .4.33 unbox.any – conver t boxed type to value 432