Jump to content

Assembly - homework help?

MrNoreee

Can anyone help me with this problem??  Thanks in advance!

 

Write the assembly code to specify an array named src that holds values: 01, 23, 45, 67, 89, and an array of five variables named dst, then write the code to copy the values in array src to array dst.

Link to comment
Share on other sites

Link to post
Share on other sites

What language?

01010010 01101111 01100010  01001101 01100001 01100011 01010010 01100001 01100101

Link to comment
Share on other sites

Link to post
Share on other sites

Assembly code, please :3  

 

What have you done so far? What are you having problems with? What instruction set are you targeting?

Link to comment
Share on other sites

Link to post
Share on other sites

Data segment:

array_size equ 5src_array db 01, 23, 45, 67, 89dst_array db array_size dup(0)

these are stored in bytes, it's enough for these values, change it out for whatever you need.

 

Code segment:

cp_loop:  mov bx, 0  mov al, src_array[bx]  mov dst_array[bx], al  inc bx  loop cp_loop

This is from the top of my head, I'm sure you can do it better. Also you might need to change the registers appropriately, since this is for the Intel8086, the one I have most experience writing Assembly for.

Link to comment
Share on other sites

Link to post
Share on other sites

we talkin java?

 

 

What language?

Assembly, otherwise he wouldn't have said assembly...

Link to comment
Share on other sites

Link to post
Share on other sites

Assembly, otherwise he wouldn't have said assembly...

well duh, we figured that out when we came back to see if he replied.

You already knew we probably didn't know what assembly was so don't reply twelve hours later with redundant info implying we're idiots

Shipping sucks

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×