- fixed newline problems

This commit is contained in:
gdr-ftp 1998-02-03 08:08:40 +00:00
parent 1259e1599f
commit bd5fc8b991
5 changed files with 889 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1,38 @@
/* * Serial Interrupt Manager * C Interface File * Copyright 1993, Procyon Enterprises Incorporated * Free distribution is hereby granted for use with the * SIM tool */ #ifdef __ORCAC__ /* * ORCA/C Prototypes */ extern int SIMVERSION(int *versionPtr); extern int INSTALLINTVECT(int port, unsigned long address); extern int REMOVEINTVECT(int port, unsigned long address); #else /* * APW C/other prototypes */ int SIMVERSION(); int INSTALLINTVECT(); int REMOVEINTVECT(); #endif #define SIMVersion SIMVERSION #define InstallIntVect INSTALLINTVECT #define RemoveIntVect REMOVEINTVECT #define SIMPrinterPort 1 #define SIMModemPort 2 #define SIMNoError 0 #define SIMAlreadyInst 1 #define SIMInvalidAddr 2 #define SIMATalkActive 3 #define SIMNotInstalled 4 #define SIMInvalidPort 5 #define SIMNotFound 6
/*
* Serial Interrupt Manager
* C Interface File
* Copyright 1993, Procyon Enterprises Incorporated
* Free distribution is hereby granted for use with the
* SIM tool
*/
#ifdef __ORCAC__
/*
* ORCA/C Prototypes
*/
extern int SIMVERSION(int *versionPtr);
extern int INSTALLINTVECT(int port, unsigned long address);
extern int REMOVEINTVECT(int port, unsigned long address);
#else
/*
* APW C/other prototypes
*/
int SIMVERSION();
int INSTALLINTVECT();
int REMOVEINTVECT();
#endif
#define SIMVersion SIMVERSION
#define InstallIntVect INSTALLINTVECT
#define RemoveIntVect REMOVEINTVECT
#define SIMPrinterPort 1
#define SIMModemPort 2
#define SIMNoError 0
#define SIMAlreadyInst 1
#define SIMInvalidAddr 2
#define SIMATalkActive 3
#define SIMNotInstalled 4
#define SIMInvalidPort 5
#define SIMNotFound 6

View File

@ -1 +1,16 @@
SIMInstallHand gequ $8000 SIMRemoveHand gequ $8001 SIMGetVersion gequ $8002 * SIM Error codes SIMNoError gequ 0 SIMAlreadyInst gequ 1 SIMInvalidAddr gequ 2 SIMATalkActive gequ 3 SIMNotInstalled gequ 4 SIMInvalidPort gequ 5 SIMNotFound gequ 6 * SIM Port codes SIMModemPort gequ 2 SIMPrinterPort gequ 1
SIMInstallHand gequ $8000
SIMRemoveHand gequ $8001
SIMGetVersion gequ $8002
* SIM Error codes
SIMNoError gequ 0
SIMAlreadyInst gequ 1
SIMInvalidAddr gequ 2
SIMATalkActive gequ 3
SIMNotInstalled gequ 4
SIMInvalidPort gequ 5
SIMNotFound gequ 6
* SIM Port codes
SIMModemPort gequ 2
SIMPrinterPort gequ 1

View File

@ -1 +1,94 @@
mcopy simlib.mac copy simequates.equ * High-level access library for SIM tool InstallIntVect START using SIMLibData result equ 0 subroutine (4:address,2:port),2 lda port sta SIMport lda address sta SIMaddress lda address+2 sta SIMaddress+2 lda #SIMInstallHand jsr DoSIMCall lda |Gerror sta result return 2:result END RemoveIntVect START using SIMLibData result equ 0 subroutine (4:address,2:port),2 lda port sta SIMport lda address sta SIMaddress lda address+2 sta SIMaddress+2 lda #SIMRemoveHand jsr DoSIMCall lda |Gerror sta result return 2:result END SIMVersion START using SIMLibData result equ 0 subroutine (4:versionPtr),2 lda #SIMGetVersion jsr DoSIMCall lda |Gerror sta result bne goodbye if an error, don't copy version lda Gversion sta [versionPtr] goodbye return 2:result END DoSIMCall START using SIMLibData pha push request code pea 1 how to flag ph4 #SIMName ph4 #SIMInData ph4 #pBlock _SendRequest bcc noToolErr cmp #$0120 ; nobody accepted the request beq noAccept rts noAccept lda #SIMNotFound sta |Gerror noToolErr rts END SIMLibData DATA SIMName str 'SerialIntrMgr~Entry~' pBlock dc i2'0' ; count field Gerror dc i2'0' ; error code Gversion dc i2'0' ; version number SIMInData ENTRY SIMport dc i2'0' SIMaddress dc i4'0' END
mcopy simlib.mac
copy simequates.equ
* High-level access library for SIM tool
InstallIntVect START
using SIMLibData
result equ 0
subroutine (4:address,2:port),2
lda port
sta SIMport
lda address
sta SIMaddress
lda address+2
sta SIMaddress+2
lda #SIMInstallHand
jsr DoSIMCall
lda |Gerror
sta result
return 2:result
END
RemoveIntVect START
using SIMLibData
result equ 0
subroutine (4:address,2:port),2
lda port
sta SIMport
lda address
sta SIMaddress
lda address+2
sta SIMaddress+2
lda #SIMRemoveHand
jsr DoSIMCall
lda |Gerror
sta result
return 2:result
END
SIMVersion START
using SIMLibData
result equ 0
subroutine (4:versionPtr),2
lda #SIMGetVersion
jsr DoSIMCall
lda |Gerror
sta result
bne goodbye if an error, don't copy version
lda Gversion
sta [versionPtr]
goodbye return 2:result
END
DoSIMCall START
using SIMLibData
pha push request code
pea 1 how to flag
ph4 #SIMName
ph4 #SIMInData
ph4 #pBlock
_SendRequest
bcc noToolErr
cmp #$0120 ; nobody accepted the request
beq noAccept
rts
noAccept lda #SIMNotFound
sta |Gerror
noToolErr rts
END
SIMLibData DATA
SIMName str 'SerialIntrMgr~Entry~'
pBlock dc i2'0' ; count field
Gerror dc i2'0' ; error code
Gversion dc i2'0' ; version number
SIMInData ENTRY
SIMport dc i2'0'
SIMaddress dc i4'0'
END

View File

@ -1 +1,31 @@
#include <stdio.h> #include "sim.h" #pragma optimize 9 asm void TestHandler() { sec rtl } int main(int argc, char *argv[]) { int v,e; e = SIMVersion(&v); if (e) { printf("SIM Error Code: %d\n",e); exit(1); } printf("SIM Version Code: %04X\n",v); e = InstallIntVect(2,(unsigned long) TestHandler); if (e) { printf("(Install) SIM Error Code: %d\n",e); exit(1); } e = RemoveIntVect(2,(unsigned long) TestHandler); if (e) { printf("(Remove) SIM Error Code: %d\n",e); exit(1); } }
#include <stdio.h>
#include "sim.h"
#pragma optimize 9
asm void TestHandler() {
sec
rtl
}
int main(int argc, char *argv[])
{
int v,e;
e = SIMVersion(&v);
if (e) {
printf("SIM Error Code: %d\n",e);
exit(1);
}
printf("SIM Version Code: %04X\n",v);
e = InstallIntVect(2,(unsigned long) TestHandler);
if (e) {
printf("(Install) SIM Error Code: %d\n",e);
exit(1);
}
e = RemoveIntVect(2,(unsigned long) TestHandler);
if (e) {
printf("(Remove) SIM Error Code: %d\n",e);
exit(1);
}
}