Subject: Re: [stella] ... [overlays]B From: Chris Wilkson <ecwilkso@xxxxxxx> Date: Wed, 26 Jun 2002 13:57:25 -0400 (EDT) |
On 26 Jun 2002 KirkIsrael@xxxxxxxxxxxxx wrote: > Any doc recomendations? Also, anything that talks about the > ORG syntax, and where and how to stick graphics. (More specific > question: in Nick's "how to draw", the [code deleted] Let's look at the following "functional" example: ORG $F000 START JMP END END JMP START ORG $FFFC .WORD START .WORD START The ORG directive tells the assembler to start assembling the following code at the given address. So in the code above, the START label is given a user defined value (address) of $f000. Since the JMP instruction takes 3 bytes (the instruction opcode and low+high address bytes) the assembler gives the END label a value of $f000+3 = $f003. The WORD directive tells the assembler to store the following 2-bytes of data directly to the binary file, low byte first. In this case, it evaluates "START" and stores $00 at $fffc, and $f0 at $fffd. Then it does it again, storing the values at $fffe and $ffff. For any addresses that don't have code assigned (in this case $f006-$fffb) the assembler writes a dummy value of $ff, just to take up space so that code segments happen at the right places. There are 2 special 2-byte locations for 6507 coding on the 2600. The RESET vector is located at $fffc:fffd. Upon a hardware reset, the 6507 looks here to get the beginning execution address. The SWI vector, or SoftWare Interrupt vector is located at $fffe:ffff. Anytime a BRK instruction is executed, the processor looks here to get the address of the interrupt handling routine. Most people don't use this on the 2600, but it has been used on occasion. So the executable listing would look something like this: address opcode comment ------- ------ ------- $F000 $4C ; JMP instruction $F001 $03 ; JMP target, low byte $F002 $F0 ; JMP target, high byte $F003 $4C ; JMP instruction $F004 $00 ; JMP target, low byte $F005 $F0 ; JMP target, high byte $F006 $FF ; no code available....place holder $F007 $FF ; no code available....place holder ... ... ... ... ... ... ... ... ... $F00A $FF ; no code available....place holder $FFFB $FF ; no code available....place holder $FFFC $00 ; RESET vector, low byte $FFFC $F0 ; RESET vector, high byte $FFFC $00 ; SWI vector, low byte $FFFC $F0 ; SWI vector, high byte Hrm....wordy. -Chris ---------------------------------------------------------------------------------------------- Archives (includes files) at http://www.biglist.com/lists/stella/archives/ Unsub & more at http://www.biglist.com/lists/stella/
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [stella] ... [overlays], KirkIsrael | Thread | [stella] tutorial progress, KirkIsrael |
Re: [stella] Missile.bin and TWO MI, Chris Wilkson | Date | [stella] tutorial progress, KirkIsrael |
Month |