Re: Commodore 128 Basic 7.0 One Liner Competition 2008




1000 inc $d020
1003 jmp $1000

It is funny that you mentioned that. That is what I did for a test
program.

The way I see it, there are essentially 3 ways to execute machine code
from BASIC.

1) The first way is the boring old DATA statements with numbers and
commas. Trouble is, you can only get about 10 instructions because
the numbers tend to be 3 digits plus the comma, plus the for-next loop
to put them in. You can't fit too many inside a single BASIC line.

2) You can define a string inside quotes at the beginning and use a
for-next loop combined with something like ASC(MID$(A$,1,1)) to read
the characters in the string and put them into memory. This is the
technique I'm working with at the moment. Obviously one might run
into certain numbers that might not be definable in a standard string
due to PETSCII limitations ($00 comes to mind), but I have not had
that problem so far.

3) You could put a REM statement at the end of the line with a bunch
of characters in quotes and have a SYS command at the beginning of the
line which would execute the code from the exact calculated spot where
the REM statement should be stored in BASIC RAM.

There may be other ways, but so far these are the only 3 ways I can
think of where you could load an ML program yet keep the program
limited to a single line of BASIC code.
.



Relevant Pages

  • Re: Open, Close, & Freefile
    ... statement adds characters such as quotes around string data. ... Write #fnum, "This is some text..." ... VB writes out the quotes whether a literal or in a variable. ... It is imo on the same line as using the trailing "$" on string intrinsics to ensure the character version is returned as opposed to Variant when that is what is intended, etc., ... ...
    (microsoft.public.vb.general.discussion)
  • Mandis Quotes (aka retiring """ and )
    ... arbitrary textual matter called "Mandis quotes". ... surround the string by a pair of doubled single quotes. ... of ASCII or Unicode characters, but instead as a sequence of lines ...
    (comp.lang.python)
  • Re: list or not a list?
    ... grouping character of quotes inside a string, that is used as a list. ... I thought, that the blank-separated characters in the string, treated ... as list, will be recognized as list elements, but I can't really ...
    (comp.lang.tcl)
  • RE: Replacing "illegal characters" in html
    ... > in a string. ... > The characters I need to replace come from MS Word copy & ... > Double Right quotes ... and 2) regular expressions. ...
    (comp.lang.python)
  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)