Advertisement
AnthonyCagliano

Untitled

Dec 5th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. ; bigint_iszero(uint8_t *op);
  2. ; point_iszero(struct Point *pt)
  3. _point_iszero:
  4. ld b, 60
  5. jr _iszero_begin
  6. _bigint_iszero:
  7. ld b, 30
  8. _iszero_begin:
  9. call ti._frameset0
  10. ld hl, (ix + 6)
  11. or a
  12. .loop:
  13. or (hl)
  14. inc hl
  15. djnz .loop
  16. or a
  17. ret z
  18. ld a, 1
  19. ld sp, ix
  20. pop ix
  21. ret
  22.  
  23.  
  24. ; bigint_isequal(uint8_t *op1, uint8_t *op2);
  25. ; point_isequal(struct Point *pt1, struct Point *pt2);
  26. _point_isequal:
  27. ld b, 60
  28. jr _isequal_begin
  29. _bigint_isequal:
  30. ld b, 30
  31. _isequal_begin:
  32. call ti._frameset0
  33. ld hl, (ix + 6)
  34. ld de, (ix + 9)
  35. ld c, 0
  36. .loop:
  37. ld a, (de)
  38. xor (hl)
  39. or a, c
  40. ld c, a
  41. inc de
  42. inc hl
  43. djnz .loop
  44. add a, -1
  45. sbc a, a
  46. inc a
  47. ld sp, ix
  48. pop ix
  49. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement