Advertisement
glokyfull

mod192 macro

May 12th, 2024
766
0
3 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;
  2. ;   move.w #-192*9+$12,d0
  3. ;
  4. ;
  5. ;   nop
  6. ;;; modulo 192
  7. ;;      you see the code in the debugger and the apropriate hexadecimal opcode
  8. ;   move.w #192,d2
  9. ;   tst.w d0
  10. ;   bmi.s .negatif
  11. ;.positif
  12. ;   cmp d2,d0
  13. ;   blt.s .ok
  14. ;   sub d2,d0
  15. ;   bra.s .positif
  16. ;.negatif
  17. ;   add.w d2,d0
  18. ;   bmi.s .negatif
  19. ;.ok
  20.    
  21. ;   illegal
  22. totopc
  23. mod192 macro \1,\2          ; then you note the opcode and change the bmi etc as a dc.w statement  so it could be repeated
  24. ; here it's a macro but it's the same problem in rept endr
  25.     move.w \2,-(sp)
  26.     move.w #192,\2
  27.     tst.w \1
  28.     dc.w $6b08
  29.     cmp \2,\1
  30.     dc.w $6d08
  31.     sub \2,\1
  32.     dc.w $60F8
  33.     add \2,\1
  34.     dc.w $6bfc
  35.     move.w (sp)+,\2
  36.     endm
  37. modnosp macro \1,\2
  38.     ;move.w \2,-(sp)
  39.     ;move.w #192,\2
  40.     tst.w \1
  41.     dc.w $6b08
  42.     cmp \2,\1
  43.     dc.w $6d08
  44.     sub \2,\1
  45.     dc.w $60F8
  46.     add \2,\1
  47.     dc.w $6bfc
  48.     ;move.w (sp)+,\2
  49.     endm
  50.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement