Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: David Murray <adric22@xxxxxxxxx>
- Date: Sat, 20 Dec 2008 20:52:56 -0800 (PST)
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.
.
- Follow-Ups:
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: Marc 'BlackJack' Rintsch
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: Groepaz
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- References:
- Commodore 128 Basic 7.0 One Liner Competition 2008
- From: Lance Lyon
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: David Murray
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: winston19842005@xxxxxxxxx
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: Andreas Kohlbach
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: David Murray
- Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- From: Andreas Kohlbach
- Commodore 128 Basic 7.0 One Liner Competition 2008
- Prev by Date: Re: Anyway to connect a PC keyboard to a C128?
- Next by Date: Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- Previous by thread: Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- Next by thread: Re: Commodore 128 Basic 7.0 One Liner Competition 2008
- Index(es):
Relevant Pages
|