Skip to main content
deleted 223 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

____________________________________________

EDIT -
Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

Yes, this question would be a duplicate of Was self-modifying code possible using BASIC?, so I expect it should be immediately closed, and I will paste it into Was self-modifying code possible using BASIC? .

____________________________________________

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

____________________________________________

EDIT -
Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

Yes, this question would be a duplicate of Was self-modifying code possible using BASIC?, so I expect it should be immediately closed, and I will paste it into Was self-modifying code possible using BASIC? .

____________________________________________

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

____________________________________________

EDIT -
Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

____________________________________________

I have added a very useful additional question
Source Link
questiontype
  • 1.1k
  • 8
  • 12

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

____________________________________________

EDIT -
Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

Yes, this question would be a duplicate of Was self-modifying code possible using BASIC?, so I expect it should be immediately closed, and I will paste it into Was self-modifying code possible using BASIC? .

____________________________________________

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?

____________________________________________

EDIT -
Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

Yes, this question would be a duplicate of Was self-modifying code possible using BASIC?, so I expect it should be immediately closed, and I will paste it into Was self-modifying code possible using BASIC? .

____________________________________________

Was Selfself-modifying-code code possible just using BASIC?

Was Selfself-modifying-code possible just using BASIC  ?

PARAMETERSParameters:

  • On commonly affordable home-computers between - Anytime -1984before 1984
  • Code that changes its own instructions while it is executing
  • Just usingUsing BASIC only
  • Not using peek or, poke or assembly language ( Now I know peek and poke are part of the BASIC language, but does not change my question )

POSSIBLE TYPES OF SOLUTIONSPossible types of solutions:

Were there any machines on which the following theoretical / generic example programsprogram might work -?

10 Let Line 20 = Print "word"
20 Print "nothing"

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just -:

10 Let Line 10 = Print "word"

10 Let Line 10 = Print "word"

Or the following theoretical / generic example program pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 Print "10 Print "word"" + [ Ato the screen, is there any special Carriagecarriage-return function / command that makes the computer accept this as the new 'Line 10' ]?

  • In the example above, I'm wondering if you print the new 'Line 10' to the screen, whether there was any special Carriage-return function / command that made the computer accept this as the new 'Line 10', obviously very unlikely there would have been.

UPDATE - NOTENote:

  • If you did get the computer to modify a line ( without using peek or poke or assembly ), and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line.? Outside of program execution mode, command-mode, if you modify a line to be longer than it was, the computer knows how to shift data forward  .

I would probably have to ask a separate question to ask -:

  • How was Selfself-modifying-code used to save space?
  • Were there any other 'interesting'interesting uses for Selfself-modifying-code code that would have been possible on the machines specified in this question?
  • Also, I wonder ifCould you could 'somehow'somehow set a Data-filedata file as the new current program ( surely not via just BASIC, without peek or poke or assembly ), or even how?
  • How many programs( surely only one ) or data-files files could be held at one time.?

Was Self-modifying-code possible just using BASIC?

Was Self-modifying-code possible just using BASIC  ?

PARAMETERS

  • On commonly affordable home-computers between - Anytime -1984
  • Code that changes its own instructions while it is executing
  • Just using BASIC
  • Not using peek or poke or assembly language ( Now I know peek and poke are part of the BASIC language, but does not change my question )

POSSIBLE TYPES OF SOLUTIONS

Were there any machines on which the following theoretical / generic example programs might work -

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just -

10 Let Line 10 = Print "word"

Or the following theoretical / generic example program -

10 Print "10 Print "word"" + [ A special Carriage-return function / command that makes the computer accept this as the new 'Line 10' ]

  • In the example above, I'm wondering if you print the new 'Line 10' to the screen, whether there was any special Carriage-return function / command that made the computer accept this as the new 'Line 10', obviously very unlikely there would have been.

UPDATE - NOTE

  • If you did get the computer to modify a line ( without using peek or poke or assembly ), and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line. Outside of program execution mode, command-mode, if you modify a line to be longer than it was, the computer knows how to shift data forward  .

I would probably have to ask a separate question to ask -

  • How was Self-modifying-code used to save space
  • Were there any other 'interesting' uses for Self-modifying-code that would have been possible on the machines specified in this question
  • Also, I wonder if you could 'somehow' set a Data-file as the new current program ( surely not via just BASIC, without peek or poke or assembly ), or even how many programs( surely only one ) or data-files could be held at one time.

Was self-modifying code possible using BASIC?

Was self-modifying-code possible using BASIC?

Parameters:

  • On commonly affordable home-computers before 1984
  • Code that changes its own instructions while it is executing
  • Using BASIC only
  • Not using peek, poke or assembly language

Possible types of solutions:

Were there any machines on which the following theoretical example program might work?

10 Let Line 20 = Print "word"
20 Print "nothing"

Or just:

10 Let Line 10 = Print "word"

Or the following pseudo-code?

10 Print "10 Print "word"" + [ A special carriage-return that makes the computer accept this as the new 'Line 10' ]

In the example above, if you print the new line 10 to the screen, is there any special carriage-return that makes the computer accept this as the new 'Line 10'?

Note:

  • If you did get the computer to modify a line, and you modified the line to be longer than it originally was, could it unknowingly overwrite part of the following line? Outside of program execution mode if you modify a line to be longer than it was, the computer knows how to shift data forward.

I would probably have to ask a separate question to ask:

  • How was self-modifying-code used to save space?
  • Were there any other interesting uses for self-modifying code that would have been possible on the machines specified in this question?
  • Could you somehow set a data file as the new current program?
  • How many programs or data files could be held at one time?
added 61 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
added 405 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
added 93 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
Became Hot Network Question
added 266 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
added 266 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
added 119 characters in body
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading
Source Link
questiontype
  • 1.1k
  • 8
  • 12
Loading