Merge pull request #4 from rigreco/Test

Test
This commit is contained in:
Riccardo 2015-03-01 14:03:59 +01:00
commit 7e3d1e3849
16 changed files with 2269 additions and 0 deletions

6
AppleII/Integer adc 1 Byte/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
/Unicalc
/Unicalc_Output.txt
/Unicalc.do
/Unidrive
/Unidrive_Output.txt
/Unidrive.asm

View File

@ -0,0 +1,7 @@
10 HOME
20 PRINT CHR$ (4);"BLOAD UNIDRIVE"
25 INPUT "N1,N2? ";N1,N2
30 POKE 10,N1
35 POKE 11,N2
40 CALL 32768
50 PRINT : PRINT "RESULT IS "; PEEK (12)

View File

@ -0,0 +1,392 @@
*
* Unidisk 3.5 Calc <beta>
*
* The target of this project is to use the Unidisk 3.5 drive to perform
* specific numerical routines: 1 Byte Add integer numbers calculation;
* in order to use it as a Apple II co-processor unit.
*
* Copyright (C) 2015 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
*** Pointers ***
LowMain equ $000A
HiMain equ $000B
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
COUT1 equ $FDF0 ;Output to screen
CROut equ $FD8E ;Carriage return
PRbyte equ $FDDA ;Print byte in hex
PRBL2 equ $F94A ;Print many spaces
KEYIN equ $FD1B ;Waits for keypress
** Command Code **
StatusCmd equ 0
** Status Code **
StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Eject equ 4
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*****************************************************
* Presentation message **************
*
ldx #0
LOOP equ *
lda DATA,x
beq ME2
jsr COut
inx
bne LOOP
*
DATA asc 'UNIDISK 3.5 UTILITY BY R. GRECO'
dfb $8D,0 ; Inverse mode on
ME2 jsr CROut
jsr CROut
ldx #0
LOOP2 equ *
lda DATA2,x
beq START
ora #$80
jsr COut
inx
bne LOOP2
*
DATA2 asc 'A X Y P'
dfb $8D,0 ; Inverse mode on
*****************************************************
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
*
* Now make the DIB call to the first guy
*
* jsr Dispatch
* dfb StatusCmd
* dw DParmsDIB
* bcs Error
*
* Got the DIB; now print the name string
*
* ldx #0
* morechars equ *
* lda DIBName,x
* ora #$80 ;COut wants high Bit set
* jsr COut ; ASCII
* inx
* cpx DIBNameLen
* bne morechars
*************************************
* ldx #02 ; Set 2 space
* jsr PRBL2
** Print Type ***********************
* lda DIBType
* jsr PRbyte ; HEX form
*************************************
* ldx #02 ; Set 2 space
* jsr PRBL2
** Print Firmware version ***********
* ldx #0
* morechars2 equ *
* lda DIBVersion,x
* jsr PRbyte ; HEX form
* inx
* cpx #$02 ; 2 Byte
* bne morechars2
* jsr COut
**************************************
jsr CROut
** Wait keypress to continue **
*
jsr KEYIN
*
*** Eject ***
jsr Dispatch
dfb ControlCmd
dw E_JECT
*** Set start HiMain Memory Pointers ***
* lda #$20 ; Hi Byte start (//c ram)
* sta HiMain ; HiMain=$20 set
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
*
jsr EXEC ; Jump the Error routine
rts
*********************************************
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*********************************************
*** Set and Reset LoMain Memory Counter ***
* RESET ldx #$FF ;Lo Byte start One more before $00 (//c ram)
* clc
* ldy Y_reg ; 1 time $DF --> Y
* iny ; Y+ --> $FF
* sty Y_reg ; Y --> Y_reg Uni=$FF
*** Execute ***
* EXEC inx
* stx LowMain ; 1 time set LowMain=$00
* stx X_reg
EXEC jsr Dispatch
dfb ControlCmd
dw EXE
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
**** Screen Output ****
*
*** Accumulator ***
lda UNIAcc_reg
jsr PRbyte
ldx #03 ; Set 3 space
jsr PRBL2
*** X Register ***
lda UNIX_reg
jsr PRbyte
ldx #01 ; Set one space
jsr PRBL2
*** Y Register ***
lda UNIY_reg
jsr PRbyte
ldx #03 ; Set one space
jsr PRBL2
*** Process Status ***
lda UNIP_val
jsr PRbyte
ldx #05 ; Set five space
jsr PRBL2
** //c Memory store adress **
* lda HiMain
* jsr PRbyte
* lda LowMain
* jsr PRbyte
* jsr CROut
**** Store in //c Main Memory ****
* ldx X_reg
* lda UNIAcc_reg ;#$FB Test
* ldy #0
* sta (LowMain),y
* cpx UNIL_End
* bne EXEC
* UNIL_End dfb $FF ; Lo Byte stop (Unidisk) - $C0 for zero page
*** Increment HiMain ***
* inc HiMain
* ldy Y_reg
* cpy UNIH_End
* bne RESET
* UNIH_End dfb $FF ; Hi Byte stop (Unidisk) - $00 for zero page
*
rts
******************************************************
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
***********************************************************
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*
*** Status Parameter Set for UNI ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*** Status Parameter Set for DIB ***
DParmsDIB equ *
DPParmsCt2 dfb 3 ;Status calls have three parameters
DPUnit2 dfb 1
DPBuffer2 dw DIB
DPStatCode2 dfb StatusDIB
*
*
*** Status List DIB ***
DIB equ *
DIBStatByte1 dfb 0
DIBDevSize dfb 0,0,0
DIBNameLen dfb 0
DIBName ds 16,0
DIBType dfb 0
DIBSubType dfb 0
DIBVersion dw 0
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*** Eject ***
E_JECT equ *
dfb 3
dfb 1
dw CNTL_LIST1
dfb Eject
*
******** CONTROL LISTS ********
*
*
*** Eject ***
CNTL_LIST1 equ *
dw $0000
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00 ; Input Value
X_reg dfb $0A ; Input Value (N1)
Y_reg dfb $01 ; Input Value (N2)
ProStatus dfb $00
LowPC_reg dfb $05
HighPC_reg dfb $05
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $05
HByte_Addr dfb $05
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $09 ;<----- Lenght of Unidisk program Lo Byte
LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
*
*** Start UNIDISK Program ***
stx $C0
sty $C1
lda $C0
adc $C1
rts

3
AppleII/Integer adc 2 Byte/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/Unidrive2
/Unidrive2_Output.txt
/_FileInformation.txt

View File

@ -0,0 +1,9 @@
10 HOME
20 PRINT CHR$ (4);"BLOAD UNIDRIVE2"
25 INPUT "N1,N2? ";N1,N2
30 POKE 25,(N1 - INT (N1 / 256) * 256)
32 POKE 26, INT (N1 / 256)
35 POKE 27,(N2 - INT (N2 / 256) * 256)
37 POKE 28, INT (N2 / 256)
40 CALL 32768
50 PRINT : PRINT "RESULT IS "; PEEK (29) + 256 * PEEK (30)

View File

@ -0,0 +1,280 @@
*
* Unidisk 3.5 Calc2 <beta>
*
* The target of this project is to use the Unidisk 3.5 drive to perform
* specific numerical routines: 2 Byte Add integer numbers calculation;
* in order to use it as a Apple II co-processor unit.
*
* Copyright (C) 2015 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
N1 equ $19 ;25
N2 equ $1B ;27
RSLT equ $1D ;29
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
CROut equ $FD8E ;Carriage return
** Command Code **
StatusCmd equ 0
** Status Code **
* StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Eject equ 4
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*****************************************************
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
*** Eject ***
jsr Dispatch
dfb ControlCmd
dw E_JECT
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*
jsr EXEC ; Jump the Error routine
rts
*********************************************
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*********************************************
*
** Set the Input Value first **
EXEC lda N1
sta $80E9 ; Absolute addressing
lda N1+1
sta $80EA
lda N2
sta $80EB
lda N2+1
sta $80EC
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
** Execute **
jsr Dispatch
dfb ControlCmd
dw EXE
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
**** Store Output results in //c ****
*
lda UNIX_reg
sta RSLT ; Store the result
lda UNIY_reg
sta RSLT+1
*
rts
******************************************************
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
***********************************************************
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*
*** Status Parameter Set for UNI ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*** Eject ***
E_JECT equ *
dfb 3
dfb 1
dw CNTL_LIST1
dfb Eject
*
******** CONTROL LISTS ********
*
*
*** Eject ***
CNTL_LIST1 equ *
dw $0000
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00 ; Input Value
X_reg dfb $00 ; Input Value (N1)
Y_reg dfb $00 ; Input Value (N2)
ProStatus dfb $00 ; Input Value
LowPC_reg dfb $05 ; Like ORG
HighPC_reg dfb $05
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $05 ; Like ORG
HByte_Addr dfb $05
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $1A ;<----- Lenght of Unidisk program Lo Byte
LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
*
*** Start UNIDISK Program ***
** Two byte adc **
org $0505
RSLTU equ $C0
clc
lda N1U ; Lo Byte
adc N2U
sta RSLTU
lda N1U+1 ; Hi Byte
adc N2U+1
sta RSLTU+1
** Output Data **
ldx RSLTU
ldy RSLTU+1
rts
** Input Dynamic Data append in the end of Unidisk routine **
N1U dfb $00
dfb $00
N2U dfb $00
dfb $00

Binary file not shown.

View File

@ -0,0 +1,280 @@
*
* Unidisk 3.5 Calc Unimplemented area <beta>
*
* The target of this project is to use the Unidisk 3.5 drive to perform
* specific numerical routines: 2 Byte Add integer numbers calculation;
* in order to use it as a Apple II co-processor unit.
*
* Copyright (C) 2015 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
N1 equ $19 ;25
N2 equ $1B ;27
RSLT equ $1D ;29
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
CROut equ $FD8E ;Carriage return
** Command Code **
StatusCmd equ 0
** Status Code **
* StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Eject equ 4
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*****************************************************
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
*** Eject ***
jsr Dispatch
dfb ControlCmd
dw E_JECT
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*
jsr EXEC ; Jump the Error routine
rts
*********************************************
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*********************************************
*
** Set the Input Value first **
EXEC lda N1
sta $80E9 ; Absolute addressing
lda N1+1
sta $80EA
lda N2
sta $80EB
lda N2+1
sta $80EC
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
** Execute **
jsr Dispatch
dfb ControlCmd
dw EXE
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
**** Store Output results in //c ****
*
lda UNIX_reg
sta RSLT ; Store the result
lda UNIY_reg
sta RSLT+1
*
rts
******************************************************
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
***********************************************************
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*
*** Status Parameter Set for UNI ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*** Eject ***
E_JECT equ *
dfb 3
dfb 1
dw CNTL_LIST1
dfb Eject
*
******** CONTROL LISTS ********
*
*
*** Eject ***
CNTL_LIST1 equ *
dw $0000
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00 ; Input Value
X_reg dfb $00 ; Input Value (N1)
Y_reg dfb $00 ; Input Value (N2)
ProStatus dfb $00 ; Input Value
LowPC_reg dfb $10 ; Like ORG Unimplemented area $0A0F - $E000
HighPC_reg dfb $0A
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $10 ; Like ORG
HByte_Addr dfb $0A
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $1A ;<----- Lenght of Unidisk program Lo Byte
LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
*
*** Start UNIDISK Program ***
** Two byte adc **
org $0A10
RSLTU equ $C0
clc
lda N1U ; Lo Byte
adc N2U
sta RSLTU
lda N1U+1 ; Hi Byte
adc N2U+1
sta RSLTU+1
** Output Data **
ldx RSLTU
ldy RSLTU+1
rts
** Input Dynamic Data append in the end of Unidisk routine **
N1U dfb $00
dfb $00
N2U dfb $00
dfb $00

View File

@ -0,0 +1,307 @@
------+-------------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------
Line | # File Line | Line Type | MX | Reloc | Size | Address Object Code | Source Code
------+-------------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------
1 | 1 UnidriveU.asm 1 | Comment | 11 | | 0 | 00/8000 | *
2 | 1 UnidriveU.asm 2 | Comment | 11 | | 0 | 00/8000 | * Unidisk 3.5 Calc Unimplemented area <beta>
3 | 1 UnidriveU.asm 3 | Comment | 11 | | 0 | 00/8000 | *
4 | 1 UnidriveU.asm 4 | Comment | 11 | | 0 | 00/8000 | * The target of this project is to use the Unidisk 3.5 drive to perform
5 | 1 UnidriveU.asm 5 | Comment | 11 | | 0 | 00/8000 | * specific numerical routines: 2 Byte Add integer numbers calculation;
6 | 1 UnidriveU.asm 6 | Comment | 11 | | 0 | 00/8000 | * in order to use it as a Apple II co-processor unit.
7 | 1 UnidriveU.asm 7 | Comment | 11 | | 0 | 00/8000 | *
8 | 1 UnidriveU.asm 8 | Comment | 11 | | 0 | 00/8000 | * Copyright (C) 2015 Riccardo Greco <rigreco.grc@gmail.com>.
9 | 1 UnidriveU.asm 9 | Comment | 11 | | 0 | 00/8000 | *
10 | 1 UnidriveU.asm 10 | Comment | 11 | | 0 | 00/8000 | * This program is free software: you can redistribute it and/or modify
11 | 1 UnidriveU.asm 11 | Comment | 11 | | 0 | 00/8000 | * it under the terms of the GNU General Public License as published by
12 | 1 UnidriveU.asm 12 | Comment | 11 | | 0 | 00/8000 | * the Free Software Foundation, either version 3 of the License, or
13 | 1 UnidriveU.asm 13 | Comment | 11 | | 0 | 00/8000 | * (at your option) any later version.
14 | 1 UnidriveU.asm 14 | Comment | 11 | | 0 | 00/8000 | * This program is distributed in the hope that it will be useful,
15 | 1 UnidriveU.asm 15 | Comment | 11 | | 0 | 00/8000 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 | 1 UnidriveU.asm 16 | Comment | 11 | | 0 | 00/8000 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 | 1 UnidriveU.asm 17 | Comment | 11 | | 0 | 00/8000 | * GNU General Public License for more details.
18 | 1 UnidriveU.asm 18 | Comment | 11 | | 0 | 00/8000 | * You should have received a copy of the GNU General Public License
19 | 1 UnidriveU.asm 19 | Comment | 11 | | 0 | 00/8000 | * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 | 1 UnidriveU.asm 20 | Comment | 11 | | 0 | 00/8000 | *
21 | 1 UnidriveU.asm 21 | Comment | 11 | | 0 | 00/8000 | *
22 | 1 UnidriveU.asm 22 | Comment | 11 | | 0 | 00/8000 | * @com.wudsn.ide.asm.hardware=APPLE2
23 | 1 UnidriveU.asm 23 | Comment | 11 | | 0 | 00/8000 | * Protocol Converter Call
24 | 1 UnidriveU.asm 24 | Directive | 11 | | 0 | 00/8000 | XC
25 | 1 UnidriveU.asm 25 | Equivalence | 11 | | 0 | 00/8000 | ZPTempL equ $0006 ;Temporary zero page storage
26 | 1 UnidriveU.asm 26 | Equivalence | 11 | | 0 | 00/8000 | ZPTempH equ $0007
27 | 1 UnidriveU.asm 27 | Comment | 11 | | 0 | 00/8000 | ** Zero page storage **
28 | 1 UnidriveU.asm 28 | Equivalence | 11 | | 0 | 00/8000 | N1 equ $19 ;25
29 | 1 UnidriveU.asm 29 | Equivalence | 11 | | 0 | 00/8000 | N2 equ $1B ;27
30 | 1 UnidriveU.asm 30 | Equivalence | 11 | | 0 | 00/8000 | RSLT equ $1D ;29
31 | 1 UnidriveU.asm 31 | Comment | 11 | | 0 | 00/8000 | *** Monitor routines ***
32 | 1 UnidriveU.asm 32 | Equivalence | 11 | | 0 | 00/8000 | COut equ $FDED ;Console output ASCII
33 | 1 UnidriveU.asm 33 | Equivalence | 11 | | 0 | 00/8000 | CROut equ $FD8E ;Carriage return
34 | 1 UnidriveU.asm 34 | Comment | 11 | | 0 | 00/8000 | ** Command Code **
35 | 1 UnidriveU.asm 35 | Equivalence | 11 | | 0 | 00/8000 | StatusCmd equ 0
36 | 1 UnidriveU.asm 36 | Comment | 11 | | 0 | 00/8000 | ** Status Code **
37 | 1 UnidriveU.asm 37 | Comment | 11 | | 0 | 00/8000 | * StatusDIB equ 3
38 | 1 UnidriveU.asm 38 | Equivalence | 11 | | 0 | 00/8000 | StatusUNI equ 5
39 | 1 UnidriveU.asm 39 | Comment | 11 | | 0 | 00/8000 | *
40 | 1 UnidriveU.asm 40 | Equivalence | 11 | | 0 | 00/8000 | ControlCmd equ 4
41 | 1 UnidriveU.asm 41 | Comment | 11 | | 0 | 00/8000 | ** Control Codes **
42 | 1 UnidriveU.asm 42 | Equivalence | 11 | | 0 | 00/8000 | Eject equ 4
43 | 1 UnidriveU.asm 43 | Equivalence | 11 | | 0 | 00/8000 | Run equ 5
44 | 1 UnidriveU.asm 44 | Equivalence | 11 | | 0 | 00/8000 | SetDWLoad equ 6
45 | 1 UnidriveU.asm 45 | Equivalence | 11 | | 0 | 00/8000 | DWLoad equ 7
46 | 1 UnidriveU.asm 46 | Comment | 11 | | 0 | 00/8000 | *
47 | 1 UnidriveU.asm 47 | Directive | 11 | | 0 | 00/8000 | org $8000
48 | 1 UnidriveU.asm 48 | Comment | 11 | | 0 | 00/8000 | *****************************************************
49 | 1 UnidriveU.asm 49 | Empty | 11 | | 0 | 00/8000 |
50 | 1 UnidriveU.asm 50 | Comment | 11 | | 0 | 00/8000 | *
51 | 1 UnidriveU.asm 51 | Comment | 11 | | 0 | 00/8000 | * Find a Protocol Converter in one of the slots.
52 | 1 UnidriveU.asm 52 | Code | 11 | | 3 | 00/8000 : 20 6A 80 | START jsr {ozunid_4}
53 | 1 UnidriveU.asm 53 | Code | 11 | | 2 | 00/8003 : B0 10 | bcs {ozunid_1}
54 | 1 UnidriveU.asm 54 | Comment | 11 | | 0 | 00/8005 | *** Eject ***
55 | 1 UnidriveU.asm 55 | Code | 11 | | 3 | 00/8005 : 20 9F 80 | jsr {ozunid_9}
56 | 1 UnidriveU.asm 56 | Data | 11 | | 1 | 00/8008 : 04 | dfb {4}
57 | 1 UnidriveU.asm 57 | Data | 11 | | 2 | 00/8009 : BE 80 | dw {ozunid_15}
58 | 1 UnidriveU.asm 58 | Comment | 11 | | 0 | 00/800B | *** Set Address ***
59 | 1 UnidriveU.asm 59 | Code | 11 | | 3 | 00/800B : 20 9F 80 | jsr {ozunid_9}
60 | 1 UnidriveU.asm 60 | Data | 11 | | 1 | 00/800E : 04 | dfb {4}
61 | 1 UnidriveU.asm 61 | Data | 11 | | 2 | 00/800F : AF 80 | dw {ozunid_12}
62 | 1 UnidriveU.asm 62 | Comment | 11 | | 0 | 00/8011 | *
63 | 1 UnidriveU.asm 63 | Code | 11 | | 3 | 00/8011 : 20 37 80 | jsr EXEC ; Jump the Error routine
64 | 1 UnidriveU.asm 64 | Code | 11 | | 1 | 00/8014 : 60 | rts
65 | 1 UnidriveU.asm 65 | Comment | 11 | | 0 | 00/8015 | *********************************************
66 | 1 UnidriveU.asm 66 | Empty | 11 | | 0 | 00/8015 | ozunid_1
67 | 1 UnidriveU.asm 66 | Equivalence | 11 | | 0 | 00/8015 | Error equ ozunid_1
68 | 1 UnidriveU.asm 67 | Comment | 11 | | 0 | 00/8015 | *
69 | 1 UnidriveU.asm 68 | Comment | 11 | | 0 | 00/8015 | * There's either no PC around, or there was no give message
70 | 1 UnidriveU.asm 69 | Comment | 11 | | 0 | 00/8015 | *
71 | 1 UnidriveU.asm 70 | Code | 11 | | 2 | 00/8015 : A2 00 | ldx #0
72 | 1 UnidriveU.asm 71 | Empty | 11 | | 0 | 00/8017 | ozunid_2
73 | 1 UnidriveU.asm 71 | Equivalence | 11 | | 0 | 00/8017 | err1 equ ozunid_2
74 | 1 UnidriveU.asm 72 | Code | 11 | | 3 | 00/8017 : BD 23 80 | lda Message,x
75 | 1 UnidriveU.asm 73 | Code | 11 | | 2 | 00/801A : F0 06 | beq {ozunid_3}
76 | 1 UnidriveU.asm 74 | Code | 11 | | 3 | 00/801C : 20 ED FD | jsr {$FDED}
77 | 1 UnidriveU.asm 75 | Code | 11 | | 1 | 00/801F : E8 | inx
78 | 1 UnidriveU.asm 76 | Code | 11 | | 2 | 00/8020 : D0 F5 | bne {ozunid_2}
79 | 1 UnidriveU.asm 77 | Comment | 11 | | 0 | 00/8022 | *
80 | 1 UnidriveU.asm 78 | Empty | 11 | | 0 | 00/8022 | ozunid_3
81 | 1 UnidriveU.asm 78 | Equivalence | 11 | | 0 | 00/8022 | errout equ ozunid_3
82 | 1 UnidriveU.asm 79 | Code | 11 | | 1 | 00/8022 : 60 | rts
83 | 1 UnidriveU.asm 80 | Comment | 11 | | 0 | 00/8023 | *
84 | 1 UnidriveU.asm 81 | Data | 11 | | 18 | 00/8023 : 4E 4F 20 50 | Message asc 'NO PC OR NO DEVICE'
| | | | | | 43 20 4F 52 |
| | | | | | 20 4E 4F 20 |
| | | | | | 44 45 56 49 |
| | | | | | 43 45 |
85 | 1 UnidriveU.asm 82 | Data | 11 | | 2 | 00/8035 : 8D 00 | dfb $8D,0
86 | 1 UnidriveU.asm 83 | Comment | 11 | | 0 | 00/8037 | *********************************************
87 | 1 UnidriveU.asm 84 | Comment | 11 | | 0 | 00/8037 | *
88 | 1 UnidriveU.asm 85 | Comment | 11 | | 0 | 00/8037 | ** Set the Input Value first **
89 | 1 UnidriveU.asm 86 | Code | 11 | | 2 | 00/8037 : A5 19 | EXEC lda {$19}
90 | 1 UnidriveU.asm 87 | Code | 11 | | 3 | 00/8039 : 8D E9 80 | sta $80E9 ; Absolute addressing
91 | 1 UnidriveU.asm 88 | Code | 11 | | 2 | 00/803C : A5 1A | lda {$19}+1
92 | 1 UnidriveU.asm 89 | Code | 11 | | 3 | 00/803E : 8D EA 80 | sta $80EA
93 | 1 UnidriveU.asm 90 | Empty | 11 | | 0 | 00/8041 |
94 | 1 UnidriveU.asm 91 | Code | 11 | | 2 | 00/8041 : A5 1B | lda {$1B}
95 | 1 UnidriveU.asm 92 | Code | 11 | | 3 | 00/8043 : 8D EB 80 | sta $80EB
96 | 1 UnidriveU.asm 93 | Code | 11 | | 2 | 00/8046 : A5 1C | lda {$1B}+1
97 | 1 UnidriveU.asm 94 | Code | 11 | | 3 | 00/8048 : 8D EC 80 | sta $80EC
98 | 1 UnidriveU.asm 95 | Comment | 11 | | 0 | 00/804B | *** Download ***
99 | 1 UnidriveU.asm 96 | Code | 11 | | 3 | 00/804B : 20 9F 80 | jsr {ozunid_9}
100 | 1 UnidriveU.asm 97 | Data | 11 | | 1 | 00/804E : 04 | dfb {4}
101 | 1 UnidriveU.asm 98 | Data | 11 | | 2 | 00/804F : B4 80 | dw {ozunid_13}
102 | 1 UnidriveU.asm 99 | Comment | 11 | | 0 | 00/8051 | ** Execute **
103 | 1 UnidriveU.asm 100 | Code | 11 | | 3 | 00/8051 : 20 9F 80 | jsr {ozunid_9}
104 | 1 UnidriveU.asm 101 | Data | 11 | | 1 | 00/8054 : 04 | dfb {4}
105 | 1 UnidriveU.asm 102 | Data | 11 | | 2 | 00/8055 : B9 80 | dw {ozunid_14}
106 | 1 UnidriveU.asm 103 | Code | 11 | | 3 | 00/8057 : 20 9F 80 | READ jsr {ozunid_9}
107 | 1 UnidriveU.asm 104 | Data | 11 | | 1 | 00/805A : 00 | dfb {0}
108 | 1 UnidriveU.asm 105 | Data | 11 | | 2 | 00/805B : A2 80 | dw {ozunid_10}
109 | 1 UnidriveU.asm 106 | Code | 11 | | 2 | 00/805D : B0 B6 | bcs {ozunid_1}
110 | 1 UnidriveU.asm 107 | Comment | 11 | | 0 | 00/805F | *
111 | 1 UnidriveU.asm 108 | Comment | 11 | | 0 | 00/805F | **** Store Output results in //c ****
112 | 1 UnidriveU.asm 109 | Comment | 11 | | 0 | 00/805F | *
113 | 1 UnidriveU.asm 110 | Code | 11 | | 3 | 00/805F : AD AB 80 | lda UNIX_reg
114 | 1 UnidriveU.asm 111 | Code | 11 | | 2 | 00/8062 : 85 1D | sta {$1D} ; Store the result
115 | 1 UnidriveU.asm 112 | Code | 11 | | 3 | 00/8064 : AD AC 80 | lda UNIY_reg
116 | 1 UnidriveU.asm 113 | Code | 11 | | 2 | 00/8067 : 85 1E | sta {$1D}+1
117 | 1 UnidriveU.asm 114 | Comment | 11 | | 0 | 00/8069 | *
118 | 1 UnidriveU.asm 115 | Code | 11 | | 1 | 00/8069 : 60 | rts
119 | 1 UnidriveU.asm 116 | Empty | 11 | | 0 | 00/806A |
120 | 1 UnidriveU.asm 117 | Comment | 11 | | 0 | 00/806A | ******************************************************
121 | 1 UnidriveU.asm 118 | Empty | 11 | | 0 | 00/806A | ozunid_4
122 | 1 UnidriveU.asm 118 | Equivalence | 11 | | 0 | 00/806A | FindPC equ ozunid_4
123 | 1 UnidriveU.asm 119 | Comment | 11 | | 0 | 00/806A | *
124 | 1 UnidriveU.asm 120 | Comment | 11 | | 0 | 00/806A | * Search slot 7 to slot 1 looking for signature bytes
125 | 1 UnidriveU.asm 121 | Comment | 11 | | 0 | 00/806A | *
126 | 1 UnidriveU.asm 122 | Code | 11 | | 2 | 00/806A : A2 07 | ldx #7 ;Do for seven slots
127 | 1 UnidriveU.asm 123 | Code | 11 | | 2 | 00/806C : A9 C7 | lda #$C7
128 | 1 UnidriveU.asm 124 | Code | 11 | | 2 | 00/806E : 85 07 | sta {$0007}
129 | 1 UnidriveU.asm 125 | Code | 11 | | 2 | 00/8070 : A9 00 | lda #$00
130 | 1 UnidriveU.asm 126 | Code | 11 | | 2 | 00/8072 : 85 06 | sta {$0006}
131 | 1 UnidriveU.asm 127 | Comment | 11 | | 0 | 00/8074 | *
132 | 1 UnidriveU.asm 128 | Empty | 11 | | 0 | 00/8074 | ozunid_5
133 | 1 UnidriveU.asm 128 | Equivalence | 11 | | 0 | 00/8074 | newslot equ ozunid_5
134 | 1 UnidriveU.asm 129 | Code | 11 | | 2 | 00/8074 : A0 07 | ldy #7
135 | 1 UnidriveU.asm 130 | Comment | 11 | | 0 | 00/8076 | *
136 | 1 UnidriveU.asm 131 | Empty | 11 | | 0 | 00/8076 | ozunid_6
137 | 1 UnidriveU.asm 131 | Equivalence | 11 | | 0 | 00/8076 | again equ ozunid_6
138 | 1 UnidriveU.asm 132 | Code | 11 | | 2 | 00/8076 : B1 06 | lda ({$0006}),y
139 | 1 UnidriveU.asm 133 | Code | 11 | | 3 | 00/8078 : D9 97 80 | cmp sigtab,y ;One for byte signature
140 | 1 UnidriveU.asm 134 | Code | 11 | | 2 | 00/807B : F0 07 | beq {ozunid_7} ;Found one signature byte
141 | 1 UnidriveU.asm 135 | Code | 11 | | 2 | 00/807D : C6 07 | dec {$0007}
142 | 1 UnidriveU.asm 136 | Code | 11 | | 1 | 00/807F : CA | dex
143 | 1 UnidriveU.asm 137 | Code | 11 | | 2 | 00/8080 : D0 F2 | bne {ozunid_5}
144 | 1 UnidriveU.asm 138 | Comment | 11 | | 0 | 00/8082 | *
145 | 1 UnidriveU.asm 139 | Comment | 11 | | 0 | 00/8082 | * if we get here, no PC find
146 | 1 UnidriveU.asm 140 | Code | 11 | | 1 | 00/8082 : 38 | sec
147 | 1 UnidriveU.asm 141 | Code | 11 | | 1 | 00/8083 : 60 | rts
148 | 1 UnidriveU.asm 142 | Comment | 11 | | 0 | 00/8084 | *
149 | 1 UnidriveU.asm 143 | Comment | 11 | | 0 | 00/8084 | * if we get here, no byte find on PC
150 | 1 UnidriveU.asm 144 | Empty | 11 | | 0 | 00/8084 | ozunid_7
151 | 1 UnidriveU.asm 144 | Equivalence | 11 | | 0 | 00/8084 | maybe equ ozunid_7
152 | 1 UnidriveU.asm 145 | Code | 11 | | 1 | 00/8084 : 88 | dey
153 | 1 UnidriveU.asm 146 | Code | 11 | | 1 | 00/8085 : 88 | dey ;if N=1 then all sig bytes OK
154 | 1 UnidriveU.asm 147 | Code | 11 | | 2 | 00/8086 : 10 EE | bpl {ozunid_6}
155 | 1 UnidriveU.asm 148 | Comment | 11 | | 0 | 00/8088 | * Found PC interface. Set up call address.
156 | 1 UnidriveU.asm 149 | Comment | 11 | | 0 | 00/8088 | * we already have high byte ($CN), we need low byte
157 | 1 UnidriveU.asm 150 | Comment | 11 | | 0 | 00/8088 | *
158 | 1 UnidriveU.asm 151 | Empty | 11 | | 0 | 00/8088 | ozunid_8
159 | 1 UnidriveU.asm 151 | Equivalence | 11 | | 0 | 00/8088 | foundPC equ ozunid_8
160 | 1 UnidriveU.asm 152 | Code | 11 | | 2 | 00/8088 : A9 FF | lda #$FF
161 | 1 UnidriveU.asm 153 | Code | 11 | | 2 | 00/808A : 85 06 | sta {$0006}
162 | 1 UnidriveU.asm 154 | Code | 11 | | 2 | 00/808C : A0 00 | ldy #0 ;For indirect load
163 | 1 UnidriveU.asm 155 | Code | 11 | | 2 | 00/808E : B1 06 | lda ({$0006}),y ;Get the byte
164 | 1 UnidriveU.asm 156 | Comment | 11 | | 0 | 00/8090 | *
165 | 1 UnidriveU.asm 157 | Comment | 11 | | 0 | 00/8090 | * Now the Acc has the low oreder ProDOS entry point.
166 | 1 UnidriveU.asm 158 | Comment | 11 | | 0 | 00/8090 | * The PC entry is three locations past this ...
167 | 1 UnidriveU.asm 159 | Comment | 11 | | 0 | 00/8090 | *
168 | 1 UnidriveU.asm 160 | Code | 11 | | 1 | 00/8090 : 18 | clc
169 | 1 UnidriveU.asm 161 | Code | 11 | | 2 | 00/8091 : 69 03 | adc #3
170 | 1 UnidriveU.asm 162 | Code | 11 | | 2 | 00/8093 : 85 06 | sta {$0006}
171 | 1 UnidriveU.asm 163 | Comment | 11 | | 0 | 00/8095 | *
172 | 1 UnidriveU.asm 164 | Comment | 11 | | 0 | 00/8095 | * Now ZPTempL has PC entry point.
173 | 1 UnidriveU.asm 165 | Comment | 11 | | 0 | 00/8095 | * Return with carry clear.
174 | 1 UnidriveU.asm 166 | Comment | 11 | | 0 | 00/8095 | *
175 | 1 UnidriveU.asm 167 | Code | 11 | | 1 | 00/8095 : 18 | clc
176 | 1 UnidriveU.asm 168 | Code | 11 | | 1 | 00/8096 : 60 | rts
177 | 1 UnidriveU.asm 169 | Comment | 11 | | 0 | 00/8097 | ***********************************************************
178 | 1 UnidriveU.asm 170 | Comment | 11 | | 0 | 00/8097 | *
179 | 1 UnidriveU.asm 171 | Comment | 11 | | 0 | 00/8097 | * There are the PC signature bytes in their relative order.
180 | 1 UnidriveU.asm 172 | Comment | 11 | | 0 | 00/8097 | * The $FF bytes are filler bytes and are not compared.
181 | 1 UnidriveU.asm 173 | Comment | 11 | | 0 | 00/8097 | *
182 | 1 UnidriveU.asm 174 | Data | 11 | | 4 | 00/8097 : FF 20 FF 00 | sigtab dfb $FF,$20,$FF,$00
183 | 1 UnidriveU.asm 175 | Data | 11 | | 4 | 00/809B : FF 03 FF 00 | dfb $FF,$03,$FF,$00
184 | 1 UnidriveU.asm 176 | Comment | 11 | | 0 | 00/809F | *
185 | 1 UnidriveU.asm 177 | Empty | 11 | | 0 | 00/809F | ozunid_9
186 | 1 UnidriveU.asm 177 | Equivalence | 11 | | 0 | 00/809F | Dispatch equ ozunid_9
187 | 1 UnidriveU.asm 178 | Code | 11 | | 3 | 00/809F : 6C 06 00 | jmp ({$0006}) ;Simulate an indirect JSR to PC
188 | 1 UnidriveU.asm 179 | Comment | 11 | | 0 | 00/80A2 | *
189 | 1 UnidriveU.asm 180 | Comment | 11 | | 0 | 00/80A2 | *** Status Parameter Set for UNI ***
190 | 1 UnidriveU.asm 181 | Empty | 11 | | 0 | 00/80A2 | ozunid_10
191 | 1 UnidriveU.asm 181 | Equivalence | 11 | | 0 | 00/80A2 | DParms equ ozunid_10
192 | 1 UnidriveU.asm 182 | Data | 11 | | 1 | 00/80A2 : 03 | DPParmsCt dfb 3 ;Status calls have three parameters
193 | 1 UnidriveU.asm 183 | Data | 11 | | 1 | 00/80A3 : 01 | DPUnit dfb 1
194 | 1 UnidriveU.asm 184 | Data | 11 | | 2 | 00/80A4 : A7 80 | DPBuffer dw {ozunid_11}
195 | 1 UnidriveU.asm 185 | Data | 11 | | 1 | 00/80A6 : 05 | DPStatCode dfb {5}
196 | 1 UnidriveU.asm 186 | Comment | 11 | | 0 | 00/80A7 | *
197 | 1 UnidriveU.asm 187 | Comment | 11 | | 0 | 00/80A7 | *
198 | 1 UnidriveU.asm 188 | Comment | 11 | | 0 | 00/80A7 | *
199 | 1 UnidriveU.asm 189 | Comment | 11 | | 0 | 00/80A7 | *** Status List UNI ***
200 | 1 UnidriveU.asm 190 | Empty | 11 | | 0 | 00/80A7 | ozunid_11
201 | 1 UnidriveU.asm 190 | Equivalence | 11 | | 0 | 00/80A7 | UNI equ ozunid_11
202 | 1 UnidriveU.asm 191 | Data | 11 | | 1 | 00/80A7 : 00 | dfb 0
203 | 1 UnidriveU.asm 192 | Data | 11 | | 1 | 00/80A8 : 00 | UNIError dfb 0
204 | 1 UnidriveU.asm 193 | Data | 11 | | 1 | 00/80A9 : 00 | UNIRetries dfb 0
205 | 1 UnidriveU.asm 194 | Data | 11 | | 1 | 00/80AA : 00 | UNIAcc_reg dfb 0
206 | 1 UnidriveU.asm 195 | Data | 11 | | 1 | 00/80AB : 00 | UNIX_reg dfb 0
207 | 1 UnidriveU.asm 196 | Data | 11 | | 1 | 00/80AC : 00 | UNIY_reg dfb 0
208 | 1 UnidriveU.asm 197 | Data | 11 | | 1 | 00/80AD : 00 | UNIP_val dfb 0
209 | 1 UnidriveU.asm 198 | Data | 11 | | 1 | 00/80AE : 00 | HHH dfb 0
210 | 1 UnidriveU.asm 199 | Comment | 11 | | 0 | 00/80AF | *
211 | 1 UnidriveU.asm 200 | Comment | 11 | | 0 | 00/80AF | *** Set Address ***
212 | 1 UnidriveU.asm 201 | Empty | 11 | | 0 | 00/80AF | ozunid_12
213 | 1 UnidriveU.asm 201 | Equivalence | 11 | | 0 | 00/80AF | SET_ADD equ ozunid_12
214 | 1 UnidriveU.asm 202 | Data | 11 | | 1 | 00/80AF : 03 | dfb 3
215 | 1 UnidriveU.asm 203 | Data | 11 | | 1 | 00/80B0 : 01 | dfb 1
216 | 1 UnidriveU.asm 204 | Data | 11 | | 2 | 00/80B1 : CD 80 | dw {ozunid_18}
217 | 1 UnidriveU.asm 205 | Data | 11 | | 1 | 00/80B3 : 06 | dfb {6}
218 | 1 UnidriveU.asm 206 | Comment | 11 | | 0 | 00/80B4 | *
219 | 1 UnidriveU.asm 207 | Comment | 11 | | 0 | 00/80B4 | *** Download ***
220 | 1 UnidriveU.asm 208 | Empty | 11 | | 0 | 00/80B4 | ozunid_13
221 | 1 UnidriveU.asm 208 | Equivalence | 11 | | 0 | 00/80B4 | DOWNLOAD equ ozunid_13
222 | 1 UnidriveU.asm 209 | Data | 11 | | 1 | 00/80B4 : 03 | dfb 3
223 | 1 UnidriveU.asm 210 | Data | 11 | | 1 | 00/80B5 : 01 | dfb 1
224 | 1 UnidriveU.asm 211 | Data | 11 | | 2 | 00/80B6 : D1 80 | dw {ozunid_19}
225 | 1 UnidriveU.asm 212 | Data | 11 | | 1 | 00/80B8 : 07 | dfb {7}
226 | 1 UnidriveU.asm 213 | Comment | 11 | | 0 | 00/80B9 | *
227 | 1 UnidriveU.asm 214 | Comment | 11 | | 0 | 00/80B9 | *** Execute ***
228 | 1 UnidriveU.asm 215 | Empty | 11 | | 0 | 00/80B9 | ozunid_14
229 | 1 UnidriveU.asm 215 | Equivalence | 11 | | 0 | 00/80B9 | EXE equ ozunid_14
230 | 1 UnidriveU.asm 216 | Data | 11 | | 1 | 00/80B9 : 03 | dfb 3
231 | 1 UnidriveU.asm 217 | Data | 11 | | 1 | 00/80BA : 01 | dfb 1
232 | 1 UnidriveU.asm 218 | Data | 11 | | 2 | 00/80BB : C5 80 | dw {ozunid_17}
233 | 1 UnidriveU.asm 219 | Data | 11 | | 1 | 00/80BD : 05 | dfb {5}
234 | 1 UnidriveU.asm 220 | Comment | 11 | | 0 | 00/80BE | *** Eject ***
235 | 1 UnidriveU.asm 221 | Empty | 11 | | 0 | 00/80BE | ozunid_15
236 | 1 UnidriveU.asm 221 | Equivalence | 11 | | 0 | 00/80BE | E_JECT equ ozunid_15
237 | 1 UnidriveU.asm 222 | Data | 11 | | 1 | 00/80BE : 03 | dfb 3
238 | 1 UnidriveU.asm 223 | Data | 11 | | 1 | 00/80BF : 01 | dfb 1
239 | 1 UnidriveU.asm 224 | Data | 11 | | 2 | 00/80C0 : C3 80 | dw {ozunid_16}
240 | 1 UnidriveU.asm 225 | Data | 11 | | 1 | 00/80C2 : 04 | dfb {4}
241 | 1 UnidriveU.asm 226 | Comment | 11 | | 0 | 00/80C3 | *
242 | 1 UnidriveU.asm 227 | Comment | 11 | | 0 | 00/80C3 | ******** CONTROL LISTS ********
243 | 1 UnidriveU.asm 228 | Comment | 11 | | 0 | 00/80C3 | *
244 | 1 UnidriveU.asm 229 | Comment | 11 | | 0 | 00/80C3 | *
245 | 1 UnidriveU.asm 230 | Comment | 11 | | 0 | 00/80C3 | *** Eject ***
246 | 1 UnidriveU.asm 231 | Empty | 11 | | 0 | 00/80C3 | ozunid_16
247 | 1 UnidriveU.asm 231 | Equivalence | 11 | | 0 | 00/80C3 | CNTL_LIST1 equ ozunid_16
248 | 1 UnidriveU.asm 232 | Data | 11 | | 2 | 00/80C3 : 00 00 | dw $0000
249 | 1 UnidriveU.asm 233 | Comment | 11 | | 0 | 00/80C5 | *
250 | 1 UnidriveU.asm 234 | Comment | 11 | | 0 | 00/80C5 | *** Execute ***
251 | 1 UnidriveU.asm 235 | Empty | 11 | | 0 | 00/80C5 | ozunid_17
252 | 1 UnidriveU.asm 235 | Equivalence | 11 | | 0 | 00/80C5 | CNTL_LIST2 equ ozunid_17
253 | 1 UnidriveU.asm 236 | Data | 11 | | 1 | 00/80C5 : 06 | Clow_byte dfb $06
254 | 1 UnidriveU.asm 237 | Data | 11 | | 1 | 00/80C6 : 00 | Chigh_byte dfb $00
255 | 1 UnidriveU.asm 238 | Data | 11 | | 1 | 00/80C7 : 00 | AccValue dfb $00 ; Input Value
256 | 1 UnidriveU.asm 239 | Data | 11 | | 1 | 00/80C8 : 00 | X_reg dfb $00 ; Input Value (N1)
257 | 1 UnidriveU.asm 240 | Data | 11 | | 1 | 00/80C9 : 00 | Y_reg dfb $00 ; Input Value (N2)
258 | 1 UnidriveU.asm 241 | Data | 11 | | 1 | 00/80CA : 00 | ProStatus dfb $00 ; Input Value
259 | 1 UnidriveU.asm 242 | Data | 11 | | 1 | 00/80CB : 10 | LowPC_reg dfb $10 ; Like ORG Unimplemented area $0A0F - $E000
260 | 1 UnidriveU.asm 243 | Data | 11 | | 1 | 00/80CC : 0A | HighPC_reg dfb $0A
261 | 1 UnidriveU.asm 244 | Comment | 11 | | 0 | 00/80CD | *
262 | 1 UnidriveU.asm 245 | Comment | 11 | | 0 | 00/80CD | *** Set Address ***
263 | 1 UnidriveU.asm 246 | Empty | 11 | | 0 | 00/80CD | ozunid_18
264 | 1 UnidriveU.asm 246 | Equivalence | 11 | | 0 | 00/80CD | CNTL_LIST3 equ ozunid_18
265 | 1 UnidriveU.asm 247 | Data | 11 | | 1 | 00/80CD : 02 | CountL_byte dfb $02
266 | 1 UnidriveU.asm 248 | Data | 11 | | 1 | 00/80CE : 00 | CountH_byte dfb $00
267 | 1 UnidriveU.asm 249 | Data | 11 | | 1 | 00/80CF : 10 | LByte_Addr dfb $10 ; Like ORG
268 | 1 UnidriveU.asm 250 | Data | 11 | | 1 | 00/80D0 : 0A | HByte_Addr dfb $0A
269 | 1 UnidriveU.asm 251 | Comment | 11 | | 0 | 00/80D1 | *
270 | 1 UnidriveU.asm 252 | Comment | 11 | | 0 | 00/80D1 | *** Download ***
271 | 1 UnidriveU.asm 253 | Empty | 11 | | 0 | 00/80D1 | ozunid_19
272 | 1 UnidriveU.asm 253 | Equivalence | 11 | | 0 | 00/80D1 | CNTL_LIST4 equ ozunid_19
273 | 1 UnidriveU.asm 254 | Data | 11 | | 1 | 00/80D1 : 1A | LenghtL_byte dfb $1A ;<----- Lenght of Unidisk program Lo Byte
274 | 1 UnidriveU.asm 255 | Data | 11 | | 1 | 00/80D2 : 00 | LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
275 | 1 UnidriveU.asm 256 | Comment | 11 | | 0 | 00/80D3 | *
276 | 1 UnidriveU.asm 257 | Comment | 11 | | 0 | 00/80D3 | *** Start UNIDISK Program ***
277 | 1 UnidriveU.asm 258 | Comment | 11 | | 0 | 00/80D3 | ** Two byte adc **
278 | 1 UnidriveU.asm 259 | Directive | 11 | | 0 | 00/80D3 | org $0A10
279 | 1 UnidriveU.asm 260 | Equivalence | 11 | | 0 | 00/0A10 | RSLTU equ $C0
280 | 1 UnidriveU.asm 261 | Empty | 11 | | 0 | 00/0A10 |
281 | 1 UnidriveU.asm 262 | Code | 11 | | 1 | 00/0A10 : 18 | clc
282 | 1 UnidriveU.asm 263 | Empty | 11 | | 0 | 00/0A11 |
283 | 1 UnidriveU.asm 264 | Code | 11 | | 3 | 00/0A11 : AD 26 0A | lda N1U ; Lo Byte
284 | 1 UnidriveU.asm 265 | Code | 11 | | 3 | 00/0A14 : 6D 28 0A | adc N2U
285 | 1 UnidriveU.asm 266 | Code | 11 | | 2 | 00/0A17 : 85 C0 | sta {$C0}
286 | 1 UnidriveU.asm 267 | Empty | 11 | | 0 | 00/0A19 |
287 | 1 UnidriveU.asm 268 | Code | 11 | | 3 | 00/0A19 : AD 27 0A | lda N1U+1 ; Hi Byte
288 | 1 UnidriveU.asm 269 | Code | 11 | | 3 | 00/0A1C : 6D 29 0A | adc N2U+1
289 | 1 UnidriveU.asm 270 | Code | 11 | | 2 | 00/0A1F : 85 C1 | sta {$C0}+1
290 | 1 UnidriveU.asm 271 | Comment | 11 | | 0 | 00/0A21 | ** Output Data **
291 | 1 UnidriveU.asm 272 | Code | 11 | | 2 | 00/0A21 : A6 C0 | ldx {$C0}
292 | 1 UnidriveU.asm 273 | Code | 11 | | 2 | 00/0A23 : A4 C1 | ldy {$C0}+1
293 | 1 UnidriveU.asm 274 | Empty | 11 | | 0 | 00/0A25 |
294 | 1 UnidriveU.asm 275 | Code | 11 | | 1 | 00/0A25 : 60 | rts
295 | 1 UnidriveU.asm 276 | Comment | 11 | | 0 | 00/0A26 | ** Input Dynamic Data append in the end of Unidisk routine **
296 | 1 UnidriveU.asm 277 | Data | 11 | | 1 | 00/0A26 : 00 | N1U dfb $00
297 | 1 UnidriveU.asm 278 | Data | 11 | | 1 | 00/0A27 : 00 | dfb $00
298 | 1 UnidriveU.asm 279 | Data | 11 | | 1 | 00/0A28 : 00 | N2U dfb $00
299 | 1 UnidriveU.asm 280 | Data | 11 | | 1 | 00/0A29 : 00 | dfb $00
------+-------------------------+-------------+----+---------+------+-----------------------+-------------------------------------------------------------------

4
AppleII/Memory dump/.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
/Uniprox
/Uniprox_Output.txt
/Uniproz
/Uniproz_Output.txt

View File

@ -0,0 +1,4 @@
10 HOME
20 PRINT CHR$ (4);"BLOAD UNIPROX"
30 CALL 32768
40 PRINT CHR$ (4);"BSAVE UNIROM,A$2000,L$1FFF"

View File

@ -0,0 +1,379 @@
*
* Unidisk 3.5 ROM Memory Dump <beta>
*
* The target of this project is to dump all the Unidisk 3.5 memory
*
* Copyright (C) 2014 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
*** Pointers ***
LowMain equ $000A
HiMain equ $000B
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
COUT1 equ $FDF0 ;Output to screen
CROut equ $FD8E ;Carriage return
PRbyte equ $FDDA ;Print byte in hex
PRBL2 equ $F94A ;Print many spaces
KEYIN equ $FD1B ;Waits for keypress
** Command Code **
StatusCmd equ 0
** Status Code **
StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Eject equ 4
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*****************************************************
* Presentation message **************
*
ldx #0
LOOP equ *
lda DATA,x
beq START
jsr COut
inx
bne LOOP
*
DATA asc 'UNIDISK 3.5 UTILITY BY R. GRECO'
dfb $8D,0 ; Inverse mode on
*****************************************************
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
jsr CROut
jsr CROut
*
* Now make the DIB call to the first guy
*
jsr Dispatch
dfb StatusCmd
dw DParmsDIB
bcs Error
*
* Got the DIB; now print the name string
*
ldx #0
morechars equ *
lda DIBName,x
ora #$80 ;COut wants high Bit set
jsr COut ; ASCII
inx
cpx DIBNameLen
bne morechars
*************************************
ldx #02 ; Set 2 space
jsr PRBL2
** Print Type ***********************
lda DIBType
jsr PRbyte ; HEX form
*************************************
ldx #02 ; Set 2 space
jsr PRBL2
** Print Firmware version ***********
ldx #0
morechars2 equ *
lda DIBVersion,x
jsr PRbyte ; HEX form
inx
cpx #$02 ; 2 Byte
bne morechars2
jsr COut
**************************************
jsr CROut
jsr CROut
** Wait keypress to continue **
*
jsr KEYIN
*
*** Eject ***
jsr Dispatch
dfb ControlCmd
dw E_JECT
*** Set start HiMain Memory Pointers ***
lda #$20 ; Hi Byte start (//c ram)
sta HiMain ; HiMain=$20 set
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
*
jsr RESET ; Jump the Error routine
rts
*********************************************
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*********************************************
*** Set and Reset LoMain Memory Counter ***
RESET ldx #$FF ;Lo Byte start One more before $00 (//c ram)
clc
ldy Y_reg ; 1 time $DF --> Y
iny ; Y+ --> $FF
sty Y_reg ; Y --> Y_reg Uni=$FF
*** Execute ***
EXEC inx
stx LowMain ; 1 time set LowMain=$00
stx X_reg
jsr Dispatch
dfb ControlCmd
dw EXE
*** Read ***
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
**** Screen Output ****
*
*** Accumulator ***
lda UNIAcc_reg
jsr COut ; Out the ASCII value
ldx #03 ; Set 3 space
jsr PRBL2
*** Y Register ***
lda UNIY_reg
jsr PRbyte
*** X Register ***
lda UNIX_reg
jsr PRbyte
ldx #01 ; Set one space
jsr PRBL2
*** Process Status ***
lda UNIP_val
jsr PRbyte
ldx #05 ; Set five space
jsr PRBL2
** //c Memory store adress **
lda HiMain
jsr PRbyte
lda LowMain
jsr PRbyte
jsr CROut
**** Store in //c Main Memory ****
ldx X_reg
lda UNIAcc_reg ;#$FB Test
ldy #0
sta (LowMain),y
cpx UNIL_End
bne EXEC
UNIL_End dfb $FF ; Lo Byte stop (Unidisk) - $C0 for zero page
*** Increment HiMain ***
inc HiMain
ldy Y_reg
cpy UNIH_End
bne RESET
UNIH_End dfb $FF ; Hi Byte stop (Unidisk) - $00 for zero page
*
rts
******************************************************
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
***********************************************************
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*
*** Status Parameter Set for UNI ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*** Status Parameter Set for DIB ***
DParmsDIB equ *
DPParmsCt2 dfb 3 ;Status calls have three parameters
DPUnit2 dfb 1
DPBuffer2 dw DIB
DPStatCode2 dfb StatusDIB
*
*
*** Status List DIB ***
DIB equ *
DIBStatByte1 dfb 0
DIBDevSize dfb 0,0,0
DIBNameLen dfb 0
DIBName ds 16,0
DIBType dfb 0
DIBSubType dfb 0
DIBVersion dw 0
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*** Eject ***
E_JECT equ *
dfb 3
dfb 1
dw CNTL_LIST1
dfb Eject
*
******** CONTROL LISTS ********
*
*
*** Eject ***
CNTL_LIST1 equ *
dw $0000
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00
X_reg dfb $00 ;($80E3) Lo Byte start $00 (Unidisk)
Y_reg dfb $DF ;($80E4) Hi Byte One more before start $E0 - $FF-->$00 for zero page (Unidisk)
ProStatus dfb $00
LowPC_reg dfb $05
HighPC_reg dfb $05
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $05
HByte_Addr dfb $05
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $0B ;<----- Lenght of Unidisk program Lo Byte
LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
*
*** Start UNIDISK Program ***
** Temporaney save in UNIDISK "Free zero page space" the address point stored in UNIDISK X, Y registers**
stx $00C0
sty $00C1
** Store in UNIDISK Accumulator the value of the UniDISK location that is store in $00C0 plus $00C1
ldy #0
lda ($00C0),y
** Restore the value of Y Unidisk register
ldy $00C1
rts

View File

@ -0,0 +1,264 @@
*
* Unidisk 3.5 RAM Zero Page Memory Dump <beta>
*
* The target of this project is to dump all the Unidisk 3.5 memory
*
* Copyright (C) 2014 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
*** Pointers ***
LowMain equ $000A
HiMain equ $000B
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
CROut equ $FD8E ;Carriage return
PRbyte equ $FDDA ;Print byte in hex
** Command Code **
StatusCmd equ 0
** Status Code **
StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*
* Find a Protocol Converter in one of the slots.
*
jsr FindPC
bcs Error
*
*** Set HiMain Memory Pointers ***
lda #$20
sta HiMain
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
*** Set and Reset LoMain Memory Counter ***
RESET ldx #$FF ;One more before start
clc
ldy Y_reg
iny
sty Y_reg
*** Execute ***
EXEC inx
stx LowMain
stx X_reg
jsr Dispatch
dfb ControlCmd
dw EXE
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
*** Accumulator ***
lda UNIAcc_reg
jsr PRbyte
*** X Register ***
lda UNIX_reg
jsr PRbyte
*** Y Register ***
lda UNIY_reg
jsr PRbyte
*** Process Status ***
lda UNIP_val
jsr PRbyte
jsr CROut
**** Store in //c Main Memory ****
ldx X_reg
lda UNIAcc_reg ;#$FB Test
ldy #0
sta (LowMain),y
cpx UNIL_End
bne EXEC
UNIL_End dfb $C0 ;$FF
*** Increment HiMain ***
inc HiMain
ldy Y_reg
cpy UNIH_End
bne RESET
UNIH_End dfb $00 ;$FF
*
rts
*
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*** Status Parameter Set ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*
*
******** CONTROL LISTS ********
*
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00
X_reg dfb $00 ;($80E3)
Y_reg dfb $FF ;($80E4) One more before start
ProStatus dfb $00
LowPC_reg dfb $05
HighPC_reg dfb $05
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $05
HByte_Addr dfb $05
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $0B
LenghtH_byte dfb $00
*
*** Start UNIDISK Program ***
** Temporaney save in UNIDISK "Free zero page space" the address point stored in UNIDISK X, Y registers**
stx $00C0
sty $00C1
** Store in UNIDISK Accumulator the value of the UniDISK location that is store in $00C0 plus $00C1
ldy #0
lda ($00C0),y
** Restore the value of Y Unidisk register
ldy $00C1
rts

View File

@ -0,0 +1,6 @@
/TestN
/TestN_Output.txt
/TestN.asm
/Unidrive3
/Unidrive3_Output.txt
/_FileInformation.txt

View File

@ -0,0 +1,7 @@
10 HOME
20 PRINT CHR$ (4);"BLOAD UNIDRIVE3"
25 INPUT "N ";N1
30 POKE 25,(N1 - INT (N1 / 256) * 256)
32 POKE 26, INT (N1 / 256)
40 CALL 32768
50 PRINT : PRINT "RESULT IS "; PEEK (29) + 256 * PEEK (30)

View File

@ -0,0 +1,321 @@
*
* Unidisk 3.5 Calc3 <beta>
*
* The target of this project is to use the Unidisk 3.5 drive to perform
* specific numerical routines: 2 Byte Add of the first N integer numbers calculation;
* in order to use it as a Apple II co-processor unit.
*
* Copyright (C) 2015 Riccardo Greco <rigreco.grc@gmail.com>.
*
* This program 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.
* This program 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 this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
N1 equ $19 ;25
* N2 equ $1B ;27
RSLT equ $1D ;29
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
CROut equ $FD8E ;Carriage return
** Command Code **
StatusCmd equ 0
** Status Code **
* StatusDIB equ 3
StatusUNI equ 5
*
ControlCmd equ 4
** Control Codes **
Eject equ 4
Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
*****************************************************
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
*** Eject ***
jsr Dispatch
dfb ControlCmd
dw E_JECT
*** Set Address ***
jsr Dispatch
dfb ControlCmd
dw SET_ADD
*
jsr EXEC ; Jump the Error routine
rts
*********************************************
Error equ *
*
* There's either no PC around, or there was no give message
*
ldx #0
err1 equ *
lda Message,x
beq errout
jsr COut
inx
bne err1
*
errout equ *
rts
*
Message asc 'NO PC OR NO DEVICE'
dfb $8D,0
*********************************************
*
** Set the Input Value first **
EXEC lda N1
sta $8111 ; Absolute addressing
lda N1+1
sta $8112
*** Download ***
jsr Dispatch
dfb ControlCmd
dw DOWNLOAD
** Execute **
jsr Dispatch
dfb ControlCmd
dw EXE
READ jsr Dispatch
dfb StatusCmd
dw DParms
bcs Error
*
**** Store Output results in //c ****
*
lda UNIX_reg
sta RSLT ; Store the result
lda UNIY_reg
sta RSLT+1
*
rts
******************************************************
FindPC equ *
*
* Search slot 7 to slot 1 looking for signature bytes
*
ldx #7 ;Do for seven slots
lda #$C7
sta ZPTempH
lda #$00
sta ZPTempL
*
newslot equ *
ldy #7
*
again equ *
lda (ZPTempL),y
cmp sigtab,y ;One for byte signature
beq maybe ;Found one signature byte
dec ZPTempH
dex
bne newslot
*
* if we get here, no PC find
sec
rts
*
* if we get here, no byte find on PC
maybe equ *
dey
dey ;if N=1 then all sig bytes OK
bpl again
* Found PC interface. Set up call address.
* we already have high byte ($CN), we need low byte
*
foundPC equ *
lda #$FF
sta ZPTempL
ldy #0 ;For indirect load
lda (ZPTempL),y ;Get the byte
*
* Now the Acc has the low oreder ProDOS entry point.
* The PC entry is three locations past this ...
*
clc
adc #3
sta ZPTempL
*
* Now ZPTempL has PC entry point.
* Return with carry clear.
*
clc
rts
***********************************************************
*
* There are the PC signature bytes in their relative order.
* The $FF bytes are filler bytes and are not compared.
*
sigtab dfb $FF,$20,$FF,$00
dfb $FF,$03,$FF,$00
*
Dispatch equ *
jmp (ZPTempL) ;Simulate an indirect JSR to PC
*
*** Status Parameter Set for UNI ***
DParms equ *
DPParmsCt dfb 3 ;Status calls have three parameters
DPUnit dfb 1
DPBuffer dw UNI
DPStatCode dfb StatusUNI
*
*
*
*** Status List UNI ***
UNI equ *
dfb 0
UNIError dfb 0
UNIRetries dfb 0
UNIAcc_reg dfb 0
UNIX_reg dfb 0
UNIY_reg dfb 0
UNIP_val dfb 0
HHH dfb 0
*
*** Set Address ***
SET_ADD equ *
dfb 3
dfb 1
dw CNTL_LIST3
dfb SetDWLoad
*
*** Download ***
DOWNLOAD equ *
dfb 3
dfb 1
dw CNTL_LIST4
dfb DWLoad
*
*** Execute ***
EXE equ *
dfb 3
dfb 1
dw CNTL_LIST2
dfb Run
*** Eject ***
E_JECT equ *
dfb 3
dfb 1
dw CNTL_LIST1
dfb Eject
*
******** CONTROL LISTS ********
*
*
*** Eject ***
CNTL_LIST1 equ *
dw $0000
*
*** Execute ***
CNTL_LIST2 equ *
Clow_byte dfb $06
Chigh_byte dfb $00
AccValue dfb $00 ; Input Value
X_reg dfb $00 ; Input Value (N1)
Y_reg dfb $00 ; Input Value (N2)
ProStatus dfb $00 ; Input Value
LowPC_reg dfb $05 ; Like ORG
HighPC_reg dfb $05
*
*** Set Address ***
CNTL_LIST3 equ *
CountL_byte dfb $02
CountH_byte dfb $00
LByte_Addr dfb $05 ; Like ORG
HByte_Addr dfb $05
*
*** Download ***
CNTL_LIST4 equ *
LenghtL_byte dfb $4A ;<----- Lenght of Unidisk program Lo Byte
LenghtH_byte dfb $00 ;<----- Lenght of Unidisk program Hi Byte
*
*** Start UNIDISK Program ***
** Two byte adc **
org $0505
RSLTU equ $C0
NDEC equ $C2
N equ $C4
** Save the N number **
lda N1U
sta N
lda N1U+1
sta N+1
** Set RSLTU=N **
lda N
sta RSLTU ; N Lo
lda N+1
sta RSLTU+1 ; N Hi
LOOP lda N
beq HI ; If NLo =0 dec NHi
** Set NDEC=N-1 Lo **
dec A
sta NDEC ; N-1 Lo
** Set NDEC=N Hi **
lda N+1
sta NDEC+1 ; NHi = NDEC Hi
jmp ENTRY
** Set NDEC=N-1 Hi **
HI lda N+1
beq DONE ; If also NHi =0 done
dec A
sta NDEC+1 ; N-1 Hi
lda #$FF
sta NDEC ; N-1 Lo = FF Set NDEC to FF
ENTRY clc
lda RSLTU ; Lo Byte
adc NDEC ; N+(N-1)
sta RSLTU
lda RSLTU+1 ; Hi Byte
adc NDEC+1 ; N+(N-1)
sta RSLTU+1
** Update N=NDEC **
lda NDEC
sta N
lda NDEC+1
sta N+1
jmp LOOP
** Output Data **
DONE ldx RSLTU
ldy RSLTU+1
rts
** Input Dynamic Data append in the end of Unidisk routine **
N1U dfb $00
dfb $00