hi!

i'm starting to program in asm (i have a school project).

i'm programming in intel asm for an 8088 simulator (the one in
tanenbaum's "structured computer organization" book)

i have a question:

is it a mistake to write subroutines that use variables to store
(intermediate and return) values?
shouldn't they only use registers?

this way, you know you can always take that routine and put it wherever
you want, without having to use the variable too.

am i correct?
thanks

asy

I think it can only be stored in registers as different banks are used to store data depending on the microcontroller you are using you could select different banks, in 8051 there are 4 different banks each containing 8 registers.

sorry but your answer is not very clear to me..

how does it relate to my original question?

thanks
asymmetric

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.