$200-$258 BASIC Input Buffer and other useful memory

Basic and Machine Language

Moderator: Moderators

User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Re: $200-$258 BASIC Input Buffer and other useful memory

Post by Mike »

aitsch wrote:
Mike wrote:Hi, Robbie,

as pointed out by chysn, there's room for small routines in $02A1..$02FF (the so-called program indirects) ...
94 bytes more for my current project sounds good.
i've tried to place this small test routine in this area (starts at $02a1):

Code: Select all

*=$1001
!byte $0b,$08, $e2,$07, $9e, $20, $36, $37, $33, $00,$00, $00 

*=$02a1			; starting at $02a1

  ldy #0
.loop
  tya
  sta $1e00,y
  lda #0
  sta $9600,y
  dey
  bne .loop
  rts
but for me programs in this location won't work.

why?

aitsch
See here, and to quote from there:
Mike wrote:[...] the BASIC stub supposed to be loaded to the BASIC start (with ",8" and not ",8,1"!), and the machine code (or other data) is supposed to follow directly behind. There is no such thing as a "fragmented" load that puts parts of loaded files to other positions. The load routine in the KERNAL only transfers a single contiguous memory segment.
... and actually, those are 95 bytes in $02A1..$02FF. :wink:
User avatar
chysn
Vic 20 Scientist
Posts: 1205
Joined: Tue Oct 22, 2019 12:36 pm
Website: http://www.beigemaze.com
Location: Michigan, USA
Occupation: Software Dev Manager

Re: $200-$258 BASIC Input Buffer and other useful memory

Post by chysn »

In addition to what Mike said about the KERNAL loading to contiguous memory, also take a look at the object file generated by your assembler. The value of * is really a pseudo program counter that tells the assembler how addresses are assigned to labels*; but the assembler itself has no say over where the code is placed. So you'll probably find that your object file is exactly the same with or without *=$02a1, since the only usage of a label afterward is as a relative branch operand.

* To clarify this further, *= doesn't mean "start code at this address." It means "assign label values as though code starts at this address."
VIC-20 Projects: wAx Assembler, TRBo: Turtle RescueBot, Helix Colony, Sub Med, Trolley Problem, Dungeon of Dance, ZEPTOPOLIS, MIDI KERNAL, The Archivist, Ed for Prophet-5

WIP: MIDIcast BASIC extension

he/him/his
Post Reply