ray@latcs1.OZ.AU (Douglas Ray) (04/25/88)
A group of us have been asked to write an emulator for the 68000. It requires minimal character/string io, and for the sake of standardisation we were asked to use CP/M 68k calling conventions. Anyone got any CP/M 68k documentation? -douglas ray (ray@latcs1.oz) (LaTrobe CompSci)
wilker@TCGOULD.TN.CORNELL.EDU (Clarence W. Wilkerson Jr.) (04/29/88)
In article <4116@latcs1.oz>, ray@latcs1.OZ.AU (Douglas Ray) writes: > > > A group of us have been asked to write an emulator for the 68000. It requires > minimal character/string io, and for the sake of standardisation we were asked > to use CP/M 68k calling conventions. Anyone got any CP/M 68k documentation? > -douglas ray (ray@latcs1.oz) (LaTrobe CompSci) There are calls #9 (print a string terminated by $) and 10 ( read into a buffer. The first byte is max length of input string, the second is actual length, followed by characters input. A ^J or ^M terminates the input ( bu t I think is not stored in the string.) However, I don't know how parameters are passed in CPM-68k. As near as I can tell from looking a a Dr. Dobbs article on a 8080 emulator under CPM68k, one loads long addresses into d1, and the function number into d0, and then calls bdos (listed as $4e42 )
jimc@iscuva.iscs.COM (Jim Cathey) (05/03/88)
In article <4607@batcomputer.tn.cornell.edu> wilker@TCGOULD.TN.CORNELL.EDU (Clarence W. Wilkerson Jr.) writes: > >In article <4116@latcs1.oz>, ray@latcs1.OZ.AU (Douglas Ray) writes: >> >>A group of us have been asked to write an emulator for the 68000. It >>requires minimal character/string io, and for the sake of >>standardisation we were asked to use CP/M 68k calling conventions. >>Anyone got any CP/M 68k documentation? -douglas ray (ray@latcs1.oz) (LaTrobe CompSci) > >There are calls #9 (print a string terminated by $) and 10 ( read >into a buffer. The first byte is max length of input string, the >second is actual length, followed by characters input. A ^J or ^M >terminates the input ( bu t I think is not stored in the string.) > However, I don't know how parameters are passed in CPM-68k. As near > as I can tell from looking a a Dr. Dobbs article on a 8080 emulator > under CPM68k, one loads long addresses into d1, and the function > number into d0, and then calls bdos (listed as $4e42 ) You got it! By the way, 'bdos' was my macro for trap #2, and 'bios' was for trap #3 which was cp/m-68k's way of calling the OS. The name binding should be obvious. For documentation, you can just use the cp/m 2.2 (8080) manuals. Now isn't _that_ special? Function code in D0.W, parameter in D1.L. Returns values in D0.W. By the way, don't use the bios trap is the official word. Bdos call #59 (?) is a direct bios call. The bios trap is not guaranteed to preserve any registers. The only reason I mention it is that you can't do simple key-driven I/O (no echoing or control-c trapping) via the bdos calls -- you have to go to the bios. There are several functions (including this one) that need D1 pointing to a special buffer. If you really need the real poop I can try to unbury my manual. The cp/m calls are disgusting enough that I don't see any reason to perpetuate their idiot-syncracies any further. Just conjure up a set of your own functions and use one of the traps to invoke them. You'll be glad you did. +----------------+ ! II CCCCCC ! Jim Cathey ! II SSSSCC ! ISC Systems Corp. ! II CC ! TAF-C8; Spokane, WA 99220 ! IISSSS CC ! UUCP: uunet!iscuva!jimc ! II CCCCCC ! (509) 927-5757 +----------------+ "With excitement like this, who is needing enemas?"