aXXo 0 Report post Posted April 11, 2008 (edited) apa yg dimaksudkan dengan contoh ne :-example code :if ((Opcode >> 4) & 0xf) <-- ???{-....}explaination : 00110010 - some opcode 00000011 - some opcode shifted right (>>) 4 bits& 00001111 - & 0xF ---------- 00000011 - resultaku kurang faham ler! tolong terangkan! macam mana boleh dapat output tu? opcode tu ape? Edited April 11, 2008 by aXXo Quote Share this post Link to post Share on other sites
zeph 1 Report post Posted April 11, 2008 opcode tu ialah real machine language dalam binary. tapi biasanya opcode ditulis dalam hexadecimal sebab binary panjang sangat. Quote Share this post Link to post Share on other sites
aXXo 0 Report post Posted April 11, 2008 opcode tu ialah real machine language dalam binary. tapi biasanya opcode ditulis dalam hexadecimal sebab binary panjang sangat.ok dah faham maksud opcode! tp dr explaination yg diberi oleh dlm cth tu mcm mane?p/s tu explaination aku dpt dr member tp kurang jelas? maksudnya aku tak faham ler hehehe Quote Share this post Link to post Share on other sites
zeph 1 Report post Posted April 11, 2008 boleh bagi full codes tak? tak faham la soalan ko ni Quote Share this post Link to post Share on other sites
Fakhrul 0 Report post Posted April 11, 2008 An explanation:1. Opcode >> 4-shift Opcode to the right by 4 bits-kalauvalue Opcode ialah 001100101st shift is 000110012nd shift is 000011003rd shift is 000001104th shift is 00000011so final result of Opcode is 000000112. Opcode & 0xF- operand AND bagi value 00000011 dan 00001111so 00000011 & 00001111------------- 00000011 Quote Share this post Link to post Share on other sites
Paralys3r 0 Report post Posted April 13, 2008 opcode means operation code.. biasanya digunakan untuk low level language (i.e assembly language). setiap pemproses memahami set suruhan yang telah dibina ke dalamnya. Suruhan2 ini mempunyai encoding yg tertentu yg dipanggil opcode. Oleh kerana ia hanyalah nombor binary, maka instruction mnemonic dicipta untuk mewakili opcode tersebut.Kalau dalam bahasa manusia, kodif ((Opcode >> 4) & 0xf)bermakna dia nak check bit ke-4 hingga bit ke-7 dalam Opcode samada ia 0 atau tidak. Jika tidak, maka blok dalam if akan dilaksanakan. Quote Share this post Link to post Share on other sites
aXXo 0 Report post Posted April 13, 2008 An explanation:1. Opcode >> 4-shift Opcode to the right by 4 bits-kalauvalue Opcode ialah 001100101st shift is 000110012nd shift is 000011003rd shift is 000001104th shift is 00000011so final result of Opcode is 000000112. Opcode & 0xF- operand AND bagi value 00000011 dan 00001111so 00000011 & 00001111------------- 00000011thanks that really a professional comment now i'm pretty much understand how to use bitwise operation!hat off to you 'BRO Quote Share this post Link to post Share on other sites