Member Avatar for OzY360

Hello. I have been assigned a programming task which is to be completed using assembly language for motorolla 68k (os9). I will attach the assignment brief to the email and a copy of the source code in a txt file. I have to adapt the code so that it does the following things:

1. Ask for and read in an array of characters,

2. Reverse the order of the characters in the array by means of a loop that pushing them on your user stack and then pops them back to the array

3. Print out with a suitable header the reversed order array.

4. Push three word values defined by you from memory onto your user stack

5. Use a subroutine to add together the words and return the answer to the stack

6. Force the calling programme to retrieve the answer and place it in a memory location.

7. Print this answer as a string to the screen.

All IO must be neatly formatted and use suitable dialogue and headings.


any help and/or insights you can offer will be very much appreciated. Thank you.

Recommended Answers

All 6 Replies

Member Avatar for OzY360

i shud add that il b very annoyed if sum 1 just posts the solution up so that i get an easy A. I dont care about gettin an A i want to learn Assembly!! In particular for this excercise i would like to understand arrays in more depth as i am confused about this particular concept. Please remember that i need help with assembly language specific to Motorolla 68k. I've been sittin here all day thinking about the problem but i'm stumped so i've tried looking at many other resources. Thank you for any insights that ya'all can offer.

Member Avatar for OzY360

ppl please i'm just looking for a push in the right direction not for any 1 2 solve this problem for me. I'm getting pretty desperate as i have to hand this work in soon.

Dunno, it's been 15+ years since I last did any 68K work.

But the essence of arrays is to load the address of an array into an 'a' register, and load the subscript into a 'd' register.

Then look for the various indexed addressing modes, something like
move.b d1, a0(d0)

There might even be auto-incrementing modes, like
move.b d1, a0(d0+)

Member Avatar for OzY360

hi, thx for ur reply i really appreciate it. I think i have a working solution now ;) i will post it up in a while so that you can take a look.

Member Avatar for OzY360

here is a copy of the source code. its attached with this message.

Member Avatar for OzY360

hey every 1 ive managed to solve this problem so i'm going 2 mark this as solved ;)

Be a part of the DaniWeb community

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