Solved: Calling MAKE-ROOM/099E

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Solved: Calling MAKE-ROOM/099E

Post by mrtinb »

I've made a small program that start with RAND USR 16515

Code: Select all

  10 REM CODE 5[3]RND[' ][: ] LN [2]{..}TAN ****
     4083 219F40        LD HL,409F
     4086 010500        LD BC,0005
     4089 CD9E09        CALL 099E
     408C C9            RET
     408D 17            "*"
     408E 17            "*"
     408F 17            "*"
     4090 17            "*"
  20 LET A$="AA"
It's made to test call to MAKE-ROOM/099E. Looking at de description of the ROM disassembly online MAKE-ROOM is called with address in HL, and number of bytes to insert in BC. The address set in this program is 409F which is the address of the 2nd "A" in line 20.

I assumed my program would insert 5 spaces in line 20, so the result would be

Code: Select all

  20 LET A$="A     A"
This does not happen. Instead the bottom line is hidden. Commands work, but the bottom line does not shown.

Has anyone used MAKE-ROOM, or know how to insert space in memory? Maybe MAKE-ROOM is the wrong ROM-routine to use.
Attachments
makeroom.p
(944 Bytes) Downloaded 170 times
Last edited by mrtinb on Thu Oct 26, 2017 12:03 pm, edited 3 times in total.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Calling MAKE-ROOM/099E

Post by siggi »

AFAIK that rom routine moves the folling memory away and corrects the pointers. But it does not fill the new space with anything. You have to fill up this new space with data, that may be displayed properly on screen (the orignal data still there seem to confuse the listing routine).

Siggi
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb »

It does not explain why the bottom line gets hidden.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: Calling MAKE-ROOM/099E

Post by Andy Rea »

an extra halt in the display file will upset the display routines... i believe the halt instruction is also the marker for end of lines in basic... so erm maybe it's trying to diplsay more lines than it can...

regards
what's that Smell.... smells like fresh flux and solder fumes...
olofsen
Posts: 189
Joined: Wed Jan 08, 2014 12:29 pm

Re: Calling MAKE-ROOM/099E

Post by olofsen »

The third and fourth bytes of a BASIC line contain its subsequent length - perhaps this should reflect the increased length because of MAKE-ROOM?
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb »

MAKE-ROOM makes a call to a routine which fixes pointers. I assumed it fixed all pointers.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Calling MAKE-ROOM/099E

Post by PokeMon »

It depends where exactly should room made. It could be used for display file, variable section, E_LINE, or STACK (STKBOT/STKEND). Depending on contents of HL several pointers are updated. A BASIC line number is not a pointer and the length of the BASIC line either. And the routine is not intended to be used for the program area, I think.

Bildschirmfoto 2017-10-09 um 20.51.34.png
Bildschirmfoto 2017-10-09 um 20.51.34.png (40.92 KiB) Viewed 3936 times
It is recommended to download this popular copy of Ian Logan's Book.

Bildschirmfoto 2017-10-09 um 20.54.06.png
Bildschirmfoto 2017-10-09 um 20.54.06.png (397 KiB) Viewed 3936 times
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb »

That's the book I'm using. Just thought it would be more detailed.

Thanks for your input. I'll try to fix the BASIC line length, and see if it'll fix it.
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
User avatar
siggi
Posts: 988
Joined: Thu May 08, 2008 9:30 am
Location: Wetterau, Germany
Contact:

Re: Calling MAKE-ROOM/099E

Post by siggi »

It is NOT a good idea to run this routine during SLOW mode. If you insert bytes into a program line, not only the line length will no more fit, but the DFILE is also moved upwards. This could result in a crahs, when the display is generated while the DFILE is moved or before the system variables (pointer to DFILE) are corrected. So try this only during FAST mode!

Siggi

PS: This routine may of course also used in program area (see comment!)
My ZX81 web-server: online since 2007, running since dec. 2020 using ZeddyNet hardware
http://zx81.ddns.net/ZxTeaM
User avatar
mrtinb
Posts: 1906
Joined: Fri Nov 06, 2015 5:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb »

Maybe I should just try to insert a new line, and not modify an existing one.

Thanks for your feedback
Martin
https://zx.rtin.be
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube
Post Reply