Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev to Unidisk #6

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions AppleII/FP-ADD/Unidrive4.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
*
* Unidisk 3.5 Driver <alfa>
*
* File Name: Unidrive4.s
* Description: Floating Point ADD operation
*
* The target of this project is to use the Unidisk 3.5 drive to perform
* specific numerical routines (integers and floating point numbers)
* calculation in order to use it as a Apple II co-processor unit.
Expand All @@ -19,10 +21,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
*
* Protocol Converter Call
XC
XC ; Enable 65C02 INSTRUCTION
TYP $06 ; Binary File Type ignored in Merlin32 (Merlin 16+ RETRO compatibility)
*AUX $8000 ; Auxiliary Type

ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
Expand Down
1 change: 1 addition & 0 deletions AppleII/FP-ADD/_FileInformation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unidrive4=Type(06),AuxType(8000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
143 changes: 143 additions & 0 deletions AppleII/FP-operations/Conv3p.S
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
* @com.wudsn.ide.asm.hardware=APPLE2
************************************
* BASIC TO FAC TO FP1 *
* X=NUMBER *
* CALL 32768,X 768,X *
************************************
org $8000

CHKCOM equ $DEBE
FRMNUM equ $DD67
PTRGET equ $DFE3
MOVMF equ $EB2B
MOVFM equ $EAF9

** Woz FP Accumulator 4 Byte + 1 Byte Extra + 1 Byte SIGN**
FP1 equ $FA ;Translate F8 --> FA
E equ $FE ;Translate FC --> FE
SIGN equ $EB

FP2 equ $EC

** Applesoft FP Accumulator 5 Byte + 1 Byte Sign **
FAC equ $9D

RSLT equ $7000

***************************

ENTRY1 jsr CHKCOM
jsr FRMNUM ;VARIABLE X ->FAC (6 Byte Unpacked)

** FPC to FP1 conversion **

lda FAC
dec A ; dec the EXP
sta FP1
sta FP2 ; Copy

lda FAC+5
bmi NEG ; chk the Hi bit of 1 byte Mantissa

POS clc ; Hi bit 0 for negative
lda FAC+5

ora #$80 ; Set Hi Bit 1 byte Mantissa (change Sign only if is positive)
ror ; Didide for 2^1

sta FP1+1
sta FP2+1 ; Copy

jmp CONT

NEG clc ; Hi bit 1 for positive
lda FAC+5

ror ; Didide for 2^1

eor #$FF ; One's complement, NOT
clc
adc #01 ; Two's complement, +1

sta FP1+1
sta FP2+1 ; Copy

CONT lda FAC+2
ror
sta FP1+2
sta FP2+2 ; Copy

lda FAC+3
ror
sta FP1+3
sta FP2+3 ; Copy FP2=FP1 X2=X1

lda FAC+4
ror
sta E

;brk
rts

************************************
* FP1 TO FAC TO BASIC *
* CALL 32831,Y 831,Y *
* PRINT Y *
************************************

*
** FP1 to FAC conversion **
*
ENTRY2 lda RSLT ; X1 1 Byte --> 9D FAC
inc A ; 2^(FP1+1) inc EXP
sta FAC

lda RSLT+1
bmi NEG2 ; chk the Hi bit of 1 byte Mantissa


POS2 clc
lda RSLT+1 ; M1 Hi 2 Byte --> 9E FAC
rol ; Multiply for 2^1

ora #$80 ; Set Hi Bit 1 byte Mantissa (change Sign only if is positive)
sta FAC+1 ; To 6^ Byte of FAC Unpacked

;sta FAC+5 ; To 1^ Byte Mantissa of FAC UnPacked
jmp CONT2

NEG2 lda RSLT+1

sec
sbc #01 ; One's complement inv -1
eor #$FF ; Two's complement inv NOT

rol ; Multiply for 2^1

sta FAC+1 ; To 1^ Byte Mantissa of FAC Packed
sta FAC+5 ; To 6^ Byte of FAC Unpacked


CONT2 lda RSLT+2 ; M1 3 Byte --> 9F FAC
rol
sta FAC+2

lda RSLT+3 ; M1 Lo 4 Byte --> A0 FAC
rol
sta FAC+3

lda E ; Extra 5 Byte --> A1 FAC
rol
sta FAC+4

;brk
***************************
*
jsr CHKCOM
jsr PTRGET ; Return the Y and A pointing to the specific variabile
tax
jsr MOVMF ;FAC->VARIABLE Y (5 Bytes Packed)

;brk
rts
chk
13 changes: 9 additions & 4 deletions AppleII/Integer-adc-1-Byte/Unicalc.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*
* Unidisk 3.5 Calc <beta>
*
* File Name: Unicalc.s
* Descriprion: 1 Byte Add integer numbers calculation
*
* 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.
Expand All @@ -19,9 +22,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
XC ; Enable 65C02 INSTRUCTION
TYP $06 ; Binary File Type ignored in Merlin32 (Merlin 16+ RETRO compatibility)
*AUX $8000 ; Auxiliary Type

ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
*** Pointers ***
Expand All @@ -47,7 +52,7 @@ Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
org $8000
*****************************************************
* Presentation message **************
*
Expand Down Expand Up @@ -80,7 +85,7 @@ DATA2 asc 'A X Y P'
*
* Find a Protocol Converter in one of the slots.
START jsr FindPC
bcs Error
bcs Error
*
* Now make the DIB call to the first guy
*
Expand Down
1 change: 1 addition & 0 deletions AppleII/Integer-adc-1-Byte/_FileInformation.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Unicalc=Type(06),AuxType(8000),VersionCreate(70),MinVersion(BE),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)
9 changes: 9 additions & 0 deletions AppleII/Integer-adc-2-Byte/UNIFUN2.bas
Original file line number Diff line number Diff line change
@@ -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)
16 changes: 11 additions & 5 deletions AppleII/Integer-adc-2-Byte/Unidrive2.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
*
* Unidisk 3.5 Calc2 <beta>
*
* File Name: Unidrive2.s
* Descriprion: 2 Byte Add integer numbers calculation
*
* 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.
Expand All @@ -19,14 +22,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
*
* Protocol Converter Call
XC
XC ; Enable 65C02 INSTRUCTION
TYP $06 ; Binary File Type ignored in Merlin32 (Merlin 16+ RETRO compatibility)
*AUX $8000 ; Auxiliary Type

ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
N1 equ $19 ;25
N2 equ $1B ;27
N1 equ $19 ;25
N2 equ $1B ;27
RSLT equ $1D ;29
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
Expand All @@ -44,7 +50,7 @@ Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
org $8000
*****************************************************

*
Expand Down
Binary file removed AppleII/Integer-adc-2-Byte/UnidriveU
Binary file not shown.
16 changes: 11 additions & 5 deletions AppleII/Integer-adc-2-Byte/UnidriveU.S
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
*
* Unidisk 3.5 Calc Unimplemented area <beta>
*
* File Name: UnidriveU.s
* Descriprion: 2 Byte Add integer numbers calculation Unimplemented area
* Result: There's no addressed memory or registers in this area
*
* 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.
Expand All @@ -19,14 +23,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*
* @com.wudsn.ide.asm.hardware=APPLE2
* Protocol Converter Call
XC
XC ; Enable 65C02 INSTRUCTION
TYP $06 ; Binary File Type ignored in Merlin32 (Merlin 16+ RETRO compatibility)
*AUX $8000 ; Auxiliary Type

ZPTempL equ $0006 ;Temporary zero page storage
ZPTempH equ $0007
** Zero page storage **
N1 equ $19 ;25
N2 equ $1B ;27
N1 equ $19 ;25
N2 equ $1B ;27
RSLT equ $1D ;29
*** Monitor routines ***
COut equ $FDED ;Console output ASCII
Expand All @@ -44,7 +50,7 @@ Run equ 5
SetDWLoad equ 6
DWLoad equ 7
*
org $8000
org $8000
*****************************************************

*
Expand Down
Loading