gno/sys/sim/simlib.asm
gdr-ftp 135cfc6169 sim.asm:
- did a 'setcom 60' to catch the weird formatting
	- created a dummy routine to go in the .root file.
	- this file didn't originally compile due to unresolved
	  references to ExtVect2.  Looking at the source it appears that
	  someone had started to modify it to allow a second interrupt
	  vector, but handn't finished the job.  I commented out the
	  initialization and checking of ExtVect2.
simlib.asm:
	- did a 'setcom 60' to catch the weird formatting
	- created a dummy routine to go in the .root file.
Makefile:
	- complete overhaul to fit into the GNO base builds
1999-02-08 05:53:38 +00:00

99 lines
1.4 KiB
NASM

setcom 60
mcopy simlib.mac
copy simequates.equ
dummysim1 start ; ends up in .root
end
* 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