02-27-2012, 02:31 AM
Testing the results of the USR function seems to come up with the right answers, but my "invert a graphic" sub seems to be breaking in strange ways.
Can't quite follow why:
Is it me doing something silly, or the compiler? It seems to miss a line off the top, and then write gibberish into the next one, before carrying on normally with the last six lines. Is it my emulator (spin)? or my program?
I just checked: Does the same thing in Spectaculator.
And "Print \b" seems to print a B missing the top before my sub even runs...
Can't quite follow why:
Is it me doing something silly, or the compiler? It seems to miss a line off the top, and then write gibberish into the next one, before carrying on normally with the last six lines. Is it my emulator (spin)? or my program?
I just checked: Does the same thing in Spectaculator.
And "Print \b" seems to print a B missing the top before my sub even runs...
Code:
SUB fastcall hMirror (udg as uInteger)
ASM
ld b,8
hMirrorRotate:
LD C,(HL)
RR C
RLA
RR C
RLA
RR C
RLA
RR C
RLA
RR C
RLA
RR C
RLA
RR C
RLA
RR C
RLA
LD (HL),A
INC HL
DJNZ hMirrorRotate
END ASM
END SUB
CLS
PRINT "Address: ";USR "B"
PRINT "\b"
hMirror (USR"B")
PRINT "\b"