FAQs and Hints

 

Last Save:27-Sep-02

This handout will be updated from time to time with emailed questions that seem to have general interest. Everyone learns at different rates and is at different stages in understanding. Some of these questions may look trivial to you once you are past that learning stage, but may prove a significant stumbling block to someone who is not as far along. Hopefully by the exam you will all be up to speed.

Current topics:

Lab – General Interest 1

Lab – Specific. 1

General Assembly Programming. 1

Assembler Addressing Modes. 1

 

Lab – General Interest

1.       Where can I find facilities outside the lab to work on the labs?

The design centre has Ultragizmo stations available and you can link to the assembler from any internet-enabled machine using Terra Term, as described in the lab manual. Simulators are also available (see the website) but are not supported.

The regular labs are only available when a TA is present.

2.       Are there resources available on the internet?

On the issue of internet resources, it is always good to consult extra material and get ideas. I cannot recommend a particular website but I can tell you that consulting material from the Motorola website may be useful to familiarize yourself thoroughly with the 68000 instruction set, as well as your textbook. However, I think that completing the labs successfully can be achieved through understanding material explained in the class lectures as well as present in the textbook, careful reading of the lab manual as well as understanding concepts specific to the Gizmo board specified in the manual, and of course, practice and testing before the lab.

3.       How do I FTP to an ugsparc account?

Use SCP instead of FTP which provides a secure shell (the same as when you ssh to some) for your link to the ugsparc network.

 

Lab – Specific

1.       In Lab 1 we are to test programs but how do we access the UltraGizmo boards?

When you are requested to "test" your lab program, it is assumed that this will be done in the lab.  Please remember that for these simple programs (ie anything before the final project), writing an assembly language program that follows your pseudocode and compiles should give you enough of a head start to get your code working during the lab time. 

Otherwise, if you REALLY want to test your program before the lab, please go to the design center found in the basement of SF (Rm 540 I think). 

There is no way to "remotely" access the gizmo boards.

2.       In Lab M3 I can write a Fibonacci sequence more compactly without a subroutine. Is that OK?

No. You must use a subroutine and you must demonstrate recursive calls and callee or caller save. Use the model of the pseudocode given in the lab writeup.

 

 

General Assembly Programming

1.       Can’t find the problem

Some things you might want to try --

2.       Appendix C of the text doesn’t seem to be giving me all the information I need

If Appendix C proves inadequate to get the 68000 information you want, check out the motorola website and look for the 68000 Programmers Reference Manual (M68000PM) and the 68000 or 68306 Users Manual. Or just write a small program and see what it does (the kick-it-and-see approach).

Assembler Addressing Modes

1.       Given I set one address register (a0)to point to a specific location in memory. If I now wish for a0 to point to a memory location 2 words down from a0's initial memory location, how would I code it?

Say a0 contains (points to) $1000.

You could then use indexed mode to get to $1002: ex add.w 2(a0),d0

This would not change the value of a0.

You could also load a register, say d1, with the value of 2, and get to $1002 using a more complex addressing mode: add.w $0(a0,d1),d0

Again the value in a0 would not change.

Or you could first move the pointer then do the operation:

tst (a0)+

add (a0),d1

2.       I get a "invalid register expression" for this instruction in my program:
move.w          (d0), d1
d0 contains the address of the next instruction to be interpreted.
I was intending to place the first word (the op-code) into register d1.

The reason you are getting the error "invlaid register

expression" is that you are trying to treat d0 the same way you would

treat an address register.  If you go to Appendix C and look at the valid addressing modes (see the headings at the top), you will note that there is no column (Dn).  This is why the instruction set provides you with address registers which can act like pointers.  You must use an address register (a0 through a7) and rewrite the instruction as:

move.w (a0), d1 ;moves the word value stored at the location ;specified in a0 to d1