8086 Assembler ...I need the code for the following problems to do a few things.....try and include inline comments so i could understand them better... that could help me out..
PLEASE!..Thanks

1. Count the number of bits, in the double word that starts at memory location DS:1234h, that are 1. Place the count in register AL.

2. Count the number of bytes, between location 60000h and 60100h, that are an even number. Place the count in register BH.

3. Move the 100h bytes located from 60000h to 600FFh to locations 60200h to 602FFh, in reverse order. The byte located at 60000h is stored at location 602FFh and so on until the byte located at 600FFh is stored at location 60200h.

4. Move every byte of data from memory locations 60000h to 600FFh to memory addresses 601C0h to 602BFh. As the data is moved, count the number of bytes that are greater in magnitude than 7Fh, using register DX to hold the count.

5. Repeat Problem 4 for data of word length. Count the number of words that exceed 7FFFh in magnitude, using register DL to hold the count. State your assumptions as to how bytes of the word are stored in memory.

6. Count the number of bytes, stored from memory address 60000h to 60200h, that are smaller than or equal to the number 4Bh. Use register CX to hold the count.

7. Add together all of the 2-word numbers that are stored from address 60000h to 60FFFh in memory. Store the sum starting at location 61020h. Each 2-word number may range in size from 00000000h to FFFFFFFFh. State your assumptions as to how the words for each number are stored in memory and how large the final some can be.

Help would be so great right now.. my teacher is dumb as a box of rocks.. and i need to learn this stuff.... remember to inline comment everything if you could so i can understand the code....

Thanks again!!

All 2 Replies

We're not going to do your homework for you. Show you made an effort, and then you may get some help.

commented: Agreed - Salem +6

TITLE "Program to add 2-words numbers"
.MODEL small; this defines the memory model
.STACK 100 ; define a stack segment of 100 bytes
.Data ; this is the data segmentll
.Code ;this is the code segment
MOV AX,6000H ;ASCII segment
MOV DS,AX
mov cx,0fffH
mov SI,0000h
addwords:
mov AX,[SI]
mov BX,[SI+2]
add Ax,[SI + 4]
adc BX,[SI+6]
add SI,0008h
cmp SI,CX
jl addwords
mov DI,1020H
mov [DI],ax
mov [DI + 2],bx
mov ah,4cH ; Exit to DOS function
int 21h
end

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.