|
1
9th March 03:19
External User
|
Error 161: Code generation error
Hallo allemaal,
Can someone explain what this "Error 161: Code generation error" is,
please?
The part causing the error is ML. I need the ML because I only have a
30 uSec window where all checking etc. has to be done. But it seems
that I'm limited in the use of ML because the moment I cross a certain
border, the error ocures. It is not the ML itself because it disappears
the moment I take a piece of code out of the program.
Here is the actual code. Look for the part marked with #####, move this
line one up and the error occures.
Thanks for any help or info !!!
var
bLPTstat, bLPTstatN, bControl : byte;
wIeeeLptaddr, wIeeeLptctrl, wIeeeLptstat,
wTrackBuffer, wTrackSize : word;
begin
repeat
asm
@1:
mov SI, wTrackBuffer { SI points to track data }
mov CX, wTrackSize
mov BH, 0 { no $FF found yet }
@4:
mov DX, wIeeeLPTstat
in AL, DX { read status register }
test AL, $40 { motor on? }
jne @99 { no, -> }
mov BL, bLPTstat
and BL, $30 { filter old step status }
mov AH, AL
and AH, $30 { filter new step status }
cmp BL, AH { compare }
jne @99 { not equal, -> }
test AL, $08 { SOE active? }
je @99 { no, -> }
mov bLPTstat, AL { save status }
cli { disable interrupts }
test AL, $80 { write or read mode? }
jne @20 { write mode, -> }
{** Read mode **}
mov DX, wIeeeLPTctrl
mov AL, bControl
and AL, $DF { LPT := output }
out DX, AL
mov bControl, AL
mov AL, [SI] { load byte from buffer }
dec DX
dec DX { DX points to LPTaddr }
out DX, AL { output byte }
inc DX
inc DX { DX points to LPTctrl }
cmp AL, $FF { possible [SYNC mark ? }
je @6 { yes, -> }
mov BH, 0 { no, delete reminder }
jmp @10
@6:
cmp BH, 0 { first $FF ? }
je @8 { yes, -> }
mov AL, bControl
and AL, $FB { SYNC signal on }
out DX, AL
mov bControl, AL
out DX, AL { keep same timing as... }
out DX, AL { ... with no SYNC signal }
jp @30
@8:
inc BH
{** Disable SYNC signal, even when not needed **}
@10:
(*
mov AL, bControl
or AL, 4 { SYNC signal off }
out DX, AL
mov bControl, AL
mov AL, bControl
###### *)
xor AL, 1 { Byte Ready on }
out DX, AL
xor AL, 1 { Byte Ready off }
out DX, AL
jp @30
@20:
mov DX, wIeeeLPTctrl
mov AL, bControl
or AL, $20 { LPT := input }
out DX, AL
mov bControl, AL
dec DX
dec DX { DX points to LPTaddr }
in AL, DX
mov [SI], AL
inc DX
inc DX { DX points to LPTctrl }
mov AL, bControl
xor AL, 1 { Byte Ready on }
out DX, AL
xor AL, 1 { Byte Ready off }
out DX, AL
@30:
{** delay for cycle time **}
in AL, DX
inc SI
loop @4 { next byte on track }
jp @1 { go to start of track }
@99:
sti { enable interrupts }
mov bLPTstat, AL { save status }
end;
until (bLPTstat <> bLPTstatN);
end.
--
___
/ __|__
/ / |_/ Groetjes, Ruud
\ \__|_\
\___| URL: Ruud.C64.org
|