Topic : TOS - The Operating System Author : Version : tos.hyp (December 19, 2008) Subject : Programmieren/Atari Nodes : 3010 Index Size : 93790 HCP-Version : 5 Compiled on : Atari @charset : atarist @lang : @default : Title @help : @options : +g -i -s +x +zz -t4 @width : 70 View Ref-File12.2.1.6 testmps.s TOS * FS 15.08.96 * * =========================================================== * Sample for the call of the MPS functions from Motorola side * =========================================================== * * Source Windows-side: * -------------------- * mps_base.cpp, mps_demo.cpp * mps_code .equ $4fbf * !! DO NOT ALTER !! DLL_ID .equ $01020304 * Enter own DLL_ID here * -------------------------------------- 60 bytes buffer bufsize .equ 60 .bss .even buffer: ds.w bufsize * -------------------------------------- * * ------------------- Here we go: ----------------------------------- * .text .globl _main _main: moveq #-1,d0 * d0 to -1 (for testing) * =========================== * Call function 0 (Demo_0): dc.w mps_code * = $4fbf dc.l DLL_ID * = Own DLL_ID dc.w 0 * Function number (here 0) * =========================== cmpi.l #1,d0 * Should return 1 bne finish * Example for call with parameters (copy_string) * ---------------------------------- movea.l #buffer,a0 * Pointer to buffer for string move.l #bufsize,d0 * Max. string length (incl.0-byte) * =========================== * Call function 4 (copy_string): dc.w mps_code * = $4fbf dc.l DLL_ID * = Own DLL_ID dc.w 4 * Function number (here 4) * =========================== bsr put_line * Output line (a0) finish: bsr wait * Wait for keypress rts * * --------------------- END main routine _main ----------------------- * * ------------------------ Output line (a0) -------------------------- put_line: moveq #13,d0 bsr put_char moveq #10,d0 put_lnext: bsr put_char move.b (a0)+,d0 bne put_lnext rts * ------------------------ Output chatacter d0 ----------------------- put_char: movem.l d0-d2/a0-a2,-(sp) move.w d0,-(sp) move.w #2,-(sp) move.w #3,-(sp) trap #13 addq.l #6,sp movem.l (sp)+,d0-d2/a0-a2 rts * -------------------------- Wait for keypress ----------------------- wait: move.w #2,-(sp) move.w #2,-(sp) trap #13 addq.l #4,sp rts See also: MagiC PC interface