Advertisement
Shaun_B

Commodore 64 USR function

Jul 30th, 2019
3,681
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 0 gosub 50
  2. 10 poke 785, 0
  3. 20 poke 786, 192:rem usr(x) calls 49152
  4. 30 let x = usr(6)
  5. 40 end
  6. 50 let i = 49152
  7. 60 read a
  8. 70 if a = -1 then return
  9. 80 poke i, a
  10. 90 let i = i + 1
  11. 100 go to 60 main loop
  12. 500 data 32, 170, 177:rem jsr $b1aa
  13. 510 data 140, 32, 208:rem sty $d020
  14. 520 data 140, 33, 208:rem sty $d021
  15. 530 data 169, 0:      rem lda #$00
  16. 540 data 32, 145, 179:rem jsr $b391
  17. 550 data 96:          rem rts
  18. 560 data -1
  19. rem this programme will create a custom routine called by the usr(x) keywork in Commodore 64 BASIC
  20. rem the routine accepts a numeric value and essentially poke the border and screen with the same
  21. rem value; the number is returned back between 0 - 255, so print usr(511) will return 255, so it
  22. rem will also act as a modulo 256 function as well, so this may be modified to a custom modulo.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement