[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'Hello world' for monitor mode and an assembler?
Alistair J Ross replied:
>On Thu, 09 Sep 2004 00:06:32 +0000, Michael J. Mahon wrote:
>
>> Bill Garber corrected:
>
>>>Now 300L will give you:
>>>
>>>JSR $FBDD
>>>RTS
>>
>> Of course you are correct.
>>
>> Brain alpha particle hit... ;-)
>
>
>It's ok - I worked it out all by myself anyway ;)
>
>Two last questions (I hope!) -- how is it possible to know what hex
>value refers to each assembler instruction. Ie you knew that $60 gives an
>RTS (return from subroutine?). I have the Apple II red book which lists
>all the 6502 instructions, so I can at least find out bit by bit what each
>one does, but I have no idea how to assemble from hex.
You have found the table of 6502 Instruction Codes in the Red Book,
and the hex opcode corresponding to the form of instruction you want
is listed in the "HEX OP Code" column.
A curious typo caused the RTS opcode ($60) not to be listed! ;-)
Of course, the mini-assembler, or _any_ real assembler takes
care of all of this for you.
>Last thing: Until I get another real Apple II (I'm waiting on a IIe and a
>Platinum), i'm using xkegs here on my Linux box. When I do a call-151 then
>I type ! to get to the mini-assembler, how can I write line by line
>assembler - do I have to know what the next address is and enter it
>manually, ie:
>
>300: JSR $FBDD
>303: RTS
>
>I had to know that JSR $FBDD was 2 memory instructions long. Or am I being
>stupid here, should I just know that JSR $FBDD (because it is seperated by
>a space) is 2 memory addresses long.
As another poster pointed out, and as shown in my example, when
entering code in the mini-assembler, if you preface the opcode with
a space, the address used will be the next sequential address.
You only need to type an address followed by a colon when you are
assembling to a non-sequential address (for example, when you are
"backing up" to fix a mistake).
-michael
Check out parallel computing for 8-bit Apples on my
Home page: http://members.aol.com/MJMahon/