computer organization& architecture for s4 cs home course plan lecture notes tutorials labs assessments a program that allows the classroom to extend onto the web. this program allows a common place for students to go for many classroom resources. using moodle, you can post news items, assign and collect assignments, post electronic journals and resources, and more. moodle
assembly language programming date of evaluation: 25th and 26th feb,2007 compare the byte in al to the byte in memory location ds:1234h. jump to the label big: if the contents of al are equal to or larger than the contents of memory location ds:1234h and store the larger value in dx.jump to the label small: if the contents are smaller than the contents of ds:1234h and store the smaller value in bx. take the smaller of 2 words stored in memory locations ds:1234h and ds:5678h and store it in register ax swap the bytes in register di such that the least significant byte of di becomes the most significant and reverse. count the number of bytes located in memory from ds:1000h to ds:1010h that are greater than 77h. put the count in register cx. write a procedure to print the factorial of a given number. use equ directive to declare constants. three sets of 1 byte numbers are stored in three separate areas of memory. one set is stored from address 60000h to 6001fh, the second set from 60030h to 6004fh and the third set from the address 600a0h to 600bfh. add together the 3 bytes, 1 from each set, that are stored in the same order in memory. place the sum of each group of 3 bytes in memory beginning at the location 600d0h. state your plan for arranging the sum of each trio in memory and the total memory address range required to store the sums. put a random word in offset location ds:1000h and another random word in the location ds:1010h. increment the word at offset 1000h and then decrement the word at 1010h, until the two words are equal in magnitude. warning ! do not let the words "pass" each other by forgetting to check for equality before incrementing or decrementing. the number a3h is somewhere in memory between ds:1000h and ds:1400h. find the first offset address that contain a3h and put the offset address in register bx. create a stack area at 1000h. push 10h bytes, located at the data memory addresses 60000h to 600ffh, on the stack using indirect addressing. then pop the stack to memory addresses 62000h to 620ffh using indirect addressing. load unique data into the 10h bytes in order to test the program. use the stack to get the ip register to the ax register. write a small procedure that adds 2 words together and stores the results in cx(high word) and dx(low word). call the procedure from a program that loads the words to be added together in registers ax and bx. write a small procedure that adds 2 words together and stored the results in cx
(high word) and dx (low word). call the procedure from a program that creates a new stack area below the existing stack area and passes the 2 words that are to be added together on the new stack.
5 write a program to print a paragraph on the monitor until th key 'q' is pressed on the keyboard. write a program to find the smallest data in an array and store it in memory write a program to sort an array of data in the descending order. (refer to the instruction xchg) write a program to generate all possible prime numbers less than the given data. write a program to find the length of a string. write a program to verify whether an input string is a palindrome or not. write a program that gets the number from the user, and calculates factorial for it. write a program to build a command prompt based simple calculator ( example of calculation: ; input 1 <- number: 10 ; input 2 <- operator: ; input 3 <- number: 5 ; ------------------; 10 - 5 = 5 ; output -> number: 5 ) draw a "happy face" on the screen made up of character 'o'. the face must be close to a ciircle. remember: a happy face has no nose. have the program terminate and return to dos when the 'q' key is pressed ( ref to int 21h, int 10h,int 16h) calculator-sample program factorial-sample program
3 move the contents of register ax to registers bx,si and ds move the contents of register dl to registers ah,bh and cl move the word contents of memory location ds:0ffch to register di move the byte contents of memory location ds:1234h to register dl move the content of register bx to memory location ds:3000h move the word content of memory location ds:1234h to memory location ds:5678h move the content of memory location ds:1acdh to register es interchange the contents of ergisters di and si. interchange the byte contents of memory location ds:1234h with the contents of memory location ds:5678h store the number 5678h in memory location ds:2000h using indirect addressing only store the contents of memory location ds:1234h in register bx using indirect addressing only. store the word contents of register ax at the word memory location ds:1234h store the number 1234h in the absolute memory address 60000h
move the number at absolute memory address 80000h to dx move the number 6000h to memory address ds:6000h move the word 3456h from the location 12000h to 15000h. ds has 1000h. bp contains 4000h. load 16 bit address to appropriate registers and move 80h from the memory location 65000 to dx. bx has 2000h, si has 1000h. move the content at the location 50000h to the register cx using based index addressing. load 8bit number in dx and dx. add the contents and put the result in dx ds has 2000h. load the register bx with 20h and 10h is stored at the location 20000h. add them and store the result at 20000h. ds has 3000h. load the register dx with 50h and 30h is stored at the location 30000h.subtract 30h from 50h and store the result at 30000h. use register bx and displacement b2h and register relative addressing to add a memory location to the cx, and then puts the result back into the memory location use a displacement of 0524 and direct addressing to add the number 2a59 to a memory location and put the sum back into the memory location use the register relative addressing to subtract the contents of a word in memory from ax and puts the results in ax. use direct addressing to move a byte to a memory location and multiply it with ax.
2 write an asp in 8085 to multiply two 8 bit numbers. write an asp in 8085 program to count the 1�s in an 8 bit data. write an asp in 8085 program to divide two 8 bit numbers. write a program to find the largest of 16 numbers. write a program to find the smallest of 16 numbers. write a program to count number of odd and even numbers in a block of 16 bytes. write a program to find the number of zeroes, positive numbers and negative numbers in a block of 16 data. write a program to find the average of 5 numbers. write a program to find the sum of squares. write a program to arrange a string ( of numbers) in the ascending order. 1 write logical steps to add a2h and 18h. both numbers should be saved for future use. save the sum in accumulator. write a program to subtract 56h from 99h. inrement the accumulator content. compare data byte c2h with the content of the accumulator and observe the flags. write a program to subtract 45h from 86h and . add 21h with the result and copy the result to the memory location 3000h. perform logical and and or with the numbers 77h and 87h and transfer and results to registers c and d. decrement the registers. input two numbers in registers b and c and store the sum in accumulator. copy the result to a memory address 2005h send the address to bc pair. add 45h and 34h and move the sum to memory locaton 2000. add 23h and 12h and move the sum to memory locaton 3000. retrieve both results and perform logical or operation and send the result to the register d. observe the flag registers. subtract 23h from 67h and send the result to the address 1013 and increment the contents of memory location. move 33h to register b and 77h to register c and calculate the sum. add 88h to the result and move the result to the address 2020. subtract 34h from 67h and store the result at the address 300b. decrement the result by two and send the result to the accumulator.
store two numbers in registers d and e and send the content to two different memory locations. perform any logical operation on them and send the result to a third memory location. increment the contents of memory location 201ch, which presently holds 7fh. tthe hl register contain 201ah. specify the contents of the entire register if it is incremented by 1. assume the contents of register b=20h, c=50h, and the memory location 2050 has 9fh. transfer the contents of the memory location 2050h to the accumulator. assume that the contents of the accumulator are f9h and the contents of the registers b and c are 20h and 50h respectively. store the accumulator contents in the memory location 2050h. rotate the contents of the accumulator left through carry, assuming the accumulator has a7h and the carry flag is reset. rotate the contents of the accumulator right through carry, assuming the accumulator has a7h and the carry flag is reset.