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: 503
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

Solved: Calling MAKE-ROOM/099E

Post by mrtinb » Mon Oct 09, 2017 12:08 pm

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 5 times
Last edited by mrtinb on Thu Oct 26, 2017 11:03 am, edited 3 times in total.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
siggi
Posts: 751
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Calling MAKE-ROOM/099E

Post by siggi » Mon Oct 09, 2017 1:09 pm

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
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
mrtinb
Posts: 503
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb » Mon Oct 09, 2017 1:33 pm

It does not explain why the bottom line gets hidden.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
Andy Rea
Posts: 1263
Joined: Fri May 09, 2008 1:48 pm
Location: notts UK

Re: Calling MAKE-ROOM/099E

Post by Andy Rea » Mon Oct 09, 2017 4:58 pm

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
6 x ZX81, 1 x TS1500 , 1 x +3e, 1 x timex 2040 printer, 1 x timex 2020 cassette deck, siclair printer and some spectrum

olofsen
Posts: 123
Joined: Wed Jan 08, 2014 11:29 am

Re: Calling MAKE-ROOM/099E

Post by olofsen » Mon Oct 09, 2017 6:01 pm

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: 503
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb » Mon Oct 09, 2017 6:58 pm

MAKE-ROOM makes a call to a routine which fixes pointers. I assumed it fixed all pointers.
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
PokeMon
Posts: 2126
Joined: Sat Sep 17, 2011 5:48 pm

Re: Calling MAKE-ROOM/099E

Post by PokeMon » Mon Oct 09, 2017 7:57 pm

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 152 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 152 times

User avatar
mrtinb
Posts: 503
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb » Mon Oct 09, 2017 8:50 pm

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
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

User avatar
siggi
Posts: 751
Joined: Thu May 08, 2008 8:30 am
Location: Dauernheim, Germany
Contact:

Re: Calling MAKE-ROOM/099E

Post by siggi » Mon Oct 09, 2017 9:06 pm

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
http://zx81-siggi.endoftheinternet.org/index.html

User avatar
mrtinb
Posts: 503
Joined: Fri Nov 06, 2015 4:44 pm
Location: Denmark
Contact:

Re: Calling MAKE-ROOM/099E

Post by mrtinb » Mon Oct 09, 2017 9:39 pm

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

Thanks for your feedback
Martin
ZX81, Lambda 8300, Commodore 64, Mac G4 Cube

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests