So I'm tasked with writing a subroutine to access a certain element of an array. When the subroutine is called, the pointer that points to it is [bp+1]. How would I make it so I could access say the 10th element of this array in the sub routine?
Locke123
0
Newbie Poster
Recommended Answers
Jump to PostSince you've specified that the pointer is in [BP+1], I will assume that you are using 16-bit registers. [BP+1] does however sound a bit odd, given that arguments in a 16-bit segment should be 2 bytes and therefore BP offsets should always be even. nevertheless, I'll use your address. First …
Jump to PostBP+1 does sound odd due to the fact that this would refer only
to the second byte of the subroutines return address, and because
WORDs are pushed and popped off the stack, thus the indexes would
normally be an even value when indexing into the stack.
After setting up a …
All 5 Replies
sbesch
2
Newbie Poster
NotNull
23
Posting Whiz in Training
sbesch
2
Newbie Poster
NotNull
23
Posting Whiz in Training
sbesch
2
Newbie Poster
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.