[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 4-4 Format for GCR Question
- Subject: Re: 4-4 Format for GCR Question
- From: Holger Picker <pickerh@uni-muenster.de>
- Date: Fri, 20 Dec 2002 14:39:45 +0100
- In-reply-to: <-iKdnQxvIYO2PJ-jXTWQkQ@giganews.com>
- Newsgroups: comp.sys.apple2
- Organization: Westfaelische Wilhelms-Universitaet Muenster, Germany
- References: <-iKdnQxvIYO2PJ-jXTWQkQ@giganews.com>
- Sender: "Holger Picker" <pickerh@uni-muenster.de>
- Xref: archiver1.google.com comp.sys.apple2:25467
On Thu, 19 Dec 2002, Bryan Parkoff wrote:
> Date: Thu, 19 Dec 2002 22:49:07 -0600
> From: Bryan Parkoff <BParkoff@satx.rr.com>
> Newsgroups: comp.sys.apple2
> Subject: 4-4 Format for GCR Question
>
> 4-4 Format for GCR Question
>
> I know how to use ASL and AND opcode to put two bytes into one byte.
>
> For example:
>
> c0 c1 c1 c0
> c1 c1 c1 c0
>
> With ASL
>
> 0c 1c 1c 0c
> c1 c1 c1 c0
>
> With AND
>
> 01111100
>
> It is how I can see above. My question is -- How can I add '1' to each
> bit before one byte can become two bytes? Which instruction (opcode) do I
> use? Please advise.
>
> --
> Yours Truly,
>
> Bryan Parkoff
> BParkoff@satx.rr.com
>
Hi,
sorry, I'm not sure what you mean. Are you referring to the odd even format?
If not, don't read the following. :-)
DOS 3.3 uses the odd even format to store the sector information in the
sector header (track, sector etc). At address $b96d it reads (Y = 3):
LDA #0
loop: STA $27
wait1: LDA $c08c,x
BPL wait1
ROL ; shift value to the left
STA $26
wait2: LDA $c08c,x
BPL wait2
AND $26; and value
STA $002c,y
EOR $27; check"sum" (i.e. checkeor :-) )
DEY
BPL loop
Shift and AND as you've written.
Writing is done at address $bcc4 (A = byte):
PHA ; put byte on stack
LSR ; first shift bits to the right
ORA $3e; $3e contains the value #$aa (s.b.)
STA $c08d,x; write to latch
CMP $c08c,x; write byte
PLA ; restore byte
NOP ; time delay
NOP
NOP
ORA #$aa; this is probably what you were looking for
NOP ; time delay
NOP
PHA
PLA
STA $c08d,x; write to latch
CMP $c08c,x; write byte
RTS
Hope, this helps.
Holger