home *** CD-ROM | disk | FTP | other *** search
- Short: Extended Syntax Assembly v1.5
- Author: Simone Bevilacqua
- Uploader: bevilacq@cli.di.unipi.it (Simone Bevilacqua)
- Type: dev/asm
- Requires: 020+ CPU
- Replaces: dev/asm/ESA.lha
-
- Ever heard of "inline asm" inside C, Pascal, etc. ?
- Well, here we have "inline C, Pascal, etc." inside asm!
-
-
- Look below: that's a small sample of ESA code!!!
-
-
- *******************************************************************************
- * CpyQtd v1.0.0
- *******************************************************************************
- * INFO copies a string enclosed between two quotes: it is considered
- * a "quote" the first char of the string;
- * the copy is NULL-terminated;
- * it fails at the first ENTER or BLANK
- * SYNOPSIS CpyQtd{StrPtr,DstBuf}
- * a1 a2
- * IN StrPtr ptr to string (filename)
- * DstBuf adr of destination buffer
- * MODIFIES a0.l ptr after string (NULL if ERROR!)
- * WARNING be careful there is *no* check!!!
- *******************************************************************************
-
- procedure CpyQtd{a1-a2},d0-d1/a1-a2
- move.b (a1)+,d0 ;get "quote"
- repeat
- move.b (a1)+,d1
-
- switch.s d1.b
- -> d0 ;successful copy
- clr.b (a1) ;NULL-termination
- moveq.l #0,d1 ;exit loop
- -> #0 ;unvalid char, exit loop
- suba.l a1,a1 ;please, let it be...
- -> #10 ;unvalid char
- moveq.l #0,d1 ;exit loop
- suba.l a1,a1 ;please, let it be...
- def
- move.b d1,(a2)+ ;copy char
- eswitch
-
- until.s ~d1.b
- movea.l a1,a0 ;new string ptr
-
- eproc
-