anyone know ASM?

Thread Starter

ABoul

Joined Mar 30, 2009
15
the question is attached. i honestly have no clue how to do any of it; i would appreciate it if someone could briefly walk me through what they know.

EDIT: the only thing i could manage to work out is that in part (i), after the first 3 lines the stack pointer is now at 9998 with the top position (9999) being Y.
 

Attachments

Wendy

Joined Mar 24, 2008
23,809
This is obviously homework.

I can get you started. When you call a subroutine the two byte values that is the return address is put on the stack. The stack is a temporary storage location for addresses, when you run the return command these values are pulled from the stack and used to take the program back where the subroutine was called.

Like I said, the stack stores addresses on a temporary basis, it uses Last In First Out. Basically the last address stored there is the first to pop out (BTW, this directly relates to the POP command).

There is a lot of variation between assy languages, though they have certain basics in common. You might specify what CPU you are using.

I may have repeated what you already knew. If so you need to get more specific with your question(s).
 

Thread Starter

ABoul

Joined Mar 30, 2009
15
This is obviously homework.

I can get you started. When you call a subroutine the two byte values that is the return address is put on the stack. The stack is a temporary storage location for addresses, when you run the return command these values are pulled from the stack and used to take the program back where the subroutine was called.

Like I said, the stack stores addresses on a temporary basis, it uses Last In First Out. Basically the last address stored there is the first to pop out (BTW, this directly relates to the POP command).

There is a lot of variation between assy languages, though they have certain basics in common. You might specify what CPU you are using.

I may have repeated what you already knew. If so you need to get more specific with your question(s).
for part (i) is this the answer?

line number | SP | content of stack
-----------------------------------
100 | 9999 | <nothing>
102 | 9999 | <nothing >
104 | 9998 | Y
106 | 9997 | <?>*

*don't know what to put here

?
 
Last edited:
Top