[Coco] 6309 microprocessor project - 10-19-2003

John Collyer johncollyer at zoominternet.net
Sun Oct 19 11:04:00 EDT 2003


6309 microprocessor project.

Hello,

I messed up the example here is a fixed example:


BeginEx   leax MyFile,pcr   * the x register has to point to the parameters
          jsr Mywin32_4     * call create file
          stq MyHandle      * save file handle, 32-bits
                            *
                            * do something to the file
                            *
          leax MyHandle,pcr * the x register has to point to the parameters
          jsr Mywin32_1     * call close the file
          testf             * If there are no errors, note since win32
returns BOOL (0/1)
          bne noerror       *
          os9 F$Exit        * Else exit with the error
noerror   os9 F$Exit        * exit with no errors
          end BeginEx       * done with example

***********************************************
* HANDLE CreateFile(
*
*  LPCTSTR lpFileName, // pointer to name of the file
*  DWORD dwDesiredAccess, // access (read-write) mode
*  DWORD dwShareMode, // share mode
*  LPSECURITY_ATTRIBUTES lpSecurityAttributes, // pointer to security
attributes
*  DWORD dwCreationDistribution, // how to create
*  DWORD dwFlagsAndAttributes, // file attributes
*  HANDLE hTemplateFile // handle to file with attributes to copy
* );
*
                            *
Mywin32_4 fcb $11,$FD,$04   *
          rts               *

MyFile    fcc "Filename"    *
          fcb 0             * <- c strings
dwDAccess fcb 0,0,0,0       *
dwSMode   fcb 0,0,0,0       *
lpSAttr   fdb Attrib        * pointer to security attributes, 16-bit address
dwCreat   fcb 0,0,0,0       *
dwFlagA   fcb 0,0,0,0       *
hTmpFile  fcb 0,0,0,0       *
                            *
Attrib    fcb 0,0,0,0       * 32-bit security attributes

***********************************************
* BOOL CloseHandle(
*
*   HANDLE hObject // handle to object to close
* );
*
                            *
Mywin32_1 fcb $11,$FD,$01   *
          rts               * return
                            *
MyHandle  fcb 0,0,0,0       * win32 handles are 32 bits
                            *
*****************************

More later.

John Collyer




More information about the Coco mailing list