{"id":189,"date":"2020-04-05T07:04:52","date_gmt":"2020-04-05T07:04:52","guid":{"rendered":"https:\/\/temp.ashkerala.com\/?p=189"},"modified":"2020-04-05T07:04:52","modified_gmt":"2020-04-05T07:04:52","slug":"computer-architecture-3","status":"publish","type":"post","link":"https:\/\/temp.ashkerala.com\/?p=189","title":{"rendered":"Computer Architecture-3"},"content":{"rendered":"<p><strong>Q. What is the main difference between 16 bit and 32 bit versions of C\/C++ while using in line assembler.<\/strong><\/p>\n<p> <strong>Ans<\/strong> The 32-bit applications are written using Microsoft Visual C\/C++ for windows and the 16-bit applications are written using Microsoft C\/C++ for DOS. The main difference is that Visual C\/C++ for windows is more common today, but does not easily call DOS functions such as INT21H.<\/p>\n<p> <strong>Q. Explain data addressing modes (with examples) available in microprocessors.<\/strong><\/p>\n<p> <strong>Ans, Direct Mode:<\/strong><br \/> \u0393\u00c7\u00f3 Instruction includes memory access.<br \/> \u0393\u00c7\u00f3 CPU accesses that location in memory.<br \/> Example:<br \/> LDAC 5<br \/> Reads the data from memory location 5, and stores the data in the CPU\u0393\u00c7\u00d6s accumulator.<\/p>\n<p> <strong>Indirect Mode:<\/strong><br \/> \u0393\u00c7\u00f3 Address specified in instruction contains address where the operand resides.<br \/> Example:<br \/> LDAC @5 or LDAC (5)<br \/> Retrieves contents of location 5, uses it to access memory address.<\/p>\n<p> <strong>Register Direct and Register Indirect Modes<\/strong><br \/> \u0393\u00c7\u00f3 Does not specify a memory address. Instead specifies a register.<br \/> Example:<br \/> LDAC R<br \/> Where R is a register containing the value 5.The instruction copies the value 5 from register and into the CPU\u0393\u00c7\u00d6s accumulator.<\/p>\n<p> <strong>Immediate Mode<\/strong><br \/> \u0393\u00c7\u00f3 The operand specified in this mode is the actual data it self.<br \/> Example:<br \/> LDAC #5<br \/> Moves the value 5 into the accumulator.<\/p>\n<p> <strong>Implicit Mode<\/strong><br \/> \u0393\u00c7\u00f3 Does not exactly specify an operand. Instruction implicitly specifies the operand because it always applies to a specific register.<br \/> Example:<br \/> CLAC<br \/> Clears the accumulator, and sets value to zero. No operands needed.<\/p>\n<p> <strong>Relative Mode<\/strong><br \/> \u0393\u00c7\u00f3 Operand supplied is an offset, not the actual address. Added to the contents of the CPU\u0393\u00c7\u00d6s program counter register to generate the required address.<br \/> Example:<br \/> LDAC $5 is located at memory location 10, and it takes up two blocks of memory.<br \/> Thus the value retrieved for this instruction will be 12 + 5, and will be stored in the accumulator<\/p>\n<p> <strong>Index Mode and Base Address Mode<\/strong><br \/> \u0393\u00c7\u00f3 Address supplied by the instruction is added to the contents of an index register.<br \/> \u0393\u00c7\u00f3 Base address mode is similar except, the index register is replaced by a base address register.<br \/> Example:<br \/> LDAC 5(X) where X = 10<br \/> Reads data from location (5 + 10) = 15 and stores it in the accumulator.<\/p>\n<p> <strong>Q. (i) Convert binary number in two&#8217;s compliment form 0100 1000<br \/> (ii) Convert hexadecimal BCH to decimal<\/strong><\/p>\n<p> <strong>Ans<\/strong>. 01001000 =&gt; 10111000<br \/> BCH =&gt;1011 1100 =&gt; 188.<\/p>\n<p> <strong>Q. Write a Program in assembly language to find the largest of n numbers stored in the memory.<\/strong><\/p>\n<p> <strong>Ans<\/strong><br \/> MOV AX, 0000<br \/> MOV SI, 0200<br \/> MOV CX, [SI]<br \/> BACK : INC SI<br \/> INC SI<br \/> CMP AX, [SI]<br \/> JAE GO<br \/> MOV AX, [SI]<br \/> GO: LOOP BACK<br \/> MOV [0251], AX<br \/> INT 3.<\/p>\n<p> <strong>Q. Write an assembly language program to find one\u0393\u00c7\u00d6s complement and two\u0393\u00c7\u00d6s complement of an 8-bit number<\/strong><\/p>\n<p> <strong>Ans One\u0393\u00c7\u00d6s complement of an 8-bit number<\/strong><br \/> LDA 2501H<br \/> CMA<br \/> STA 2502H<br \/> HLT.<br \/> <strong>Two\u0393\u00c7\u00d6s complement of an 8-bit number<\/strong><br \/> LDA 2501H<br \/> CMA<br \/> INR A<br \/> STA 2502H<br \/> HLT.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Q. What is the main difference between 16 bit and 32 bit versions of C\/C++ while using in line assembler. Ans The 32-bit applications are written using Microsoft Visual C\/C++ for windows and the 16-bit applications are written using Microsoft C\/C++ for DOS. The main difference is that Visual C\/C++ for windows is more common&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"categories":[18],"tags":[],"class_list":["post-189","post","type-post","status-publish","format-standard","hentry","category-computer-architecture-and-organization"],"_links":{"self":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/189","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=189"}],"version-history":[{"count":0,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=\/wp\/v2\/posts\/189\/revisions"}],"wp:attachment":[{"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=189"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=189"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/temp.ashkerala.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=189"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}