diff --git a/SD_CARD/BaS_gcc/include/cache.h b/SD_CARD/BaS_gcc/include/cache.h
new file mode 100644
index 0000000..52e90ed
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/cache.h
@@ -0,0 +1,32 @@
+#ifndef _CACHE_H_
+#define _CACHE_H_
+
+/*
+ * cache.h
+ *
+ * This file is part of BaS_gcc.
+ *
+ * BaS_gcc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * BaS_gcc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with BaS_gcc. If not, see .
+ *
+ * Copyright 2010 - 2012 F. Aschwanden
+ * Copyright 2011 - 2012 V. Riviere
+ * Copyright 2012 M. Froeschle
+ *
+ */
+
+#include
+
+extern void flush_and_invalidate_caches(void);
+
+#endif /* _CACHE_H_ */
diff --git a/SD_CARD/BaS_gcc/include/ff.h b/SD_CARD/BaS_gcc/include/ff.h
new file mode 100644
index 0000000..e6f6cce
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ff.h
@@ -0,0 +1,337 @@
+/*---------------------------------------------------------------------------/
+/ FatFs - FAT file system module include file R0.09a (C)ChaN, 2012
+/----------------------------------------------------------------------------/
+/ FatFs module is a generic FAT file system module for small embedded systems.
+/ This is a free software that opened for education, research and commercial
+/ developments under license policy of following terms.
+/
+/ Copyright (C) 2012, ChaN, all right reserved.
+/
+/ * The FatFs module is a free software and there is NO WARRANTY.
+/ * No restriction on use. You can use, modify and redistribute it for
+/ personal, non-profit or commercial product UNDER YOUR RESPONSIBILITY.
+/ * Redistributions of source code must retain the above copyright notice.
+/
+/----------------------------------------------------------------------------*/
+
+#ifndef _FATFS
+#define _FATFS 4004 /* Revision ID */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "integer.h" /* Basic integer types */
+#include "ffconf.h" /* FatFs configuration options */
+
+#if _FATFS != _FFCONF
+#error Wrong configuration file (ffconf.h).
+#endif
+
+
+
+/* Definitions of volume management */
+
+#if _MULTI_PARTITION /* Multiple partition configuration */
+typedef struct {
+ BYTE pd; /* Physical drive number */
+ BYTE pt; /* Partition: 0:Auto detect, 1-4:Forced partition) */
+} PARTITION;
+extern PARTITION VolToPart[]; /* Volume - Partition resolution table */
+#define LD2PD(vol) (VolToPart[vol].pd) /* Get physical drive number */
+#define LD2PT(vol) (VolToPart[vol].pt) /* Get partition index */
+
+#else /* Single partition configuration */
+#define LD2PD(vol) (BYTE)(vol) /* Each logical drive is bound to the same physical drive number */
+#define LD2PT(vol) 0 /* Always mounts the 1st partition or in SFD */
+
+#endif
+
+
+
+/* Type of path name strings on FatFs API */
+
+#if _LFN_UNICODE /* Unicode string */
+#if !_USE_LFN
+#error _LFN_UNICODE must be 0 in non-LFN cfg.
+#endif
+#ifndef _INC_TCHAR
+typedef WCHAR TCHAR;
+#define _T(x) L ## x
+#define _TEXT(x) L ## x
+#endif
+
+#else /* ANSI/OEM string */
+#ifndef _INC_TCHAR
+typedef char TCHAR;
+#define _T(x) x
+#define _TEXT(x) x
+#endif
+
+#endif
+
+
+
+/* File system object structure (FATFS) */
+
+typedef struct {
+ BYTE fs_type; /* FAT sub-type (0:Not mounted) */
+ BYTE drv; /* Physical drive number */
+ BYTE csize; /* Sectors per cluster (1,2,4...128) */
+ BYTE n_fats; /* Number of FAT copies (1,2) */
+ BYTE wflag; /* win[] dirty flag (1:must be written back) */
+ BYTE fsi_flag; /* fsinfo dirty flag (1:must be written back) */
+ WORD id; /* File system mount ID */
+ WORD n_rootdir; /* Number of root directory entries (FAT12/16) */
+#if _MAX_SS != 512
+ WORD ssize; /* Bytes per sector (512, 1024, 2048 or 4096) */
+#endif
+#if _FS_REENTRANT
+ _SYNC_t sobj; /* Identifier of sync object */
+#endif
+#if !_FS_READONLY
+ DWORD last_clust; /* Last allocated cluster */
+ DWORD free_clust; /* Number of free clusters */
+ DWORD fsi_sector; /* fsinfo sector (FAT32) */
+#endif
+#if _FS_RPATH
+ DWORD cdir; /* Current directory start cluster (0:root) */
+#endif
+ DWORD n_fatent; /* Number of FAT entries (= number of clusters + 2) */
+ DWORD fsize; /* Sectors per FAT */
+ DWORD fatbase; /* FAT start sector */
+ DWORD dirbase; /* Root directory start sector (FAT32:Cluster#) */
+ DWORD database; /* Data start sector */
+ DWORD winsect; /* Current sector appearing in the win[] */
+ BYTE win[_MAX_SS]; /* Disk access window for Directory, FAT (and Data on tiny cfg) */
+} FATFS;
+
+
+
+/* File object structure (FIL) */
+
+typedef struct {
+ FATFS* fs; /* Pointer to the related file system object */
+ WORD id; /* File system mount ID of the related file system object */
+ BYTE flag; /* File status flags */
+ BYTE pad1;
+ DWORD fptr; /* File read/write pointer (0ed on file open) */
+ DWORD fsize; /* File size */
+ DWORD sclust; /* File data start cluster (0:no data cluster, always 0 when fsize is 0) */
+ DWORD clust; /* Current cluster of fpter */
+ DWORD dsect; /* Current data sector of fpter */
+#if !_FS_READONLY
+ DWORD dir_sect; /* Sector containing the directory entry */
+ BYTE* dir_ptr; /* Pointer to the directory entry in the window */
+#endif
+#if _USE_FASTSEEK
+ DWORD* cltbl; /* Pointer to the cluster link map table (null on file open) */
+#endif
+#if _FS_LOCK
+ UINT lockid; /* File lock ID (index of file semaphore table Files[]) */
+#endif
+#if !_FS_TINY
+ BYTE buf[_MAX_SS]; /* File data read/write buffer */
+#endif
+} FIL;
+
+
+
+/* Directory object structure (DIR) */
+
+typedef struct {
+ FATFS* fs; /* Pointer to the owner file system object */
+ WORD id; /* Owner file system mount ID */
+ WORD index; /* Current read/write index number */
+ DWORD sclust; /* Table start cluster (0:Root dir) */
+ DWORD clust; /* Current cluster */
+ DWORD sect; /* Current sector */
+ BYTE* dir; /* Pointer to the current SFN entry in the win[] */
+ BYTE* fn; /* Pointer to the SFN (in/out) {file[8],ext[3],status[1]} */
+#if _USE_LFN
+ WCHAR* lfn; /* Pointer to the LFN working buffer */
+ WORD lfn_idx; /* Last matched LFN index number (0xFFFF:No LFN) */
+#endif
+} DIR;
+
+
+
+/* File status structure (FILINFO) */
+
+typedef struct {
+ DWORD fsize; /* File size */
+ WORD fdate; /* Last modified date */
+ WORD ftime; /* Last modified time */
+ BYTE fattrib; /* Attribute */
+ TCHAR fname[13]; /* Short file name (8.3 format) */
+#if _USE_LFN
+ TCHAR* lfname; /* Pointer to the LFN buffer */
+ UINT lfsize; /* Size of LFN buffer in TCHAR */
+#endif
+} FILINFO;
+
+
+
+/* File function return code (FRESULT) */
+
+typedef enum {
+ FR_OK = 0, /* (0) Succeeded */
+ FR_DISK_ERR, /* (1) A hard error occurred in the low level disk I/O layer */
+ FR_INT_ERR, /* (2) Assertion failed */
+ FR_NOT_READY, /* (3) The physical drive cannot work */
+ FR_NO_FILE, /* (4) Could not find the file */
+ FR_NO_PATH, /* (5) Could not find the path */
+ FR_INVALID_NAME, /* (6) The path name format is invalid */
+ FR_DENIED, /* (7) Access denied due to prohibited access or directory full */
+ FR_EXIST, /* (8) Access denied due to prohibited access */
+ FR_INVALID_OBJECT, /* (9) The file/directory object is invalid */
+ FR_WRITE_PROTECTED, /* (10) The physical drive is write protected */
+ FR_INVALID_DRIVE, /* (11) The logical drive number is invalid */
+ FR_NOT_ENABLED, /* (12) The volume has no work area */
+ FR_NO_FILESYSTEM, /* (13) There is no valid FAT volume */
+ FR_MKFS_ABORTED, /* (14) The f_mkfs() aborted due to any parameter error */
+ FR_TIMEOUT, /* (15) Could not get a grant to access the volume within defined period */
+ FR_LOCKED, /* (16) The operation is rejected according to the file sharing policy */
+ FR_NOT_ENOUGH_CORE, /* (17) LFN working buffer could not be allocated */
+ FR_TOO_MANY_OPEN_FILES, /* (18) Number of open files > _FS_SHARE */
+ FR_INVALID_PARAMETER /* (19) Given parameter is invalid */
+} FRESULT;
+
+
+
+/*--------------------------------------------------------------*/
+/* FatFs module application interface */
+
+FRESULT f_mount (BYTE, FATFS*); /* Mount/Unmount a logical drive */
+FRESULT f_open (FIL*, const TCHAR*, BYTE); /* Open or create a file */
+FRESULT f_read (FIL*, void*, UINT, UINT*); /* Read data from a file */
+FRESULT f_lseek (FIL*, DWORD); /* Move file pointer of a file object */
+FRESULT f_close (FIL*); /* Close an open file object */
+FRESULT f_opendir (DIR*, const TCHAR*); /* Open an existing directory */
+FRESULT f_readdir (DIR*, FILINFO*); /* Read a directory item */
+FRESULT f_stat (const TCHAR*, FILINFO*); /* Get file status */
+FRESULT f_write (FIL*, const void*, UINT, UINT*); /* Write data to a file */
+FRESULT f_getfree (const TCHAR*, DWORD*, FATFS**); /* Get number of free clusters on the drive */
+FRESULT f_truncate (FIL*); /* Truncate file */
+FRESULT f_sync (FIL*); /* Flush cached data of a writing file */
+FRESULT f_unlink (const TCHAR*); /* Delete an existing file or directory */
+FRESULT f_mkdir (const TCHAR*); /* Create a new directory */
+FRESULT f_chmod (const TCHAR*, BYTE, BYTE); /* Change attribute of the file/dir */
+FRESULT f_utime (const TCHAR*, const FILINFO*); /* Change times-tamp of the file/dir */
+FRESULT f_rename (const TCHAR*, const TCHAR*); /* Rename/Move a file or directory */
+FRESULT f_chdrive (BYTE); /* Change current drive */
+FRESULT f_chdir (const TCHAR*); /* Change current directory */
+FRESULT f_getcwd (TCHAR*, UINT); /* Get current directory */
+FRESULT f_forward (FIL*, UINT(*)(const BYTE*,UINT), UINT, UINT*); /* Forward data to the stream */
+FRESULT f_mkfs (BYTE, BYTE, UINT); /* Create a file system on the drive */
+FRESULT f_fdisk (BYTE, const DWORD[], void*); /* Divide a physical drive into some partitions */
+int f_putc (TCHAR, FIL*); /* Put a character to the file */
+int f_puts (const TCHAR*, FIL*); /* Put a string to the file */
+int f_printf (FIL*, const TCHAR*, ...); /* Put a formatted string to the file */
+TCHAR* f_gets (TCHAR*, int, FIL*); /* Get a string from the file */
+
+#define f_eof(fp) (((fp)->fptr == (fp)->fsize) ? 1 : 0)
+#define f_error(fp) (((fp)->flag & FA__ERROR) ? 1 : 0)
+#define f_tell(fp) ((fp)->fptr)
+#define f_size(fp) ((fp)->fsize)
+
+#ifndef EOF
+#define EOF (-1)
+#endif
+
+
+
+
+/*--------------------------------------------------------------*/
+/* Additional user defined functions */
+
+/* RTC function */
+#if !_FS_READONLY
+DWORD get_fattime (void);
+#endif
+
+/* Unicode support functions */
+#if _USE_LFN /* Unicode - OEM code conversion */
+WCHAR ff_convert (WCHAR, UINT); /* OEM-Unicode bidirectional conversion */
+WCHAR ff_wtoupper (WCHAR); /* Unicode upper-case conversion */
+#if _USE_LFN == 3 /* Memory functions */
+void* ff_memalloc (UINT); /* Allocate memory block */
+void ff_memfree (void*); /* Free memory block */
+#endif
+#endif
+
+/* Sync functions */
+#if _FS_REENTRANT
+int ff_cre_syncobj (BYTE, _SYNC_t*);/* Create a sync object */
+int ff_req_grant (_SYNC_t); /* Lock sync object */
+void ff_rel_grant (_SYNC_t); /* Unlock sync object */
+int ff_del_syncobj (_SYNC_t); /* Delete a sync object */
+#endif
+
+
+
+
+/*--------------------------------------------------------------*/
+/* Flags and offset address */
+
+
+/* File access control and file status flags (FIL.flag) */
+
+#define FA_READ 0x01
+#define FA_OPEN_EXISTING 0x00
+#define FA__ERROR 0x80
+
+#if !_FS_READONLY
+#define FA_WRITE 0x02
+#define FA_CREATE_NEW 0x04
+#define FA_CREATE_ALWAYS 0x08
+#define FA_OPEN_ALWAYS 0x10
+#define FA__WRITTEN 0x20
+#define FA__DIRTY 0x40
+#endif
+
+
+/* FAT sub type (FATFS.fs_type) */
+
+#define FS_FAT12 1
+#define FS_FAT16 2
+#define FS_FAT32 3
+
+
+/* File attribute bits for directory entry */
+
+#define AM_RDO 0x01 /* Read only */
+#define AM_HID 0x02 /* Hidden */
+#define AM_SYS 0x04 /* System */
+#define AM_VOL 0x08 /* Volume label */
+#define AM_LFN 0x0F /* LFN entry */
+#define AM_DIR 0x10 /* Directory */
+#define AM_ARC 0x20 /* Archive */
+#define AM_MASK 0x3F /* Mask of defined bits */
+
+
+/* Fast seek feature */
+#define CREATE_LINKMAP 0xFFFFFFFF
+
+
+
+/*--------------------------------*/
+/* Multi-byte word access macros */
+
+#if _WORD_ACCESS == 1 /* Enable word access to the FAT structure */
+#define LD_WORD(ptr) (WORD)(*(WORD*)(BYTE*)(ptr))
+#define LD_DWORD(ptr) (DWORD)(*(DWORD*)(BYTE*)(ptr))
+#define ST_WORD(ptr,val) *(WORD*)(BYTE*)(ptr)=(WORD)(val)
+#define ST_DWORD(ptr,val) *(DWORD*)(BYTE*)(ptr)=(DWORD)(val)
+#else /* Use byte-by-byte access to the FAT structure */
+#define LD_WORD(ptr) (WORD)(((WORD)*((BYTE*)(ptr)+1)<<8)|(WORD)*(BYTE*)(ptr))
+#define LD_DWORD(ptr) (DWORD)(((DWORD)*((BYTE*)(ptr)+3)<<24)|((DWORD)*((BYTE*)(ptr)+2)<<16)|((WORD)*((BYTE*)(ptr)+1)<<8)|*(BYTE*)(ptr))
+#define ST_WORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8)
+#define ST_DWORD(ptr,val) *(BYTE*)(ptr)=(BYTE)(val); *((BYTE*)(ptr)+1)=(BYTE)((WORD)(val)>>8); *((BYTE*)(ptr)+2)=(BYTE)((DWORD)(val)>>16); *((BYTE*)(ptr)+3)=(BYTE)((DWORD)(val)>>24)
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _FATFS */
diff --git a/SD_CARD/BaS_gcc/include/ffconf.h b/SD_CARD/BaS_gcc/include/ffconf.h
new file mode 100644
index 0000000..90de5fc
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ffconf.h
@@ -0,0 +1,190 @@
+/*---------------------------------------------------------------------------/
+/ FatFs - FAT file system module configuration file R0.09a (C)ChaN, 2012
+/----------------------------------------------------------------------------/
+/
+/ CAUTION! Do not forget to make clean the project after any changes to
+/ the configuration options.
+/
+/----------------------------------------------------------------------------*/
+#ifndef _FFCONF
+#define _FFCONF 4004 /* Revision ID */
+
+
+/*---------------------------------------------------------------------------/
+/ Functions and Buffer Configurations
+/----------------------------------------------------------------------------*/
+
+#define _FS_TINY 0 /* 0:Normal or 1:Tiny */
+/* When _FS_TINY is set to 1, FatFs uses the sector buffer in the file system
+/ object instead of the sector buffer in the individual file object for file
+/ data transfer. This reduces memory consumption 512 bytes each file object. */
+
+
+#define _FS_READONLY 0 /* 0:Read/Write or 1:Read only */
+/* Setting _FS_READONLY to 1 defines read only configuration. This removes
+/ writing functions, f_write, f_sync, f_unlink, f_mkdir, f_chmod, f_rename,
+/ f_truncate and useless f_getfree. */
+
+
+#define _FS_MINIMIZE 0 /* 0 to 3 */
+/* The _FS_MINIMIZE option defines minimization level to remove some functions.
+/
+/ 0: Full function.
+/ 1: f_stat, f_getfree, f_unlink, f_mkdir, f_chmod, f_truncate and f_rename
+/ are removed.
+/ 2: f_opendir and f_readdir are removed in addition to 1.
+/ 3: f_lseek is removed in addition to 2. */
+
+
+#define _USE_STRFUNC 0 /* 0:Disable or 1-2:Enable */
+/* To enable string functions, set _USE_STRFUNC to 1 or 2. */
+
+
+#define _USE_MKFS 0 /* 0:Disable or 1:Enable */
+/* To enable f_mkfs function, set _USE_MKFS to 1 and set _FS_READONLY to 0 */
+
+
+#define _USE_FORWARD 0 /* 0:Disable or 1:Enable */
+/* To enable f_forward function, set _USE_FORWARD to 1 and set _FS_TINY to 1. */
+
+
+#define _USE_FASTSEEK 0 /* 0:Disable or 1:Enable */
+/* To enable fast seek feature, set _USE_FASTSEEK to 1. */
+
+
+
+/*---------------------------------------------------------------------------/
+/ Locale and Namespace Configurations
+/----------------------------------------------------------------------------*/
+
+#define _CODE_PAGE 932
+/* The _CODE_PAGE specifies the OEM code page to be used on the target system.
+/ Incorrect setting of the code page can cause a file open failure.
+/
+/ 932 - Japanese Shift-JIS (DBCS, OEM, Windows)
+/ 936 - Simplified Chinese GBK (DBCS, OEM, Windows)
+/ 949 - Korean (DBCS, OEM, Windows)
+/ 950 - Traditional Chinese Big5 (DBCS, OEM, Windows)
+/ 1250 - Central Europe (Windows)
+/ 1251 - Cyrillic (Windows)
+/ 1252 - Latin 1 (Windows)
+/ 1253 - Greek (Windows)
+/ 1254 - Turkish (Windows)
+/ 1255 - Hebrew (Windows)
+/ 1256 - Arabic (Windows)
+/ 1257 - Baltic (Windows)
+/ 1258 - Vietnam (OEM, Windows)
+/ 437 - U.S. (OEM)
+/ 720 - Arabic (OEM)
+/ 737 - Greek (OEM)
+/ 775 - Baltic (OEM)
+/ 850 - Multilingual Latin 1 (OEM)
+/ 858 - Multilingual Latin 1 + Euro (OEM)
+/ 852 - Latin 2 (OEM)
+/ 855 - Cyrillic (OEM)
+/ 866 - Russian (OEM)
+/ 857 - Turkish (OEM)
+/ 862 - Hebrew (OEM)
+/ 874 - Thai (OEM, Windows)
+/ 1 - ASCII only (Valid for non LFN cfg.)
+*/
+
+
+#define _USE_LFN 0 /* 0 to 3 */
+#define _MAX_LFN 255 /* Maximum LFN length to handle (12 to 255) */
+/* The _USE_LFN option switches the LFN support.
+/
+/ 0: Disable LFN feature. _MAX_LFN and _LFN_UNICODE have no effect.
+/ 1: Enable LFN with static working buffer on the BSS. Always NOT reentrant.
+/ 2: Enable LFN with dynamic working buffer on the STACK.
+/ 3: Enable LFN with dynamic working buffer on the HEAP.
+/
+/ The LFN working buffer occupies (_MAX_LFN + 1) * 2 bytes. To enable LFN,
+/ Unicode handling functions ff_convert() and ff_wtoupper() must be added
+/ to the project. When enable to use heap, memory control functions
+/ ff_memalloc() and ff_memfree() must be added to the project. */
+
+
+#define _LFN_UNICODE 0 /* 0:ANSI/OEM or 1:Unicode */
+/* To switch the character code set on FatFs API to Unicode,
+/ enable LFN feature and set _LFN_UNICODE to 1. */
+
+
+#define _FS_RPATH 0 /* 0 to 2 */
+/* The _FS_RPATH option configures relative path feature.
+/
+/ 0: Disable relative path feature and remove related functions.
+/ 1: Enable relative path. f_chdrive() and f_chdir() are available.
+/ 2: f_getcwd() is available in addition to 1.
+/
+/ Note that output of the f_readdir fnction is affected by this option. */
+
+
+
+/*---------------------------------------------------------------------------/
+/ Physical Drive Configurations
+/----------------------------------------------------------------------------*/
+
+#define _VOLUMES 1
+/* Number of volumes (logical drives) to be used. */
+
+
+#define _MAX_SS 512 /* 512, 1024, 2048 or 4096 */
+/* Maximum sector size to be handled.
+/ Always set 512 for memory card and hard disk but a larger value may be
+/ required for on-board flash memory, floppy disk and optical disk.
+/ When _MAX_SS is larger than 512, it configures FatFs to variable sector size
+/ and GET_SECTOR_SIZE command must be implememted to the disk_ioctl function. */
+
+
+#define _MULTI_PARTITION 0 /* 0:Single partition, 1/2:Enable multiple partition */
+/* When set to 0, each volume is bound to the same physical drive number and
+/ it can mount only first primaly partition. When it is set to 1, each volume
+/ is tied to the partitions listed in VolToPart[]. */
+
+
+#define _USE_ERASE 0 /* 0:Disable or 1:Enable */
+/* To enable sector erase feature, set _USE_ERASE to 1. CTRL_ERASE_SECTOR command
+/ should be added to the disk_ioctl functio. */
+
+
+
+/*---------------------------------------------------------------------------/
+/ System Configurations
+/----------------------------------------------------------------------------*/
+
+#define _WORD_ACCESS 0 /* 0 or 1 */
+/* Set 0 first and it is always compatible with all platforms. The _WORD_ACCESS
+/ option defines which access method is used to the word data on the FAT volume.
+/
+/ 0: Byte-by-byte access.
+/ 1: Word access. Do not choose this unless following condition is met.
+/
+/ When the byte order on the memory is big-endian or address miss-aligned word
+/ access results incorrect behavior, the _WORD_ACCESS must be set to 0.
+/ If it is not the case, the value can also be set to 1 to improve the
+/ performance and code size.
+*/
+
+
+/* A header file that defines sync object types on the O/S, such as
+/ windows.h, ucos_ii.h and semphr.h, must be included prior to ff.h. */
+
+#define _FS_REENTRANT 0 /* 0:Disable or 1:Enable */
+#define _FS_TIMEOUT 1000 /* Timeout period in unit of time ticks */
+#define _SYNC_t HANDLE /* O/S dependent type of sync object. e.g. HANDLE, OS_EVENT*, ID and etc.. */
+
+/* The _FS_REENTRANT option switches the reentrancy (thread safe) of the FatFs module.
+/
+/ 0: Disable reentrancy. _SYNC_t and _FS_TIMEOUT have no effect.
+/ 1: Enable reentrancy. Also user provided synchronization handlers,
+/ ff_req_grant, ff_rel_grant, ff_del_syncobj and ff_cre_syncobj
+/ function must be added to the project. */
+
+
+#define _FS_LOCK 0 /* 0:Disable or >=1:Enable */
+/* To enable file lock control feature, set _FS_LOCK to 1 or greater.
+ The value defines how many files can be opened simultaneously. */
+
+
+#endif /* _FFCONFIG */
diff --git a/SD_CARD/BaS_gcc/include/ii_add.h b/SD_CARD/BaS_gcc/include/ii_add.h
new file mode 100644
index 0000000..bc23f63
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_add.h
@@ -0,0 +1,581 @@
+//--------------------------------------------------------------------
+// add
+//--------------------------------------------------------------------
+/*****************************************************************************************/
+//--------------------------------------------------------------------
+// byt
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// add.b #im,dx
+//--------------------------------------------------------------------
+addbir_macro:.macro
+ move.w (a0)+,d0
+ extb.l d0
+ mvs.b \2,d1
+ add.l d0,d1
+ set_cc0
+ move.b d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add ea,dx
+//--------------------------------------------------------------------
+adddd:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add ea,dx (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+addddd:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 a1,d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add (ea),dx (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+adddda:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add (ay)+,dx (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+addddai:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1)+,d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add -(ay),dx (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+addddad:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 -(a1),d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add d16(ay),dx
+//--------------------------------------------------------------------
+addd16ad:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add d8(ay,dy),dx
+//--------------------------------------------------------------------
+addd8ad:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add xxx.w,dx
+//--------------------------------------------------------------------
+addxwd:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.w (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add xxx.l,dx
+//--------------------------------------------------------------------
+addxld:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add d16(pc),dx
+//--------------------------------------------------------------------
+addd16pcd:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add d8(pc,dy),dx
+//--------------------------------------------------------------------
+addd8pcd:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// add dy,ea
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // add dx,(ay) (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+addeda:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,(ay)+ (first ea->a1 z.B. für a0,a1,USP)
+//--------------------------------------------------------------------
+addedai:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)+
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,(ay)+
+//--------------------------------------------------------------------
+addedaid:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2+
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,-(ay)
+//--------------------------------------------------------------------
+addedad:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 -(a1),d1
+ move.l a1,\2
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,-(ay)
+//--------------------------------------------------------------------
+addedadd:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 -\2,d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,d16(ay)
+//--------------------------------------------------------------------
+adde16ad:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ mvs.\3 (a1),d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add.w d8(ay,dy),dx
+//--------------------------------------------------------------------
+adde8ad:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \2,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d1
+ move.l \1,d0
+.else
+ mvs.\3 (a1),d1
+ mvs.\3 \1,d0
+.endif
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,xxx.w
+//--------------------------------------------------------------------
+addxwe:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.w (a0)+,a1
+ mvs.\3 (a1),d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // add dx,xxx.l
+//--------------------------------------------------------------------
+addxle:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l (a0)+,a1
+ mvs.\3 (a1),d1
+ add.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+/******************************************************/
+// adress register
+/******************************************************/
+//--------------------------------------------------------------------
+// // adda.w ea,ax (ea = dx;ax;(ax);(ax)+,-(ax)
+//--------------------------------------------------------------------
+addaw:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,pc_off(a7) // pc auf next
+ movem.l (a7),d0/d1/a0/a1 // register zurpück
+ mvs.w \1,d0
+ adda.l d0,\2
+ move.l d0_off(a7),d0
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+ .endm;
+//--------------------------------------------------------------------
+// add.w ea,usp
+//--------------------------------------------------------------------
+addawa7:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.w \1,d0
+ move.l usp,a1
+ add.l d0,a1
+ move.l a1,usp
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w ea,usp (ea = dx;ax;(ax);(ax)+,-(ax)
+//--------------------------------------------------------------------
+addawu:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,pc_off(a7) // pc auf next
+ movem.l (a7),d0/d1/a0/a1 // register zurpück
+ move.l a7,_a7_save
+ move.l usp,a7
+ move.l \1,d0
+ adda.l d0,\2
+ move.l a7,usp
+ move.l _a7_save,a7
+ move.l d0_off(a7),d0
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w ea,usp (ea = a7 => dx;ax;(ax);(ax)+,-(ax)
+//--------------------------------------------------------------------
+addawua7:.macro
+ addawu \1,\2
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w d16(ay),ax
+//--------------------------------------------------------------------
+addawd16a:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ adda.l d0,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ add.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w d8(ay,dy),ax
+//--------------------------------------------------------------------
+addawd8a:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+ mvs.w (a1),d0
+ move.l \2,a1
+ add.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w xxx.w,ax
+//--------------------------------------------------------------------
+addawxwax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.w \1,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w xxx.l,ax
+//--------------------------------------------------------------------
+addawxlax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w d16(pc),ax
+//--------------------------------------------------------------------
+addawd16pcax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.w \1,a1
+ adda.l a0,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w d8(pc,dy),ax
+//--------------------------------------------------------------------
+addawd8pcax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+ mvs.w (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.w #im,ax
+//--------------------------------------------------------------------
+addawim:.macro
+#ifdef halten_add
+ halt
+#endif
+ mvs.w \1,d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.l d8(ay,dy),ax
+//--------------------------------------------------------------------
+addald8a:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+ move.l (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // adda.l d8(pc,dy),ax
+//--------------------------------------------------------------------
+addakd8pcax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+ move.l (a1),d0
+ move.l \2,a1
+ adda.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//*****************************************************************************************
+// addx
+//*****************************************************************************************
+//--------------------------------------------------------------------
+// // addx dy,dx
+//--------------------------------------------------------------------
+adddx:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.b sr_off+1(a7),d0 //ccr holen
+ move d0,ccr //setzen
+ mvs.\3 \2,d0
+ mvs.\3 \1,d1
+ addx.l d0,d1
+ set_cc0
+ move.\3 d1,\1
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // addx -(ay),-(ax)
+//--------------------------------------------------------------------
+adddax:.macro
+#ifdef halten_add
+ halt
+#endif
+ move.b sr_off+1(a7),d0 //ccr holen
+ move d0,ccr //setzen
+ move.l \1,a1
+.ifc \3,l
+ move.l -(a1),d0
+.else
+ mvs.\3 -(a1),d0
+.endif
+ move.l \2,a1
+.ifc \3,l
+ move.l -(a1),d0
+.else
+ mvs.\3 -(a1),d1
+.endif
+ addx.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
diff --git a/SD_CARD/BaS_gcc/include/ii_and.h b/SD_CARD/BaS_gcc/include/ii_and.h
new file mode 100644
index 0000000..f74afde
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_and.h
@@ -0,0 +1,441 @@
+//--------------------------------------------------------------------
+// and
+//--------------------------------------------------------------------
+/*****************************************************************************************/
+//--------------------------------------------------------------------
+// byt
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// and.b #im,dx
+//--------------------------------------------------------------------
+andbir_macro:.macro
+ move.w (a0)+,d0
+ extb.l d0
+ mvs.b \2,d1
+ and.l d0,d1
+ set_cc0
+ move.b d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and ea,dx
+//--------------------------------------------------------------------
+anddd:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and ea(l)->dy(w),dx z.B. für USP
+//--------------------------------------------------------------------
+andddd:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 a1,d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and (ea)->dy,dx
+//--------------------------------------------------------------------
+anddda:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and ea->ay,(ay)+,dx
+//--------------------------------------------------------------------
+andddai:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1)+,d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and ea->ay,-(ay),dx
+//--------------------------------------------------------------------
+andddad:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 -(a1),d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and d16(ay),dx
+//--------------------------------------------------------------------
+andd16ad:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and d8(ay,dy),dx
+//--------------------------------------------------------------------
+andd8ad:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and xxx.w,dx
+//--------------------------------------------------------------------
+andxwd:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.w (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and xxx.l,dx
+//--------------------------------------------------------------------
+andxld:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and d16(pc),dx
+//--------------------------------------------------------------------
+andd16pcd:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l a0,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and d8(pc,dy),dx
+//--------------------------------------------------------------------
+andd8pcd:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// and dx,ea
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // and dx,(ea)->dy
+//--------------------------------------------------------------------
+andeda:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+andedai:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)+
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+andedaid:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2+
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+andedad:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 -(a1),d1
+ move.l a1,\2
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+andedadd:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 -\2,d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,d16(ay)
+//--------------------------------------------------------------------
+ande16ad:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ mvs.\3 (a1),d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and.w dx,d8(ay,dy)
+//--------------------------------------------------------------------
+ande8ad:.macro
+#ifdef halten_and
+ halt
+#endif
+ move.l \2,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d1
+ move.l \1,d0
+.else
+ mvs.\3 (a1),d1
+ mvs.\3 \1,d0
+.endif
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,xxx.w
+//--------------------------------------------------------------------
+andxwe:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.w (a0)+,a1
+ mvs.\3 (a1),d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // and dx,xxx.l
+//--------------------------------------------------------------------
+andxle:.macro
+#ifdef halten_and
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l (a0)+,a1
+ mvs.\3 (a1),d1
+ and.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w ea,ax
+//--------------------------------------------------------------------
+andaw:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// and.w ea,usp
+//--------------------------------------------------------------------
+andawa7:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w usp?,ax
+//--------------------------------------------------------------------
+andawu:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w usp?,usp
+//--------------------------------------------------------------------
+andawua7:.macro
+ andawu \1,\2
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w d16(ay),ax
+//--------------------------------------------------------------------
+andawd16a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w d8(ay,dy),ax
+//--------------------------------------------------------------------
+andawd8a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w xxx.w,ax
+//--------------------------------------------------------------------
+andawxwax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w xxx.l,ax
+//--------------------------------------------------------------------
+andawxlax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w d16(pc),ax
+//--------------------------------------------------------------------
+andawd16pcax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w d8(pc,dy),ax
+//--------------------------------------------------------------------
+andawd8pcax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.w #im,ax
+//--------------------------------------------------------------------
+andawim:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.l d8(ay,dy),ax
+//--------------------------------------------------------------------
+andald8a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // anda.l d8(pc,dy),ax
+//--------------------------------------------------------------------
+andald8pcax:.macro
+ jmp ii_error
+ .endm;
+//*****************************************************************************************
+// spezial addx subx etc.
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // addx dy,dx
+//--------------------------------------------------------------------
+anddx:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // addx -(ay),-(ax)
+//--------------------------------------------------------------------
+anddax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
diff --git a/SD_CARD/BaS_gcc/include/ii_dbcc.h b/SD_CARD/BaS_gcc/include/ii_dbcc.h
new file mode 100644
index 0000000..652cdbe
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_dbcc.h
@@ -0,0 +1,117 @@
+//--------------------------------------------------------------------
+// dbcc,trapcc
+//--------------------------------------------------------------------
+.text
+ii_lset_dbcc:.macro
+// dbra
+ ii_lset_opeau 51,c
+ ii_lset_opeau 52,c
+ ii_lset_opeau 53,c
+ ii_lset_opeau 54,c
+ ii_lset_opeau 55,c
+ ii_lset_opeau 56,c
+ ii_lset_opeau 57,c
+ ii_lset_opeau 58,c
+ ii_lset_opeau 59,c
+ ii_lset_opeau 5a,c
+ ii_lset_opeau 5b,c
+ ii_lset_opeau 5c,c
+ ii_lset_opeau 5d,c
+ ii_lset_opeau 5e,c
+ ii_lset_opeau 5f,c
+.endm
+
+ii_dbcc_func:.macro
+ii_0x51c8:
+ dbra_macro d0_off+2(a7)
+ii_0x51c9:
+ dbra_macro d1_off+2(a7)
+ii_0x51ca:
+ dbra_macro d2
+ii_0x51cb:
+ dbra_macro d3
+ii_0x51cc:
+ dbra_macro d4
+ii_0x51cd:
+ dbra_macro d5
+ii_0x51ce:
+ dbra_macro d6
+ii_0x51cf:
+ dbra_macro d7
+//---------------------------------------------------------------------------------------------
+// dbcc dx
+//---------------------------------------------------------------------------------------------
+ ii_dbcc 2,hi
+ ii_dbcc 3,ls
+ ii_dbcc 4,cc
+ ii_dbcc 5,cs
+ ii_dbcc 6,ne
+ ii_dbcc 7,eq
+ ii_dbcc 8,vc
+ ii_dbcc 9,vs
+ ii_dbcc a,pl
+ ii_dbcc b,mi
+ ii_dbcc c,ge
+ ii_dbcc d,lt
+ ii_dbcc e,gt
+ ii_dbcc f,le
+.endm
+//---------------------------------------------------------------------------------------------
+// dbra dx
+//---------------------------------------------------------------------------------------------
+dbra_macro:.macro
+#ifdef halten_dbcc
+ halt
+#endif
+ mvz.w \1,d1 // dx holen
+ subq.l #1,d1 // dx-1
+ bcc dbra\@ // bra if plus?
+ addq.l #2,a0 // offset überspringen
+ move.w d1,\1 // dx sichern
+ ii_end
+dbra\@:
+ move.w (a0),a1 // offset (wird auf long erweitert)
+ add.l a1,a0 // dazuadieren
+ move.w d1,\1 // dx sichern
+ ii_end
+.endm
+//---------------------------------------------------------------------------------------------
+// dbcc dx
+//---------------------------------------------------------------------------------------------
+dbcc_macro:.macro
+#ifdef halten_dbcc
+ halt
+#endif
+ b\2 dbncc\@
+ mvz.w \1,d1 // dx holen
+ subq.l #1,d1 // dx-1
+ bcc dbcc\@ // bra if plus?
+dbncc\@:
+ addq.l #2,a0 // offset überspringen
+ move.w d1,\1 // dx sichern
+ ii_end
+dbcc\@:
+ move.w (a0),a1 // offset (wird auf long erweitert)
+ add.l a1,a0 // dazuadieren
+ move.w d1,\1 // dx sichern
+ ii_end
+.endm
+//db
+ii_dbcc:.macro
+ii_0x5\1c8:
+ dbcc_macro d0_off+2(a7),\2
+ii_0x5\1c9:
+ dbcc_macro d1_off+2(a7),\2
+ii_0x5\1ca:
+ dbcc_macro d2,\2
+ii_0x5\1cb:
+ dbcc_macro d3,\2
+ii_0x5\1cc:
+ dbcc_macro d4,\2
+ii_0x5\1cd:
+ dbcc_macro d5,\2
+ii_0x5\1ce:
+ dbcc_macro d6,\2
+ii_0x5\1cf:
+ dbcc_macro d7,\2
+.endm
\ No newline at end of file
diff --git a/SD_CARD/BaS_gcc/include/ii_ewf.h b/SD_CARD/BaS_gcc/include/ii_ewf.h
new file mode 100644
index 0000000..34d2483
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_ewf.h
@@ -0,0 +1,181 @@
+//--------------------------------------------------------------------
+// extension word format missing
+//--------------------------------------------------------------------
+.text
+ii_ewf_lset:.macro
+// pea
+ ii_lset_opeag 48,7
+ ii_lset 0x487b
+// jmp
+ ii_lset_opeag 4e,f
+ ii_lset 0x4efb
+// jsr
+ ii_lset_opeag 4e,b
+ ii_lset 0x4ebb
+// tas
+ ii_lset_opeag 4a,f
+ ii_lset 0x4ebb
+// tst.b
+ ii_lset_opeag 4a,3
+ ii_lset 0x4ebb
+// tst.w
+ ii_lset_opeag 4a,7
+ ii_lset 0x4ebb
+// tst.l
+ ii_lset_opeag 4a,b
+ ii_lset 0x4ebb
+// clr.b
+ ii_lset_opeag 42,3
+ ii_lset 0x423b
+// clr.w
+ ii_lset_opeag 42,7
+ ii_lset 0x423b
+// clr.l
+ ii_lset_opeag 42,b
+ ii_lset 0x423b
+.endm
+//---------------------------------------------------------------------------------------------
+ii_ewf_func:.macro
+ ewf_func_macro pea,487
+ ewf_func_macro jmp,4ef
+ ewf_func_macro jsr,4eb
+ ewf_func_macro tas,4af
+ ewf_func_macro tstb,4a3
+ ewf_func_macro tstw,4a7
+ ewf_func_macro tstl,4ab
+ ewf_func_macro clrb,423
+ ewf_func_macro clrw,427
+ ewf_func_macro clrl,42b
+.endm
+//---------------------------------------------------------------------------------------------
+pea_macro:.macro
+ jsr ewf
+ move.l (a1),d0
+ move.l usp,a1
+ move.l d0,-(a1)
+ move.l a1,usp
+ ii_end
+.endm
+
+jmp_macro:.macro
+ jsr ewf
+ move.l a1,a0
+ ii_end
+.endm
+
+jsr_macro:.macro
+ jsr ewf
+ move.l a1,d0
+ move.l usp,a1
+ move.l a0,-(a1)
+ move.l a1,usp
+ move.l d0,a0
+ ii_end
+.endm
+
+tas_macro:.macro
+ jsr ewf
+ tas (a1)
+ set_cc0
+ ii_end
+.endm
+
+tstb_macro:.macro
+ jsr ewf
+ tst.b (a1)
+ set_cc0
+ ii_end
+.endm
+
+tstw_macro:.macro
+ jsr ewf
+ tst.w (a1)
+ set_cc0
+ ii_end
+.endm
+
+tstl_macro:.macro
+ jsr ewf
+ tst.l (a1)
+ set_cc0
+ ii_end
+.endm
+
+clrb_macro:.macro
+ jsr ewf
+ clr.b (a1)
+ set_cc0
+ ii_end
+.endm
+
+clrw_macro:.macro
+ jsr ewf
+ clr.w (a1)
+ set_cc0
+ ii_end
+.endm
+
+clrl_macro:.macro
+ jsr ewf
+ clr.l (a1)
+ set_cc0
+ ii_end
+.endm
+//--------------------------------------------------------------------
+ewf_func_macro:.macro //1=art 2=code
+ii_0x\20:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a0_off(a7),a1
+ \1_macro
+ii_0x\21:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a1_off(a7),a1
+ \1_macro
+ii_0x\22:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a2,a1
+ \1_macro
+ii_0x\23:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a3,a1
+ \1_macro
+ii_0x\24:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a4,a1
+ \1_macro
+ii_0x\25:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a5,a1
+ \1_macro
+ii_0x\26:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a6,a1
+ \1_macro
+ii_0x\27:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l usp,a1
+ \1_macro
+ii_0x\2b:
+#ifdef halten_ewf
+ halt
+#endif
+ move.l a0,a1
+ \1_macro
+.endm
+
diff --git a/SD_CARD/BaS_gcc/include/ii_exg.h b/SD_CARD/BaS_gcc/include/ii_exg.h
new file mode 100644
index 0000000..a0544af
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_exg.h
@@ -0,0 +1,120 @@
+//--------------------------------------------------------------------
+// exg
+//--------------------------------------------------------------------
+.text
+ii_exg_lset:.macro
+/* ii_lset_dxu c,40 //dx,d0
+ ii_lset_dxu c,41 //dx,d1
+ ii_lset_dxu c,42 //dx,d2
+ ii_lset_dxu c,43 //dx,d3
+ ii_lset_dxu c,44 //dx,d4
+ ii_lset_dxu c,45 //dx,d5
+ ii_lset_dxu c,46 //dx,d6
+ ii_lset_dxu c,47 //dx,d7
+ ii_lset_dxu c,48 //ax,a0
+ ii_lset_dxu c,49 //ax,a1
+ ii_lset_dxu c,4a //ax,a2
+ ii_lset_dxu c,4b //ax,a3
+ ii_lset_dxu c,4c //ax,a4
+ ii_lset_dxu c,4d //ax,a5
+ ii_lset_dxu c,4e //ax,a6
+ ii_lset_dxu c,4f //ax,a7 */ -->setting by "and"
+ ii_lset_dxu c,88 //dx,a0
+ ii_lset_dxu c,89 //dx,a1
+ ii_lset_dxu c,8a //dx,a2
+ ii_lset_dxu c,8b //dx,a3
+ ii_lset_dxu c,8c //dx,a4
+ ii_lset_dxu c,8d //dx,a5
+ ii_lset_dxu c,8e //dx,a6
+ ii_lset_dxu c,8f //dx,a7
+.endm
+//---------------------------------------------------------------------------------------------
+ii_exg_func:.macro
+// exg dx,dy
+ ii_exg_dx_dx 14,d0_off(a7)
+ ii_exg_dx_dx 34,d1_off(a7)
+ ii_exg_dx_dx 54,d2
+ ii_exg_dx_dx 74,d3
+ ii_exg_dx_dx 94,d4
+ ii_exg_dx_dx b4,d5
+ ii_exg_dx_dx d4,d6
+ ii_exg_dx_dx f4,d7
+// exg ax,ay
+ ii_exg_to_ax 14,a0_off(a7)
+ ii_exg_to_ax 34,a1_off(a7)
+ ii_exg_to_ax 54,a2
+ ii_exg_to_ax 74,a3
+ ii_exg_to_ax 94,a4
+ ii_exg_to_ax b4,a5
+ ii_exg_to_ax d4,a6
+ ii_exg_to_ax f4,usp
+// exg dx,ay
+ ii_exg_to_ax 18,d0_off(a7)
+ ii_exg_to_ax 38,d1_off(a7)
+ ii_exg_to_ax 58,d2
+ ii_exg_to_ax 78,d3
+ ii_exg_to_ax 98,d4
+ ii_exg_to_ax b8,d5
+ ii_exg_to_ax d8,d6
+ ii_exg_to_ax f8,d7
+.endm
+//---------------------------------------------------------------------------------------------
+exg_macro:.macro
+#ifdef halten_exg
+ halt
+#endif
+ move.l \1,a1
+.ifc \2,usp
+ move.l a1,d0
+ move.l \2,a1
+ move.l a1,\1
+ move.l d0,a1
+.else
+ .ifc \1,usp
+ move.l a1,d0
+ move.l \2,a1
+ move.l a1,\1
+ move.l d0,a1
+ .else
+ move.l \2,\1
+ .endif
+.endif
+ move.l a1,\2
+ ii_end
+.endm
+ii_exg_dx_dx:.macro
+ii_0xc\10:
+ exg_macro \2,d0_off(a7)
+ii_0xc\11:
+ exg_macro \2,d1_off(a7)
+ii_0xc\12:
+ exg_macro \2,d2
+ii_0xc\13:
+ exg_macro \2,d3
+ii_0xc\14:
+ exg_macro \2,d4
+ii_0xc\15:
+ exg_macro \2,d5
+ii_0xc\16:
+ exg_macro \2,d6
+ii_0xc\17:
+ exg_macro \2,d7
+.endm
+ii_exg_to_ax:.macro
+ii_0xc\18:
+ exg_macro \2,a0_off(a7)
+ii_0xc\19:
+ exg_macro \2,a1_off(a7)
+ii_0xc\1a:
+ exg_macro \2,a2
+ii_0xc\1b:
+ exg_macro \2,a3
+ii_0xc\1c:
+ exg_macro \2,a4
+ii_0xc\1d:
+ exg_macro \2,a5
+ii_0xc\1e:
+ exg_macro \2,a6
+ii_0xc\1f:
+ exg_macro \2,usp
+.endm
\ No newline at end of file
diff --git a/SD_CARD/BaS_gcc/include/ii_func.h b/SD_CARD/BaS_gcc/include/ii_func.h
new file mode 100644
index 0000000..f545f47
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_func.h
@@ -0,0 +1,945 @@
+//--------------------------------------------------------------------
+// functionen macros
+//--------------------------------------------------------------------
+ii_lset_func:.macro
+/******************************************************/
+// byt
+/******************************************************/
+// func.b dy,dx
+ ii_lset_dx \1,00 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+ ii_lset_dx \1,01
+ ii_lset_dx \1,02
+ ii_lset_dx \1,03
+ ii_lset_dx \1,04
+ ii_lset_dx \1,05
+ ii_lset_dx \1,06
+ ii_lset_dx \1,07
+// func.b ax,dx
+ ii_lset_dxu \1,08
+ ii_lset_dxu \1,09
+ ii_lset_dxu \1,0a
+ ii_lset_dxu \1,0b
+ ii_lset_dxu \1,0c
+ ii_lset_dxu \1,0d
+ ii_lset_dxu \1,0e
+ ii_lset_dxu \1,0f
+// func.b (ax),dx
+ ii_lset_dx \1,10
+ ii_lset_dx \1,11
+ ii_lset_dx \1,12
+ ii_lset_dx \1,13
+ ii_lset_dx \1,14
+ ii_lset_dx \1,15
+ ii_lset_dx \1,16
+ ii_lset_dx \1,17
+// func.b (ax)+,dx
+ ii_lset_dx \1,18
+ ii_lset_dx \1,19
+ ii_lset_dx \1,1a
+ ii_lset_dx \1,1b
+ ii_lset_dx \1,1c
+ ii_lset_dx \1,1d
+ ii_lset_dx \1,1e
+ ii_lset_dx \1,1f
+// func.b -(ax),dx
+ ii_lset_dx \1,20
+ ii_lset_dx \1,21
+ ii_lset_dx \1,22
+ ii_lset_dx \1,23
+ ii_lset_dx \1,24
+ ii_lset_dx \1,25
+ ii_lset_dx \1,26
+ ii_lset_dx \1,27
+// func.b d16(ax),dx
+ ii_lset_dx \1,28
+ ii_lset_dx \1,29
+ ii_lset_dx \1,2a
+ ii_lset_dx \1,2b
+ ii_lset_dx \1,2c
+ ii_lset_dx \1,2d
+ ii_lset_dx \1,2e
+ ii_lset_dx \1,2f
+// func.b dd8(ax,dy),dx
+ ii_lset_dx \1,30
+ ii_lset_dx \1,31
+ ii_lset_dx \1,32
+ ii_lset_dx \1,33
+ ii_lset_dx \1,34
+ ii_lset_dx \1,35
+ ii_lset_dx \1,36
+ ii_lset_dx \1,37
+// func.b xxx.w,dx
+ ii_lset_dx \1,38 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.b xxx.l,dx
+ ii_lset_dx \1,39 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.b d16(pc),dx
+ ii_lset_dxg \1,7a // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.b d8(pc,dy),dx
+ ii_lset_dxg \1,3b // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.b #im,dx
+ ii_lset_dxg \1,3c // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+/******************************************************/
+// word
+/******************************************************/
+// func.w dy,dx
+ ii_lset_dx \1,40 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+ ii_lset_dx \1,41
+ ii_lset_dx \1,42
+ ii_lset_dx \1,43
+ ii_lset_dx \1,44
+ ii_lset_dx \1,45
+ ii_lset_dx \1,46
+ ii_lset_dx \1,47
+// func.w ax,dx
+ ii_lset_dx \1,48
+ ii_lset_dx \1,49
+ ii_lset_dx \1,4a
+ ii_lset_dx \1,4b
+ ii_lset_dx \1,4c
+ ii_lset_dx \1,4d
+ ii_lset_dx \1,4e
+ ii_lset_dx \1,4f
+// func.w (ax),dx
+ ii_lset_dx \1,50
+ ii_lset_dx \1,51
+ ii_lset_dx \1,52
+ ii_lset_dx \1,53
+ ii_lset_dx \1,54
+ ii_lset_dx \1,55
+ ii_lset_dx \1,56
+ ii_lset_dx \1,57
+// func.w (ax)+,dx
+ ii_lset_dx \1,58
+ ii_lset_dx \1,59
+ ii_lset_dx \1,5a
+ ii_lset_dx \1,5b
+ ii_lset_dx \1,5c
+ ii_lset_dx \1,5d
+ ii_lset_dx \1,5e
+ ii_lset_dx \1,5f
+// func.w -(ax),dx
+ ii_lset_dx \1,60
+ ii_lset_dx \1,61
+ ii_lset_dx \1,62
+ ii_lset_dx \1,63
+ ii_lset_dx \1,64
+ ii_lset_dx \1,65
+ ii_lset_dx \1,66
+ ii_lset_dx \1,67
+// func.w d16(ax),dx
+ ii_lset_dx \1,68
+ ii_lset_dx \1,69
+ ii_lset_dx \1,6a
+ ii_lset_dx \1,6b
+ ii_lset_dx \1,6c
+ ii_lset_dx \1,6d
+ ii_lset_dx \1,6e
+ ii_lset_dx \1,6f
+// func.w d8(ax,dy),dx
+ ii_lset_dx \1,70
+ ii_lset_dx \1,71
+ ii_lset_dx \1,72
+ ii_lset_dx \1,73
+ ii_lset_dx \1,74
+ ii_lset_dx \1,75
+ ii_lset_dx \1,76
+ ii_lset_dx \1,77
+// func.w xxx.w,dx
+ ii_lset_dx \1,78 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.w xxx.l,dx
+ ii_lset_dx \1,79 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.w d16(pc),dx
+ ii_lset_dxg \1,7a // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.w d8(pc,dy),dx
+ ii_lset_dxg \1,7b // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+// func.w #im,dx
+ ii_lset_dxg \1,7c // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+/******************************************************/
+// long
+/******************************************************/
+// func.l ax,dx -> -(ay),-(ax)
+ ii_lset_dxu \1,c8
+ ii_lset_dxu \1,c9
+ ii_lset_dxu \1,ca
+ ii_lset_dxu \1,cb
+ ii_lset_dxu \1,cc
+ ii_lset_dxu \1,cd
+ ii_lset_dxu \1,ce
+ ii_lset_dxu \1,cf
+// func.w d8(ax,dy),dx
+ ii_lset_dx \1,b0
+ ii_lset_dx \1,b1
+ ii_lset_dx \1,b2
+ ii_lset_dx \1,b3
+ ii_lset_dx \1,b4
+ ii_lset_dx \1,b5
+ ii_lset_dx \1,b6
+ ii_lset_dx \1,b7
+// func.l d8(pc,dy),dx
+ ii_lset_dxg \1,bb // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+/******************************************************/
+// adress register
+/******************************************************/
+//func.w dy,ax
+ ii_lset_dxg \1,c0
+ ii_lset_dxg \1,c1
+ ii_lset_dxg \1,c2
+ ii_lset_dxg \1,c3
+ ii_lset_dxg \1,c4
+ ii_lset_dxg \1,c5
+ ii_lset_dxg \1,c6
+ ii_lset_dxg \1,c7
+//func.w ay,ax
+ ii_lset_dxg \1,c8
+ ii_lset_dxg \1,c9
+ ii_lset_dxg \1,ca
+ ii_lset_dxg \1,cb
+ ii_lset_dxg \1,cc
+ ii_lset_dxg \1,cd
+ ii_lset_dxg \1,ce
+ ii_lset_dxg \1,cf
+//func.w (ay),ax
+ ii_lset_dxg \1,d0
+ ii_lset_dxg \1,d1
+ ii_lset_dxg \1,d2
+ ii_lset_dxg \1,d3
+ ii_lset_dxg \1,d4
+ ii_lset_dxg \1,d5
+ ii_lset_dxg \1,d6
+ ii_lset_dxg \1,d7
+//func.w (ay)+,ax
+ ii_lset_dxg \1,d8
+ ii_lset_dxg \1,d9
+ ii_lset_dxg \1,da
+ ii_lset_dxg \1,db
+ ii_lset_dxg \1,dc
+ ii_lset_dxg \1,dd
+ ii_lset_dxg \1,de
+ ii_lset_dxg \1,df
+//func.w -(ay),ax
+ ii_lset_dxg \1,e0
+ ii_lset_dxg \1,e1
+ ii_lset_dxg \1,e2
+ ii_lset_dxg \1,e3
+ ii_lset_dxg \1,e4
+ ii_lset_dxg \1,e5
+ ii_lset_dxg \1,e6
+ ii_lset_dxg \1,e7
+//func.w d16(ay),ax
+ ii_lset_dxg \1,e8
+ ii_lset_dxg \1,e9
+ ii_lset_dxg \1,ea
+ ii_lset_dxg \1,eb
+ ii_lset_dxg \1,ec
+ ii_lset_dxg \1,ed
+ ii_lset_dxg \1,ee
+ ii_lset_dxg \1,ef
+//func.w d8(ay,dy),ax
+ ii_lset_dxg \1,f0
+ ii_lset_dxg \1,f1
+ ii_lset_dxg \1,f2
+ ii_lset_dxg \1,f3
+ ii_lset_dxg \1,f4
+ ii_lset_dxg \1,f5
+ ii_lset_dxg \1,f6
+ ii_lset_dxg \1,f7
+// func.w xxx.w,ax
+ ii_lset_dxg \1,f8
+// func.w xxx.l,ax
+ ii_lset_dxg \1,f9
+// func.w d16(pc),ax
+ ii_lset_dxg \1,fa
+// func.w d8(pc,dy),ax
+ ii_lset_dxg \1,fb
+// func.w #im,ax
+ ii_lset_dxg \1,fc
+//--------------------------------------------------------------------
+// ende
+ .endm;
+/*****************************************************************************************/
+ii_func:.macro
+//--------------------------------------------------------------------
+// byt
+//--------------------------------------------------------------------
+///--------------------------------------------------------------------
+// func.b ds,dx
+//--------------------------------------------------------------------
+ funcbeadx \1,00,\2dd,d0_off+3(a7)
+ funcbeadx \1,01,\2dd,d1_off+3(a7)
+ funcbeadx \1,02,\2dd,d2
+ funcbeadx \1,03,\2dd,d3
+ funcbeadx \1,04,\2dd,d4
+ funcbeadx \1,05,\2dd,d5
+ funcbeadx \1,06,\2dd,d6
+ funcbeadx \1,07,\2dd,d7
+//--------------------------------------------------------------------
+// func.b (ax),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,10,\2dda,a0_off(a7)
+ funcbeadx \1,11,\2dda,a1_off(a7)
+ funcbeadx \1,12,\2dd,(a2)
+ funcbeadx \1,13,\2dd,(a3)
+ funcbeadx \1,14,\2dd,(a4)
+ funcbeadx \1,15,\2dd,(a5)
+ funcbeadx \1,16,\2dd,(a6)
+ funcbeadx \1,17,\2dda,usp
+//--------------------------------------------------------------------
+// func.b (ax)+,dx
+//--------------------------------------------------------------------
+ funcbeadx \1,18,\2ddai,a0_off(a7)
+ funcbeadx \1,19,\2ddai,a1_off(a7)
+ funcbeadx \1,1a,\2dd,(a2)+
+ funcbeadx \1,1b,\2dd,(a3)+
+ funcbeadx \1,1c,\2dd,(a4)+
+ funcbeadx \1,1d,\2dd,(a5)+
+ funcbeadx \1,1e,\2dd,(a6)+
+ funcbeadx \1,1f,\2ddai,usp
+//--------------------------------------------------------------------
+// func.b -(ax),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,20,\2ddad,a0_off(a7)
+ funcbeadx \1,21,\2ddad,a1_off(a7)
+ funcbeadx \1,22,\2dd,-(a2)
+ funcbeadx \1,23,\2dd,-(a3)
+ funcbeadx \1,24,\2dd,-(a4)
+ funcbeadx \1,25,\2dd,-(a5)
+ funcbeadx \1,26,\2dd,-(a6)
+ funcbeadx \1,27,\2ddad,usp
+//--------------------------------------------------------------------
+// func.b d16(ax),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,28,\2d16ad,a0_off(a7)
+ funcbeadx \1,29,\2d16ad,a1_off(a7)
+ funcbeadx \1,2a,\2d16ad,a2
+ funcbeadx \1,2b,\2d16ad,a3
+ funcbeadx \1,2c,\2d16ad,a4
+ funcbeadx \1,2d,\2d16ad,a5
+ funcbeadx \1,2e,\2d16ad,a6
+ funcbeadx \1,2f,\2d16ad,usp
+//--------------------------------------------------------------------
+// func.b d8(ax,dy),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,30,\2d8ad,a0_off(a7)
+ funcbeadx \1,31,\2d8ad,a1_off(a7)
+ funcbeadx \1,32,\2d8ad,a2
+ funcbeadx \1,33,\2d8ad,a3
+ funcbeadx \1,34,\2d8ad,a4
+ funcbeadx \1,35,\2d8ad,a5
+ funcbeadx \1,36,\2d8ad,a6
+ funcbeadx \1,37,\2d8ad,usp
+//--------------------------------------------------------------------
+// func.b xxx.w,dx
+//--------------------------------------------------------------------
+ funcbeadx \1,38,\2xwd,(a0)+
+//--------------------------------------------------------------------
+// func.b xxx.w,dx
+//--------------------------------------------------------------------
+ funcbeadx \1,39,\2xld,(a0)+
+//--------------------------------------------------------------------
+// func.b d16(pc),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,3a,\2d16pcd,(a0)+
+//--------------------------------------------------------------------
+// func.b d8(pc,dy),dx
+//--------------------------------------------------------------------
+ funcbeadx \1,3b,\2d8pcd,(a0)+ (a0 wird nicht verwendet)
+//--------------------------------------------------------------------
+// func.b #im,dx
+//--------------------------------------------------------------------
+ funcbeadx \1,3c,\2bir_macro,(a0)+
+//--------------------------------------------------------------------
+// func.b dy,ea
+//--------------------------------------------------------------------
+///--------------------------------------------------------------------
+// func.b dx,dd -> addx subx etc. src und dest vertauscht!
+//--------------------------------------------------------------------
+ funcbdxea \1,00,\2dx,d0_off+3(a7)
+ funcbdxea \1,01,\2dx,d1_off+3(a7)
+ funcbdxea \1,02,\2dx,d2
+ funcbdxea \1,03,\2dx,d3
+ funcbdxea \1,04,\2dx,d4
+ funcbdxea \1,05,\2dx,d5
+ funcbdxea \1,06,\2dx,d6
+ funcbdxea \1,07,\2dx,d7
+//--------------------------------------------------------------------
+// func.b -(ax),-(ay) addx subx etc. src und dest vertauscht!
+//--------------------------------------------------------------------
+ funcaxay \1,08,\2dax,a0_off(a7),b
+ funcaxay \1,09,\2dax,a1_off(a7).b
+ funcaxay \1,0a,\2dax,a2,b
+ funcaxay \1,0b,\2dax,a3,b
+ funcaxay \1,0c,\2dax,a4,b
+ funcaxay \1,0d,\2dax,a5,b
+ funcaxay \1,0e,\2dax,a6,b
+ funcaxay \1,0f,\2dax,usp,b
+//--------------------------------------------------------------------
+// func.b dy,(ax)
+//--------------------------------------------------------------------
+ funcbdxea \1,10,\2eda,a0_off(a7)
+ funcbdxea \1,11,\2eda,a1_off(a7)
+ funcbdxea \1,12,\2dd,(a2)
+ funcbdxea \1,13,\2dd,(a3)
+ funcbdxea \1,14,\2dd,(a4)
+ funcbdxea \1,15,\2dd,(a5)
+ funcbdxea \1,16,\2dd,(a6)
+ funcbdxea \1,17,\2eda,usp
+//--------------------------------------------------------------------
+// func.b dy,(ax)+
+//--------------------------------------------------------------------
+ funcbdxea \1,18,\2edai,a0_off(a7)
+ funcbdxea \1,19,\2edai,a1_off(a7)
+ funcbdxea \1,1a,\2edaid,(a2)
+ funcbdxea \1,1b,\2edaid,(a3)
+ funcbdxea \1,1c,\2edaid,(a4)
+ funcbdxea \1,1d,\2edaid,(a5)
+ funcbdxea \1,1e,\2edaid,(a6)
+ funcbdxea \1,1f,\2edai,usp
+//--------------------------------------------------------------------
+// func.b dy,-(ax)
+//--------------------------------------------------------------------
+ funcbdxea \1,20,\2edad,a0_off(a7)
+ funcbdxea \1,21,\2edad,a1_off(a7)
+ funcbdxea \1,22,\2edadd,(a2)
+ funcbdxea \1,23,\2edadd,(a3)
+ funcbdxea \1,24,\2edadd,(a4)
+ funcbdxea \1,25,\2edadd,(a5)
+ funcbdxea \1,26,\2edadd,(a6)
+ funcbdxea \1,27,\2edad,usp
+//--------------------------------------------------------------------
+// func.b dy,d16(ax)
+//--------------------------------------------------------------------
+ funcbdxea \1,28,\2e16ad,a0_off(a7)
+ funcbdxea \1,29,\2e16ad,a1_off(a7)
+ funcbdxea \1,2a,\2e16ad,a2
+ funcbdxea \1,2b,\2e16ad,a3
+ funcbdxea \1,2c,\2e16ad,a4
+ funcbdxea \1,2d,\2e16ad,a5
+ funcbdxea \1,2e,\2e16ad,a6
+ funcbdxea \1,2f,\2e16ad,usp
+//--------------------------------------------------------------------
+// func.b dy,d8(ax,dy)
+//--------------------------------------------------------------------
+ funcbdxea \1,30,\2e8ad,a0_off(a7)
+ funcbdxea \1,31,\2e8ad,a1_off(a7)
+ funcbdxea \1,32,\2e8ad,a2
+ funcbdxea \1,33,\2e8ad,a3
+ funcbdxea \1,34,\2e8ad,a4
+ funcbdxea \1,35,\2e8ad,a5
+ funcbdxea \1,36,\2e8ad,a6
+ funcbdxea \1,37,\2e8ad,usp
+//--------------------------------------------------------------------
+// func.w dy,xxx.w
+//--------------------------------------------------------------------
+ funcwdxea \1,38,\2xwe,(a0)+
+//--------------------------------------------------------------------
+// func.w dy,xxx.w
+//--------------------------------------------------------------------
+ funcwdxea \1,39,\2xld,(a0)+
+/*****************************************************************************************/
+// word
+/*****************************************************************************************/
+// func.w ds,dx
+//--------------------------------------------------------------------
+ funcweadx \1,40,\2dd,d0_off+2(a7)
+ funcweadx \1,41,\2dd,d1_off+2(a7)
+ funcweadx \1,42,\2dd,d2
+ funcweadx \1,43,\2dd,d3
+ funcweadx \1,44,\2dd,d4
+ funcweadx \1,45,\2dd,d5
+ funcweadx \1,46,\2dd,d6
+ funcweadx \1,47,\2dd,d7
+//--------------------------------------------------------------------
+// func.w ax,dx
+//--------------------------------------------------------------------
+ funcweadx \1,48,\2dd,a0_off+2(a7)
+ funcweadx \1,49,\2dd,a1_off+2(a7)
+ funcweadx \1,4a,\2dd,a2
+ funcweadx \1,4b,\2dd,a3
+ funcweadx \1,4c,\2dd,a4
+ funcweadx \1,4d,\2dd,a5
+ funcweadx \1,4e,\2dd,a6
+ funcweadx \1,4f,\2ddd,usp
+//--------------------------------------------------------------------
+// func.w (ax),dx
+//--------------------------------------------------------------------
+ funcweadx \1,50,\2dda,a0_off(a7)
+ funcweadx \1,51,\2dda,a1_off(a7)
+ funcweadx \1,52,\2dd,(a2)
+ funcweadx \1,53,\2dd,(a3)
+ funcweadx \1,54,\2dd,(a4)
+ funcweadx \1,55,\2dd,(a5)
+ funcweadx \1,56,\2dd,(a6)
+ funcweadx \1,57,\2dda,usp
+//--------------------------------------------------------------------
+// func.w (ax)+,dx
+//--------------------------------------------------------------------
+ funcweadx \1,58,\2ddai,a0_off(a7)
+ funcweadx \1,59,\2ddai,a1_off(a7)
+ funcweadx \1,5a,\2dd,(a2)+
+ funcweadx \1,5b,\2dd,(a3)+
+ funcweadx \1,5c,\2dd,(a4)+
+ funcweadx \1,5d,\2dd,(a5)+
+ funcweadx \1,5e,\2dd,(a6)+
+ funcweadx \1,5f,\2ddai,usp
+//--------------------------------------------------------------------
+// func.w -(ax),dx
+//--------------------------------------------------------------------
+ funcweadx \1,60,\2ddad,a0_off(a7)
+ funcweadx \1,61,\2ddad,a1_off(a7)
+ funcweadx \1,62,\2dd,-(a2)
+ funcweadx \1,63,\2dd,-(a3)
+ funcweadx \1,64,\2dd,-(a4)
+ funcweadx \1,65,\2dd,-(a5)
+ funcweadx \1,66,\2dd,-(a6)
+ funcweadx \1,67,\2ddad,usp
+//--------------------------------------------------------------------
+// func.w d16(ax),dx
+//--------------------------------------------------------------------
+ funcweadx \1,68,\2d16ad,a0_off(a7)
+ funcweadx \1,69,\2d16ad,a1_off(a7)
+ funcweadx \1,6a,\2d16ad,a2
+ funcweadx \1,6b,\2d16ad,a3
+ funcweadx \1,6c,\2d16ad,a4
+ funcweadx \1,6d,\2d16ad,a5
+ funcweadx \1,6e,\2d16ad,a6
+ funcweadx \1,6f,\2d16ad,usp
+//--------------------------------------------------------------------
+// func.w d8(ax,dy),dx
+//--------------------------------------------------------------------
+ funcweadx \1,70,\2d8ad,a0_off(a7)
+ funcweadx \1,71,\2d8ad,a1_off(a7)
+ funcweadx \1,72,\2d8ad,a2
+ funcweadx \1,73,\2d8ad,a3
+ funcweadx \1,74,\2d8ad,a4
+ funcweadx \1,75,\2d8ad,a5
+ funcweadx \1,76,\2d8ad,a6
+ funcweadx \1,77,\2d8ad,usp
+//--------------------------------------------------------------------
+// func.w xxx.w,dx
+//--------------------------------------------------------------------
+ funcweadx \1,78,\2xwd,(a0)+
+//--------------------------------------------------------------------
+// func.w xxx.w,dx
+//--------------------------------------------------------------------
+ funcweadx \1,79,\2xld,(a0)+
+//--------------------------------------------------------------------
+// func.w d16(pc),dx
+//--------------------------------------------------------------------
+ funcweadx \1,7a,\2d16pcd,(a0)+
+//--------------------------------------------------------------------
+// func.w d8(pc,dy),dx
+//--------------------------------------------------------------------
+ funcweadx \1,7b,\2d8pcd,(a0)+ (a0 wird nicht verwendet)
+//--------------------------------------------------------------------
+// func.w #im,dx
+//--------------------------------------------------------------------
+ funcweadx \1,7c,\2dd,(a0)+
+//--------------------------------------------------------------------
+// func.w dy,ea
+//--------------------------------------------------------------------
+///--------------------------------------------------------------------
+// func.w dx,dd -> addx subx etc.
+//--------------------------------------------------------------------
+.ifnc \2,and //platz für exg
+ funcwdxea \1,40,\2dx,d0_off+2(a7)
+ funcwdxea \1,41,\2dx,d1_off+2(a7)
+ funcwdxea \1,42,\2dx,d2
+ funcwdxea \1,43,\2dx,d3
+ funcwdxea \1,44,\2dx,d4
+ funcwdxea \1,45,\2dx,d5
+ funcwdxea \1,46,\2dx,d6
+ funcwdxea \1,47,\2dx,d7
+//--------------------------------------------------------------------
+// func.w -(ax),-(ay) -> addx,subx
+//--------------------------------------------------------------------
+ funcaxay \1,48,\2dax,a0_off(a7),w
+ funcaxay \1,49,\2dax,a1_off(a7).w
+ funcaxay \1,4a,\2dax,a2,w
+ funcaxay \1,4b,\2dax,a3,w
+ funcaxay \1,4c,\2dax,a4,w
+ funcaxay \1,4d,\2dax,a5,w
+ funcaxay \1,4e,\2dax,a6,w
+ funcaxay \1,4f,\2dax,usp,w
+.endif
+//--------------------------------------------------------------------
+// func.w dy,(ax)
+//--------------------------------------------------------------------
+ funcwdxea \1,50,\2eda,a0_off(a7)
+ funcwdxea \1,51,\2eda,a1_off(a7)
+ funcwdxea \1,52,\2dd,(a2)
+ funcwdxea \1,53,\2dd,(a3)
+ funcwdxea \1,54,\2dd,(a4)
+ funcwdxea \1,55,\2dd,(a5)
+ funcwdxea \1,56,\2dd,(a6)
+ funcwdxea \1,57,\2eda,usp
+//--------------------------------------------------------------------
+// func.w dy,(ax)+
+//--------------------------------------------------------------------
+ funcwdxea \1,58,\2edai,a0_off(a7)
+ funcwdxea \1,59,\2edai,a1_off(a7)
+ funcwdxea \1,5a,\2edaid,(a2)
+ funcwdxea \1,5b,\2edaid,(a3)
+ funcwdxea \1,5c,\2edaid,(a4)
+ funcwdxea \1,5d,\2edaid,(a5)
+ funcwdxea \1,5e,\2edaid,(a6)
+ funcwdxea \1,5f,\2edai,usp
+//--------------------------------------------------------------------
+// func.w dy,-(ax)
+//--------------------------------------------------------------------
+ funcwdxea \1,60,\2edad,a0_off(a7)
+ funcwdxea \1,61,\2edad,a1_off(a7)
+ funcwdxea \1,62,\2edadd,(a2)
+ funcwdxea \1,63,\2edadd,(a3)
+ funcwdxea \1,64,\2edadd,(a4)
+ funcwdxea \1,65,\2edadd,(a5)
+ funcwdxea \1,66,\2edadd,(a6)
+ funcwdxea \1,67,\2edad,usp
+//--------------------------------------------------------------------
+// func.w dy,d16(ax)
+//--------------------------------------------------------------------
+ funcwdxea \1,68,\2e16ad,a0_off(a7)
+ funcwdxea \1,69,\2e16ad,a1_off(a7)
+ funcwdxea \1,6a,\2e16ad,a2
+ funcwdxea \1,6b,\2e16ad,a3
+ funcwdxea \1,6c,\2e16ad,a4
+ funcwdxea \1,6d,\2e16ad,a5
+ funcwdxea \1,6e,\2e16ad,a6
+ funcwdxea \1,6f,\2e16ad,usp
+//--------------------------------------------------------------------
+// func.w dy,d8(ax,dy)
+//--------------------------------------------------------------------
+ funcwdxea \1,70,\2e8ad,a0_off(a7)
+ funcwdxea \1,71,\2e8ad,a1_off(a7)
+ funcwdxea \1,72,\2e8ad,a2
+ funcwdxea \1,73,\2e8ad,a3
+ funcwdxea \1,74,\2e8ad,a4
+ funcwdxea \1,75,\2e8ad,a5
+ funcwdxea \1,76,\2e8ad,a6
+ funcwdxea \1,77,\2e8ad,usp
+//--------------------------------------------------------------------
+// func.w dy,xxx.w
+//--------------------------------------------------------------------
+ funcwdxea \1,78,\2xwe,(a0)+
+//--------------------------------------------------------------------
+// func.w dy,xxx.w
+//--------------------------------------------------------------------
+ funcwdxea \1,79,\2xld,(a0)+
+/*****************************************************************************************/
+// long
+/*****************************************************************************************/
+//--------------------------------------------------------------------
+// func.l -(ax),-(ay)
+//--------------------------------------------------------------------
+ funcaxay \1,c8,\2dax,a0_off(a7),l
+ funcaxay \1,c9,\2dax,a1_off(a7).l
+ funcaxay \1,ca,\2dax,a2,l
+ funcaxay \1,cb,\2dax,a3,l
+ funcaxay \1,cc,\2dax,a4,l
+ funcaxay \1,cd,\2dax,a5,l
+ funcaxay \1,ce,\2dax,a6,l
+ funcaxay \1,cf,\2dax,usp,l
+//--------------------------------------------------------------------
+// func.l d8(ax,dy),dx
+//--------------------------------------------------------------------
+ funcleadx \1,b0,\2d8ad,a0_off(a7)
+ funcleadx \1,b1,\2d8ad,a1_off(a7)
+ funcleadx \1,b2,\2d8ad,a2
+ funcleadx \1,b3,\2d8ad,a3
+ funcleadx \1,b4,\2d8ad,a4
+ funcleadx \1,b5,\2d8ad,a5
+ funcleadx \1,b6,\2d8ad,a6
+ funcleadx \1,b7,\2d8ad,usp
+//--------------------------------------------------------------------
+// func.l d8(pc,dy),dx
+//--------------------------------------------------------------------
+ funcleadx \1,bb,\2d8pcd,(a0)+ (a0 wird nicht verwendet)
+//--------------------------------------------------------------------
+// func.l dy,d8(ax,dy)
+//--------------------------------------------------------------------
+ funcldxea \1,b0,\2e8ad,a0_off(a7)
+ funcldxea \1,b1,\2e8ad,a1_off(a7)
+ funcldxea \1,b2,\2e8ad,a2
+ funcldxea \1,b3,\2e8ad,a3
+ funcldxea \1,b4,\2e8ad,a4
+ funcldxea \1,b5,\2e8ad,a5
+ funcldxea \1,b6,\2e8ad,a6
+ funcldxea \1,b7,\2e8ad,usp
+/******************************************************/
+// adress register
+/******************************************************/
+//--------------------------------------------------------------------
+// func.w ea,ax
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// func.w dx,ax
+//--------------------------------------------------------------------
+ funcweaax \1,c0,\2aw,d0
+ funcweaax \1,c1,\2aw,d1
+ funcweaax \1,c2,\2aw,d2
+ funcweaax \1,c3,\2aw,d3
+ funcweaax \1,c4,\2aw,d4
+ funcweaax \1,c5,\2aw,d5
+ funcweaax \1,c6,\2aw,d6
+ funcweaax \1,c7,\2aw,d7
+//--------------------------------------------------------------------
+// func.w ay,ax
+//--------------------------------------------------------------------
+ funcweaax \1,c8,\2aw,a0
+ funcweaax \1,c9,\2aw,a1
+ funcweaax \1,ca,\2aw,a2
+ funcweaax \1,cb,\2aw,a3
+ funcweaax \1,cc,\2aw,a4
+ funcweaax \1,cd,\2aw,a5
+ funcweaax \1,ce,\2aw,a6
+ funcweaax \1,cf,\2awu,a7
+//--------------------------------------------------------------------
+// func.w (ay),ax
+//--------------------------------------------------------------------
+ funcweaax \1,d0,\2aw,(a0)
+ funcweaax \1,d1,\2aw,(a1)
+ funcweaax \1,d2,\2aw,(a2)
+ funcweaax \1,d3,\2aw,(a3)
+ funcweaax \1,d4,\2aw,(a4)
+ funcweaax \1,d5,\2aw,(a5)
+ funcweaax \1,d6,\2aw,(a6)
+ funcweaax \1,d7,\2awu,(a7)
+//--------------------------------------------------------------------
+// func.w (ay)+,ax
+//--------------------------------------------------------------------
+ funcweaax \1,d8,\2aw,(a0)+
+ funcweaax \1,d9,\2aw,(a1)+
+ funcweaax \1,da,\2aw,(a2)+
+ funcweaax \1,db,\2aw,(a3)+
+ funcweaax \1,dc,\2aw,(a4)+
+ funcweaax \1,dd,\2aw,(a5)+
+ funcweaax \1,de,\2aw,(a6)+
+ funcweaax \1,df,\2awu,(a7)+
+//--------------------------------------------------------------------
+// func.w -(ay),ax
+//--------------------------------------------------------------------
+ funcweaax \1,e0,\2aw,-(a0)
+ funcweaax \1,e1,\2aw,-(a1)
+ funcweaax \1,e2,\2aw,-(a2)
+ funcweaax \1,e3,\2aw,-(a3)
+ funcweaax \1,e4,\2aw,-(a4)
+ funcweaax \1,e5,\2aw,-(a5)
+ funcweaax \1,e6,\2aw,-(a6)
+ funcweaax \1,e7,\2awu,-(a7)
+//--------------------------------------------------------------------
+// func.w d16(ay),ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,e8,\2awd16a,a0_off(a7)
+ funcweaaxn \1,e9,\2awd16a,a1_off(a7)
+ funcweaaxn \1,ea,\2awd16a,a2
+ funcweaaxn \1,eb,\2awd16a,a3
+ funcweaaxn \1,ec,\2awd16a,a4
+ funcweaaxn \1,ed,\2awd16a,a5
+ funcweaaxn \1,ee,\2awd16a,a6
+ funcweaaxn \1,ef,\2awd16a,usp
+//--------------------------------------------------------------------
+// func.w d8(ay,dy),ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,f0,\2awd8a,a0_off(a7)
+ funcweaaxn \1,f1,\2awd8a,a1_off(a7)
+ funcweaaxn \1,f2,\2awd8a,a2
+ funcweaaxn \1,f3,\2awd8a,a3
+ funcweaaxn \1,f4,\2awd8a,a4
+ funcweaaxn \1,f5,\2awd8a,a5
+ funcweaaxn \1,f6,\2awd8a,a6
+ funcweaaxn \1,f7,\2awd8a,usp
+//--------------------------------------------------------------------
+// func.w xxx.w,ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,f8,\2awxwax,(a0)+
+//--------------------------------------------------------------------
+// func.w xxxlw,ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,f9,\2awxlax,(a0)+
+//--------------------------------------------------------------------
+// func.w d16(pc),ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,fa,\2awd16pcax,(a0)+
+//--------------------------------------------------------------------
+// func.w d8(pc,dy),ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,fb,\2awd8pcax,(a0)+ //(a0 wird nicht verwendet)
+//--------------------------------------------------------------------
+// func.w #im,ax
+//--------------------------------------------------------------------
+ funcweaaxn \1,fc,\2awim,(a0)+
+//--------------------------------------------------------------------
+// ende
+ .endm;
+//--------------------------------------------------------------------
+// byt
+funcbeadx:.macro // function byt: im,dx
+ii_0x\10\2:
+ \3 \4,d0_off+3(a7),b
+ii_0x\12\2:
+ \3 \4,d1_off+3(a7),b
+ii_0x\14\2:
+ \3 \4,d2,b
+ii_0x\16\2:
+ \3 \4,d3,b
+ii_0x\18\2:
+ \3 \4,d4,b
+ii_0x\1a\2:
+ \3 \4,d5,b
+ii_0x\1c\2:
+ \3 \4,d6,b
+ii_0x\1e\2:
+ \3 \4,d7,b
+ .endm;
+funcbdxea:.macro // ea(\4) function(\3) dx -> ea
+ii_0x\11\2:
+ \3 d0_off+3(a7),\4,b
+ii_0x\13\2:
+ \3 d1_off+3(a7),\4,b
+ii_0x\15\2:
+ \3 d2,\4,b
+ii_0x\17\2:
+ \3 d3,\4,b
+ii_0x\19\2:
+ \3 d4,\4,b
+ii_0x\1b\2:
+ \3 d5,\4,b
+ii_0x\1d\2:
+ \3 d6,\4,b
+ii_0x\1f\2:
+ \3 d7,\4,b
+ .endm;
+//--------------------------------------------------------------------
+// word
+funcweadx:.macro // dx function(\3) ea(\4) -> dx
+ii_0x\10\2:
+ \3 \4,d0_off+2(a7),w
+ii_0x\12\2:
+ \3 \4,d1_off+2(a7),w
+ii_0x\14\2:
+ \3 \4,d2,w
+ii_0x\16\2:
+ \3 \4,d3,w
+ii_0x\18\2:
+ \3 \4,d4,w
+ii_0x\1a\2:
+ \3 \4,d5,w
+ii_0x\1c\2:
+ \3 \4,d6,w
+ii_0x\1e\2:
+ \3 \4,d7,w
+ .endm;
+funcwdxea:.macro // ea(\4) function(\3) dx -> ea
+ii_0x\11\2:
+ \3 d0_off+2(a7),\4,w
+ii_0x\13\2:
+ \3 d1_off+2(a7),\4,w
+ii_0x\15\2:
+ \3 d2,\4,w
+ii_0x\17\2:
+ \3 d3,\4,w
+ii_0x\19\2:
+ \3 d4,\4,w
+ii_0x\1b\2:
+ \3 d5,\4,w
+ii_0x\1d\2:
+ \3 d6,\4,w
+ii_0x\1f\2:
+ \3 d7,\4,w
+ .endm;
+//--------------------------------------------------------------------
+// long
+funcleadx:.macro // dx function(\3) ea(\4) -> dx
+ii_0x\10\2:
+ \3 \4,d0_off(a7),w
+ii_0x\12\2:
+ \3 \4,d1_off(a7),w
+ii_0x\14\2:
+ \3 \4,d2,w
+ii_0x\16\2:
+ \3 \4,d3,w
+ii_0x\18\2:
+ \3 \4,d4,w
+ii_0x\1a\2:
+ \3 \4,d5,w
+ii_0x\1c\2:
+ \3 \4,d6,w
+ii_0x\1e\2:
+ \3 \4,d7,w
+ .endm;
+funcldxea:.macro // ea(\4) function(\3) dx -> ea
+ii_0x\11\2:
+ \3 d0_off(a7),\4,w
+ii_0x\13\2:
+ \3 d1_off(a7),\4,w
+ii_0x\15\2:
+ \3 d2,\4,w
+ii_0x\17\2:
+ \3 d3,\4,w
+ii_0x\19\2:
+ \3 d4,\4,w
+ii_0x\1b\2:
+ \3 d5,\4,w
+ii_0x\1d\2:
+ \3 d6,\4,w
+ii_0x\1f\2:
+ \3 d7,\4,w
+ .endm;
+//--------------------------------------------------------------
+// address
+funcweaax:.macro // ax function(\3) ea(\4)(ext long!) -> ax
+ii_0x\10\2:
+ \3 \4,a0
+ii_0x\12\2:
+ \3 \4,a1
+ii_0x\14\2:
+ \3 \4,a2
+ii_0x\16\2:
+ \3 \4,a3
+ii_0x\18\2:
+ \3 \4,a4
+ii_0x\1a\2:
+ \3 \4,a5
+ii_0x\1c\2:
+ \3 \4,a6
+ii_0x\1e\2:
+ \3a7 \4,a7 // "a7" beachten wegen usp
+ .endm;
+funcweaaxn:.macro // ax function(\3) ea(\4)(ext long!) -> ax
+ii_0x\10\2:
+ \3 \4,a0_off(a7)
+ii_0x\12\2:
+ \3 \4,a1_off(a7)
+ii_0x\14\2:
+ \3 \4,a2
+ii_0x\16\2:
+ \3 \4,a3
+ii_0x\18\2:
+ \3 \4,a4
+ii_0x\1a\2:
+ \3 \4,a5
+ii_0x\1c\2:
+ \3 \4,a6
+ii_0x\1e\2:
+ \3 \4,usp
+ .endm;
+//--------------------------------------------------------------
+// byt, word, long
+//--------------------------------------------------------------
+funcaxay:.macro // ea(\4) function(\3) dx -> ea,\5 = size
+ii_0x\11\2:
+ \3 a0_off(a7),\4,\5
+ii_0x\13\2:
+ \3 a1_off(a7),\4,\5
+ii_0x\15\2:
+ \3 a2,\4,\5
+ii_0x\17\2:
+ \3 a3,\4,\5
+ii_0x\19\2:
+ \3 a4,\4,\5
+ii_0x\1b\2:
+ \3 a5,\4,\5
+ii_0x\1d\2:
+ \3 a6,\4,\5
+ii_0x\1f\2:
+ \3 usp,\4,\5
+ .endm;
diff --git a/SD_CARD/BaS_gcc/include/ii_jmp.h b/SD_CARD/BaS_gcc/include/ii_jmp.h
new file mode 100644
index 0000000..1896118
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_jmp.h
@@ -0,0 +1,59 @@
+//--------------------------------------------------------------------
+// extension word format missing
+//--------------------------------------------------------------------
+ii_\1_func:.macro
+ii_0x\20:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a0_off(a7),a1
+ \1_macro
+ii_0x\21:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a1_off(a7),a1
+ \1_macro
+ii_0x\22:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a2,a1
+ \1_macro
+ii_0x\23:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a3,a1
+ \1_macro
+ii_0x\24:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a4,a1
+ \1_macro
+ii_0x\25:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a5,a1
+ \1_macro
+ii_0x\26:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a6,a1
+ \1_macro
+ii_0x\27:
+#ifdef halten_\1
+ halt
+#endif
+ move.l usp,a1
+ \1_macro
+ii_0x\2b:
+#ifdef halten_\1
+ halt
+#endif
+ move.l a0,a1
+ \1_macro
+.endm
diff --git a/SD_CARD/BaS_gcc/include/ii_lea.h b/SD_CARD/BaS_gcc/include/ii_lea.h
new file mode 100644
index 0000000..7a422a7
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_lea.h
@@ -0,0 +1,105 @@
+//-------------------------------------------------------------------
+// lea
+//-------------------------------------------------------------------
+.text
+ii_lea_lset:.macro
+ ii_lset_dxu 4,f0 // lea d8(a0,dy.w),a0-a7
+ ii_lset_dxu 4,f1 // lea d8(a1,dy.w),a0-a7
+ ii_lset_dxu 4,f2 // lea d8(a2,dy.w),a0-a7
+ ii_lset_dxu 4,f3 // lea d8(a3,dy.w),a0-a7
+ ii_lset_dxu 4,f4 // lea d8(a4,dy.w),a0-a7
+ ii_lset_dxu 4,f5 // lea d8(a5,dy.w),a0-a7
+ ii_lset_dxu 4,f6 // lea d8(a6,dy.w),a0-a7
+ ii_lset_dxu 4,f7 // lea d8(a7,dy.w),a0-a7
+ ii_lset_dxu 4,fb // lea d8(pc,dy.w),a0-a7
+.endm
+
+//---------------------------------------------------------------------------------------------
+// function
+//---------------------------------------------------------------------------------------------
+ii_lea_sub:.macro
+ii_0x4\1\2:
+#ifdef halten_lea
+ halt
+#endif
+ move.l \4,a1
+ jsr ewf
+ move.l a1,\3
+ ii_end
+.endm
+ii_lea_func:.macro
+//lea d8(ax,dy.w),a0-a7
+ ii_lea_sub 1,f0,a0_off(a7),a0_off(a7)
+ ii_lea_sub 1,f1,a0_off(a7),a1_off(a7)
+ ii_lea_sub 1,f2,a0_off(a7),a2
+ ii_lea_sub 1,f3,a0_off(a7),a3
+ ii_lea_sub 1,f4,a0_off(a7),a4
+ ii_lea_sub 1,f5,a0_off(a7),a5
+ ii_lea_sub 1,f6,a0_off(a7),a6
+ ii_lea_sub 1,f7,a0_off(a7),usp
+ ii_lea_sub 3,f0,a1_off(a7),a0_off(a7)
+ ii_lea_sub 3,f1,a1_off(a7),a1_off(a7)
+ ii_lea_sub 3,f2,a1_off(a7),a2
+ ii_lea_sub 3,f3,a1_off(a7),a3
+ ii_lea_sub 3,f4,a1_off(a7),a4
+ ii_lea_sub 3,f5,a1_off(a7),a5
+ ii_lea_sub 3,f6,a1_off(a7),a6
+ ii_lea_sub 3,f7,a1_off(a7),usp
+ ii_lea_sub 5,f0,a2,a0_off(a7)
+ ii_lea_sub 5,f1,a2,a1_off(a7)
+ ii_lea_sub 5,f2,a2,a2
+ ii_lea_sub 5,f3,a2,a3
+ ii_lea_sub 5,f4,a2,a4
+ ii_lea_sub 5,f5,a2,a5
+ ii_lea_sub 5,f6,a2,a6
+ ii_lea_sub 5,f7,a2,usp
+ ii_lea_sub 7,f0,a3,a0_off(a7)
+ ii_lea_sub 7,f1,a3,a1_off(a7)
+ ii_lea_sub 7,f2,a3,a2
+ ii_lea_sub 7,f3,a3,a3
+ ii_lea_sub 7,f4,a3,a4
+ ii_lea_sub 7,f5,a3,a5
+ ii_lea_sub 7,f6,a3,a6
+ ii_lea_sub 7,f7,a3,usp
+ ii_lea_sub 9,f0,a4,a0_off(a7)
+ ii_lea_sub 9,f1,a4,a1_off(a7)
+ ii_lea_sub 9,f2,a4,a2
+ ii_lea_sub 9,f3,a4,a3
+ ii_lea_sub 9,f4,a4,a4
+ ii_lea_sub 9,f5,a4,a5
+ ii_lea_sub 9,f6,a4,a6
+ ii_lea_sub 9,f7,a4,usp
+ ii_lea_sub b,f0,a5,a0_off(a7)
+ ii_lea_sub b,f1,a5,a1_off(a7)
+ ii_lea_sub b,f2,a5,a2
+ ii_lea_sub b,f3,a5,a3
+ ii_lea_sub b,f4,a5,a4
+ ii_lea_sub b,f5,a5,a5
+ ii_lea_sub b,f6,a5,a6
+ ii_lea_sub b,f7,a6,usp
+ ii_lea_sub d,f0,a6,a0_off(a7)
+ ii_lea_sub d,f1,a6,a1_off(a7)
+ ii_lea_sub d,f2,a6,a2
+ ii_lea_sub d,f3,a6,a3
+ ii_lea_sub d,f4,a6,a4
+ ii_lea_sub d,f5,a6,a5
+ ii_lea_sub d,f6,a6,a6
+ ii_lea_sub d,f7,a6,usp
+ ii_lea_sub f,f0,usp,a0_off(a7)
+ ii_lea_sub f,f1,usp,a1_off(a7)
+ ii_lea_sub f,f2,usp,a2
+ ii_lea_sub f,f3,usp,a3
+ ii_lea_sub f,f4,usp,a4
+ ii_lea_sub f,f5,usp,a5
+ ii_lea_sub f,f6,usp,a6
+ ii_lea_sub f,f7,usp,usp
+// lea d8(pc,dy.w),az
+ ii_lea_sub 1,fb,a0_off(a7),a0
+ ii_lea_sub 3,fb,a1_off(a7),a0
+ ii_lea_sub 5,fb,a2,a0
+ ii_lea_sub 7,fb,a3,a0
+ ii_lea_sub 9,fb,a4,a0
+ ii_lea_sub b,fb,a5,a0
+ ii_lea_sub d,fb,a6,a0
+ ii_lea_sub f,fb,usp,a0
+.endm
\ No newline at end of file
diff --git a/SD_CARD/BaS_gcc/include/ii_macro.h b/SD_CARD/BaS_gcc/include/ii_macro.h
new file mode 100644
index 0000000..eca557e
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_macro.h
@@ -0,0 +1,144 @@
+/*******************************************************/
+// constanten
+/*******************************************************/
+.extern ___RAMBAR1
+.extern _rt_cacr
+.extern _rt_mod
+.extern _rt_ssp
+.extern _rt_usp
+.extern _rt_vbr
+.extern _d0_save
+.extern _a7_save
+
+ii_ss = 16
+d0_off = 0
+d1_off = 4
+a0_off = 8
+a1_off = 12
+format_off = 16
+sr_off = 18
+ccr_off = 19
+pc_off = 20
+
+#define table 0x20000000-0x8000-0xF000*4 // Adresse Sprungtabelle -> 8000=Sprungbereich mod cod, 61k(ohne 0xFxxx!)x4= tabelle
+
+/*******************************************************/
+// allgemeine macros
+/*******************************************************/
+ii_end: .macro
+ move.l a0,pc_off(a7)
+ movem.l (a7),d0/d1/a0/a1
+ lea ii_ss(a7),a7
+ rte
+ .endm;
+
+set_cc0:.macro
+ move.w ccr,d0
+ move.b d0,ccr_off(a7)
+ .endm;
+
+ii_esr: .macro // geht nicht!!??
+ movem.l (a7),d0/d1/a0/a1
+ lea ii_ss+8(a7),a7 // stack erhöhen
+ move.w d0,_d0_save // d0.w sicheren
+ move.w -6(a7),d0 // sr holen
+ move.w d0,sr // sr setzen
+ nop
+ move.w _d0_save,d0 // d0.w zurück
+ .endm;
+
+ii_end_mvm:.macro
+ move.l a0_off(a7),a0
+ lea 16(a7),a7
+ rte
+ .endm;
+
+ii_endj:.macro
+ movem.l (a7),d0/d1/a0/a1 // register zurück
+ lea ii_ss(a7),a7 // korr
+ rte // ende
+ .endm;
+
+set_nzvc:.macro // set ccr bits nzvc
+ move.w ccr,d1
+ bclr #4,d1
+ btst #4,ccr_off(a7)
+ beq snzvc2\@
+ bset #4,d1
+snzvc2\@:
+ move.b d1,ccr_off(a7)
+ .endm;
+
+set_cc1:.macro
+ move.w ccr,d1
+ move.b d1,ccr_off(a7)
+ .endm;
+
+set_cc_b:.macro
+ move.w ccr,d1
+ btst #7,d0 // byt negativ?
+ beq set_cc_b2\@
+ bset #3,d1 // make negativ
+set_cc_b2\@:
+ move.b d1,ccr_off(a7)
+ .endm;
+
+set_cc_w:.macro
+ move.w ccr,d1
+ btst #15,d0 // byt negativ?
+ beq set_cc_w2\@
+ bset #3,d1 // make negativ
+set_cc_w2\@:
+ move.b d1,ccr_off(a7)
+ .endm;
+
+get_pc: .macro
+ lea.l (a0),a1
+ .endm;
+
+//--------------------------------------------------------------------
+ii_lset:.macro offs
+ lea table+\offs*4,a0
+ move.l #ii_\offs,(a0)
+ .endm;
+ii_lset_dx:.macro // 0x1.22 -> z.B. 1=d,2=4 ->0xd040 -> 0xde40
+ ii_lset_dxg \1,\2
+ ii_lset_dxu \1,\2
+ .endm;
+ii_lset_dxg:.macro // gerade: 0x1.22 -> z.B. 1=d,2=4 ->0xd040 -> 0xde40
+ lea table+0x\10\2*4,a0
+ move.l #ii_0x\10\2,(a0)
+ lea 0x800(a0),a0 // 4 * 0x200
+ move.l #ii_0x\12\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\14\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\16\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\18\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1a\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1c\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1e\2,(a0)
+ .endm;
+ii_lset_dxu:.macro // ungerade: 0x1.22 -> z.B. 1=d,2=4 ->0xd140 -> 0xdf40
+ lea table+0x\11\2*4,a0
+ move.l #ii_0x\11\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\13\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\15\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\17\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\19\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1b\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1d\2,(a0)
+ lea 0x800(a0),a0
+ move.l #ii_0x\1f\2,(a0)
+ .endm;
+
diff --git a/SD_CARD/BaS_gcc/include/ii_move.h b/SD_CARD/BaS_gcc/include/ii_move.h
new file mode 100644
index 0000000..4fb5832
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_move.h
@@ -0,0 +1,1270 @@
+//-------------------------------------------------------------------
+// move
+//-------------------------------------------------------------------
+.extern ewf
+
+.text
+ii_move_lset:.macro
+//-------------------------------------------------------------------------
+// 0x1000 move.b
+//-------------------------------------------------------------------------
+// move.x d16(ax),xxx.w 1=size 2=adress register
+ ii_lset_opeau 11,e
+// move.x d16(ax),xxx.l
+ ii_lset_opeau 13,e
+// move.x d16(pc),xxx.w
+ ii_lset 0x11fa
+// move.x d16(pc),xxx.l
+ ii_lset 0x13fa
+// move.x xxx.w,d16(ax)
+ ii_lset_dxu 1,78
+// move.x xxx.l,d16(ax)
+ ii_lset_dxu 1,79
+// move.x #xx,d16(ax)
+ ii_lset_dxu 1,7c
+// move.x xxx.w,xxx.w; 1=size 2=size source adr 3=size dest adr 4=code
+ ii_lset 0x11f8
+// move.x xxx.l,xxx.w
+ ii_lset 0x11f9
+// move.x xxx.w,xxx.l
+ ii_lset 0x13f8
+// move.x xxx.l,xxx.l
+ ii_lset 0x13f9
+// move.x #xx,xxx.w //1=size 2=size dest adr 3=code
+ ii_lset 0x11fc
+// move.x #xx,xxx.l //1=size 2=size dest adr 3=code
+ ii_lset 0x13fc
+//---------------------------------------------------------------------
+// move.x ea,d8(ax,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// move.x dx,d8(a0-a7,dy)
+ ii_lset_opeag 11,8
+ ii_lset_opeag 13,8
+ ii_lset_opeag 15,8
+ ii_lset_opeag 17,8
+ ii_lset_opeag 19,8
+ ii_lset_opeag 1b,8
+ ii_lset_opeag 1d,8
+ ii_lset_opeag 1f,8
+// move.x (ax),d8(a0-a7,dy)
+// move.x (ax)+,d8(a0-a7,dy)
+ ii_lset_opea 11,9
+ ii_lset_opea 13,9
+ ii_lset_opea 15,9
+ ii_lset_opea 17,9
+ ii_lset_opea 19,9
+ ii_lset_opea 1b,9
+ ii_lset_opea 1d,9
+ ii_lset_opea 1f,9
+// move.x -(ax),d8(a0-a7,dy)
+ ii_lset_opeag 11,a
+ ii_lset_opeag 13,a
+ ii_lset_opeag 15,a
+ ii_lset_opeag 17,a
+ ii_lset_opeag 19,a
+ ii_lset_opeag 1b,a
+ ii_lset_opeag 1d,a
+ ii_lset_opeag 1f,a
+//---------------------------------------------------------------------
+// move.x ea,d8(pc,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// move.x dx,d8(pc,dy)
+ ii_lset_opeag 17,c
+// move.x (ax),d8(pc,dy)
+// move.x (ax)+,d8(pc,dy)
+ ii_lset_opea 17,d
+// move.x -(ax),d8(pc,dy)
+ ii_lset_opeag 17,e
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),d0-d7
+ ii_lset_opeag 10,3
+ ii_lset_opeag 12,3
+ ii_lset_opeag 14,3
+ ii_lset_opeag 16,3
+ ii_lset_opeag 18,3
+ ii_lset_opeag 1a,3
+ ii_lset_opeag 1c,3
+ ii_lset_opeag 1e,3
+// move.x d8(ax,dy),a0-a7
+ ii_lset_opeag 10,7
+ ii_lset_opeag 12,7
+ ii_lset_opeag 14,7
+ ii_lset_opeag 16,7
+ ii_lset_opeag 18,7
+ ii_lset_opeag 1a,7
+ ii_lset_opeag 1c,7
+ ii_lset_opeag 1e,7
+// move.x d8(ax,dy),(a0)-(a7)
+ ii_lset_opeag 10,b
+ ii_lset_opeag 12,b
+ ii_lset_opeag 14,b
+ ii_lset_opeag 16,b
+ ii_lset_opeag 18,b
+ ii_lset_opeag 1a,b
+ ii_lset_opeag 1c,b
+ ii_lset_opeag 1e,b
+// move.x d8(ax,dy),(a0)+-(a7)+
+ ii_lset_opeag 10,f
+ ii_lset_opeag 12,f
+ ii_lset_opeag 14,f
+ ii_lset_opeag 16,f
+ ii_lset_opeag 18,f
+ ii_lset_opeag 1a,f
+ ii_lset_opeag 1c,f
+ ii_lset_opeag 1e,f
+// move.x d8(ax,dy),-(a0) bis -(a7)
+ ii_lset_opeag 11,3
+ ii_lset_opeag 13,3
+ ii_lset_opeag 15,3
+ ii_lset_opeag 17,3
+ ii_lset_opeag 19,3
+ ii_lset_opeag 1b,3
+ ii_lset_opeag 1d,3
+ ii_lset_opeag 1f,3
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),d0-d7
+ ii_lset_dxg 1,3b
+// move.x d8(pc,dy),a0-a7
+ ii_lset_dxg 1,7b
+// move.x d8(pc,dy),(a0-a7)
+ ii_lset_dxg 1,bb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxg 1,fb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxu 1,3b
+//-------------------------------------------------------------------------
+// 0x2000 move.l
+//-------------------------------------------------------------------------
+// move.x d16(ax),xxx.w 1=size 2=adress register
+ ii_lset_opeau 21,e
+// move.x d16(ax),xxx.l
+ ii_lset_opeau 23,e
+// move.x d16(pc),xxx.w
+ ii_lset 0x21fa
+// move.x d16(pc),xxx.l
+ ii_lset 0x23fa
+// move.x xxx.w,d16(ax)
+ ii_lset_dxu 2,78
+// move.x xxx.l,d16(ax)
+ ii_lset_dxu 2,79
+// move.x #xx,d16(ax)
+ ii_lset_dxu 2,7c
+// move.x xxx.w,xxx.w; 1=size 2=size source adr 3=size dest adr 4=code
+ ii_lset 0x21f8
+// move.x xxx.l,xxx.w
+ ii_lset 0x21f9
+// move.x xxx.w,xxx.l
+ ii_lset 0x23f8
+// move.x xxx.l,xxx.l
+ ii_lset 0x23f9
+// move.x #xx,xxx.w //1=size 2=size dest adr 3=code
+ ii_lset 0x21fc
+// move.x #xx,xxx.l //1=size 2=size dest adr 3=code
+ ii_lset 0x23fc
+// move.x ea,d8(ax,dy) -------------------------------------------
+// move.x dx,d8(a0-a7,dy)
+ ii_lset_opeag 21,8
+ ii_lset_opeag 23,8
+ ii_lset_opeag 25,8
+ ii_lset_opeag 27,8
+ ii_lset_opeag 29,8
+ ii_lset_opeag 2b,8
+ ii_lset_opeag 2d,8
+ ii_lset_opeag 2f,8
+// move.x (ax),d8(a0-a7,dy)
+// move.x (ax)+,d8(a0-a7,dy)
+ ii_lset_opea 21,9
+ ii_lset_opea 23,9
+ ii_lset_opea 25,9
+ ii_lset_opea 27,9
+ ii_lset_opea 29,9
+ ii_lset_opea 2b,9
+ ii_lset_opea 2d,9
+ ii_lset_opea 2f,9
+// move.x -(ax),d8(a0-a7,dy)
+ ii_lset_opeag 21,a
+ ii_lset_opeag 23,a
+ ii_lset_opeag 25,a
+ ii_lset_opeag 27,a
+ ii_lset_opeag 29,a
+ ii_lset_opeag 2b,a
+ ii_lset_opeag 2d,a
+ ii_lset_opeag 2f,a
+//---------------------------------------------------------------------
+// move.x ea,d8(pc,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// move.x dx,d8(pc,dy)
+// move.x ax,d8(pc,dy)
+ ii_lset_opea 27,c
+// move.x (ax),d8(pc,dy)
+// move.x (ax)+,d8(pc,dy)
+ ii_lset_opea 27,d
+// move.x -(ax),d8(pc,dy)
+ ii_lset_opeag 27,e
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),d0-d7
+ ii_lset_opeag 20,3
+ ii_lset_opeag 22,3
+ ii_lset_opeag 24,3
+ ii_lset_opeag 26,3
+ ii_lset_opeag 28,3
+ ii_lset_opeag 2a,3
+ ii_lset_opeag 2c,3
+ ii_lset_opeag 2e,3
+// move.x d8(ax,dy),a0-a7
+ ii_lset_opeag 20,7
+ ii_lset_opeag 22,7
+ ii_lset_opeag 24,7
+ ii_lset_opeag 26,7
+ ii_lset_opeag 28,7
+ ii_lset_opeag 2a,7
+ ii_lset_opeag 2c,7
+ ii_lset_opeag 2e,7
+// move.x d8(ax,dy),(a0)-(a7)
+ ii_lset_opeag 20,b
+ ii_lset_opeag 22,b
+ ii_lset_opeag 24,b
+ ii_lset_opeag 26,b
+ ii_lset_opeag 28,b
+ ii_lset_opeag 2a,b
+ ii_lset_opeag 2c,b
+ ii_lset_opeag 2e,b
+// move.x d8(ax,dy),(a0)+-(a7)+
+ ii_lset_opeag 20,f
+ ii_lset_opeag 22,f
+ ii_lset_opeag 24,f
+ ii_lset_opeag 26,f
+ ii_lset_opeag 28,f
+ ii_lset_opeag 2a,f
+ ii_lset_opeag 2c,f
+ ii_lset_opeag 2e,f
+// move.x d8(ax,dy),-(a0) bis -(a7)
+ ii_lset_opeag 21,3
+ ii_lset_opeag 23,3
+ ii_lset_opeag 25,3
+ ii_lset_opeag 27,3
+ ii_lset_opeag 29,3
+ ii_lset_opeag 2b,3
+ ii_lset_opeag 2d,3
+ ii_lset_opeag 2f,3
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),d0-d7
+ ii_lset_dxg 2,3b
+// move.x d8(pc,dy),a0-a7
+ ii_lset_dxg 2,7b
+// move.x d8(pc,dy),(a0-a7)
+ ii_lset_dxg 2,bb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxg 2,fb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxu 2,3b
+//-------------------------------------------------------------------------
+// 0x3000 move.w
+///-------------------------------------------------------------------------
+// move.x d16(ax),xxx.w 1=size 2=adress register
+ ii_lset_opeau 31,e
+// move.x d16(ax),xxx.l
+ ii_lset_opeau 33,e
+// move.x d16(pc),xxx.w
+ ii_lset 0x31fa
+// move.x d16(pc),xxx.l
+ ii_lset 0x33fa
+// move.x xxx.w,d16(ax)
+ ii_lset_dxu 3,78
+// move.x xxx.l,d16(ax)
+ ii_lset_dxu 3,79
+// move.x #xx,d16(ax)
+ ii_lset_dxu 3,7c
+// move.x xxx.w,xxx.w; 1=size 2=size source adr 3=size dest adr 4=code
+ ii_lset 0x31f8
+// move.x xxx.l,xxx.w
+ ii_lset 0x31f9
+// move.x xxx.w,xxx.l
+ ii_lset 0x33f8
+// move.x xxx.l,xxx.l
+ ii_lset 0x33f9
+// move.x #xx,xxx.w //1=size 2=size dest adr 3=code
+ ii_lset 0x31fc
+// move.x #xx,xxx.l //1=size 2=size dest adr 3=code
+ ii_lset 0x33fc
+// move.x ea,d8(ax,dy) -------------------------------------------
+// move.x dx,d8(a0-a7,dy)
+ ii_lset_opeag 31,8
+ ii_lset_opeag 33,8
+ ii_lset_opeag 35,8
+ ii_lset_opeag 37,8
+ ii_lset_opeag 39,8
+ ii_lset_opeag 3b,8
+ ii_lset_opeag 3d,8
+ ii_lset_opeag 3f,8
+// move.x (ax),d8(a0-a7,dy)
+// move.x (ax)+,d8(a0-a7,dy)
+ ii_lset_opea 31,9
+ ii_lset_opea 33,9
+ ii_lset_opea 35,9
+ ii_lset_opea 37,9
+ ii_lset_opea 39,9
+ ii_lset_opea 3b,9
+ ii_lset_opea 3d,9
+ ii_lset_opea 3f,9
+// move.x -(ax),d8(a0-a7,dy)
+ ii_lset_opeag 31,a
+ ii_lset_opeag 33,a
+ ii_lset_opeag 35,a
+ ii_lset_opeag 37,a
+ ii_lset_opeag 39,a
+ ii_lset_opeag 3b,a
+ ii_lset_opeag 3d,a
+ ii_lset_opeag 3f,a
+//---------------------------------------------------------------------
+// move.x ea,d8(pc,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// move.x dx,d8(pc,dy)
+// move.x ax,d8(pc,dy)
+ ii_lset_opea 37,c
+// move.x (ax),d8(pc,dy)
+// move.x (ax)+,d8(pc,dy)
+ ii_lset_opea 37,d
+// move.x -(ax),d8(pc,dy)
+ ii_lset_opeag 37,e
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),d0-d7
+ ii_lset_opeag 30,3
+ ii_lset_opeag 32,3
+ ii_lset_opeag 34,3
+ ii_lset_opeag 36,3
+ ii_lset_opeag 38,3
+ ii_lset_opeag 3a,3
+ ii_lset_opeag 3c,3
+ ii_lset_opeag 3e,3
+// move.x d8(ax,dy),a0-a7
+ ii_lset_opeag 30,7
+ ii_lset_opeag 32,7
+ ii_lset_opeag 34,7
+ ii_lset_opeag 36,7
+ ii_lset_opeag 38,7
+ ii_lset_opeag 3a,7
+ ii_lset_opeag 3c,7
+ ii_lset_opeag 3e,7
+// move.x d8(ax,dy),(a0)-(a7)
+ ii_lset_opeag 30,b
+ ii_lset_opeag 32,b
+ ii_lset_opeag 34,b
+ ii_lset_opeag 36,b
+ ii_lset_opeag 38,b
+ ii_lset_opeag 3a,b
+ ii_lset_opeag 3c,b
+ ii_lset_opeag 3e,b
+// move.x d8(ax,dy),(a0)+-(a7)+
+ ii_lset_opeag 30,f
+ ii_lset_opeag 32,f
+ ii_lset_opeag 34,f
+ ii_lset_opeag 36,f
+ ii_lset_opeag 38,f
+ ii_lset_opeag 3a,f
+ ii_lset_opeag 3c,f
+ ii_lset_opeag 3e,f
+// move.x d8(ax,dy),-(a0) bis -(a7)
+ ii_lset_opeag 31,3
+ ii_lset_opeag 33,3
+ ii_lset_opeag 35,3
+ ii_lset_opeag 37,3
+ ii_lset_opeag 39,3
+ ii_lset_opeag 3b,3
+ ii_lset_opeag 3d,3
+ ii_lset_opeag 3f,3
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),d0-d7
+ ii_lset_dxg 3,3b
+// move.x d8(pc,dy),a0-a7
+ ii_lset_dxg 3,7b
+// move.x d8(pc,dy),(a0-a7)
+ ii_lset_dxg 3,bb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxg 3,fb
+// move.x d8(pc,dy),(a0-a7)+
+ ii_lset_dxu 3,3b
+.endm
+//---------------------------------------------------------------------------------------------
+// function
+//---------------------------------------------------------------------------------------------
+ii_move_op:.macro
+// move.x d16(ax),xxx.w 1=size 2=adress register
+ ii_move_d16ax_xxx 1e8,a0_off(a7),w
+ ii_move_d16ax_xxx 1e9,a1_off(a7),w
+ ii_move_d16ax_xxx 1ea,a2,w
+ ii_move_d16ax_xxx 1eb,a3,w
+ ii_move_d16ax_xxx 1ec,a4,w
+ ii_move_d16ax_xxx 1ed,a5,w
+ ii_move_d16ax_xxx 1ee,a6,w
+ ii_move_d16ax_xxx 1ef,usp,w
+// move.x d16(ax),xxx.l
+ ii_move_d16ax_xxx 3e8,a0_off(a7),l
+ ii_move_d16ax_xxx 3e9,a1_off(a7),l
+ ii_move_d16ax_xxx 3ea,a2,l
+ ii_move_d16ax_xxx 3eb,a3,l
+ ii_move_d16ax_xxx 3ec,a4,l
+ ii_move_d16ax_xxx 3ed,a5,l
+ ii_move_d16ax_xxx 3ee,a6,l
+ ii_move_d16ax_xxx 3ef,usp,l
+// move.x d16(pc),xxx.w
+ ii_move_d16ax_xxx 1fa,a0,w
+// move.x d16(pc),xxx.l
+ ii_move_d16ax_xxx 3fa,a0,l
+// move.x xxx.w,d16(ax)
+// move.x xxx.l,d16(ax)
+// move.x #xx,d16(ax)
+ ii_move_xxx_d16ax 1,a0_off(a7)
+ ii_move_xxx_d16ax 3,a1_off(a7)
+ ii_move_xxx_d16ax 5,a2
+ ii_move_xxx_d16ax 7,a3
+ ii_move_xxx_d16ax 9,a4
+ ii_move_xxx_d16ax b,a5
+ ii_move_xxx_d16ax d,a6
+ ii_move_xxx_d16ax f,usp
+// move.x xxx.w,xxx.w; 1=size 2=size source adr 3=size dest adr 4=code
+ ii_move_xxx_xxx b,w,w,11f8
+ ii_move_xxx_xxx l,w,w,21f8
+ ii_move_xxx_xxx w,w,w,31f8
+// move.x xxx.l,xxx.w
+ ii_move_xxx_xxx b,l,w,11f9
+ ii_move_xxx_xxx l,l,w,21f9
+ ii_move_xxx_xxx w,l,w,31f9
+// move.x xxx.w,xxx.l
+ ii_move_xxx_xxx b,w,l,13f8
+ ii_move_xxx_xxx l,w,l,23f8
+ ii_move_xxx_xxx w,w,l,33f8
+// move.x xxx.l,xxx.l
+ ii_move_xxx_xxx b,l,l,13f9
+ ii_move_xxx_xxx l,l,l,23f9
+ ii_move_xxx_xxx w,l,l,33f9
+// move.x #xx,xxx.w //1=size 2=size dest adr 3=code
+ ii_move_im_xxx b,w,11fc
+ ii_move_im_xxx l,w,21fc
+ ii_move_im_xxx w,w,31fc
+// move.x #xx,xxx.l //1=size 2=size dest adr 3=code
+ ii_move_im_xxx b,l,13fc
+ ii_move_im_xxx l,l,23fc
+ ii_move_im_xxx w,l,33fc
+//---------------------------------------------------------------------
+// move.x ea,d8(ax,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// move.x dx,d8(ax/pc,dy)
+ ii_move_dxxia d0_off(a7),80,id,d,c0
+ ii_move_dxxia d1_off(a7),81,id,d,c1
+ ii_move_dxxia d2,82,d,d,c2
+ ii_move_dxxia d3,83,d,d,c3
+ ii_move_dxxia d4,84,d,d,c4
+ ii_move_dxxia d5,85,d,d,c5
+ ii_move_dxxia d6,86,d,d,c6
+ ii_move_dxxia d7,87,d,d,c7
+// move.x ax,d8(ax/pc,dy)
+ ii_move_dxxia a0_off(a7),88,id,d,c8
+ ii_move_dxxia a1_off(a7),89,id,d,c9
+ ii_move_dxxia a2,8a,d,da,ca
+ ii_move_dxxia a3,8b,d,da,cb
+ ii_move_dxxia a4,8c,d,da,cc
+ ii_move_dxxia a5,8d,d,da,cd
+ ii_move_dxxia a6,8e,d,da,ce
+ ii_move_dxxia a7,8f,a7,da,cf
+// move.x (ax),d8(ax/pc,dy)
+ ii_move_dxxia a0_off(a7),90,ia,d,d0
+ ii_move_dxxia a1_off(a7),91,ia,d,d1
+ ii_move_dxxia (a2),92,d,d,d2
+ ii_move_dxxia (a3),93,d,d,d3
+ ii_move_dxxia (a4),94,d,d,d4
+ ii_move_dxxia (a5),95,d,d,d5
+ ii_move_dxxia (a6),96,d,d,d6
+ ii_move_dxxia (a7),97,a7,d,d7
+// move.x (ax)+,d8(ax/pc,dy)
+ ii_move_dxxia a0_off(a7),98,iap,d,d8
+ ii_move_dxxia a1_off(a7),99,iap,d,d9
+ ii_move_dxxia (a2)+,9a,d,d,da
+ ii_move_dxxia (a3)+,9b,d,d,db
+ ii_move_dxxia (a4)+,9c,d,d,dc
+ ii_move_dxxia (a5)+,9d,d,d,dd
+ ii_move_dxxia (a6)+,9e,d,d,de
+ ii_move_dxxia (a7)+,9f,a7,d,df
+// move.x -(ax),d8(ax/pc,dy)
+ ii_move_dxxia a0_off(a7),a0,iam,d,e0
+ ii_move_dxxia a1_off(a7),a1,iam,d,e1
+ ii_move_dxxia -(a2),a2,d,d,e2
+ ii_move_dxxia -(a3),a3,d,d,e3
+ ii_move_dxxia -(a4),a4,d,d,e4
+ ii_move_dxxia -(a5),a5,d,d,e5
+ ii_move_dxxia -(a6),a6,d,d,e6
+ ii_move_dxxia -(a7),a7,a7,d,e7
+//---------------------------------------------------------------------
+// move.x d8(ax/pc,dy),ea --------------------------------------------
+//---------------------------------------------------------------------
+// move.x d8(ax/pc,dy),dz
+ ii_move_d8_dest d0,id,03,dx
+ ii_move_d8_dest d1,id,23,dx
+ ii_move_d8_dest d2,d,43,dx
+ ii_move_d8_dest d3,d,63,dx
+ ii_move_d8_dest d4,d,83,dx
+ ii_move_d8_dest d5,d,a3,dx
+ ii_move_d8_dest d6,d,c3,dx
+ ii_move_d8_dest d7,d,e3,dx
+// move.x d8(ax/pc,dy),az
+ ii_move_d8_dest a0,id,07,ax
+ ii_move_d8_dest a1,id,27,ax
+ ii_move_d8_dest a2,d,47,ax
+ ii_move_d8_dest a3,d,67,ax
+ ii_move_d8_dest a4,d,87,ax
+ ii_move_d8_dest a5,d,a7,ax
+ ii_move_d8_dest a6,d,c7,ax
+ ii_move_d8_dest usp,id,e7,ax
+// move.x d8(ax/pc,dy),(az)
+ ii_move_d8_dest a0_off(a7),id,0b,ia
+ ii_move_d8_dest a1_off(a7),id,2b,ia
+ ii_move_d8_dest (a2),d,4b,ia
+ ii_move_d8_dest (a3),d,6b,ia
+ ii_move_d8_dest (a4),d,8b,ia
+ ii_move_d8_dest (a5),d,ab,ia
+ ii_move_d8_dest (a6),d,cb,ia
+ ii_move_d8_dest usp,id,eb,ia
+// move.x d8(ax/pc,dy),(az)+
+ ii_move_d8_dest a0_off(a7),id,0f,iap
+ ii_move_d8_dest a1_off(a7),id,2f,iap
+ ii_move_d8_dest (a2)+,d,4f,iap
+ ii_move_d8_dest (a3)+,d,6f,iap
+ ii_move_d8_dest (a4)+,d,8f,iap
+ ii_move_d8_dest (a5)+,d,af,iap
+ ii_move_d8_dest (a6)+,d,cf,iap
+ ii_move_d8_dest usp,id,ef,iap
+// move.x d8(ax/pc,dy),-(az)
+ ii_move_d8_dest a0_off(a7),id,13,iam
+ ii_move_d8_dest a1_off(a7),id,33,iam
+ ii_move_d8_dest -(a2),d,53,iam
+ ii_move_d8_dest -(a3),d,73,iam
+ ii_move_d8_dest -(a4),d,93,iam
+ ii_move_d8_dest -(a5),d,b3,iam
+ ii_move_d8_dest -(a6),d,d3,iam
+ ii_move_d8_dest usp,id,f3,iam
+.endm //end function
+//====================================================================
+// subs ----------------------------------------------------------
+//====================================================================
+// move.x d16(ax),xxx.w/l 1=code 2=adress register 3=dest adr size
+ii_move_d16ax_xxx:.macro
+ii_0x1\1: //byt:
+#ifdef halten_move
+ halt
+#endif
+ mvs.w (a0)+,d0
+ move.l \2,a1
+ add.l d0,a1
+ move.b (a1),d0
+ move.\3 (a0)+,a1
+ move.b d0,(a1)
+ set_cc0
+ ii_end
+ii_0x2\1: //long:
+#ifdef halten_move
+ halt
+#endif
+ mvs.w (a0)+,d0
+ move.l \2,a1
+ add.l d0,a1
+ move.l (a1),d0
+ move.\3 (a0)+,a1
+ move.l d0,(a1)
+ set_cc0
+ ii_end
+ii_0x3\1: //word:
+#ifdef halten_move
+ halt
+#endif
+ mvs.w (a0)+,d0
+ move.l \2,a1
+ add.l d0,a1
+ move.w (a1),d0
+ move.\3 (a0)+,a1
+ move.w d0,(a1)
+ set_cc0
+ ii_end
+.endm
+//----------------------------------------
+// move.x xxx.w,d16(ax)
+// move.x xxx.l,d16(ax)
+// move.x #xx,d16(ax)
+ii_move_xxx_d16ax:.macro //1=code 2=adress register
+ii_0x1\178: //byt xxx.w
+#ifdef halten_move
+ halt
+#endif
+ move.w (a0)+,a1
+ move.b (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.b d0,(a1)
+ set_cc0
+ ii_end
+ii_0x1\179: //byt xxx.l
+#ifdef halten_move
+ halt
+#endif
+ move.l (a0)+,a1
+ move.b (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.b d0,(a1)
+ set_cc0
+ ii_end
+ii_0x1\17c: //byt #x
+#ifdef halten_move
+ halt
+#endif
+ mvs.b (a0)+,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.b d0,(a1)
+ set_cc0
+ ii_end
+ii_0x2\178: //long xxx.w
+#ifdef halten_move
+ halt
+#endif
+ move.w (a0)+,a1
+ move.l (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.l d0,(a1)
+ set_cc0
+ ii_end
+ii_0x2\179: //long xxx.l
+#ifdef halten_move
+ halt
+#endif
+ move.l (a0)+,a1
+ move.l (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.l d0,(a1)
+ set_cc0
+ ii_end
+ii_0x2\17c: //long #x
+#ifdef halten_move
+ halt
+#endif
+ move.l (a0)+,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.l d0,(a1)
+ set_cc0
+ ii_end
+ ii_end
+ii_0x3\178: //word xxx.w
+#ifdef halten_move
+ halt
+#endif
+ move.w (a0)+,a1
+ move.w (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.w d0,(a1)
+ set_cc0
+ ii_end
+ii_0x3\179: //word xxx.l
+#ifdef halten_move
+ halt
+#endif
+ move.l (a0)+,a1
+ move.w (a1),d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.w d0,(a1)
+ set_cc0
+ ii_end
+ii_0x3\17c: //word #x
+#ifdef halten_move
+ halt
+#endif
+ move.w (a0)+,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.w d0,(a1)
+ set_cc0
+ ii_end
+.endm
+// move.x xxx,xxx
+ii_move_xxx_xxx:.macro //1=size 2=size source adr 3=size dest adr 4=code
+ii_0x\4:
+#ifdef halten_move
+ halt
+#endif
+ move.\2 (a0)+,a1
+ move.\1 (a1),d0
+ move.\3 (a0)+,d1
+ move.\1 d0,(a1)
+ set_cc0
+ ii_end
+.endm
+// move.x im,xxx
+ii_move_im_xxx:.macro //1=size 2=size dest adr 3=code
+ii_0x\3:
+#ifdef halten_move
+ halt
+#endif
+.ifc 1,b
+ move.w (a0)+,d0
+.else
+ move.\1 (a0)+,d0
+.endif
+ move.\2 (a0)+,a1
+ move.\1 d0,(a1)
+ set_cc0
+ ii_end
+.endm
+//---------------------------------------------------------------------
+// move.x ea,d8(ax,dy) -------------------------------------------
+//---------------------------------------------------------------------
+// ea=dx,ax,(ax),(ax)+,-(ax)
+//---------------------------------------------------------------------
+ii_move_dxxia:.macro //1=source 2=code 1.stelle 3=code 2 letzte Stellen 4=art 5=code d8(pc,dy)
+.ifc \3,id
+ ii_move_dxxi b,\1+3,1,\2,\3,\5
+ ii_move_dxxi w,\1+2,2,\2,\3,\5
+ ii_move_dxxi l,\1,3,\2,\3,\5
+.else
+ .ifc \4,da
+ ii_move_dxxi w,\1,2,\2,\3,\5
+ ii_move_dxxi l,\1,3,\2,\3,\5
+ .else
+ ii_move_dxxi b,\1,1,\2,\3,\5
+ ii_move_dxxi w,\1,2,\2,\3,\5
+ ii_move_dxxi l,\1,3,\2,\3,\5
+ .endif
+.endif
+.endm
+
+ii_move_dxxi:.macro
+ii_0x\31\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a0_off(a7),a1
+ move_end \1,\2,\5
+ii_0x\33\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a1_off(a7),a1
+ move_end \1,\2,\5
+ii_0x\35\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a2,a1
+ move_end \1,\2,\5
+ii_0x\37\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a3,a1
+ move_end \1,\2,\5
+ii_0x\39\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a4,a1
+ move_end \1,\2,\5
+ii_0x\3b\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a5,a1
+ move_end \1,\2,\5
+ii_0x\3d\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a6,a1
+ move_end \1,\2,\5
+ii_0x\3f\4: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l usp,a1
+ move_end \1,\2,\5
+ii_0x\37\6: //1=size 2=source 3=code 1.stelle 4=code 2 letzte Stellen
+#ifdef halten_move
+ halt
+#endif
+ move.l a0,a1
+ move_end \1,\2,\5
+.endm
+//------------------------------------
+move_end:.macro
+ jsr ewf
+.ifc 3,a7
+ move.l a7,d1 // a7 sichern
+ move.l usp,a7 // a7 holen
+.endif
+.ifc 3,ia
+ move.l a2,d1 // a2 sichern
+ move.l \2,a2
+ move.\2 (a2),(a1)
+ move.l d1,a2 // a2 zurück
+.else
+ .ifc 3,iap
+ move.l a2,d1 // a2 sichern
+ move.l \2,a2
+ move.\2 (a2)+,(a1)
+ .else
+ .ifc 3,iam
+ move.l a2,d1 // a2 sichern
+ move.l \2,a2
+ move.\2 -(a2),(a1)
+ .else
+ move.\1 \2,(a1)
+ .endif
+ .endif
+.endif
+.ifc 3,a7
+ movea.l a7,usp // a7 zurück
+ movea.l d1,a7 // a7 setzen
+.endif
+ set_cc0
+.ifc 3,iap
+ move.l d1,a2 // a2 zurück
+.endif
+.ifc 3,iam
+ move.l d1,a2 // a2 zurück
+.endif
+ ii_end
+.endm
+//---------------------------------------------------------------------
+// move.x ea,d8(pc,dy)
+//---------------------------------------------------------------------
+
+//---------------------------------------------------------------------
+// move.x d8(ax,dy),ea ---------------------------------------------
+//---------------------------------------------------------------------
+ii_move_d8_dest:.macro //1=dest 2=art 3=code 2.+3.stelle 4=art adresse
+//byt
+ii_0x1\30:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0_off(a7),a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\31:
+#ifdef halten_move
+ halt
+#endif
+ move.l a1_off(a7),a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\32:
+#ifdef halten_move
+ halt
+#endif
+ move.l a2,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\33:
+#ifdef halten_move
+ halt
+#endif
+ move.l a3,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\34:
+#ifdef halten_move
+ halt
+#endif
+ move.l a4,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\35:
+#ifdef halten_move
+ halt
+#endif
+ move.l a5,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\36:
+#ifdef halten_move
+ halt
+#endif
+ move.l a6,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\37:
+#ifdef halten_move
+ halt
+#endif
+ move.l usp,a1
+ moveb_a1_src\4 \1,\2
+ii_0x1\3b:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0,a1
+ moveb_a1_src\4 \1,\2
+//long
+ii_0x2\30:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0_off(a7),a1
+ movel_a1_src\4 \1,\2
+ii_0x2\31:
+#ifdef halten_move
+ halt
+#endif
+ move.l a1_off(a7),a1
+ movel_a1_src\4 \1,\2
+ii_0x2\32:
+#ifdef halten_move
+ halt
+#endif
+ move.l a2,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\33:
+#ifdef halten_move
+ halt
+#endif
+ move.l a3,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\34:
+#ifdef halten_move
+ halt
+#endif
+ move.l a4,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\35:
+#ifdef halten_move
+ halt
+#endif
+ move.l a5,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\36:
+#ifdef halten_move
+ halt
+#endif
+ move.l a6,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\37:
+#ifdef halten_move
+ halt
+#endif
+ move.l usp,a1
+ movel_a1_src\4 \1,\2
+ii_0x2\3b:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0,a1
+ moveb_a1_src\4 \1,\2
+//word
+ii_0x3\30:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0_off(a7),a1
+ movew_a1_src\4 \1,\2
+ii_0x3\31:
+#ifdef halten_move
+ halt
+#endif
+ move.l a1_off(a7),a1
+ movew_a1_src\4 \1,\2
+ii_0x3\32:
+#ifdef halten_move
+ halt
+#endif
+ move.l a2,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\33:
+#ifdef halten_move
+ halt
+#endif
+ move.l a3,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\34:
+#ifdef halten_move
+ halt
+#endif
+ move.l a4,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\35:
+#ifdef halten_move
+ halt
+#endif
+ move.l a5,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\36:
+#ifdef halten_move
+ halt
+#endif
+ move.l a6,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\37:
+#ifdef halten_move
+ halt
+#endif
+ move.l usp,a1
+ movew_a1_src\4 \1,\2
+ii_0x3\3b:
+#ifdef halten_move
+ halt
+#endif
+ move.l a0,a1
+ moveb_a1_src\4 \1,\2
+.endm
+//---------------------------------------------------------------------
+//dx
+moveb_a1_srcdx:.macro
+ jsr ewf
+.ifc \2,id
+ move.b (a1),\1_off+3(a7)
+.else
+ move.b (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movel_a1_srcdx:.macro
+ jsr ewf
+.ifc \2,id
+ move.l (a1),\1_off(a7)
+.else
+ move.l (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movew_a1_srcdx:.macro
+ jsr ewf
+.ifc \2,id
+ move.w (a1),\1_off+2(a7)
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+// ax
+moveb_a1_srcax:.macro
+ jsr ewf
+.ifc \2,id
+ .ifc \1,usp
+ move.w (a1),a1
+ move.l a1,usp
+ .else
+ move.w (a1),\1_off+2(a7)
+ .endif
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movel_a1_srcax:.macro
+ jsr ewf
+.ifc \2,id
+ .ifc \1,usp
+ move.l (a1),a1
+ move.l a1,usp
+ .else
+ move.l (a1),\1_off(a7)
+ .endif
+.else
+ move.l (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movew_a1_srcax:.macro
+ jsr ewf
+.ifc \2,id
+ .ifc \1,usp
+ move.w (a1),a1
+ move.l a1,usp
+ .else
+ move.w (a1),\1_off+2(a7)
+ .endif
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+// (ax)
+moveb_a1_srcia:.macro
+ jsr ewf
+.ifc \2,id
+ move.b (a1),d0
+ move.l \1,a1
+ move.b d0,(a1)
+.else
+ move.b (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movel_a1_srcia:.macro
+ jsr ewf
+.ifc \2,id
+ move.l (a1),d0
+ move.l \1,a1
+ move.l d0,(a1)
+.else
+ move.l (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movew_a1_srcia:.macro
+ jsr ewf
+.ifc \2,id
+ move.w (a1),d0
+ move.l \1,a1
+ move.w d0,(a1)
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+// (ax)+
+moveb_a1_srciap:.macro
+ jsr ewf
+.ifc \2,id
+ move.b (a1),d0
+ move.l \1,a1
+ move.b d0,(a1)+
+ move.l a1,\1
+.else
+ move.b (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movel_a1_srciap:.macro
+ jsr ewf
+.ifc \2,id
+ move.l (a1),d0
+ move.l \1,a1
+ move.l d0,(a1)+
+ move.l a1,\1
+.else
+ move.l (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movew_a1_srciap:.macro
+ jsr ewf
+.ifc \2,id
+ move.w (a1),d0
+ move.l \1,a1
+ move.w d0,(a1)+
+ move.l a1,\1
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+// -(ax)
+moveb_a1_srciam:.macro
+ jsr ewf
+.ifc \2,id
+ move.b (a1),d0
+ move.l \1,a1
+ move.b d0,-(a1)
+ move.l a1,\1
+.else
+ move.b (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movel_a1_srciam:.macro
+ jsr ewf
+.ifc \2,id
+ move.l (a1),d0
+ move.l \1,a1
+ move.l d0,-(a1)
+ move.l a1,\1
+.else
+ move.l (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+movew_a1_srciam:.macro
+ jsr ewf
+.ifc \2,id
+ move.w (a1),d0
+ move.l \1,a1
+ move.w d0,-(a1)
+ move.l a1,\1
+.else
+ move.w (a1),\1
+.endif
+ set_cc0
+ ii_end
+.endm
+
+//---------------------------------------------------------------------
+// move.x d8(pc,dy),ea
+//---------------------------------------------------------------------
+
+
+
+// move.w dx,(a0,dx.w*SF)
+ ii_lset 0x3180
+ ii_lset 0x3181
+ ii_lset 0x3182
+ ii_lset 0x3183
+ ii_lset 0x3184
+ ii_lset 0x3185
+ ii_lset 0x3186
+ ii_lset 0x3187
+
+//--------------------------------------------------------------------
+// // move.w dx,d(ay,dz.w*sf)
+//--------------------------------------------------------------------
+movew_ewfw:.macro off1, off2
+ move.l \off2,a1
+ jsr ewf
+ move.w \off1,(a1)
+ set_cc0
+ ii_end
+ .endm
+ii_0x3180:
+ movew_ewfw d0_off+2(a7),a0_off(a7)
+ii_0x3181:
+ movew_ewfw d0_off+2(a7),a0_off(a7)
+ii_0x3182:
+ movew_ewfw d2,a0_off(a7)
+ii_0x3183:
+ movew_ewfw d3,a0_off(a7)
+ii_0x3184:
+ movew_ewfw d4,a0_off(a7)
+ii_0x3185:
+ movew_ewfw d5,a0_off(a7)
+ii_0x3186:
+ movew_ewfw d6,a0_off(a7)
+ii_0x3187:
+ movew_ewfw d7,a0_off(a7)
diff --git a/SD_CARD/BaS_gcc/include/ii_movem.h b/SD_CARD/BaS_gcc/include/ii_movem.h
new file mode 100644
index 0000000..5e8a470
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_movem.h
@@ -0,0 +1,374 @@
+//***********************************************************************************/
+// movem
+//***********************************************************************************/
+ii_movem_lset: .macro
+// movem.l rx,xxx.L
+ ii_lset 0x48f9
+// movem.l xxx.L,rx
+ ii_lset 0x4cf9
+// movem.w rx,xxx.L
+ ii_lset 0x48b9
+// movem.w xxx.L,rx
+ ii_lset 0x4cb9
+// movem.l rx,-(ax)
+ ii_lset 0x48e0
+ ii_lset 0x48e1
+ ii_lset 0x48e2
+ ii_lset 0x48e3
+ ii_lset 0x48e4
+ ii_lset 0x48e5
+ ii_lset 0x48e6
+ ii_lset 0x48e7
+// movem.l (ax)+,rx
+ ii_lset 0x4cd8
+ ii_lset 0x4cd9
+ ii_lset 0x4cda
+ ii_lset 0x4cdb
+ ii_lset 0x4cdc
+ ii_lset 0x4cdd
+ ii_lset 0x4cde
+ ii_lset 0x4cdf
+.endm
+//***********************************************************************************/
+ii_movem_func: .macro
+//-------------------------------------------------------------------
+// movem.l
+//--------------------------------------------------------------------
+// movem.l (ax)+,reg
+//--------------------------------------------------------------------
+ .long 0
+az_reg_table:
+ .byte 0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4 // 0-f
+ .byte 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5 // 10-1f
+ .byte 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5 // 20-2f
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // 30-3f
+ .byte 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5 // 40-4f
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // 50
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // 60
+ .byte 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7 // 70
+ .byte 1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5 // 80-8f
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // 90
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // a0
+ .byte 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7 // b0
+ .byte 2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6 // c0
+ .byte 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7 // d0
+ .byte 3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7 // e0
+ .byte 4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8 // f0
+//-------------------------------------------------------------------------------
+ii_0x48e0: // movem.l reglist,-(a0)
+ mvm_mem_macro 0x48d0,a0_off(a7),2
+ii_0x48e1: // movem.l reglist,-(a1)
+ mvm_mem_macro 0x48d1,a1_off(a7),2
+ii_0x48e2: // movem.l reglist,-(a2)
+ mvm_mem_macro 0x48d2,a2,2
+ii_0x48e3: // movem.l reglist,-(a3)
+ mvm_mem_macro 0x48d3,a3,2
+ii_0x48e4: // movem.l reglist,-(a4)
+ mvm_mem_macro 0x48d4,a4,2
+ii_0x48e5: // movem.l reglist,-(a5)
+ mvm_mem_macro 0x48d5,a5,2
+ii_0x48e6: // movem.l reglist,-(a6)
+ mvm_mem_macro 0x48d6,a6,2
+ii_0x48e7: // movem.l reglist,-(a7)
+ mvm_mem_macro 0x48d7,usp,2
+//-------------------------------------------------------------------------------
+ii_0x4cd8: // movem.l (a0)+,reglist
+ mvm_reg_macro 0x4cd0,0x41e8,2
+ii_0x4cd9: // movem.l (a1)+,reglist
+ mvm_reg_macro 0x4cd1,0x43e9,2
+ii_0x4cda: // movem.l (a2)+,reglist
+ mvm_reg_macro 0x4cd2,0x45ea,2
+ii_0x4cdb: // movem.l (a3)+,reglist
+ mvm_reg_macro 0x4cd3,0x47eb,2
+ii_0x4cdc: // movem.l (a4)+,reglist
+ mvm_reg_macro 0x4cd4,0x49ec,2
+ii_0x4cdd: // movem.l (a5)+,reglist
+ mvm_reg_macro 0x4cd5,0x4bed,2
+ii_0x4cde: // movem.l (a6)+,reglist
+ mvm_reg_macro 0x4cd6,0x4dee,2
+ii_0x4cdf: // movem.l (a7)+,reglist
+ mvm_reg_macro 0x4cd7,0x4fef,2
+//----------------------------------------------------------------------------
+ii_0x48f9: // movem.l reg,xxx.L
+#ifdef halten_movem
+ halt
+#endif
+ move.w (a0)+,d0
+ move.l (a0)+,a1
+ movemrm_macro l
+//---------------------------------------------------------------------------------------------
+ii_0x4cf9: // movem.l xxx.L,reg
+#ifdef halten_movem
+ halt
+#endif
+ move.w (a0)+,d0
+ move.l (a0)+,a1
+ movemmr_macro l
+//----------------------------------------------------------------------------
+ii_0x48b9: // movem.w reg,xxx.L
+#ifdef halten_movem
+ halt
+#endif
+ move.w (a0)+,d0
+ move.l (a0)+,a1
+ movemrm_macro w
+//---------------------------------------------------------------------------------------------
+ii_0x4cb9: // movem.w xxx.L,reg
+#ifdef halten_movem
+ halt
+#endif
+ move.w (a0)+,d0
+ move.l (a0)+,a1
+ movemmr_macro w
+.endm
+//==============================================================
+mvm_mem_macro:.macro
+#ifdef halten_movem
+ halt
+#endif
+ lea az_reg_table,a1
+ mvz.b (a0),d1
+ mvz.b 0(a1,d1)+,d0
+ mvz.b 1(a0),d1
+ mvz.b 0(a1,d1)+,d1
+ add.l d0,d1
+ lsl.l #\3,d1 // * anzahl byts pro wert
+ move.l \2,a1
+ sub.l d1,a1 // ax-anzahl byts
+ move.l a1,\2
+ lea ___RAMBAR1,a1
+ move.l a1,pc_off(a7)
+ move.l a1,d0
+ addq.l #1,d0
+ movec d0,RAMBAR1
+ move.w #\1,(a1)+ // movem.x reg_list,-(a7)
+ move.w (a0)+,(a1)+ // register list
+ move.w #0x4ef9,(a1)+ // jmp.l
+ move.l a0,(a1) // rücksprungadresse
+ move.l #___RAMBAR1 + 0x81,d0 // instruction
+ movec d0,RAMBAR1
+ movem.l (a7),d0/d1/a0/a1
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+.endm
+//---------------------------------------------------------------------------------
+mvm_reg_macro:.macro
+#ifdef halten_movem
+ halt
+#endif
+ lea az_reg_table,a1
+ mvz.b (a0),d1
+ mvz.b 0(a1,d1)+,d0
+ mvz.b 1(a0),d1
+ mvz.b 0(a1,d1)+,d1
+ add.l d0,d1
+ lea ___RAMBAR1,a1
+ move.l a1,pc_off(a7)
+ move.l a1,d0
+ addq.l #1,d0
+ movec d0,RAMBAR1
+ move.w #\1,(a1)+ // movem.x (ax),reg_list
+ move.w (a0)+,(a1)+ // register list
+ move.w #\2,(a1)+ // lea 0(ax),ax
+ lsl.l #\3,d1 // * anzahl byts pro wert
+ move.w d1,(a1)+ // offset von lea
+ move.w #0x4ef9,(a1)+ // jmp.l
+ move.l a0,(a1) // rücksprungadresse
+ move.l #___RAMBAR1 + 0x81,d0 // instruction
+ movec d0,RAMBAR1
+ movem.l (a7),d0/d1/a0/a1
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+.endm
+//---------------------------------------------------------------------------------
+movemrm_macro:.macro // in d0 register liste, in a1 zieladresse
+#ifdef halten_movem
+ halt
+#endif
+ tst.b d0 // datenregister zu verschieben?
+ bne mrm_dx\@ // ja->
+ lsr.l #8,d0 // sonst zu addressregister
+ jmp mmrm_nd7\@ // ->
+mrm_dx\@:
+ lsr.l #1,d0
+ bcc mmrm_nd0\@
+.ifc 1,l
+ move.l d0_off(a7),(a1)+
+.else
+ move.w d0_off+2(a7),(a1)+
+.endif
+mmrm_nd0\@:
+ lsr.l #1,d0
+ bcc mmrm_nd1\@
+.ifc 1,l
+ move.l d1_off(a7),(a1)+
+.else
+ move.w d1_off+2(a7),(a1)+
+.endif
+mmrm_nd1\@:
+ lsr.l #1,d0
+ bcc mmrm_nd2\@
+ move.\1 d2,(a1)+
+mmrm_nd2\@:
+ lsr.l #1,d0
+ bcc mmrm_nd3\@
+ move.\1 d3,(a1)+
+mmrm_nd3\@:
+ lsr.l #1,d0
+ bcc mmrm_nd4\@
+ move.\1 d4,(a1)+
+mmrm_nd4\@:
+ lsr.l #1,d0
+ bcc mmrm_nd5\@
+ move.\1 d5,(a1)+
+mmrm_nd5\@:
+ lsr.l #1,d0
+ bcc mmrm_nd6\@
+ move.l d6,(a1)+
+mmrm_nd6\@:
+ lsr.l #1,d0
+ bcc mmrm_nd7\@
+ move.\1 d7,(a1)+
+mmrm_nd7\@:
+ tst.b d0 // addressregister zu verschieben?
+ beq mmrm_na7\@
+ lsr.l #1,d0
+ bcc mmrm_na0\@
+.ifc 1,l
+ move.l a0_off(a7),(a1)+
+.else
+ move.w a0_off+2(a7),(a1)+
+.endif
+mmrm_na0\@:
+ lsr.l #1,d0
+ bcc mmrm_na1\@
+.ifc 1,l
+ move.l a1_off(a7),(a1)+
+.else
+ move.w a1_off+2(a7),(a1)+
+.endif
+mmrm_na1\@:
+ lsr.l #1,d0
+ bcc mmrm_na2\@
+ move.\1 a2,(a1)+
+mmrm_na2\@:
+ lsr.l #1,d0
+ bcc mmrm_na3\@
+ move.\1 a3,(a1)+
+mmrm_na3\@:
+ lsr.l #1,d0
+ bcc mmrm_na4\@
+ move.\1 a4,(a1)+
+mmrm_na4\@:
+ lsr.l #1,d0
+ bcc mmrm_na5\@
+ move.\1 a5,(a1)+
+mmrm_na5\@:
+ lsr.l #1,d0
+ bcc mmrm_na6\@
+ move.\1 a6,(a1)+
+mmrm_na6\@:
+ lsr.l #1,d0
+ bcc mmrm_na7\@
+ move.l a0,d1 // sichern
+ move.l usp,a0 // ist ja usp
+ move.\1 a0,(a1)+ // nach a0
+ move.l d1,a0 // pc zurück
+mmrm_na7\@:
+ ii_end
+ .endm
+//---------------------------------------------------------------------------------------------
+movemmr_macro:.macro // in d0 register liste, in a1 source adr
+#ifdef halten_movem
+ halt
+#endif
+ tst.b d0 // datenregister zu verschieben?
+ bne mmr_dx\@ // ja->
+ lsr.l #8,d0 // sonst zu addressregister
+ bra mmmr_nd7\@ // ->
+mmr_dx\@:
+ lsr.l #1,d0
+ bcc mmmr_nd0\@
+.ifc 1,l
+ move.l (a1)+,d0_off(a7)
+.else
+ move.w (a1)+,d0_off+2(a7)
+.endif
+mmmr_nd0\@:
+ lsr.l #1,d0
+ bcc mmmr_nd1\@
+.ifc 1,l
+ move.l (a1)+,d1_off(a7)
+.else
+ move.w (a1)+,d1_off+2(a7)
+.endif
+mmmr_nd1\@:
+ lsr.l #1,d0
+ bcc mmmr_nd2\@
+ move.\1 (a1)+,d2
+mmmr_nd2\@:
+ lsr.l #1,d0
+ bcc mmmr_nd3\@
+ move.\1 (a1)+,d3
+mmmr_nd3\@:
+ lsr.l #1,d0
+ bcc mmmr_nd4\@
+ move.\1 (a1)+,d4
+mmmr_nd4\@:
+ lsr.l #1,d0
+ bcc mmmr_nd5\@
+ move.\1 (a1)+,d5
+mmmr_nd5\@:
+ lsr.l #1,d0
+ bcc mmmr_nd6\@
+ move.\1 (a1)+,d6
+mmmr_nd6\@:
+ lsr.l #1,d0
+ bcc mmmr_nd7\@
+ move.\1 (a1)+,d7
+mmmr_nd7\@:
+ tst.b d0 // addressregister zu verschieben?
+ beq mmmr_na7\@ // nein->
+ lsr.l #1,d0
+ bcc mmmr_na0\@
+.ifc 1,l
+ move.l (a1)+,a0_off(a7)
+.else
+ move.w (a1)+,a0_off+2(a7)
+.endif
+mmmr_na0\@:
+ lsr.l #1,d0
+ bcc mmmr_na1\@
+.ifc 1,l
+ move.l (a1)+,a1_off(a7)
+.else
+ move.w (a1)+,a1_off+2(a7)
+.endif
+mmmr_na1\@:
+ lsr.l #1,d0
+ bcc mmmr_na2\@
+ move.\1 (a1)+,a2
+mmmr_na2\@:
+ lsr.l #1,d0
+ bcc mmmr_na3\@
+ move.\1 (a1)+,a3
+mmmr_na3\@:
+ lsr.l #1,d0
+ bcc mmmr_na4\@
+ move.\1 (a1)+,a4
+mmmr_na4\@:
+ lsr.l #1,d0
+ bcc mmmr_na5\@
+ move.\1 (a1)+,a5
+mmmr_na5\@:
+ lsr.l #1,d0
+ bcc mmmr_na6\@
+ move.\1 (a1)+,a6
+mmmr_na6\@:
+ lsr.l #1,d0
+ bcc mmmr_na7\@
+ move.\1 (a1)+,a1 // nach a0
+ move.l a1,usp // war ja usp
+mmmr_na7\@:
+ ii_end
+ .endm
diff --git a/SD_CARD/BaS_gcc/include/ii_movep.h b/SD_CARD/BaS_gcc/include/ii_movep.h
new file mode 100644
index 0000000..830fdf7
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_movep.h
@@ -0,0 +1,179 @@
+//--------------------------------------------------------------------
+// movep
+//--------------------------------------------------------------------
+.text
+ii_movep_lset:.macro
+ ii_lset_opeau 01,0 //movep.w d(a0-7),d0
+ ii_lset_opeau 03,0 //movep.w d(a0-7),d1
+ ii_lset_opeau 05,0 //movep.w d(a0-7),d2
+ ii_lset_opeau 07,0 //movep.w d(a0-7),d3
+ ii_lset_opeau 09,0 //movep.w d(a0-7),d4
+ ii_lset_opeau 0b,0 //movep.w d(a0-7),d5
+ ii_lset_opeau 0d,0 //movep.w d(a0-7),d6
+ ii_lset_opeau 0f,0 //movep.w d(a0-7),d7
+
+ ii_lset_opeau 01,4 //movep.w d0,d(a0-7)
+ ii_lset_opeau 03,4 //movep.w d1,d(a0-7)
+ ii_lset_opeau 05,4 //movep.w d2,d(a0-7)
+ ii_lset_opeau 07,4 //movep.w d3,d(a0-7)
+ ii_lset_opeau 09,4 //movep.w d4,d(a0-7)
+ ii_lset_opeau 0b,4 //movep.w d5,d(a0-7)
+ ii_lset_opeau 0d,4 //movep.w d6,d(a0-7)
+ ii_lset_opeau 0f,4 //movep.w d7,d(a0-7)
+
+ ii_lset_opeau 01,8 //movep.l d(a0-7),d0
+ ii_lset_opeau 03,8 //movep.l d(a0-7),d1
+ ii_lset_opeau 05,8 //movep.l d(a0-7),d2
+ ii_lset_opeau 07,8 //movep.l d(a0-7),d3
+ ii_lset_opeau 09,8 //movep.l d(a0-7),d4
+ ii_lset_opeau 0b,8 //movep.l d(a0-7),d5
+ ii_lset_opeau 0d,8 //movep.l d(a0-7),d6
+ ii_lset_opeau 0f,8 //movep.l d(a0-7),d7
+
+ ii_lset_opeau 01,c //movep.l d0,d(a0-7)
+ ii_lset_opeau 03,c //movep.l d1,d(a0-7)
+ ii_lset_opeau 05,c //movep.l d2,d(a0-7)
+ ii_lset_opeau 07,c //movep.l d3,d(a0-7)
+ ii_lset_opeau 09,c //movep.l d4,d(a0-7)
+ ii_lset_opeau 0b,c //movep.l d5,d(a0-7)
+ ii_lset_opeau 0d,c //movep.l d6,d(a0-7)
+ ii_lset_opeau 0f,c //movep.l d7,d(a0-7)
+.endm
+//---------------------------------------------------------------------------------------------
+ii_movep_func:.macro
+//movep.w d(a0-7),d0-7
+ ii_movep 010,d0_off(a7),wad
+ ii_movep 030,d1_off(a7),wad
+ ii_movep 050,d2,wad
+ ii_movep 070,d3,wad
+ ii_movep 090,d4,wad
+ ii_movep 0b0,d5,wad
+ ii_movep 0d0,d6,wad
+ ii_movep 0f0,d7,wad
+//movep.w d0-7,d(a0-7)
+ ii_movep 014,d0_off(a7),wda
+ ii_movep 034,d1_off(a7),wda
+ ii_movep 054,d2,wda
+ ii_movep 074,d3,wda
+ ii_movep 094,d4,wda
+ ii_movep 0b4,d5,wda
+ ii_movep 0d4,d6,wda
+ ii_movep 0f4,d7,wda
+//movep.l d(a0-7),d0-7
+ ii_movep 018,d0_off(a7),lad
+ ii_movep 038,d1_off(a7),lad
+ ii_movep 058,d2,lad
+ ii_movep 078,d3,lad
+ ii_movep 098,d4,lad
+ ii_movep 0b8,d5,lad
+ ii_movep 0d8,d6,lad
+ ii_movep 0f8,d7,lad
+//movep.l d0-7,d(a0-7)
+ ii_movep 01c,d0_off(a7),lda
+ ii_movep 03c,d1_off(a7),lda
+ ii_movep 05c,d2,lda
+ ii_movep 07c,d3,lda
+ ii_movep 09c,d4,lda
+ ii_movep 0bc,d5,lda
+ ii_movep 0dc,d6,lda
+ ii_movep 0fc,d7,lda
+.endm
+//---------------------------------------------------------------------------------------------
+ii_movep:.macro //1=code ziffer 1-3 2=register 3=art
+ii_0x\18:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a0_off(a7),a1
+ ii_movep\3_up1 \2
+ii_0x\19:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a1_off(a7),a1
+ ii_movep\3_up1 \2
+ii_0x\1a:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a2,a1
+ ii_movep\3_up1 \2
+ii_0x\1b:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a3,a1
+ ii_movep\3_up1 \2
+ii_0x\1c:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a4,a1
+ ii_movep\3_up1 \2
+ii_0x\1d:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a5,a1
+ ii_movep\3_up1 \2
+ii_0x\1e:
+#ifdef halten_movep
+ halt
+#endif
+ move.l a6,a1
+ ii_movep\3_up1 \2
+ii_0x\1f:
+#ifdef halten_movep
+ halt
+#endif
+ move.l usp,a1
+ ii_movep\3_up1 \2
+.endm
+
+ii_movepwad_up1:.macro
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.b (a1),d0
+ lsl.l #8,d0
+ move.b 2(a1,d1.l),d0
+ move.w d0,\1
+ ii_end
+.endm
+
+ii_movepwda_up1:.macro
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.w \1,d0
+ move.b d0,2(a1)
+ lsr.l #8,d0
+ move.b d0,(a1)
+ ii_end
+.endm
+
+ii_moveplad_up1:.macro
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.b (a1),d0
+ lsl.l #8,d0
+ move.b 2(a1),d0
+ lsl.l #8,d0
+ move.b 4(a1),d0
+ lsl.l #8,d0
+ move.b 6(a1),d0
+ move.l d0,\1
+ ii_end
+.endm
+
+ii_moveplda_up1:.macro
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ move.l \1,d0
+ move.b d0,6(a1)
+ lsr.l #8,d0
+ move.b d0,4(a1)
+ lsr.l #8,d0
+ move.b d0,2(a1)
+ lsr.l #8,d0
+ move.b d0,(a1)
+ ii_end
+.endm
diff --git a/SD_CARD/BaS_gcc/include/ii_op.h b/SD_CARD/BaS_gcc/include/ii_op.h
new file mode 100644
index 0000000..a3fc0cf
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_op.h
@@ -0,0 +1,661 @@
+/*****************************************************************************************/
+// opertionen
+/*****************************************************************************************/
+ii_lset_op:.macro
+//byt
+ ii_lset_opea \1,0 // dx,ax
+ ii_lset_opea \1,1 // (ax), (ax)+
+ ii_lset_opea \1,2 // -(ax),d16(ax)
+ ii_lset_opeag \1,3 // d8(ax,dy)
+ lea table+0x\1\238*4,a0
+ move.l #ii_0x\138,(a0)+ // xxx.w
+ move.l #ii_0x\139,(a0)+ // xxx.l
+//word
+ ii_lset_opea \1,4 // dx,ax
+ ii_lset_opea \1,5 // (ax), (ax)+
+ ii_lset_opea \1,6 // -(ax),d16(ax)
+ ii_lset_opeag \1,7 // d8(ax,dy)
+ lea table+0x\178*4,a0
+ move.l #ii_0x\178,(a0)+ // xxx.w
+ move.l #ii_0x\179,(a0)+ // xxx.l
+//long
+ ii_lset_opea \1,8 // dx,ax
+ ii_lset_opea \1,9 // (ax), (ax)+
+ ii_lset_opea \1,a // -(ax),d16(ax)
+ ii_lset_opeag \1,b // d8(ax,dy)
+ lea table+0x\1b8*4,a0
+ move.l #ii_0x\1b8,(a0)+ // xxx.w
+ move.l #ii_0x\1b9,(a0)+ // xxx.l
+ .endm
+
+ii_lset_opeag:.macro // 0x1120-0x1127
+ lea table+0x\1\20*4,a0
+ move.l #ii_0x\1\20,(a0)+
+ move.l #ii_0x\1\21,(a0)+
+ move.l #ii_0x\1\22,(a0)+
+ move.l #ii_0x\1\23,(a0)+
+ move.l #ii_0x\1\24,(a0)+
+ move.l #ii_0x\1\25,(a0)+
+ move.l #ii_0x\1\26,(a0)+
+ move.l #ii_0x\1\27,(a0)+
+ .endm;
+
+ii_lset_opeau:.macro // 0x1128-0x112f
+ lea table+0x\1\28*4,a0
+ move.l #ii_0x\1\28,(a0)+
+ move.l #ii_0x\1\29,(a0)+
+ move.l #ii_0x\1\2a,(a0)+
+ move.l #ii_0x\1\2b,(a0)+
+ move.l #ii_0x\1\2c,(a0)+
+ move.l #ii_0x\1\2d,(a0)+
+ move.l #ii_0x\1\2e,(a0)+
+ move.l #ii_0x\1\2f,(a0)+
+ .endm;
+
+ii_lset_opea:.macro
+ ii_lset_opeag \1,\2
+ ii_lset_opeau \1,\2
+ .endm
+/******************************************************/
+ii_op:.macro // 1=code 2=operation 3 = normal oder immediat/quick
+// byt
+ opdx \1,\2,b,0,\3 // dx,ax
+ opia \1,\2,b,1,\3 // (ax),(ax)+
+ opdia \1,\2,b,2,\3 // -(ax),d16(ax)
+ opd8a \1,\2,b,3,\3 // d8(ax),xxx
+// word
+ opdx \1,\2,w,4,\3 // dx,ax
+ opia \1,\2,w,5,\3 // (ax),(ax)+
+ opdia \1,\2,w,6,\3 // -(ax),d16(ax)
+ opd8a \1,\2,w,7,\3 // d8(ax),xxx
+// long
+ opdx \1,\2,l,8,\3 // dx,ax
+ opia \1,\2,l,9,\3 // (ax),(ax)+
+ opdia \1,\2,l,a,\3 // -(ax),d16(ax)
+ opd8a \1,\2,l,b,\3 // d8(ax),xxx
+ .endm
+/******************************************************/
+// byt word long
+/******************************************************/
+opdx: .macro //register: \1=code \2 = operation \3 = size \4=size and adressierungsart 5 = immediate oder normal
+ii_0x\1\40:
+ .ifc \3,b
+ op\5smd \2,d0_off+3(a7),d0_off+3(a7),\3
+ .else
+ .ifc \3,w
+ op\5smd \2,d0_off+2(a7),d0_off+2(a7),\3
+ .else
+ op\5smd \2,d0_off(a7),d0_off(a7),\3
+ .endif
+ .endif
+ii_0x\1\41:
+ .ifc \3,b
+ op\5smd \2,d1_off+3(a7),d1_off+3(a7),\3
+ .else
+ .ifc \3,w
+ op\5smd \2,d1_off+2(a7),d1_off+2(a7),\3
+ .else
+ op\5smd \2,d1_off(a7),d1_off(a7),\3
+ .endif
+.endif
+ii_0x\1\42:
+ op\5smd \2,d2,d2,\3
+ii_0x\1\43:
+ op\5smd \2,d3,d3,\3
+ii_0x\1\44:
+ op\5smd \2,d4,d4,\3
+ii_0x\1\45:
+ op\5smd \2,d5,d5,\3
+ii_0x\1\46:
+ op\5smd \2,d6,d6,\3
+ii_0x\1\47:
+ op\5smd \2,d7,d7,\3
+//ax
+ii_0x\1\48:
+ opa\5smd \2,a0_off(a7),a0_off(a7),\3
+ii_0x\1\49:
+ opa\5smd \2,a1_off(a7),a1_off(a7),\3
+ii_0x\1\4a:
+ opa\5smd \2,a2,a2,\3
+ii_0x\1\4b:
+ opa\5smd \2,a3,a3,\3
+ii_0x\1\4c:
+ opa\5smd \2,a4,a4,\3
+ii_0x\1\4d:
+ opa\5smd \2,a5,a5,\3
+ii_0x\1\4e:
+ opa\5smd \2,a6,a6,\3
+ii_0x\1\4f:
+ opa\5smd \2,usp,usp,\3
+.endm;
+//-----------------------------------------------
+opia: .macro // (ax) \1=code \2 = operation \3 = size \4=size and adressierungsart 5 = immediate oder normal
+//(ax)
+ii_0x\1\40:
+ op\5sia \2,a0_off(a7),(a1),(a1),\3
+ii_0x\1\41:
+ op\5sia \2,a1_off(a7),(a1),(a1),\3
+ii_0x\1\42:
+ op\5smd \2,(a2),(a2),\3
+ii_0x\1\43:
+ op\5smd \2,(a3),(a3),\3
+ii_0x\1\44:
+ op\5smd \2,(a4),(a4),\3
+ii_0x\1\45:
+ op\5smd \2,(a5),(a5),\3
+ii_0x\1\46:
+ op\5smd \2,(a6),(a6),\3
+ii_0x\1\47:
+ op\5sia \2,usp,(a1),(a1),\3
+//(ax)+
+ii_0x\1\48:
+ op\5sia \2,a0_off(a7),(a1),(a1)+,\3
+ii_0x\1\49:
+ op\5sia \2,a1_off(a7),(a1),(a1)+,\3
+ii_0x\1\4a:
+ op\5smd \2,(a2),(a2)+,\3
+ii_0x\1\4b:
+ op\5smd \2,(a3),(a3)+,\3
+ii_0x\1\4c:
+ op\5smd \2,(a4),(a4)+,\3
+ii_0x\1\4d:
+ op\5smd \2,(a5),(a5)+,\3
+ii_0x\1\4e:
+ op\5smd \2,(a6),(a6)+,\3
+ii_0x\1\4f:
+ op\5sia \2,usp,(a1),(a1)+,\3
+.endm;
+//-----------------------------------------------
+opdia: .macro // -(ax) \1=code \2 = operation \3 = size \4 size and adressierungsart 5 = immediate oder normal
+ii_0x\1\40:
+ op\5sia \2,a0_off(a7),-(a1),(a1),\3
+ii_0x\1\41:
+ op\5sia \2,a1_off(a7),-(a1),(a1),\3
+ii_0x\1\42:
+ op\5smd \2,-(a2),(a2),\3
+ii_0x\1\43:
+ op\5smd \2,-(a3),(a3),\3
+ii_0x\1\44:
+ op\5smd \2,-(a4),(a4),\3
+ii_0x\1\45:
+ op\5smd \2,-(a5),(a5),\3
+ii_0x\1\46:
+ op\5smd \2,-(a6),(a6),\3
+ii_0x\1\47:
+ op\5sia \2,usp,-(a1),(a1),\3
+
+ii_0x\1\48:
+ op\5sd16a \2,a0_off(a7),\3
+ii_0x\1\49:
+ op\5sd16a \2,a1_off(a7),\3
+ii_0x\1\4a:
+ op\5sd16a \2,a2,\3
+ii_0x\1\4b:
+ op\5sd16a \2,a3,\3
+ii_0x\1\4c:
+ op\5sd16a \2,a4,\3
+ii_0x\1\4d:
+ op\5sd16a \2,a5,\3
+ii_0x\1\4e:
+ op\5sd16a \2,a6,\3
+ii_0x\1\4f:
+ op\5sd16a \2,usp,\3
+.endm;
+//-----------------------------------------------
+opd8a: .macro // d8(ax,dy) \1=code \2 = operation \3 = size \4=size and adressierungsart 5 = immediate oder normal
+ii_0x\1\40:
+ op\5sd8a \2,a0_off(a7),\3
+ii_0x\1\41:
+ op\5sd8a \2,a1_off(a7),\3
+ii_0x\1\42:
+ op\5sd8a \2,a2,\3
+ii_0x\1\43:
+ op\5sd8a \2,a3,\3
+ii_0x\1\44:
+ op\5sd8a \2,a4,\3
+ii_0x\1\45:
+ op\5sd8a \2,a5,\3
+ii_0x\1\46:
+ op\5sd8a \2,a6,\3
+ii_0x\1\47:
+ op\5sd8a \2,usp,\3
+
+ii_0x\1\48:
+ op\5sxx \2,\3,w
+ii_0x\1\49:
+ op\5sxx \2,\3,l
+.endm;
+//-----------------------------------------------
+opnsmd:.macro // direct dx: 1=operation 2=ea src 3=ea dest 4=size
+#ifdef halten_op
+ halt
+#endif
+.ifc \4,l
+ move.l \2,d1
+.else
+ mvs.\4 \2,d1
+.endif
+ .ifc \1,negx
+ move.b sr_off+1(a7),d1 //ccr holen
+ move d1,ccr //setzen
+ .endif
+ \1 d1
+ set_cc0
+ move.\4 d1,\3
+ ii_end
+ .endm;
+
+opansmd:.macro // direct ax: 1=operation 2=ea src 3=ea dest 4=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \2,usp
+ move.l usp,a1
+ move.l a1,d1
+.else
+ move.l \2,d1
+.endif
+ \1 d1
+.ifc \3,usp
+ move.l d1,a1
+ move.l a1,usp
+.else
+ move.l d1,\3
+.endif
+ ii_end
+.endm;
+
+opnsia:.macro // indirect: 1=operation 2=adress register 3= src 4=dest 5=size
+#ifdef halten_op
+ halt
+#endif
+ move.l \2,a1
+.ifc \5,l
+ move.l \3,d1
+.else
+ mvs.\5 \3,d1
+.endif
+ .ifc \1,negx
+ move.b sr_off+1(a7),d1 //ccr holen
+ move d1,ccr //setzen
+ .endif
+ \1 d1
+ set_cc0
+ move.\5 d1,\4
+ ii_end
+ .endm;
+
+opnsd16a:.macro // indirect: 1=operation 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+ .ifc \1,negx
+ move.b sr_off+1(a7),d1 //ccr holen
+ move d1,ccr //setzen
+ .endif
+ \1 d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opnsd8a:.macro // indirect: 1=operation 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+ move.l \2,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+ .ifc \1,negx
+ move.b sr_off+1(a7),d1 //ccr holen
+ move d1,ccr //setzen
+ .endif
+ \1 d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opnsxx:.macro // indirect: 1=operation 2=size 3=size adresse
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \2,l
+ move.l (a1),d1
+.else
+ mvs.\2 (a1),d1
+.endif
+ move.\3 (a0)+,a1
+ .ifc \1,negx
+ move.b sr_off+1(a7),d1 //ccr holen
+ move d1,ccr //setzen
+ .endif
+ \1 d1
+ set_cc0
+ move.\2 d1,(a1)
+ ii_end
+ .endm;
+//*******************************************************************************3
+opismd:.macro // immediate dx: 1=opieration 2=ea src 3=ea dest 4=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+.ifc \4,l
+ move.l \2,d1
+.else
+ mvs.\4 \2,d1
+.endif
+ \1 d0,d1
+ set_cc0
+.ifnc \1,cmp.l
+ move.\4 d1,\3
+.endif
+ ii_end
+.endm;
+
+opaismd:.macro // immediate ax: 1=opieration 2=ea src 3=ea dest 4=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+.ifc \2,usp
+ move.l usp,a1
+ move.l a1,d1
+.else
+ move.l \2,d1
+.endif
+ \1 d0,d1
+.ifnc \1,cmp.l
+.ifc \3,usp
+ move.l d1,a1
+ move.l a1,usp
+.else
+ move.l d1,\3
+.endif
+.endif
+ ii_end
+.endm;
+
+opisia:.macro // indirect: 1=opieration 2=adress register 3= src 4=dest 5=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \5,l
+ move.l (a0)+,d0
+.else
+ .ifc \5,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l \2,a1
+.ifc \5,l
+ move.l \3,d1
+.else
+ mvs.\5 \3,d1
+.endif
+ \1 d0,d1
+ set_cc0
+.ifnc \1,cmp.l
+ move.\5 d1,\4
+.endif
+ ii_end
+.endm;
+
+opisd16a:.macro // indirect: 1=opieration 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \3,l
+ move.l (a0)+,d0
+.else
+ .ifc \3,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+ \1 d0,d1
+ set_cc0
+.ifnc \1,cmp.l
+ move.\3 d1,(a1)
+.endif
+ ii_end
+ .endm;
+
+opisd8a:.macro // indirect: 1=opieration 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+
+.ifc \3,l
+ move.l (a0)+,d0
+.else
+ .ifc \3,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l d0,_d0_save
+ move.l \2,a1
+ jsr ewf
+ move.l _d0_save,d0
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+ \1 d0,d1
+ set_cc0
+.ifnc \1,cmp.l
+ move.\3 d1,(a1)
+.endif
+ ii_end
+ .endm;
+
+opisxx:.macro // immediate: 1=opieration 2=size 3=size adresse
+.ifc \2,l
+ move.l (a0)+,d0
+.else
+ .ifc \2,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.\3 (a0)+,a1
+.ifc \2,l
+ move.l (a1),d1
+.else
+ mvs.\2 (a1),d1
+.endif
+ \1 d0,d1
+ set_cc0
+.ifnc \1,cmp.l
+ move.\2 d1,(a1)
+.endif
+ ii_end
+ .endm;
+//*******************************************************************************3
+opqsmd:.macro // quick: 1=opieration 2=ea src 3=ea dest 4=size
+.ifc \4,l
+ move.l \2,d1
+.else
+ mvs.\4 \2,d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d0
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 ,d1
+ set_cc0
+ move.\4 d1,\3
+ ii_end
+ .endm;
+
+opaqsmd:.macro // quick: 1=opieration 2=ea src 3=ea dest 4=size
+.ifc \2,usp
+ move.l usp,a1
+ move.l a1,d1
+.else
+ move.l \2,d1
+.endif
+ \1 ,d1
+.ifc \3,usp
+ move.l d1,a1
+ move.l a1,usp
+.else
+ move.l d1,\3
+.endif
+ ii_end
+ .endm;
+
+opqsia:.macro // indirect: 1=opieration 2=adress register 3= src 4=dest 5=size
+#ifdef halten_op
+ halt
+#endif
+
+ move.l \2,a1
+.ifc \5,l
+ move.l \3,d1
+.else
+ mvs.\5 \3,d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d0
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 ,d1
+ set_cc0
+ move.\5 d1,\4
+ ii_end
+ .endm;
+
+opqsd16a:.macro // indirect: 1=opieration 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d0
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 ,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opqsd8a:.macro // indirect: 1=opieration 2=adress register 3=size
+#ifdef halten_op
+ halt
+#endif
+
+ move.l d0,_d0_save
+ move.l \2,a1
+ jsr ewf
+ move.l _d0_save,d0
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d0
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 ,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opqsxx:.macro // quick: 1=opieration 2=size 3=size adresse
+#ifdef halten_op
+ halt
+#endif
+
+ move.\3 (a0)+,a1
+.ifc \2,l
+ move.l (a1),d1
+.else
+ mvs.\2 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d0
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 ,d1
+ set_cc0
+ move.\2 d1,(a1)
+ ii_end
+ .endm;
diff --git a/SD_CARD/BaS_gcc/include/ii_opc.h b/SD_CARD/BaS_gcc/include/ii_opc.h
new file mode 100644
index 0000000..8b887ce
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_opc.h
@@ -0,0 +1,263 @@
+/*****************************************************************************************/
+// functionen macros: fehlende adressierungsarte (MCF nur Dx support) ohne ax
+// zusammen mit op.h
+/*****************************************************************************************/
+ii_lset_opc:.macro
+ ii_lset_opeag \1,c // dx,ax
+ ii_lset_opea \1,d // (ax), (ax)+
+ ii_lset_opea \1,e // -(ax),d16(ax)
+ ii_lset_opeag \1,f // d8(ax,dy)
+ lea table+0x\1b8*4,a0
+ move.l #ii_0x\1b8,(a0)+ // xxx.w
+ move.l #ii_0x\1b9,(a0)+ // xxx.l
+ .endm
+
+/******************************************************/
+ii_opc:.macro // 1=code 2=operation 3 = normal oder immediat
+ opcdx \1,\2,l,c,\3 // dx,ax
+ opia \1,\2,l,d,\3 // (ax),(ax)+
+ opdia \1,\2,l,e,\3 // -(ax),d16(ax)
+ opd8a \1,\2,l,f,\3 // d8(ax),xxx
+ .endm
+//*******************************************************************************3
+/******************************************************/
+// byt word long
+/******************************************************/
+opcdx: .macro //register: \1=code \2 = operation \3 = size \4=size and adressierungsart 5 = immediate oder normal
+ii_0x\1\40:
+#ifdef halten_opc
+ halt
+#endif
+ .ifc \3,b
+ op\5smd \2,d0_off+3(a7),d0_off+3(a7),\3
+ .else
+ .ifc \3,w
+ op\5smd \2,d0_off+2(a7),d0_off+2(a7),\3
+ .else
+ op\5smd \2,d0_off(a7),d0_off(a7),\3
+ .endif
+ .endif
+ii_0x\1\41:
+ .ifc \3,b
+ op\5smd \2,d1_off+3(a7),d1_off+3(a7),\3
+ .else
+ .ifc \3,w
+ op\5smd \2,d1_off+2(a7),d1_off+2(a7),\3
+ .else
+ op\5smd \2,d1_off(a7),d1_off(a7),\3
+ .endif
+.endif
+ii_0x\1\42:
+ op\5smd \2,d2,d2,\3
+ii_0x\1\43:
+ op\5smd \2,d3,d3,\3
+ii_0x\1\44:
+ op\5smd \2,d4,d4,\3
+ii_0x\1\45:
+ op\5smd \2,d5,d5,\3
+ii_0x\1\46:
+ op\5smd \2,d6,d6,\3
+ii_0x\1\47:
+ op\5smd \2,d7,d7,\3
+.endm
+//-----------------------------------------------------
+opcsmd:.macro // dx: 1=opieration 2=ea src 3=ea dest 4=size
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+.ifc \4,l
+ move.l \2,d1
+.else
+ mvs.\4 \2,d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d1
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 d1
+ set_cc0
+ move.\4 d1,\3
+ ii_end
+ .endm;
+
+opacsmd:.macro // ax: 1=opieration 2=ea src 3=ea dest 4=size
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+.ifc \2,usp
+ move.l usp,a1
+ move.l a1,d1
+.else
+ move.l \2,d1
+.endif
+ \1 d1
+ set_cc0
+.ifc \3,usp
+ move.l d1,a1
+ move.l a1,usp
+.else
+ move.l d1,\3
+.endif
+ ii_end
+ .endm;
+
+opcsia:.macro // (ax) (ax)+ -(ax): 1=opieration 2=adress register 3= src 4=dest 5=size
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l \2,a1
+.ifc \5,l
+ move.l \3,d1
+.else
+ mvs.\5 \3,d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d1
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 d1
+ set_cc0
+ move.\5 d1,\4
+ ii_end
+ .endm;
+
+opcsd16a:.macro // d16(ax): 1=opieration 2=adress register 3=size
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d1
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opcsd8a:.macro // indirect: 1=opieration 2=adress register 3=size
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \4,l
+ move.l (a0)+,d0
+.else
+ .ifc \4,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.l d0,_d0_save
+ move.l \2,a1
+ jsr ewf
+ move.l _d0_save,d0
+.ifc \3,l
+ move.l (a1),d1
+.else
+ mvs.\3 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d1
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+
+opcsxx:.macro // indirect: 1=opieration 2=size 3=size adresse
+#ifdef halten_opc
+ halt
+#endif
+
+.ifc \2,l
+ move.l (a0)+,d0
+.else
+ .ifc \2,w
+ mvs.w (a0)+,d0
+ .else
+ move.w (a0)+,d0
+ extb.l d0
+ .endif
+.endif
+ move.\3 (a0)+,a1
+.ifc \2,l
+ move.l (a1),d1
+.else
+ mvs.\2 (a1),d1
+.endif
+.ifc \1,eor.l d0
+ move.l d0_off(a7),d1
+.endif
+.ifc \1,eor.l d1
+ move.l d1_off(a7),d1
+.endif
+ \1 d1
+ set_cc0
+ move.\2 d1,(a1)
+ ii_end
+ .endm;
diff --git a/SD_CARD/BaS_gcc/include/ii_or.h b/SD_CARD/BaS_gcc/include/ii_or.h
new file mode 100644
index 0000000..dfe4450
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_or.h
@@ -0,0 +1,442 @@
+//--------------------------------------------------------------------
+// or
+//--------------------------------------------------------------------
+/*****************************************************************************************/
+//--------------------------------------------------------------------
+// byt
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// or.b #im,dx
+//--------------------------------------------------------------------
+orbir_macro:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.w (a0)+,d0
+ extb.l d0
+ mvs.b \2,d1
+ or.l d0,d1
+ set_cc0
+ move.b d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or ea,dx
+//--------------------------------------------------------------------
+ordd:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or ea(l)->dy(w),dx z.B. für USP
+//--------------------------------------------------------------------
+orddd:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 a1,d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or (ea)->dy,dx
+//--------------------------------------------------------------------
+ordda:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or ea->ay,(ay)+,dx
+//--------------------------------------------------------------------
+orddai:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1)+,d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or ea->ay,-(ay),dx
+//--------------------------------------------------------------------
+orddad:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 -(a1),d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or d16(ay),dx
+//--------------------------------------------------------------------
+ord16ad:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or d8(ay,dy),dx
+//--------------------------------------------------------------------
+ord8ad:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or xxx.w,dx
+//--------------------------------------------------------------------
+orxwd:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.w (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or xxx.l,dx
+//--------------------------------------------------------------------
+orxld:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or d16(pc),dx
+//--------------------------------------------------------------------
+ord16pcd:.macro
+ halt
+ move.l a0,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or d8(pc,dy),dx
+//--------------------------------------------------------------------
+ord8pcd:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// or dy,ea
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // or (ea)->dy,dx
+//--------------------------------------------------------------------
+oreda:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+oredai:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)+
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+oredaid:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2+
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+oredad:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 -(a1),d1
+ move.l a1,\2
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+oredadd:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 -\2,d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,d16(ay)
+//--------------------------------------------------------------------
+ore16ad:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ mvs.\3 (a1),d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or.w dx,d8(ay,dy)
+//--------------------------------------------------------------------
+ore8ad:.macro
+#ifdef halten_or
+ halt
+#endif
+ move.l \2,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d1
+ move.l \1,d0
+.else
+ mvs.\3 (a1),d1
+ mvs.\3 \1,d0
+.endif
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,xxx.w
+//--------------------------------------------------------------------
+orxwe:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.w (a0)+,a1
+ mvs.\3 (a1),d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // or dx,xxx.l
+//--------------------------------------------------------------------
+orxle:.macro
+#ifdef halten_or
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l (a0)+,a1
+ mvs.\3 (a1),d1
+ or.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w ea,ax
+//--------------------------------------------------------------------
+oraw:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// or.w ea,usp
+//--------------------------------------------------------------------
+orawa7:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w usp?,ax
+//--------------------------------------------------------------------
+orawu:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w usp?,usp
+//--------------------------------------------------------------------
+orawua7:.macro
+ orawu \1,\2
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w d16(ay),ax
+//--------------------------------------------------------------------
+orawd16a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w d8(ay,dy),ax
+//--------------------------------------------------------------------
+orawd8a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w xxx.w,ax
+//--------------------------------------------------------------------
+orawxwax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w xxx.l,ax
+//--------------------------------------------------------------------
+orawxlax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w d16(pc),ax
+//--------------------------------------------------------------------
+orawd16pcax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w d8(pc,dy),ax
+//--------------------------------------------------------------------
+orawd8pcax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.w #im,ax
+//--------------------------------------------------------------------
+orawim:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.l d8(ay,dy),ax
+//--------------------------------------------------------------------
+orald8a:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // ora.l d8(pc,dy),ax
+//--------------------------------------------------------------------
+orald8pcax:.macro
+ jmp ii_error
+ .endm;
+//*****************************************************************************************
+// spezial addx subx etc.
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // addx dy,dx
+//--------------------------------------------------------------------
+ordx:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
+// // addx -(ay),-(ax)
+//--------------------------------------------------------------------
+ordax:.macro
+ jmp ii_error
+ .endm;
+//--------------------------------------------------------------------
diff --git a/SD_CARD/BaS_gcc/include/ii_pea.h b/SD_CARD/BaS_gcc/include/ii_pea.h
new file mode 100644
index 0000000..69f69d0
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_pea.h
@@ -0,0 +1,74 @@
+//--------------------------------------------------------------------
+// pea
+//--------------------------------------------------------------------
+.text
+ii_pea_lset:.macro
+ ii_lset_opeag 48,7
+ ii_lset 0x487b
+.endm
+//---------------------------------------------------------------------------------------------
+ii_pea_func:.macro
+ii_0x4870:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a0_off(a7),a1
+ pea_macro
+ii_0x4871:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a1_off(a7),a1
+ pea_macro
+ii_0x4872:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a2,a1
+ pea_macro
+ii_0x4873:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a3,a1
+ pea_macro
+ii_0x4874:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a4,a1
+ pea_macro
+ii_0x4875:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a5,a1
+ pea_macro
+ii_0x4876:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a6,a1
+ pea_macro
+ii_0x4877:
+#ifdef halten_pea
+ halt
+#endif
+ move.l usp,a1
+ pea_macro
+ii_0x487b:
+#ifdef halten_pea
+ halt
+#endif
+ move.l a0,a1
+ pea_macro
+.endm
+//---------------------------------------------------------------------------------------------
+pea_macro:.macro
+ jsr ewf
+ move.l (a1),d0
+ move.l usp,a1
+ move.l d0,-(a1)
+ move.l a1,usp
+ ii_end
+.endm
\ No newline at end of file
diff --git a/SD_CARD/BaS_gcc/include/ii_shd.h b/SD_CARD/BaS_gcc/include/ii_shd.h
new file mode 100644
index 0000000..ecace29
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_shd.h
@@ -0,0 +1,247 @@
+/*****************************************************************************************/
+// opertionen
+/*****************************************************************************************/
+ii_lset_shd:.macro
+ ii_lset_shdx e0 //r d0
+ ii_lset_shdx e2 //r d1
+ ii_lset_shdx e4 //r d2
+ ii_lset_shdx e6 //r d3
+ ii_lset_shdx e8 //r d4
+ ii_lset_shdx ea //r d5
+ ii_lset_shdx ec //r d6
+ ii_lset_shdx ee //r d7
+
+ ii_lset_shdx e1 //l d0
+ ii_lset_shdx e3 //l d1
+ ii_lset_shdx e4 //l d2
+ ii_lset_shdx e5 //l d3
+ ii_lset_shdx e9 //l d4
+ ii_lset_shdx eb //l d5
+ ii_lset_shdx ed //l d6
+ ii_lset_shdx ef //l d7
+ .endm
+
+ii_lset_shdx:.macro
+//byt
+ ii_lset_opea \1,0 // as,ls #im,dx
+ ii_lset_opea \1,1 // rox,ro #im,dx
+ ii_lset_opea \1,2 // as,ls dy,dx
+ ii_lset_opea \1,3 // rox,ro dy,dx
+//word
+ ii_lset_opea \1,4 // as,ls #im,dx
+ ii_lset_opea \1,5 // rox,ro #im,dx
+ ii_lset_opea \1,6 // as,ls dy,dx
+ ii_lset_opea \1,7 // rox,ro dy,dx
+//long
+// ii_lset_opea \1,8 // as,ls #im,dx -> vorhanden
+ ii_lset_opea \1,9 // rox,ro #im,dx
+// ii_lset_opea \1,a // as,ls dy,dx -> vorhanden
+ ii_lset_opea \1,b // rox,ro dy,dx
+ .endm
+/******************************************************/
+ii_shd:.macro // 1=code 2=operation 3 = normal, direct oder immediat
+// byt
+ opdx \1,\2,b,0,\3 // dx
+// word
+ opdx \1,\2,w,4,\3 // dx
+// long
+ opdx \1,\2,l,8,\3 // dx
+ .endm
+/******************************************************/
+// byt word long routinen
+/******************************************************/
+sh_asr: .macro // asr -> 1=operation 2 = dx 3 = dy/im 4 = size b/w
+ mvs.\4 \2,d1
+ sh_shal \1,\2,\3,\4
+ .endm
+
+sh_lsr: .macro // asl -> 1=operation 2 = dx 3 = dy/im 4 = size b/w
+ mvz.\4 \2,d1
+ sh_shal \1,\2,\3,\4
+ .endm
+
+sh_shal:.macro
+ move.w \3,d0
+ \1.l d0,d1
+ set_cc0
+ move.\4 d1,\2
+ .endm
+
+sh_all: .macro // asl/lsl -> 1=operation 2 = dx 3 = dy/im 4 = size b/w
+ mvz.\4 \2,d1
+.ifc \4,b
+ byterev.l d1
+.else
+ swap.w d1
+.endif
+ sh_asr \1,\2,\3,\4
+ .endm
+
+sh_ror: .macro // ror -> 1=operation 2 = dx 3 = dy/im 4 = size b/w/l
+ move.\4 \2,d1 /
+ move.w \3,d0
+.ifc \4,b
+ lsl.l #8,d1
+ move.b \2,d1
+ and.l #0x7,d0
+ lsr.l d0,d1
+.else
+ .ifc \4,w
+ swap.w d1
+ move.w \2,d1
+ and.l #0xf,d0
+ lsr.l d0,d1
+ .else
+ and.l #0x1f,d0
+ lsr.l d0,d1
+ move.l d1,a1
+ move.l \2,d1
+ sub.l #32,d0
+ neg.l d0
+ lsl.l d0,d1
+ add.l a1,d1
+ .endif
+.endif
+ move.\4 d1,\2
+ move.w ccr,d0
+ and.l #1,d1 // ist auch carry bit
+ or.l d1,d0
+ move.b d0,ccr_off(a7)
+ .endm
+
+sh_rol: .macro // rol -> 1=operation 2 = dx 3 = dy/im 4 = size b/w/l
+ move.\4 \2,d1
+ move.w \3,d0
+.ifc \4,b
+ lsl.l #8,d1
+ move.b \2,d1
+ and.l #0x7,d0
+ lsl.l d0,d1
+ lsr.l #8,d1
+ moveq #7,d0
+.else
+ .ifc \4,w
+ swap.w d1
+ move.w \2,d1
+ and.l #0xf,d0
+ lsr.l d0,d1
+ swap.w d1
+ moveq #15,d0
+ .else
+ and.l #0x1f,d0
+ lsl.l d0,d1
+ move.l d1,a1
+ move.l \2,d1
+ sub.l #32,d0
+ neg.l d0
+ lsr.l d0,d1
+ add.l a1,d1
+ moveq #31,d0
+ .endif
+.endif
+ move.\4 d1,\2
+ lsr.l d0,d1 // carry bit schieben
+ move.w ccr,d0
+ and.l #1,d1
+ or.l d1,d0
+ move.b d0,ccr_off(a7)
+ .endm
+
+sh_roxr: .macro // roxr -> 1=operation 2 = dx 3 = dy/im 4 = size b/w/l
+ clr.l d0
+ addx.l d0,d0
+ifc \4,b
+ mvz.b \2,d1
+ lsl.l #1,d1
+ add.l d0,d1
+ lsl.l #8,d1
+ move.b \2,d1
+ move.w \3,d0
+ and.l #0x7,d0
+ lsr.l d0,d1
+ set_cc0
+else
+ .ifc \4,w
+ mvz.b \2,d1
+ lsl.l #1,d1
+ add.l d0,d1
+ lsl.l #8,d1
+ lsl.l #8,d1
+ move.w \2,d1
+ move.w \3,d0
+ and.l #0xf,d0
+ lsr.l d0,d1
+ set_cc0
+ .else
+ bitrev.l d0
+ move.l \2,d1
+ lsr.l #1,d1
+ add.l d0,d1
+ move.w \3,d0
+ subq.l #1,d0
+ and.l #0x1f,d0
+ lsr.l d0,d1
+ move.l d1,a1
+ set_cc1
+ move.l \2,d1
+ sub.l #32,d0
+ neg.l d0
+ lsl.l d0,d1
+ add.l a1,d1
+ .endif
+.endif
+ move.\4 d1,\2
+ .endm
+
+sh_roxl: .macro // roxl -> 1=operation 2 = dx 3 = dy/im 4 = size b/w/l
+ clr.l d0
+ addx.l d0,d0
+ifc \4,b
+ mvz.b \2,d1
+ lsl.l #1,d1
+ add.l d0,d1
+ lsl.l #8,d1
+ move.b \2,d1
+ lsl.l #8,d1
+ lsl.l #7,d1
+ move.w \3,d0
+ and.l #0x7,d0
+ lsl.l d0,d1
+ set_cc0
+ byterev.l d1
+else
+ .ifc \4,w
+ mvz.b \2,d1
+ lsl.l #1,d1
+ add.l d0,d1
+ lsl.l #8,d1
+ lsl.l #7,d1
+ mvz.w \2,d0
+ lsr.l #1,d0
+ add.l d0,d1
+ move.w \3,d0
+ and.l #0xf,d0
+ lsl.l d0,d1
+ set_cc0
+ swap.w d1
+ .else
+ move.l \2,d1
+ lsl.l #1,d1
+ add.l d0,d1
+ move.w \3,d0
+ subq.l #1,d0
+ and.l #0x1f,d0
+ lsl.l d0,d1
+ move.l d1,a1
+ set_cc1
+ move.l \2,d1
+ sub.l #32,d0
+ neg.l d0
+ lsr.l d0,d1
+ add.l a1,d1
+ .endif
+.endif
+ move.\4 d1,\2
+ .endm
+
+
\ No newline at end of file
diff --git a/SD_CARD/BaS_gcc/include/ii_shift.h b/SD_CARD/BaS_gcc/include/ii_shift.h
new file mode 100644
index 0000000..f83bfcb
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_shift.h
@@ -0,0 +1,687 @@
+/*****************************************************************************************/
+// opertionen
+/*****************************************************************************************/
+ii_shift_lset:.macro
+/******************************************************/
+// byt
+/******************************************************/
+// asx.b #,dx
+ ii_lset_dx \1,00 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+ ii_lset_dx \1,01
+ ii_lset_dx \1,02
+ ii_lset_dx \1,03
+ ii_lset_dx \1,04
+ ii_lset_dx \1,05
+ ii_lset_dx \1,06
+ ii_lset_dx \1,07
+// lsx.b #,dx
+ ii_lset_dxu \1,08
+ ii_lset_dxu \1,09
+ ii_lset_dxu \1,0a
+ ii_lset_dxu \1,0b
+ ii_lset_dxu \1,0c
+ ii_lset_dxu \1,0d
+ ii_lset_dxu \1,0e
+ ii_lset_dxu \1,0f
+// roxx.b #,dx
+ ii_lset_dx \1,10
+ ii_lset_dx \1,11
+ ii_lset_dx \1,12
+ ii_lset_dx \1,13
+ ii_lset_dx \1,14
+ ii_lset_dx \1,15
+ ii_lset_dx \1,16
+ ii_lset_dx \1,17
+// rox.b #,dx
+ ii_lset_dx \1,18
+ ii_lset_dx \1,19
+ ii_lset_dx \1,1a
+ ii_lset_dx \1,1b
+ ii_lset_dx \1,1c
+ ii_lset_dx \1,1d
+ ii_lset_dx \1,1e
+ ii_lset_dx \1,1f
+// asx.b dy,dx
+ ii_lset_dx \1,20
+ ii_lset_dx \1,21
+ ii_lset_dx \1,22
+ ii_lset_dx \1,23
+ ii_lset_dx \1,24
+ ii_lset_dx \1,25
+ ii_lset_dx \1,26
+ ii_lset_dx \1,27
+// lsx.b dy,dx
+ ii_lset_dx \1,28
+ ii_lset_dx \1,29
+ ii_lset_dx \1,2a
+ ii_lset_dx \1,2b
+ ii_lset_dx \1,2c
+ ii_lset_dx \1,2d
+ ii_lset_dx \1,2e
+ ii_lset_dx \1,2f
+// roxx.dy,dx
+ ii_lset_dx \1,30
+ ii_lset_dx \1,31
+ ii_lset_dx \1,32
+ ii_lset_dx \1,33
+ ii_lset_dx \1,34
+ ii_lset_dx \1,35
+ ii_lset_dx \1,36
+ ii_lset_dx \1,37
+// rox.b dy,dx
+ ii_lset_dx \1,38
+ ii_lset_dx \1,39
+ ii_lset_dx \1,3a
+ ii_lset_dx \1,3b
+ ii_lset_dx \1,3c
+ ii_lset_dx \1,3d
+ ii_lset_dx \1,3e
+ ii_lset_dx \1,3f
+/******************************************************/
+// word
+/******************************************************/
+// asx.w #x,dx
+ ii_lset_dx \1,40 // 0x1.22 -> z.B. 1=d2=4 ->0xd07c -> 0xde7c
+ ii_lset_dx \1,41
+ ii_lset_dx \1,42
+ ii_lset_dx \1,43
+ ii_lset_dx \1,44
+ ii_lset_dx \1,45
+ ii_lset_dx \1,46
+ ii_lset_dx \1,47
+// lsx.w #,dx
+ ii_lset_dx \1,48
+ ii_lset_dx \1,49
+ ii_lset_dx \1,4a
+ ii_lset_dx \1,4b
+ ii_lset_dx \1,4c
+ ii_lset_dx \1,4d
+ ii_lset_dx \1,4e
+ ii_lset_dx \1,4f
+// roxx.w #,dx
+ ii_lset_dx \1,50
+ ii_lset_dx \1,51
+ ii_lset_dx \1,52
+ ii_lset_dx \1,53
+ ii_lset_dx \1,54
+ ii_lset_dx \1,55
+ ii_lset_dx \1,56
+ ii_lset_dx \1,57
+// rox.w #xdx
+ ii_lset_dx \1,58
+ ii_lset_dx \1,59
+ ii_lset_dx \1,5a
+ ii_lset_dx \1,5b
+ ii_lset_dx \1,5c
+ ii_lset_dx \1,5d
+ ii_lset_dx \1,5e
+ ii_lset_dx \1,5f
+// asx.w dy,dx
+ ii_lset_dx \1,60
+ ii_lset_dx \1,61
+ ii_lset_dx \1,62
+ ii_lset_dx \1,63
+ ii_lset_dx \1,64
+ ii_lset_dx \1,65
+ ii_lset_dx \1,66
+ ii_lset_dx \1,67
+// lsx.w dy,dx
+ ii_lset_dx \1,68
+ ii_lset_dx \1,69
+ ii_lset_dx \1,6a
+ ii_lset_dx \1,6b
+ ii_lset_dx \1,6c
+ ii_lset_dx \1,6d
+ ii_lset_dx \1,6e
+ ii_lset_dx \1,6f
+// roxx.w dy,dx
+ ii_lset_dx \1,70
+ ii_lset_dx \1,71
+ ii_lset_dx \1,72
+ ii_lset_dx \1,73
+ ii_lset_dx \1,74
+ ii_lset_dx \1,75
+ ii_lset_dx \1,76
+ ii_lset_dx \1,77
+// rox.w dy,dx
+ ii_lset_dx \1,78
+ ii_lset_dx \1,79
+ ii_lset_dx \1,7a
+ ii_lset_dx \1,7b
+ ii_lset_dx \1,7c
+ ii_lset_dx \1,7d
+ ii_lset_dx \1,7e
+ ii_lset_dx \1,7f
+/******************************************************/
+// long
+/******************************************************/
+// roxx.l #,dx
+ ii_lset_dx \1,90
+ ii_lset_dx \1,91
+ ii_lset_dx \1,92
+ ii_lset_dx \1,93
+ ii_lset_dx \1,94
+ ii_lset_dx \1,95
+ ii_lset_dx \1,96
+ ii_lset_dx \1,97
+// rox.l #xdx
+ ii_lset_dx \1,98
+ ii_lset_dx \1,99
+ ii_lset_dx \1,9a
+ ii_lset_dx \1,9b
+ ii_lset_dx \1,9c
+ ii_lset_dx \1,9d
+ ii_lset_dx \1,9e
+ ii_lset_dx \1,9f
+// roxx.l dy,dx
+ ii_lset_dx \1,b0
+ ii_lset_dx \1,b1
+ ii_lset_dx \1,b2
+ ii_lset_dx \1,b3
+ ii_lset_dx \1,b4
+ ii_lset_dx \1,b5
+ ii_lset_dx \1,b6
+ ii_lset_dx \1,b7
+// rox.l dy,dx
+ ii_lset_dx \1,b8
+ ii_lset_dx \1,b9
+ ii_lset_dx \1,ba
+ ii_lset_dx \1,bb
+ ii_lset_dx \1,bc
+ ii_lset_dx \1,bd
+ ii_lset_dx \1,be
+ ii_lset_dx \1,bf
+//--------------------------------------------------------------------
+// asr.w ea
+ ii_lset_opea \10,d // (ax), (ax)+
+ ii_lset_opea \10,e // -(ax),d16(ax)
+ ii_lset_opeag \10,f // d8(ax,dy)
+ lea table+0x\10\2f8*4,a0
+ move.l #ii_0x\10f8,(a0)+ // xxx.w
+ move.l #ii_0x\10f9,(a0)+ // xxx.l
+// asl.w ea
+ ii_lset_opea \11,d // (ax), (ax)+
+ ii_lset_opea \11,e // -(ax),d16(ax)
+ ii_lset_opeag \11,f // d8(ax,dy)
+ lea table+0x\11\2f8*4,a0
+ move.l #ii_0x\11f8,(a0)+ // xxx.w
+ move.l #ii_0x\11f9,(a0)+ // xxx.l
+// lsr.w ea
+ ii_lset_opea \12,d // (ax), (ax)+
+ ii_lset_opea \12,e // -(ax),d16(ax)
+ ii_lset_opeag \12,f // d8(ax,dy)
+ lea table+0x\12\2f8*4,a0
+ move.l #ii_0x\12f8,(a0)+ // xxx.w
+ move.l #ii_0x\12f9,(a0)+ // xxx.l
+// lsr.w ea
+ ii_lset_opea \13,d // (ax), (ax)+
+ ii_lset_opea \13,e // -(ax),d16(ax)
+ ii_lset_opeag \13,f // d8(ax,dy)
+ lea table+0x\13\2f8*4,a0
+ move.l #ii_0x\13f8,(a0)+ // xxx.w
+ move.l #ii_0x\13f9,(a0)+ // xxx.l
+// roxr.w ea
+ ii_lset_opea \14,d // (ax), (ax)+
+ ii_lset_opea \14,e // -(ax),d16(ax)
+ ii_lset_opeag \14,f // d8(ax,dy)
+ lea table+0x\14\2f8*4,a0
+ move.l #ii_0x\14f8,(a0)+ // xxx.w
+ move.l #ii_0x\14f9,(a0)+ // xxx.l
+// roxl.w ea
+ ii_lset_opea \15,e // (ax), (ax)+
+ ii_lset_opea \15,e // -(ax),d16(ax)
+ ii_lset_opeag \15,f // d8(ax,dy)
+ lea table+0x\15\2f8*4,a0
+ move.l #ii_0x\15f8,(a0)+ // xxx.w
+ move.l #ii_0x\15f9,(a0)+ // xxx.l
+// ror.w ea
+ ii_lset_opea \16,d // (ax), (ax)+
+ ii_lset_opea \16,e // -(ax),d16(ax)
+ ii_lset_opeag \16,f // d8(ax,dy)
+ lea table+0x\16\2f8*4,a0
+ move.l #ii_0x\16f8,(a0)+ // xxx.w
+ move.l #ii_0x\16f9,(a0)+ // xxx.l
+// rol.w ea
+ ii_lset_opea \17,d // (ax), (ax)+
+ ii_lset_opea \17,e // -(ax),d16(ax)
+ ii_lset_opeag \17,f // d8(ax,dy)
+ lea table+0x\17\2f8*4,a0
+ move.l #ii_0x\17f8,(a0)+ // xxx.w
+ move.l #ii_0x\17f9,(a0)+ // xxx.l
+// ende
+.endm;
+/******************************************************/
+ii_shift_op:.macro // 1=code
+//byt-------------------------------
+//asx.b #x,dx
+ ii_shift_op2agb 0,as,a
+//lsx.b #x,dx
+ ii_shift_op2aub 0,ls,a
+//roxx.b #x,dx
+ ii_shift_op2agb 1,rox,a
+//rox.b #x,dx
+ ii_shift_op2aub 1,ro,a
+//asx.b dy,dx
+ ii_shift_op2agb 2,as,b
+//lsx.b dy,dx
+ ii_shift_op2aub 2,ls,b
+//roxx.b dy,dx
+ ii_shift_op2agb 3,rox,b
+//rox.b dy,dx
+ ii_shift_op2aub 3,ro,b
+// word ---------------------------------------
+//asx.w #x,dx
+ ii_shift_op2agw 4,as,a
+//lsx.w #x,dx
+ ii_shift_op2auw 4,ls,a
+//roxx.w #x,dx
+ ii_shift_op2agw 5,rox,a
+//rox.w #x,dx
+ ii_shift_op2auw 5,ro,a
+//asx.w dy,dx
+ ii_shift_op2agw 6,as,b
+//lsx.w dy,dx
+ ii_shift_op2auw 6,ls,b
+//roxx.w dy,dx
+ ii_shift_op2agw 7,rox,b
+//rox.w dy,dx
+ ii_shift_op2auw 7,ro,b
+// long ---------------------------------------
+//roxx.l #x,dx
+ ii_shift_op2agw 9,rox,a
+//rox.l #x,dx
+ ii_shift_op2auw 9,ro,a
+//roxx.l dy,dx
+ ii_shift_op2agw b,rox,b
+//rox.l dy,dx
+ ii_shift_op2auw b,ro,b
+// ea ---------------------------------------
+//asr.w #1,ea
+ ii_shift_op2ea 0,asr
+//asl.w #1,ea
+ ii_shift_op2ea 1,asl
+//lsr.w #1,ea
+ ii_shift_op2ea 2,lsr,
+//lsl.w #1,ea
+ ii_shift_op2ea 3,lsl
+//roxr.w #1,ea
+ ii_shift_op2ea 4,roxr
+//roxl.w #1,ea
+ ii_shift_op2ea 5,roxl
+//ror.w #1,ea
+ ii_shift_op2ea 6,ror
+//rol.w #1,ea
+ ii_shift_op2ea 7,rol
+.endm
+//byt ============================================
+ii_shift_op2agb:.macro //byt: 1=code 2=operation 3=quick(a) oder register(b)
+ ii_shift_op1\3b \1,0,\2,d0_off+3(a7)
+ ii_shift_op1\3b \1,1,\2,d1_off+3(a7)
+ ii_shift_op1\3b \1,2,\2,d2
+ ii_shift_op1\3b \1,3,\2,d3
+ ii_shift_op1\3b \1,4,\2,d4
+ ii_shift_op1\3b \1,5,\2,d5
+ ii_shift_op1\3b \1,6,\2,d6
+ ii_shift_op1\3b \1,7,\2,d7
+.endm
+
+ii_shift_op2aub:.macro //byt: 1=code 2=operation
+ ii_shift_op1\3b \1,8,\2,d0_off+3(a7)
+ ii_shift_op1\3b \1,9,\2,d1_off+3(a7)
+ ii_shift_op1\3b \1,a,\2,d2
+ ii_shift_op1\3b \1,b,\2,d3
+ ii_shift_op1\3b \1,c,\2,d4
+ ii_shift_op1\3b \1,d,\2,d5
+ ii_shift_op1\3b \1,e,\2,d6
+ ii_shift_op1\3b \1,f,\2,d7
+.endm
+
+ii_shift_op1ab:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0 0\1\2,b,\3r,#8,\4
+ ii_shift_op0 2\1\2,b,\3r,#1,\4
+ ii_shift_op0 4\1\2,b,\3r,#2,\4
+ ii_shift_op0 6\1\2,b,\3r,#3,\4
+ ii_shift_op0 8\1\2,b,\3r,#4,\4
+ ii_shift_op0 a\1\2,b,\3r,#5,\4
+ ii_shift_op0 c\1\2,b,\3r,#6,\4
+ ii_shift_op0 e\1\2,b,\3r,#7,\4
+ ii_shift_op0 1\1\2,b,\3l,#8,\4
+ ii_shift_op0 3\1\2,b,\3l,#1,\4
+ ii_shift_op0 5\1\2,b,\3l,#2,\4
+ ii_shift_op0 7\1\2,b,\3l,#3,\4
+ ii_shift_op0 9\1\2,b,\3l,#4,\4
+ ii_shift_op0 b\1\2,b,\3l,#5,\4
+ ii_shift_op0 d\1\2,b,\3l,#6,\4
+ ii_shift_op0 f\1\2,b,\3l,#7,\4
+.endm
+
+ii_shift_op1bb:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0b 0\1\2,b,\3r,d0_off(a7),\4
+ ii_shift_op0b 2\1\2,b,\3r,d1_off(a7),\4
+ ii_shift_op0 4\1\2,b,\3r,d2,\4
+ ii_shift_op0 6\1\2,b,\3r,d3,\4
+ ii_shift_op0 8\1\2,b,\3r,d4,\4
+ ii_shift_op0 a\1\2,b,\3r,d5,\4
+ ii_shift_op0 c\1\2,b,\3r,d6,\4
+ ii_shift_op0 e\1\2,b,\3r,d7,\4
+ ii_shift_op0b 1\1\2,b,\3l,d0_off(a7),\4
+ ii_shift_op0b 3\1\2,b,\3l,d1_off(a7),\4
+ ii_shift_op0 5\1\2,b,\3l,d2,\4
+ ii_shift_op0 7\1\2,b,\3l,d3,\4
+ ii_shift_op0 9\1\2,b,\3l,d4,\4
+ ii_shift_op0 b\1\2,b,\3l,d5,\4
+ ii_shift_op0 d\1\2,b,\3l,d6,\4
+ ii_shift_op0 f\1\2,b,\3l,d7,\4
+.endm
+// word ---------------------------------------
+ii_shift_op2agw:.macro //byt: 1=code 2=operation 3=quick(a) oder register(b)
+ ii_shift_op1\3w \1,0,\2,d0_off+2(a7)
+ ii_shift_op1\3w \1,1,\2,d1_off+2(a7)
+ ii_shift_op1\3w \1,2,\2,d2
+ ii_shift_op1\3w \1,3,\2,d3
+ ii_shift_op1\3w \1,4,\2,d4
+ ii_shift_op1\3w \1,5,\2,d5
+ ii_shift_op1\3w \1,6,\2,d6
+ ii_shift_op1\3w \1,7,\2,d7
+.endm
+
+ii_shift_op2auw:.macro //byt: 1=code 2=operation
+ ii_shift_op1\3w \1,8,\2,d0_off+2(a7)
+ ii_shift_op1\3w \1,9,\2,d1_off+2(a7)
+ ii_shift_op1\3w \1,a,\2,d2
+ ii_shift_op1\3w \1,b,\2,d3
+ ii_shift_op1\3w \1,c,\2,d4
+ ii_shift_op1\3w \1,d,\2,d5
+ ii_shift_op1\3w \1,e,\2,d6
+ ii_shift_op1\3w \1,f,\2,d7
+.endm
+
+ii_shift_op1aw:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0 0\1\2,w,\3r,#8,\4
+ ii_shift_op0 2\1\2,w,\3r,#1,\4
+ ii_shift_op0 4\1\2,w,\3r,#2,\4
+ ii_shift_op0 6\1\2,w,\3r,#3,\4
+ ii_shift_op0 8\1\2,w,\3r,#4,\4
+ ii_shift_op0 a\1\2,w,\3r,#5,\4
+ ii_shift_op0 c\1\2,w,\3r,#6,\4
+ ii_shift_op0 e\1\2,w,\3r,#7,\4
+ ii_shift_op0 1\1\2,w,\3l,#8,\4
+ ii_shift_op0 3\1\2,w,\3l,#1,\4
+ ii_shift_op0 5\1\2,w,\3l,#2,\4
+ ii_shift_op0 7\1\2,w,\3l,#3,\4
+ ii_shift_op0 9\1\2,w,\3l,#4,\4
+ ii_shift_op0 b\1\2,w,\3l,#5,\4
+ ii_shift_op0 d\1\2,w,\3l,#6,\4
+ ii_shift_op0 f\1\2,w,\3l,#7,\4
+.endm
+
+ii_shift_op1bw:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0b 0\1\2,w,\3r,d0_off(a7),\4
+ ii_shift_op0b 2\1\2,w,\3r,d1_off(a7),\4
+ ii_shift_op0 4\1\2,w,\3r,d2,\4
+ ii_shift_op0 6\1\2,w,\3r,d3,\4
+ ii_shift_op0 8\1\2,w,\3r,d4,\4
+ ii_shift_op0 a\1\2,w,\3r,d5,\4
+ ii_shift_op0 c\1\2,w,\3r,d6,\4
+ ii_shift_op0 e\1\2,w,\3r,d7,\4
+ ii_shift_op0b 1\1\2,w,\3l,d0_off(a7),\4
+ ii_shift_op0b 3\1\2,w,\3l,d1_off(a7),\4
+ ii_shift_op0 5\1\2,w,\3l,d2,\4
+ ii_shift_op0 7\1\2,w,\3l,d3,\4
+ ii_shift_op0 9\1\2,w,\3l,d4,\4
+ ii_shift_op0 b\1\2,w,\3l,d5,\4
+ ii_shift_op0 d\1\2,w,\3l,d6,\4
+ ii_shift_op0 f\1\2,w,\3l,d7,\4
+.endm
+// long ---------------------------------------
+ii_shift_op2agl:.macro //byt: 1=code 2=operation 3=quick(a) oder register(b)
+ ii_shift_op1\3l \1,0,\2,d0_off(a7)
+ ii_shift_op1\3l \1,1,\2,d1_off(a7)
+ ii_shift_op1\3l \1,2,\2,d2
+ ii_shift_op1\3l \1,3,\2,d3
+ ii_shift_op1\3l \1,4,\2,d4
+ ii_shift_op1\3l \1,5,\2,d5
+ ii_shift_op1\3l \1,6,\2,d6
+ ii_shift_op1\3l \1,7,\2,d7
+.endm
+
+ii_shift_op2aul:.macro //byt: 1=code 2=operation
+ ii_shift_op1\3l \1,8,\2,d0_off(a7)
+ ii_shift_op1\3l \1,9,\2,d1_off(a7)
+ ii_shift_op1\3l \1,a,\2,d2
+ ii_shift_op1\3l \1,b,\2,d3
+ ii_shift_op1\3l \1,c,\2,d4
+ ii_shift_op1\3l \1,d,\2,d5
+ ii_shift_op1\3l \1,e,\2,d6
+ ii_shift_op1\3l \1,f,\2,d7
+.endm
+
+ii_shift_op1al:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0 0\1\2,l,\3r,#8,\4
+ ii_shift_op0 2\1\2,l,\3r,#1,\4
+ ii_shift_op0 4\1\2,l,\3r,#2,\4
+ ii_shift_op0 6\1\2,l,\3r,#3,\4
+ ii_shift_op0 8\1\2,l,\3r,#4,\4
+ ii_shift_op0 a\1\2,l,\3r,#5,\4
+ ii_shift_op0 c\1\2,l,\3r,#6,\4
+ ii_shift_op0 e\1\2,l,\3r,#7,\4
+ ii_shift_op0 1\1\2,l,\3l,#8,\4
+ ii_shift_op0 3\1\2,l,\3l,#1,\4
+ ii_shift_op0 5\1\2,l,\3l,#2,\4
+ ii_shift_op0 7\1\2,l,\3l,#3,\4
+ ii_shift_op0 9\1\2,l,\3l,#4,\4
+ ii_shift_op0 b\1\2,l,\3l,#5,\4
+ ii_shift_op0 d\1\2,l,\3l,#6,\4
+ ii_shift_op0 f\1\2,l,\3l,#7,\4
+.endm
+
+ii_shift_op1bl:.macro // z.B. asr.w. #x,dx 1=code 3.ziffer 2=code 4.ziffer 3=shift art 4=dx
+ ii_shift_op0b 0\1\2,l,\3r,d0_off(a7),\4
+ ii_shift_op0b 2\1\2,l,\3r,d1_off(a7),\4
+ ii_shift_op0 4\1\2,l,\3r,d2,\4
+ ii_shift_op0 6\1\2,l,\3r,d3,\4
+ ii_shift_op0 8\1\2,l,\3r,d4,\4
+ ii_shift_op0 a\1\2,l,\3r,d5,\4
+ ii_shift_op0 c\1\2,l,\3r,d6,\4
+ ii_shift_op0 e\1\2,l,\3r,d7,\4
+ ii_shift_op0b 1\1\2,l,\3l,d0_off(a7),\4
+ ii_shift_op0b 3\1\2,l,\3l,d1_off(a7),\4
+ ii_shift_op0 5\1\2,l,\3l,d2,\4
+ ii_shift_op0 7\1\2,l,\3l,d3,\4
+ ii_shift_op0 9\1\2,l,\3l,d4,\4
+ ii_shift_op0 b\1\2,l,\3l,d5,\4
+ ii_shift_op0 d\1\2,l,\3l,d6,\4
+ ii_shift_op0 f\1\2,l,\3l,d7,\4
+.endm
+// .word ea ============================================
+ii_shift_op2ea:.macro //1=code 2.ziffer 2=shiftart
+// (a0) bis (a7) ----------------------------
+ii_0xe\1d0:
+ move.l a0_off(a7),a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1d1:
+ move.l a1_off(a7),a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1d2:
+ ii_shift_typ w,\2,#1,(a2),(a2).
+ii_0xe\1d3:
+ ii_shift_typ w,\2,#1,(a3),(a3).
+ii_0xe\1d4:
+ ii_shift_typ w,\2,#1,(a4),(a4).
+ii_0xe\1d5:
+ ii_shift_typ w,\2,#1,(a5),(a5).
+ii_0xe\1d6:
+ ii_shift_typ w,\2,#1,(a6),(a6).
+ii_0xe\1d7:
+ move.l usp,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+// (a0)+ bis (a7)+ -----------------------------
+ii_0xe\1d8:
+ move.l a0_off(a7),a1
+ addq.l #2,a0_off(a7)
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1d9:
+ move.l a1_off(a7),a1
+ addq.l #2,a0_off(a7)
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1da:
+ ii_shift_typ w,\2,#1,(a2),(a2)+.
+ii_0xe\1db:
+ ii_shift_typ w,\2,#1,(a3),(a3)+
+ii_0xe\1dc:
+ ii_shift_typ w,\2,#1,(a4),(a4)+
+ii_0xe\1dd:
+ ii_shift_typ w,\2,#1,(a5),(a5)+
+ii_0xe\1de:
+ ii_shift_typ w,\2,#1,(a6),(a6)+
+ii_0xe\1df:
+ move.l usp,a1
+ addq.l #2,a1
+ move.l a1,usp
+ subq.l #2,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+// -(a0) bis -(a7) -----------------------------
+ii_0xe\1e0:
+ move.l a0_off(a7),a1
+ subq.l #2,a1
+ move.l a1,a0_off(a7)
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1e1:
+ move.l a1_off(a7),a1
+ subq.l #2,a1
+ move.l a1,a1_off(a7)
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1e2:
+ ii_shift_typ w,\2,#1,-(a2),(a2).
+ii_0xe\1e3:
+ ii_shift_typ w,\2,#1,-(a3),(a3)
+ii_0xe\1e4:
+ ii_shift_typ w,\2,#1,-(a4),(a4)
+ii_0xe\1e5:
+ ii_shift_typ w,\2,#1,-(a5),(a5)
+ii_0xe\1e6:
+ ii_shift_typ w,\2,#1,-(a6),(a6)
+ii_0xe\1e7:
+ move.l usp,a1
+ subq.l #2,a1
+ move.l a1,usp
+ ii_shift_typ w,\2,#1,(a1),(a1).
+// d16(a0) bis d16(a7) -----------------------------
+ii_0xe\1e8:
+ move.w (a0)+,a1
+ add.l a0_off(a7),a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1e9:
+ move.w (a0)+,a1
+ add.l a1_off(a7),a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1ea:
+ move.w (a0)+,a1
+ add.l a2,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1eb:
+ move.w (a0)+,a1
+ add.l a3,a1
+ ii_shift_typ w,\2,#1,(a1),(a1)
+ii_0xe\1ec:
+ move.w (a0)+,a1
+ add.l a4,a1
+ ii_shift_typ w,\2,#1,(a1),(a1)
+ii_0xe\1ed:
+ move.w (a0)+,a1
+ add.l a5,a1
+ ii_shift_typ w,\2,#1,(a1),(a1)
+ii_0xe\1ee:
+ move.w (a0)+,a1
+ add.l a6,a1
+ ii_shift_typ w,\2,#1,(a1),(a1)
+ii_0xe\1ef:
+ mvs.w (a0)+,d0
+ move.l usp,a1
+ add.l d0,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+// d8(a0,dy) bis d8(a7,dy) -----------------------------
+ii_0xe\1f0:
+ move.l a0_off(a0),a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f1:
+ move.l a1_off(a0),a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f2:
+ move.l a2,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f3:
+ move.l a3,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f4:
+ move.l a4,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f5:
+ move.l a5,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f6:
+ move.l a6,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f7:
+ move.l usp,a1
+ jsr ewf
+ ii_shift_typ w,\2,#1,(a1),(a1).
+// xxx.w xxx.l
+ii_0xe\1f8:
+ move.w (a0)+,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+ii_0xe\1f9:
+ move.l (a0)+,a1
+ ii_shift_typ w,\2,#1,(a1),(a1).
+.endm
+//============================================================================
+//subroutine
+//------------------------------
+ii_shift_op0:.macro // shift: 1=code 2=size 3=shift art 4=shift wert 5=ea
+ii_0xe\1:
+ ii_shift_typ \2,\3,\4,\5,\5
+.endm
+
+ii_shift_op0b:.macro // shift wert nach d0 holen: 1=code 2=size 3=shift art 4=shift wert 5=ea
+ii_0xe\1:
+ move.l \4,d0
+ ii_shift_typ \2,\3,d0,\5,\5
+.endm
+
+ii_shift_typ:.macro //1=size 2=shift art 3=shift wert 4=source 5=dest
+#ifdef halten
+ halt
+#endif
+.ifc asr,\2
+ mvs.\1 \4,d1
+.else
+ mvz.\1 \4,d1
+.endif
+.ifc roxr,\2
+ nop
+.else
+ .ifc roxl,\2
+ nop
+ .else
+ .ifc ror,\2
+ nop
+ .else
+ .ifc rol,\2
+ nop
+ .else
+ \2.l \3,d1
+ .endif
+ .endif
+ .endif
+.endif
+ set_cc0
+ move.\1 d1,\5
+ ii_end
+.endm
diff --git a/SD_CARD/BaS_gcc/include/ii_sub.h b/SD_CARD/BaS_gcc/include/ii_sub.h
new file mode 100644
index 0000000..1405e1a
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/ii_sub.h
@@ -0,0 +1,584 @@
+//--------------------------------------------------------------------
+// sub
+//--------------------------------------------------------------------
+/*****************************************************************************************/
+//--------------------------------------------------------------------
+// byt
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// sub.b #im,dx
+//--------------------------------------------------------------------
+subbir_macro:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.w (a0)+,d0
+ extb.l d0
+ mvs.b \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.b d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub ea,dx
+//--------------------------------------------------------------------
+subdd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub ea(l)->dy(w),dx z.B. für USP
+//--------------------------------------------------------------------
+subddd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 a1,d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub (ea)->dy,dx
+//--------------------------------------------------------------------
+subdda:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub ea->ay,(ay)+,dx
+//--------------------------------------------------------------------
+subddai:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 (a1)+,d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub ea->ay,-(ay),dx
+//--------------------------------------------------------------------
+subddad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.\3 -(a1),d0
+ move.l a1,\1
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub d16(ay),dx
+//--------------------------------------------------------------------
+subd16ad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub d8(ay,dy),dx
+//--------------------------------------------------------------------
+subd8ad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub xxx.w,dx
+//--------------------------------------------------------------------
+subxwd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.w (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub xxx.l,dx
+//--------------------------------------------------------------------
+subxld:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l (a0)+,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub d16(pc),dx
+//--------------------------------------------------------------------
+subd16pcd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,a1
+ mvs.w (a0)+,d0
+ add.l d0,a1
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub d8(pc,dy),dx
+//--------------------------------------------------------------------
+subd8pcd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d0
+ move.l \2,d1
+.else
+ mvs.\3 (a1),d0
+ mvs.\3 \2,d1
+.endif
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// sub dy,ea
+//--------------------------------------------------------------------
+//--------------------------------------------------------------------
+// // sub (ea)->dy,dx
+//--------------------------------------------------------------------
+subeda:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+subedai:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 (a1),d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)+
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,ea->ay,(ay)+
+//--------------------------------------------------------------------
+subedaid:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 \2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2+
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+subedad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.\3 -(a1),d1
+ move.l a1,\2
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,ea->ay,-(ay)
+//--------------------------------------------------------------------
+subedadd:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ mvs.\3 -\2,d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,d16(ay)
+//--------------------------------------------------------------------
+sube16ad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l \2,a1
+ mvs.w (a0)+,d1
+ add.l d1,a1
+ mvs.\3 (a1),d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,d8(ay,dy)
+//--------------------------------------------------------------------
+sube8ad:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \2,a1
+ jsr ewf
+.ifc \3,l
+ move.l (a1),d1
+ move.l \1,d0
+.else
+ mvs.\3 (a1),d1
+ mvs.\3 \1,d0
+.endif
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,xxx.w
+//--------------------------------------------------------------------
+subxwe:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.w (a0)+,a1
+ mvs.\3 (a1),d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // sub dx,xxx.l
+//--------------------------------------------------------------------
+subxle:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.\3 \1,d0
+ move.l (a0)+,a1
+ mvs.\3 (a1),d1
+ sub.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+/******************************************************/
+// adress register
+/******************************************************/
+//--------------------------------------------------------------------
+// // suba.w ea,ax
+//--------------------------------------------------------------------
+subaw:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,pc_off(a7) // pc auf next
+ movem.l (a7),d0/d1/a0/a1 // register zurpück
+ mvs.w \1,d0
+ suba.l d0,\2
+ move.l d0_off(a7),d0
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+ .endm;
+//--------------------------------------------------------------------
+// sub.w ea,usp
+//--------------------------------------------------------------------
+subawa7:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.w \1,d0
+ move.l usp,a1
+ sub.l d0,a1
+ move.l a1,usp
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w usp?,ax
+//--------------------------------------------------------------------
+subawu:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,pc_off(a7) // pc auf next
+ movem.l (a7),d0/d1/a0/a1 // register zurpück
+ move.l a7,_a7_save
+ move.l usp,a7
+ move.l \1,d0
+ suba.l d0,\2
+ move.l a7,usp
+ move.l _a7_save,a7
+ move.l d0_off(a7),d0
+ lea ii_ss(a7),a7 // stack erhöhen
+ rte
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w usp?,usp
+//--------------------------------------------------------------------
+subawua7:.macro
+ subawu \1,\2
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w d16(ay),ax
+//--------------------------------------------------------------------
+subawd16a:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ mvs.w (a0)+,d0
+ adda.l d0,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w d8(ay,dy),ax
+//--------------------------------------------------------------------
+subawd8a:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+ mvs.w (a1),d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w xxx.w,ax
+//--------------------------------------------------------------------
+subawxwax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.w (a0)+,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ suba.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w xxx.l,ax
+//--------------------------------------------------------------------
+subawxlax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l (a0)+,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ suba.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w d16(pc),ax
+//--------------------------------------------------------------------
+subawd16pcax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.w (a0)+,a1
+ adda.l a0,a1
+ mvs.w (a1),d0
+ move.l \2,a1
+ suba.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w d8(pc,dy),ax
+//--------------------------------------------------------------------
+subawd8pcax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+ mvs.w (a1),d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.w #im,ax
+//--------------------------------------------------------------------
+subawim:.macro
+#ifdef halten_sub
+ halt
+#endif
+ mvs.w \1,d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.l d8(ay,dy),ax
+//--------------------------------------------------------------------
+subald8a:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l \1,a1
+ jsr ewf
+ move.l (a1),d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // suba.l d8(pc,dy),ax
+//--------------------------------------------------------------------
+subakd8pcax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.l a0,a1
+ jsr ewf
+ move.l (a1),d0
+ move.l \2,a1
+ sub.l d0,a1
+ move.l a1,\2
+ ii_end
+ .endm;
+//*****************************************************************************************
+// subx
+//*****************************************************************************************
+//--------------------------------------------------------------------
+// // subx dy,dx
+//--------------------------------------------------------------------
+subdx:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.b sr_off+1(a7),d0 //ccr holen
+ move d0,ccr //setzen
+ mvs.\3 \2,d0
+ mvs.\3 \1,d1
+ subx.l d0,d1
+ set_cc0
+ move.\3 d1,\1
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
+// // subx -(ay),-(ax)
+//--------------------------------------------------------------------
+subdax:.macro
+#ifdef halten_sub
+ halt
+#endif
+ move.b sr_off+1(a7),d0 //ccr holen
+ move d0,ccr //setzen
+ move.l \1,a1
+.ifc \3,l
+ move.l -(a1),d0
+.else
+ mvs.\3 -(a1),d0
+.endif
+ move.l \2,a1
+.ifc \3,l
+ move.l -(a1),d0
+.else
+ mvs.\3 -(a1),d1
+.endif
+ subx.l d0,d1
+ set_cc0
+ move.\3 d1,(a1)
+ ii_end
+ .endm;
+//--------------------------------------------------------------------
diff --git a/SD_CARD/BaS_gcc/include/integer.h b/SD_CARD/BaS_gcc/include/integer.h
new file mode 100644
index 0000000..137b988
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/integer.h
@@ -0,0 +1,37 @@
+/*-------------------------------------------*/
+/* Integer type definitions for FatFs module */
+/*-------------------------------------------*/
+
+#ifndef _INTEGER
+#define _INTEGER
+
+#ifdef _WIN32 /* FatFs development platform */
+
+#include
+#include
+
+#else /* Embedded platform */
+
+/* These types must be 16-bit, 32-bit or larger integer */
+typedef int INT;
+typedef unsigned int UINT;
+
+/* These types must be 8-bit integer */
+typedef char CHAR;
+typedef unsigned char UCHAR;
+typedef unsigned char BYTE;
+
+/* These types must be 16-bit integer */
+typedef short SHORT;
+typedef unsigned short USHORT;
+typedef unsigned short WORD;
+typedef unsigned short WCHAR;
+
+/* These types must be 32-bit integer */
+typedef long LONG;
+typedef unsigned long ULONG;
+typedef unsigned long DWORD;
+
+#endif
+
+#endif
diff --git a/SD_CARD/BaS_gcc/include/macro.h b/SD_CARD/BaS_gcc/include/macro.h
new file mode 100644
index 0000000..2afa44e
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/macro.h
@@ -0,0 +1,10 @@
+/*******************************************************/
+// allgemeine macros
+/*******************************************************/
+.text
+wait_pll: .macro
+wait1_pll\@:
+ tst.w (a1)
+ bmi wait1_pll\@
+ rts
+.endm
diff --git a/SD_CARD/BaS_gcc/include/startcf.h b/SD_CARD/BaS_gcc/include/startcf.h
new file mode 100644
index 0000000..67a9d9d
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/startcf.h
@@ -0,0 +1,25 @@
+
+#define cf_stack
+
+//#define ii_on
+#define halten
+#define halten_dbcc
+#define halten_and
+#define halten_add
+#define halten_sub
+#define halten_or
+#define halten_op
+#define halten_opc
+#define halten_movem
+#define halten_lea
+#define halten_shift
+#define halten_move
+#define halten_exg
+#define halten_movep
+#define halten_ewf
+
+#define DIP_SWITCH (*(volatile uint8_t *)(&_MBAR[0xA2C]))
+#define DIP_SWITCHa __MBAR + 0xA2C
+
+#define sca_page_ID 6
+
diff --git a/SD_CARD/BaS_gcc/include/sysinit.h b/SD_CARD/BaS_gcc/include/sysinit.h
new file mode 100644
index 0000000..9439c0f
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/sysinit.h
@@ -0,0 +1,43 @@
+/*
+ * File: sysinit.h
+ * Purpose: Firebee Power-on Reset configuration
+ *
+ * Notes:
+ *
+ * This file is part of BaS_gcc.
+ *
+ * BaS_gcc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * BaS_gcc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with BaS_gcc. If not, see .
+ *
+ * Copyright 2010 - 2012 F. Aschwanden
+ * Copyright 2011 - 2012 V. Riviere
+ * Copyright 2012 M. Froeschle
+ *
+ */
+
+#ifndef __SYSINIT_H__
+#define __SYSINIT_H__
+#include
+
+extern inline bool waitfor(uint32_t us, int (*condition)(void));
+
+/* adresses where FPGA data lives in flash */
+#define FPGA_FLASH_DATA ((uint8_t *) 0xe0700000L)
+#define FPGA_FLASH_DATA_END ((uint8_t *) 0xe0800000L)
+
+/* function(s) from init_fpga.c */
+extern void init_fpga(void);
+
+#endif /* __SYSINIT_H__ */
+
+
diff --git a/SD_CARD/BaS_gcc/include/wait.h b/SD_CARD/BaS_gcc/include/wait.h
new file mode 100644
index 0000000..44141f6
--- /dev/null
+++ b/SD_CARD/BaS_gcc/include/wait.h
@@ -0,0 +1,36 @@
+/*
+ * wait.h
+ *
+ * Author: mfro
+ *
+ * This file is part of BaS_gcc.
+ *
+ * BaS_gcc is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * BaS_gcc is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with BaS_gcc. If not, see .
+ *
+ * Copyright 2010 - 2012 F. Aschwanden
+ * Copyright 2011 - 2012 V. Riviere
+ * Copyright 2012 M. Froeschle
+ *
+ */
+
+#ifndef _WAIT_H_
+#define _WAIT_H_
+
+#include
+
+extern inline void wait(uint32_t us);
+extern inline bool waitfor(uint32_t us, int (*condition)(void));
+
+
+#endif /* _WAIT_H_ */