[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on ProDOS SmartPort drive remapping



Alex Freed wrote:


Maybe you can still solve a 30+ year old mystery for me :)

The 360 assembly language was the first I ever saw. And I remember a mantra a lot (all 3 I saw?) started with. Something like:

BALR 1,0
USING *,1

The BALR must be "branch and link register". I can guess that either "1" or "0" was a register that the system put something in?
But what is the USING?

BALR 1,0 puts the address of the next instruction in register one,
but does NOT branch because R0 for a branch destination is special.

USING *,1 tells the assembler to use R1 as a base register for resolving
symbolic addresses for the next 4096 bytes. The assembler will figure the offset and use R1 as the base address. For example,

  BALR 1,0
  USING *,1
  L 2,ONE
  B AROUND
ONE DC F'1'
AROUND AR 2,2

would load 1 into R2, and then add it to itself.

ONE is eight bytes past the address in R1, AROUND is
12 bytes past R1.  Instructions only have 12 bits for
displacement in a 24 bit address space.

-- glen