home *** CD-ROM | disk | FTP | other *** search
/ Il CD di internet / CD.iso / SOURCE / EXTRA-ST / CPM-80-E / CPM-0.2 / CPM-0 / cpm-0.2 / z80emu.S < prev    next >
Encoding:
Text File  |  1994-06-06  |  1.3 KB  |  61 lines

  1. /*****************************************************************************/
  2. /*                                         */
  3. /*                                         */
  4. /*    CP/M emulator version 0.1                         */
  5. /*                                         */
  6. /*    written by Michael Bischoff (mbi@mo.math.nat.tu-bs.de)             */
  7. /*    June-1994                                 */
  8. /*                                         */
  9. /*    This file is distributed under the GNU COPYRIGHT             */
  10. /*    see COPYRIGHT.GNU for Copyright details                     */
  11. /*                                         */
  12. /*                                         */
  13. /*****************************************************************************/
  14.         .file    "z80emu.s"
  15. gcc2_compiled.:
  16. ___gnu_compiled_c:
  17. .text
  18.         .align 4,0x90
  19.  
  20. #define dispatch                \
  21.         movzbl (%esi,%ebp),%edi;    \
  22.         inc %esi;            \
  23.         sall $2,%edi;            \
  24.         jmp jumptab(%edi)
  25.  
  26. .globl        _emulate
  27. _emulate:
  28.         pushl %ebp
  29.         pushl %esi
  30.         pushl %edi
  31.         pushl %ecx
  32.         pushl %edx
  33.         pushl %ebx
  34.         movzwl _z80regs,%esi
  35.         /* movzwl _z80regs+4,%ebp */
  36.         movl $_z80mem,%ebp
  37.         movzwl _z80regs+8,%ecx
  38.         movzwl _z80regs+12,%edx
  39.         movzwl _z80regs+16,%ebx
  40.         movzwl _z80regs+20,%eax
  41.         dispatch
  42.  
  43.         .align 4,0x90
  44. exitemu:    decl %esi
  45.         movw %esi,_z80regs
  46.         /* movw %ebp,_z80regs+4 */
  47.         movw %ecx,_z80regs+8
  48.         movw %edx,_z80regs+12
  49.         movw %ebx,_z80regs+16
  50.         movw %eax,_z80regs+20
  51.         popl %ebx
  52.         popl %edx
  53.         popl %ecx
  54.         popl %edi
  55.         popl %esi
  56.         popl %ebp
  57.         ret
  58.  
  59. #include "code.s"
  60. #include "code2.s"
  61.         .align 4,0x90