2015-03-14 21:48:35 +00:00
|
|
|
|
PR#3
|
2015-06-03 18:30:57 +00:00
|
|
|
|
PREFIX /A2OSX.SRC
|
2015-03-14 21:48:35 +00:00
|
|
|
|
NEW
|
|
|
|
|
INC 1
|
|
|
|
|
AUTO 6
|
|
|
|
|
.LIST OFF
|
|
|
|
|
.OP 65C02
|
|
|
|
|
.OR $2000
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.TF /A2OSX.BOOT/SBIN/GETTY
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-26 20:51:06 +00:00
|
|
|
|
.INB /A2OSX.DEV/INC/MACROS.I
|
|
|
|
|
.INB /A2OSX.DEV/INC/A2OSX.I
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ZPTmp1 .EQ ZPBIN
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
* File Header (16 Bytes)
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.START cld
|
|
|
|
|
jmp (.1,x)
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA #$61 6502,Level 1 (65c02)
|
|
|
|
|
.DA #1 BIN Layout Version 1
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA CS.END-CS.START
|
|
|
|
|
.DA DS.END-DS.START Data Segment to Allocate
|
|
|
|
|
.DA 0
|
|
|
|
|
.DA 0
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
* Relocation Table
|
|
|
|
|
*--------------------------------------
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.1 .DA CS.INIT
|
|
|
|
|
.DA CS.RUN
|
|
|
|
|
.DA CS.DOEVENT
|
|
|
|
|
.DA CS.QUIT
|
2015-09-13 20:35:07 +00:00
|
|
|
|
L.MSG.USAGE .DA MSG.USAGE
|
|
|
|
|
L.MSG.GREETINGS .DA MSG.GREETINGS
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DA 0 End Of Reloc Table
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2016-10-24 15:54:43 +00:00
|
|
|
|
CS.INIT >SYSCALL GetArgC
|
2016-08-17 06:25:58 +00:00
|
|
|
|
cmp #1
|
2015-09-13 20:35:07 +00:00
|
|
|
|
bne .1
|
|
|
|
|
|
|
|
|
|
>LDYA L.MSG.USAGE
|
2016-11-03 16:23:46 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
lda #0
|
2015-09-13 20:35:07 +00:00
|
|
|
|
sec
|
|
|
|
|
rts
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.1 lda #1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
|
|
|
|
>SYSCALL GetDevByNameYA
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .98
|
2015-03-14 21:48:35 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
>STYA pDev
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
txa
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.PS.hINDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pPs),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.PS.hOUTDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pPs),y
|
2015-03-14 21:48:35 +00:00
|
|
|
|
ldy #S.PS.hERRDEV
|
2015-06-03 18:30:57 +00:00
|
|
|
|
sta (pPs),y
|
2015-10-19 20:35:00 +00:00
|
|
|
|
|
2016-06-07 06:10:18 +00:00
|
|
|
|
ldx #DEVMGR.OPEN
|
|
|
|
|
jsr pDevJmp
|
|
|
|
|
bcs .99
|
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
lda #2
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetArgA
|
2015-03-14 21:48:35 +00:00
|
|
|
|
bcs .99
|
|
|
|
|
|
2016-11-01 17:18:04 +00:00
|
|
|
|
>SYSCALL ExpandPStrYA
|
2016-08-17 06:25:58 +00:00
|
|
|
|
bcs .99
|
2016-11-01 17:18:04 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
txa
|
2016-11-01 17:18:04 +00:00
|
|
|
|
|
2015-06-03 18:30:57 +00:00
|
|
|
|
ldy #hBinName
|
|
|
|
|
sta (pData),y
|
2016-06-07 06:10:18 +00:00
|
|
|
|
clc
|
|
|
|
|
rts
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-08-17 06:25:58 +00:00
|
|
|
|
.98 sec
|
2015-03-14 21:48:35 +00:00
|
|
|
|
.99 rts
|
|
|
|
|
*--------------------------------------
|
2016-06-07 06:10:18 +00:00
|
|
|
|
CS.RUN lda #13 try send a CR...
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL COutA Device Is Ready ?
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .8 no..loop...
|
2016-06-07 06:10:18 +00:00
|
|
|
|
|
|
|
|
|
lda pDev
|
|
|
|
|
clc
|
|
|
|
|
adc #S.DEV.NAME
|
|
|
|
|
tay
|
|
|
|
|
lda pDev+1
|
|
|
|
|
adc /S.DEV.NAME
|
|
|
|
|
>PUSHYA
|
|
|
|
|
>LDYA L.MSG.GREETINGS
|
2016-11-03 16:23:46 +00:00
|
|
|
|
>SYSCALL CPrintFYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2015-11-22 22:30:06 +00:00
|
|
|
|
bcs .8 unable to send greetings...loop..
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
ldy #hBinName
|
|
|
|
|
lda (pData),y
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL GetMemPtrA
|
|
|
|
|
>SYSCALL ExecProcessNewEnvYA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.9 rts
|
2015-11-22 22:30:06 +00:00
|
|
|
|
|
|
|
|
|
.8 clc
|
|
|
|
|
rts
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.DOEVENT sec
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
CS.QUIT ldy #hBinName
|
|
|
|
|
lda (pData),y
|
2016-10-03 15:59:36 +00:00
|
|
|
|
beq .1
|
2016-10-24 15:54:43 +00:00
|
|
|
|
>SYSCALL FreeMemA
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
2016-10-03 15:59:36 +00:00
|
|
|
|
.1 ldx #DEVMGR.CLOSE
|
2016-06-07 06:10:18 +00:00
|
|
|
|
* jsr pDevJmp
|
2015-06-03 18:30:57 +00:00
|
|
|
|
|
|
|
|
|
clc
|
2015-03-14 21:48:35 +00:00
|
|
|
|
rts
|
|
|
|
|
*--------------------------------------
|
|
|
|
|
CS.END
|
2016-10-24 15:54:43 +00:00
|
|
|
|
MSG.USAGE >CSTR "GETTY <DEV> <PROGRAM>"
|
|
|
|
|
MSG.GREETINGS >CSTR "\e[12h\nA2osX-GeTTY on Dev=%S\n"
|
2015-03-14 21:48:35 +00:00
|
|
|
|
*--------------------------------------
|
2015-06-03 18:30:57 +00:00
|
|
|
|
.DUMMY
|
|
|
|
|
.OR 0
|
|
|
|
|
DS.START
|
|
|
|
|
hBinName .BS 1
|
|
|
|
|
DS.END .ED
|
2015-03-14 21:48:35 +00:00
|
|
|
|
MAN
|
|
|
|
|
SAVE SBIN/GETTY.S
|
|
|
|
|
ASM
|