home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / PROG / ASSEMBLY / V20BOOT.ZIP / GOTOCPM.ASM next >
Encoding:
Assembly Source File  |  1990-04-30  |  1.7 KB  |  51 lines

  1.  
  2. ;This is the only 8088 assembly code required by the
  3. ; emulator
  4.  
  5. ; version to be assembled by TASM or MASM
  6. ; will set bp = cpmstack, ds = cpmseg, and try
  7. ; to access by BRKEM #baseint
  8. ; for this to work, #baseint must have been already installed
  9. ; to point to 8080 code
  10. ; the interrupt  pointer determines the cs of the 8080 code
  11. ; we calculate the ds  = cs, since there are no overides
  12. ; in emulation mode, and most 8080 code implicitly assumes
  13. ; cs = ds
  14. ; could redo bdos code to bankswitch the variables used,
  15. ; but why bother
  16.  
  17.  
  18. ; procedure gotocpm(cpmseg,cpmstack,baseint : word);
  19. ;begin
  20. ; contains a kludge to get variable interrupt call
  21. ; or BRKEM call
  22. ; have to rewrite byte after the opcode
  23. ; on machines with a cache, could be a problem
  24.  
  25. code segment word public
  26.      assume cs:code
  27.      public  gotocpm
  28. gotocpm proc near
  29.             push bp    ;
  30.             mov  bp,sp ; standard set up code, no local variables
  31.             mov  ax,[bp + 4] ; brkem int # patch
  32.             mov  byte ptr cs:hack,al  ; modify code
  33.             mov  ax,[bp + 8] ; using near call, so last param at bp + 2
  34.             mov  dx,[bp +6]  ; cpmstack to dx
  35.             push bp       ; used by V20 as stack pointer
  36.             push ds       ; set equal to CP/M data=code
  37.             mov  ds,ax    ; [cpm80] set data segment for cpm
  38.             mov  bp, dx   ; cpmstack to set cp/m stack
  39.             db   0fh,0ffh ;   BRKEM
  40. hack:       db   000h;    ;   BRKEM  XX uses XX interrupt
  41.                           ; overwritten in this version
  42.             pop ds
  43.             pop bp
  44.             mov sp,bp  ; standard exit code
  45.             pop bp
  46.             ret 6   ; 3 two byte parameters pushed on stack
  47. gotocpm     endp
  48.  
  49. code ends
  50. end
  51.