It is currently Mon Oct 20, 2014 4:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Jul 14, 2011 4:27 pm 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
I have a program that a mixture of assembler and basic.
I load it in and relocate it in assembler (from a *RUN command from disc)
but then I want to run the basic part of it

To do that I think I want to perform these commands:

PAGE=&2E00:OLD:RUN

How do I do that from assembler?

OSCLI only works for * Commands I think.

- PJ


Top
 
PostPosted: Thu Jul 14, 2011 6:37 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
You can do it by inserting the characters into the keyboard buffer, and then returning back to BASIC. (You can also do it by programming a soft key with *KEY, and then inserting just that into the keyboard buffer, but this won't work if you have something valuable between &B00 and &BFF).

Here's an example:
Code:
\ insert command into keyboard buffer, character by character
LDX #0
.insertloop
TXA
PHA
LDA #138
LDY command,X
LDX #0
JSR &FFF4
PLA
TAX
INX
CPX #commandend-command
BNE insertloop

\ turn off VDU output (otherwise you'll see the commands being 'typed' into the keyboard buffer)
LDA #21
JSR &FFEE

\ enter BASIC
\ note: if the machine code was definitely called from BASIC, you can just put an RTS instead
LDX #basic MOD 256
LDY #basic DIV 256
JMP &FFF7

.command
\ abbreviated as much as possible, to avoid filling up the keyboard buffer
EQUS "PA.=&2E00"
EQUB 13
EQUS "O."
EQUB 13
EQUS "RUN"
EQUB 6    \ reenable VDU output just before 'pressing' RETURN
EQUB 13
.commandend

.basic
EQUS "BASIC"
EQUB 13

Untested, but should do the trick!


Last edited by RichTW on Thu Jul 14, 2011 8:42 pm, edited 1 time in total.

Top
 
PostPosted: Thu Jul 14, 2011 8:37 pm 
Offline
 Profile

Joined: Fri Nov 07, 2008 2:28 pm
Posts: 65
Thanks!
Worked first time!!


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron