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

Re: Best ASM Programming book for Apple



Mookie Harrington <ch003i@mail.rochester.edu> wrote:
: Hello all!
: 
: I was interested in recommendations for the best assembly programming book
: for the Apple ][ (particuarly //e).  I have two in my collection, one
: which is specifically addresses to turning Pascal programs into Assembly,
: and one which is entitled something like "Apple Machine Code" (red book,
: spiral binding).  I'm taking a class on assembly right now at school, and
: I hope to start doing some serious programming on my Apple when I get home
: this Summer.
: Also, I know that the //e allows you to enter some sort of Machine Code
: assembler with the "!" command.  Is that so you can type in ASM commands
: directly, instead of having to use the 00-FF codes?
: I'm sure I used some incorrect terminology in this post, so please feel
: free to correct me.  Much appreciated!

My personal recommendation for 8-bit assembly programming is a book 
called "Assembly Lines" by Roger Wagner.  Good luck finding it; sorry, 
I'm keeping my copy.

To get from Applesoft ("]") to the Machine Language Monitor ("*") issue 
the command...

]CALL -151
*

(don't type the "]"; that's the prompt.  I include prompts so you can 
tell what language you should be talking to when you issue the command).

Entering hand-assembled machine code is easy...in the Monitor, give the 
address, a colon to tell the system you want to change that address, and 
the new hex value.  Subsequent values go into subsequent addresses; 
everything is in hex.  To view the contents of a memory location, type 
the address.  To view the contents of a range of addresses, type the 
address of the first address, a period, then the ending address.  To get 
a disassembly, type the address followed by the letter "L".

*300:A9 87 20 ED FD
*:60
*300
0300- A9
*300.305
0300- A9 87 20 ED FD 60
*300L
0300- A9 87    LDA #$87
0302- 20 ED FD JSR $FDED
0305- 60       RTS
0306- 00       BRK
(etc)

If you are on an ENHANCED ][e (the splash screen says "Apple //e") or 
][c, you can enter the mini-assembler as follows:

]CALL -151
*!
!

I think a <RETURN> on a blank line takes you back to the Monitor.  In the 
Mini-Assembler, you type an address, a colon, and the instruction
!300:LDA #$87
! JSR $FDED
! RTS
!
*

As you type the instructions they will be instantly assembled and appear 
in assembled form on the screen.

If you are on an older ][e (the splash screen says "Apple ]["), you need 
a DOS 3.3 System Master which will load Integer BASIC into memory.  Then 
you can get into the Mini Assembler as follows:
]INT
>CALL -151
*F666G
!

You have to enter the Monitor from Integer BASIC so that you can talk to 
the alternate version of the Monitor ROM.  The Mini-Assembler entry point 
is at $F666.  The Monitor entry point is at $FF69 which is important 
because that's how you get out of the Mini-Assembler:
!$FF69G
*
Hope that helps!

AD AD C4 E1 F6 E5 A0 C1 EC F4 E8 EF E6 E6 AC A0 DD DB 8D
    /-\        _       _          *** Thanks for a great season!! ***
   /XXX\      /X\     /X\_      _     /X\__      _     _        _____
  /XXXXX\    /XXX\   /XXXX\    /X\   /XXXXX\    /X\   /X\      /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX