Advertisement
vito-Z80

exx test

Mar 13th, 2020
1,461
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     module spr8
  2.     //  first regs hldebc
  3.     ld hl,sprite
  4.     ld de,scrAddr
  5.     //  bc - free
  6.     exx    
  7.     //  second regs hldebc
  8.     ld hl,mask
  9.     ld de,scrAddr
  10.     ld b,8
  11. nextSymbol:
  12.     //  push de     11t
  13.     ld c,8     
  14. nextLine:      
  15.     ld a,(de)   //  screen
  16.     and (hl)    //  mask
  17.     inc hl
  18.     exx        
  19.     //  first regs hldebc
  20.     or (hl)     //  sprite
  21.     inc hl
  22.     exx        
  23.     //  second regs hldebc
  24.     ld (de),a   //  screen
  25.     inc d       //  call to screen line, for calculate can using [de,bc] from first regs hldebc
  26.     dec c
  27.     jr nz,nextLine
  28.     //  pop de      10t
  29.     //  inc e       4t
  30.     //      = 25t
  31.     //------
  32.     exx
  33.     //  first regs hldebc
  34.     ld a,d
  35.     exx
  36.     //  second regs hldebc
  37.     ld d,a
  38.     inc e
  39.     //------ 20t vs 25t at push de,pop de,inc e
  40.     // of course can use: |ld a,d|sub 8|ld d,a|inc e| = 19t without stack or exx
  41.     dec b
  42.     jr nz,nextSymbol
  43.     ret
  44.  
  45.     endmodule
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement