Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Assembly Coding help 1. Write assembly code for each of the following decision structures. a. IF AX < 0 THEN PUT -1 IN BX END_IF
Assembly Coding help 1. Write assembly code for each of the following decision structures. a. IF AX < 0 THEN PUT -1 IN BX END_IF b. Suppose DL contains the ASCII code of a character. IF (DL >= 'A') AND (DL <= 'Z') THEN display DL ELSE output a zero END_IF c. IF (AX < BX) OR (BX < CX) THEN put 0 in DX ELSE put 1 in DX END_IF 2. Employ LOOP instructions to do the following: a. put the sum of the first fifty terms of the arithmetic sequence 1,5,9,13,... in DX. b. Read a character and display it 80 times on the next line. 3. Perform the following logic operations a. 10101111 AND 10001011 b. 10110001 OR 01001001 c. 01111100 XOR 11011010 d. NOT 01011110 4. Give a logic instruction to do each of the following a. Clear the even-numbered bits of AX, leaving the other bits unchanged. b. Set the most and least significant bits of BL, leaving the other bits unchanged. c. Complement the msb of DX, leaving the other bits unchanged. d. Replace the value of the word variable WORD1 by its one's complement. 5. Use the TEST instruction to do each of the following. a. Set ZF if the the contents of AX is zero. b. Clear ZF if BX contains an odd number. c. Set SF if DX contains a negative number. d. Set ZF if DX contains a zero or positive number e. Set PF if BL contains an even number of 1 bits. 6. Use the Bit Test and Jump instructions to do the following a. Complement the msb of DX, leaving the other bits unchanged b. Jump to label DONE if bit 4 of EAX is 1 c. Jump to label L2 if bit 5 of CL is 0 7. Write instructions that will do the following a. Change the right most 1 bit (i.e. the lowest bit that is a 1) in AX to 0 while preserving the other bits. b. Change the left most 1 bit (i.e. the highest bit that is a 1) in AX to 0 while preserving the other bits.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started