Add Machine Code to BASIC

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
solaris104
Posts: 14
Joined: Thu Jun 04, 2015 7:28 pm

Add Machine Code to BASIC

Post by solaris104 »

I have machine code in file and I want to add to BASIC program 1 REM. Exists any tools for it?
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Add Machine Code to BASIC

Post by Paul »

In theory, there is no difference between theory and practice. But, in practice, there is.
solaris104
Posts: 14
Joined: Thu Jun 04, 2015 7:28 pm

Re: Add Machine Code to BASIC

Post by solaris104 »

I have long BASIC program in *.p format and I cannot overwrite it machine code from file. How I insert it with ZX81-IDE?
User avatar
Paul
Posts: 1517
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Add Machine Code to BASIC

Post by Paul »

You can load your p file and edit it there.
All basic commands are supported.
Then you add a REM statement and your machine code.
Ide puts your code there. Ten line can be anywhere in code.
There are some explanation there in the tread as well as some how to

You will need to learn a bit though. The IDE is very powerful. You will greatly benefit from what you learn.
kind regards Paul
In theory, there is no difference between theory and practice. But, in practice, there is.
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Add Machine Code to BASIC

Post by PokeMon »

solaris104 wrote:I have long BASIC program in *.p format and I cannot overwrite it machine code from file. How I insert it with ZX81-IDE?
You may open the .p file via "Open ZX binary" in file menu and this will probably work if not assembly inside the .p file.
Here you find a more detailed description and "how to" instructions:
viewtopic.php?f=6&t=1064
User avatar
XavSnap
Posts: 1941
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Add Machine Code to BASIC

Post by XavSnap »

Move the RAM_top, copy the machine code using LDIR...
Load your program.

But, :shock:
If the previous machine code is located in a REM, edit the program to create a new line to reserve ASM room!
The code MUST be paste at the same address offset!
...
or use the Xur Tools.
P>text using SAVE"New.TXT"
ASM p>text SAVE"ASM.TXT"

Copy the text ASM rem to the "new" P file.
Reload the "new" file in the explorer window.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply