Advertisement
Zeda

Pixel Plotting TI-8x Asm

Dec 14th, 2011
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;===============================================================
  2. PlotPixel:
  3. ;===============================================================
  4. ;Inputs:
  5. ;     B is the x-coordinate
  6. ;     C is the y-coordinate
  7. ;     D=Method
  8. ;        1=Test
  9. ;        2=Off
  10. ;        3=On
  11. ;     (BufPtr) points to the buffer to draw to
  12. ;Outputs:
  13. ;     BC is equal to (BufPtr)
  14. ;     DE not modified
  15. ;     HL points to the byte the pixel is drawn to
  16. ;     When using the pixel test method:
  17. ;       z means pixel off
  18. ;       nz means pixel on
  19. ;Destroys:
  20. ;     A
  21. ;===============================================================
  22.      ld a,3Fh            ;7
  23.      srl b \ rra         ;12    19
  24.      srl b \ rra         ;12    31
  25.      srl b \ rra         ;12    43
  26.      cpl                 ;4     47
  27.      or d                ;4     51
  28.      rrca \ rrca         ;8     59
  29.      ld (Method),a       ;13    72
  30.      ld a,b              ;4     76
  31.      ld b,0              ;7     83
  32.      ld h,b \ ld l,c     ;4     87
  33.      add hl,bc           ;11    98
  34.      add hl,bc           ;11   109
  35.      add hl,hl           ;11   120
  36.      add hl,hl           ;11   131
  37.      ld c,a              ;4    135
  38.      add hl,bc           ;11   146
  39.      ld bc,(BufPtr)      ;20   166
  40.      add hl,bc           ;11   177
  41.      .db $CB             ;15   192
  42. Method:
  43.      .db 46h
  44.      ret                 ;10   202  37 bytes
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement