Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Assembly question
#25
this is fun

here is how I printed a block to co-ords 7,3
Code:
function FASTCALL drawthis() as ubyte
asm
LD HL,16384
LD BC,7

LD A,3
RRC A
RRC A
RRC A
OR 7
LD L,A

drawblokes:
INC H
LD A,254
LD (HL),A
DEC BC
LD A, B  
OR C    
JP NZ,drawblokes
    end asm
end function

drawthis()
Print "done"


but if I move INC H to just before the jump command the screen goes a bit weird
Code:
function FASTCALL drawthis() as ubyte
asm
LD HL,16384
LD BC,7

LD A,3
RRC A
RRC A
RRC A
OR 7
LD L,A

drawblokes:

LD A,254
LD (HL),A

DEC BC
LD A, B  
OR C
INC H
JP NZ,drawblokes
    end asm
end function

drawthis()
Print "done"

EDIT
ohhh
INC seems to set the zero flag
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)