CALL subroutine and Monitor subroutine difference

Building your first 6502-based project? We'll help you get started here.
Post Reply
Kris1978
Posts: 41
Joined: 21 May 2018

CALL subroutine and Monitor subroutine difference

Post by Kris1978 »

At memory location $FBDD in the Monitor (Apple II/e), resides a subroutine that beeps the speaker.

If we try to call that subroutine from Integer BASIC, we have to use CALL 768 (where 768 is in decimal form and it's equivalent in hexadecimal is $300)

Normally the correct one shouldn't be CALL 64477? (which is the decimal equivalent of $FBDD)

It should but according to Apple II reference manual, locations above 32767 are specified using negative numbers.

Okay but that doesn't mean that CALL 768 is still wrong?

Nevertheless, it's NOT wrong, it's correct, since the speaker beeps!

Why? :?
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: CALL subroutine and Monitor subroutine difference

Post by BigEd »

It looks to me like $300 is a common place to put user code - have you already done some POKE or code-loading action which set up a routine at $300?

CALL -1059
might be the right invocation in Basic to JSR to $FBDD
Kris1978
Posts: 41
Joined: 21 May 2018

Re: CALL subroutine and Monitor subroutine difference

Post by Kris1978 »

Correct!

Thank you! :)
User avatar
barrym95838
Posts: 2056
Joined: 30 Jun 2013
Location: Sacramento, CA, USA

Re: CALL subroutine and Monitor subroutine difference

Post by barrym95838 »

Nicely done, Ed! I imagine that Integer BASIC Apple ][s are about as common as hen's teeth on your side of the pond, but you nailed the response.
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)
User avatar
BigEd
Posts: 11463
Joined: 11 Dec 2008
Location: England
Contact:

Re: CALL subroutine and Monitor subroutine difference

Post by BigEd »

Cheers Mike, indeed, pretty rare but not never seen. In fact I think there were one or two at the recent ABUG meetup. But as it happens I just did a bit of web searching - if I'd been really diligent, or if I'd thought of it, I might have fired up an emulator...
Post Reply