mon.s 764 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. .define Mon
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine performs some monitor calls.
  8. ! The exit call just resets the hardware_stackpointer so
  9. ! this routine will return to the operating system.
  10. ! The close call just returns a zero.
  11. ! The ioctl call just pops its arguments and returns a zero.
  12. ! The write routine is a real one.
  13. Mon:
  14. cpx #1
  15. bne 1f ! exit
  16. ldx STACK ! load stackpointer
  17. dex
  18. dex ! adjust stackpointer
  19. txs ! set stackpointer
  20. rts
  21. 1: cpx #4
  22. bne 1f
  23. jmp Mwrite
  24. 1: cpx #6 ! facked
  25. bne 1f ! close
  26. lda #0
  27. tax ! return zero
  28. rts
  29. 1: cpx #54
  30. jsr Pop ! pop first argument (fildes)
  31. jsr Pop ! pop second argument (request)
  32. jsr Pop ! pop third argument (argp)
  33. lda #0
  34. tax ! return zero
  35. rts