6801 relative address calculations
Teller.John at orbital.com
Teller.John at orbital.com
Mon Feb 22 15:31:44 GMT 1999
Here is an explanation of my disassembly:
; Clear RAM from 0061 to 0001
F095 CE 00 61 LDX $0061 ; Point at RAM addr 0061
F098 6F 00 CLR [X] ; Clear mem pointed to by X
F09A 09 DEX ; Decrement X
F09B 26 FB BNE $F098 ; Go around until X = 0
| | | | | | |
| | | | | | +-- Comments
| | | | | +---- Operand (that which is operated on)
| | | | +-------- Operator (the command to the CPU)
| +--+--+------------ The raw bytes that make up the whole instruction
+------------------------ The address of the instruction.
The first byte of a 6801 instruction is the operator. This defines what
operation the 6801 will perform using any following bytes. Some
instructions consist of only the operator with no operands. Some
instructions are made up of an operand and one to three operands. The
operands consist of bytes that are used immediately to set the contents of
a register (LDX $0061), or as an index or offset to a location in memory
(among other things).
For more information, consult the 68HC11 data sheets on the Motorola web
site. These are pretty close to the 6801 and will tell you a lot more than
you probably want to know.
--- John Teller
"Bruce Plecan" <nacelp at bright.net> on 02/21/99 12:05:58 AM
Please respond to gmecm at efi332.eng.ohio-state.edu
To: gmecm at efi332.eng.ohio-state.edu
cc: (bcc: John Teller/ORBVA)
Subject: Re: 6801 relative address calculations
-----Original Message-----
From: Scot Sealander <Sealand at clarityconnect.com>
To: gmecm at efi332.eng.ohio-state.edu <gmecm at efi332.eng.ohio-state.edu>
Date: Thursday, February 18, 1999 9:35 PM
Subject: Re: 6801 relative address calculations
All I get out of this is the "branch", anybody mind, explaining further..
>
>> F02F 20 0C BRA $F03C ; F030 + 0C = F03C
>
>That should be F031 + OC = F03D
>
>
>
>> F095 CE 00 61 LDX $0061
>> F098 6F 00 CLR [X]
>> F09A 09 DEX
>> F09B 26 FB BNE $F096 ; This jumps to the 00 in the LDX
>> instruction!
>
>In this case, the PC at the BNE is F09D. FB + F09D = F098
>
>So this is a loop to clear 0061 down to 0001.
>
>Scot Sealander Sealand at clarityconnect.com
>
More information about the Gmecm
mailing list