home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / apple / pcpi.mac < prev    next >
Text File  |  1985-04-19  |  577b  |  39 lines

  1.  
  2. ; MODULE PCPI
  3. ; Module use:
  4. ; Place parameters on stack. 
  5. ; Call routine
  6. .z80
  7. readbyte equ 0ffe0h
  8. writebyte equ 0ffe3h
  9. readword equ 0ffe6h
  10. writeword equ 0ffe9h
  11. ; Peek  - Returns 1 Apple byte at <addr>
  12. ; Parms on stack  <addr> <2 bytes> Address of memory to peek
  13.  jr peek
  14. ; Poke - Poke memory into apple
  15. ; Parms.  <addr> <2 bytes> <data> <2 bytes>
  16.  pop hl
  17.  pop bc
  18.  pop de
  19.  push hl
  20.  ld h,b
  21.  ld l,c
  22.  ld c,7
  23.  call writebyte
  24.  call writeword
  25.  ld c,l
  26.  call writebyte
  27.  ret
  28. peek: pop hl
  29.  pop de
  30.  push hl
  31.  ld c,6
  32.  call writebyte
  33.  call writeword
  34.  call readbyte
  35.  ld l,a
  36.  ld h,0
  37.  ret
  38.  end
  39.