Jump to content
IGNORED

Playground


senior_falcon

Recommended Posts

(as an aside.. an EA#5 loader from TI BASIC. How this would have killed back in the day.... ;) )

 

Oh gawd, yes! Could you imagine being able to go back into time, say 1983, then walking into an anonymous TI-User group in some unknown city... then pulling that little piece of wizardry out of your diskette case and showing it off? I can only imagine the reaction.

  • Like 1
Link to comment
Share on other sites

  • 2 months later...

STARTBUFFER could be anywhere. So you include the text at the front of the buffer. This way you can look at VDP ram with Classic99's debugger to find out where the buffer actually is. If you do any CALL FILES other than 3 it will be in a different location. But none of that matters - when a program runs under playground it figures out where where the embedded code is. If you created a program with a standard TI disc controller with CALL FILES(3) and then load it with a CF7 it will be in a different location in VDP, but all that gets taken care of by the playground loader.

Link to comment
Share on other sites

STARTBUFFER could be anywhere. So you include the text at the front of the buffer. This way you can look at VDP ram with Classic99's debugger to find out where the buffer actually is. If you do any CALL FILES other than 3 it will be in a different location. But none of that matters - when a program runs under playground it figures out where where the embedded code is. If you created a program with a standard TI disc controller with CALL FILES(3) and then load it with a CF7 it will be in a different location in VDP, but all that gets taken care of by the playground loader.

 

In light of post #48 and what I think you just said, a program of >800 bytes will be loaded in the topmost part of VRAM to include the highest available VRAM location stored in >8370. If that is the case, there is surely some way to discover that last location so that >8370 can be restored without the convoluted checking we have been implementing in @Gazoo’s “Programing challenge” thread.

 

...lee

Link to comment
Share on other sites

Lee provided the insight needed to figure out how to restore the value at >8370.

Below is the first program from post #48 mentioned above:

R0 points to the 1st byte in BUFFER. When we set it up as described in post #48 we wanted to reserve >0772 bytes for the buffer, so if you add >0771 to R0 it will point to the highest available address in VDP ram, which just happens to be the number that was in >8370. You'll see the 2 lines of code needed to restore >8370

 

N.B. The buffer must be an even number of bytes. Either playground or the assembler does some rounding and the address will be off by a byte if your buffer is an odd number of bytes in length.

 

This works with any CALL FILES in BASIC with a ti controller. These all give an odd number in >8370. If the CF7 needs 8 more bytes there should be no problem, however if for some reason it gives an even number in >8370, then it is possible that the value will be off by one byte. (I have no way to test this.)

 

(edit) Just to recap: once embedded, the last byte of BUFFER will be the last byte of the BASIC program. When you load a BASIC program, the last byte of the program is at the highest available address in VDP ram. Since we know the address of the start of BUFFER and the length it is easy to find the highest available address and plug it into >8370.





*Move Loader from VDP to CPU for Gazoo, March 22,2015
        
WKSP	EQU >83A2			don't need the PAGE, SUB, SUBPAG equates
LD2CPU	DATA BUFFER-LD2CPS		Length of page to load to >8300
LD2CPS	LI R0,BUFFER-1
	A R13,R0			R0 will point to start of buffer in VDP
	LI R1,>3000			will move buffer to >3000 in CPU
	MOVB @WKSP+1,*R15		VDPWA is in R15
	MOVB R0,*R15
LDRLP	MOVB *R14,*R1+		        Read the byte	
	CI R1,>3772			read them all?
	JNE LDRLP			no, keep looping

        AI R0,>0771       !!! now R0 points to last byte in BUFFER
        MOV R0,@>8370     !!! which is highest available address in VDP ram
        
	B @>3000			done, start program
BUFFER	TEXT 'STARTBUFFER12345'  	>10 bytes long
	BSS >0762  			loader is >0772 bytes long  	
	
	END
Edited by senior_falcon
  • Like 1
Link to comment
Share on other sites

Bravo! :thumbsup: :thumbsup: :thumbsup:

 

... If the CF7 gives an even number in >8370, then it is possible that the value will be off by one byte. (I have no way to test this.)

 

The CF7 gives an odd number exactly 8 bytes lower than the TI, viz., >37CF for max of 3 files. BwG gives 2 bytes lower than TI: >37D5.

 

...lee

Edited by Lee Stewart
Link to comment
Share on other sites

Bravo! :thumbsup: :thumbsup: :thumbsup:

 

 

The CF7 gives an odd number exactly 8 bytes lower than the TI, viz., >37CF for max of 3 files. BwG gives 2 bytes lower than TI: >37D5.

 

...lee

 

BASGRMLOAD.dsk

 

Can you try this disk, Lee? It apparently works in classic99 with the TI Disk Controller code banked in, so it should work on a real TI.

I finally followed Senior Falcon's directions from his original post coupling it with the newest update and it actually worked! (Imagine that :) )

And if your's and SeniorBirdGuy's assumptions are correct, this should work. The disk contains all the work files and the GROMLOAD program file. You'll have to use another disk with the Ubergrom Grom dump to reload the cart. Thanks Guys!

 

Gazoo

  • Like 1
Link to comment
Share on other sites

 

attachicon.gifBASGRMLOAD.dsk

 

Can you try this disk, Lee? It apparently works in classic99 with the TI Disk Controller code banked in, so it should work on a real TI.

I finally followed Senior Falcon's directions from his original post coupling it with the newest update and it actually worked! (Imagine that :) )

And if your's and SeniorBirdGuy's assumptions are correct, this should work. The disk contains all the work files and the GROMLOAD program file. You'll have to use another disk with the Ubergrom Grom dump to reload the cart. Thanks Guys!

 

Gazoo

 

OK, Chief, I’ll get on it right away!

 

...lee

Link to comment
Share on other sites

 

attachicon.gifBASGRMLOAD.dsk

 

Can you try this disk, Lee? It apparently works in classic99 with the TI Disk Controller code banked in, so it should work on a real TI.

I finally followed Senior Falcon's directions from his original post coupling it with the newest update and it actually worked! (Imagine that :) )

And if your's and SeniorBirdGuy's assumptions are correct, this should work. The disk contains all the work files and the GROMLOAD program file. You'll have to use another disk with the Ubergrom Grom dump to reload the cart. Thanks Guys!

 

Gazoo

 

... and of course the next thing to create is a 90k disk that loads BOOT with no cart and a nice EA5-program-menu configured. Put the disk in any TI with 32k memory and run a TI BASIC program that loads and runs a menu of assembly programs would be cool!

 

BASICLOAD is 10 sectors and BOOT is 50 sectors, so subtract 60 sectors from 358 and you get 298 sectors.

 

So here's the challenge - submit a disk with the BOOT program and a bunch of EA5 programs configured in BOOT. There should be 10 free sectors on the disk to put the BASICLOAD program.

 

Won't that be a cool demo in November! ;)

 

Gazoo

  • Like 1
Link to comment
Share on other sites

 

attachicon.gifBASGRMLOAD.dsk

 

Can you try this disk, Lee? It apparently works in classic99 with the TI Disk Controller code banked in, so it should work on a real TI.

I finally followed Senior Falcon's directions from his original post coupling it with the newest update and it actually worked! (Imagine that :) )

And if your's and SeniorBirdGuy's assumptions are correct, this should work. The disk contains all the work files and the GROMLOAD program file. You'll have to use another disk with the Ubergrom Grom dump to reload the cart. Thanks Guys!

 

Gazoo

 

It works! :-o

 

It still doesn't pass the GROM checker; but, BASICLOAD loads and runs GROMLOAD. I can't get a compressed EA3 file to run from option B (TIW/EA); but, again, without a pass by the GROM checker, I shouldn’t complain.

 

...lee

Link to comment
Share on other sites

  • 5 months later...

@Lee and Dragonstomper I am truly amazed by your skills and tenacity towards Gazoo's challenge. I am so glad that he could see his last challenge accomplished thanks to your help. I think that what you 3 did is holywood material. Was software your hobby or did you work as software developers during your life? You seem to be pros,

Link to comment
Share on other sites

@Lee and Dragonstomper I am truly amazed by your skills and tenacity towards Gazoo's challenge. I am so glad that he could see his last challenge accomplished thanks to your help. I think that what you 3 did is holywood material. Was software your hobby or did you work as software developers during your life? You seem to be pros,

 

Yes to both parts of your question—though I am not sure I would put myself in the same league as Harry (@senior_falcon) even though I, quite possibly, have been at the software game longer than he. There are quite a few similarly able folks on this forum, by the way—in hardware as well as software.

 

...lee

  • Like 1
Link to comment
Share on other sites

@Lee and @Dragonstomper and any developer in these wonderful forums, would you feel like sharing some software dev experiences with us in some new threads that we can read and learn from you. I mean real life experiences of what you did during your lifetime, to be shared and stored digitally for many years to come. I am sure you all made great things in your lifetime and not just a boring 9 to 5 job. Were you part of a team writing games on the TI? or some other popular console ? The challenges, the failures, the long hours and finally the successes. We hear about Wozniac, Jobs and Gates but I am sure the real people behind the great successes are the soldiers like you "The unsung heroes". Thanks for your time, genius and persistence to ensure you leave this world a little better than you found it. I am 48 and wrote a few basic applications for the TI back 30 years ago but nothing compared to the wonder I am seeing here. Keep it up.

  • Like 1
Link to comment
Share on other sites

Spoiler


*Kid Dis/Assembler
*Dis/Assembler for TI99/4A console
*and 1 tape recorder only,uses the
*PlayGround Loader by Harry Wilhelm
*For big Kids ONLY!
*Easier to code pages at _Y00
*_YZZ Branchs and DATAs   (BL >83ZZ)
*     size to copy at _XFE(DATA >00ZZ)
*MOVE/SAVE page if wanted
*pages >A___ are at 1___ so
*POP/RETURN >A008 is at 1008
*To load a PG program:
*____ AORG >0F44 BVDP-SPG
*0F44 COPY "CS1" code at BVDP+2

CALL EQU >837E push caller PC + ...
NEXT EQU >8384 push called page
RET EQU >8386 push nothing

WKSP EQU >83A2 workspace
PAD EQU >8300 scratchpad ram

L0 EQU WKSP+1 less    "       "
M1 EQU WKSP+2
L1 EQU WKSP+3
M2 EQU WKSP+4
L2 EQU WKSP+5
M3 EQU WKSP+6
L4 EQU WKSP+9
L5 EQU WKSP+11
M6 EQU WKSP+12
L6 EQU WKSP+13
L7 EQU WKSP+15
L8 EQU WKSP+17
L11 EQU WKSP+23
L12 EQU WKSP+25

PAB EQU >0320 peripheral access block
BUF EQU >8346 print/read buffer
PTR EQU >8376 code pointer
BLN EQU >02E0 base line to display to
BVDP EQU >0FFE base vdp to code to
SPG EQU 186 size playground loader
SSB EQU >0700 saved screen buf

*dummy page to pass POP/RETURN
DUM DATA DUME-DUM-2
 BL @RET
 DATA MOD
DUME

*pops Program Counter and page from stack
POP DATA POPE-POPS
POPS
 INCT R9 Stack Pointer
 MOV *R9,R11 PC\
 INCT R9        >could be MOV *R9+,R11
 MOV *R9,R12 page
 A R13,R12
 MOVB @L12,*R15
 MOVB R12,*R15

 INCT R11
 LI R12,>8300
 JMP POPS+>94
POPE

*modifies loader to use stack
MOD DATA MODE-MOD-2
 LI R9,>8370 SP
 LI R11,>0649 = CALL DECT R9
 MOV R11,@>837E
 LI R12,>C64B =  MOV R11,R9  PC
 MOV R12,@>8380
 MOV R11,@>8382  DECT R9
 LI R12,>C65B = NEXT MOV *R11,R9 page
 MOV R12,@>8384
*               RET
 BL @NEXT
 DATA BEG
MODE

MOVVDP DATA MOVVDE-MOVVDP-2
 ORI R1,>4000
 SOC R3,R3
 JGT MOVVD1

 A R2,R0 backward
 DEC R0
 A R2,R1
 DEC R1
MOVVD1
 MOVB @L0,*R15
 MOVB R0,*R15
 A R3,R0
 MOVB *R14,R11
 MOVB @L1,*R15
 MOVB R1,*R15
 A R3,R1
 MOVB R11,*R10
 DEC R2
 JNE MOVVD1

 BL @RET
 DATA POP
MOVVDE
 COPY "KDA2"


GPLLNK DATA GPLLNE-GPLLNS
GPLLNS
 CLR R11
 JMP GPLH
GPLHR
 MOV @>0050,R4
 MOV @WKSP+0,R6
 BL *R4
 INCT @>8373
 MOV @GPLXAD-GPLLNS+PAD,@>8302(R4)
 B @>0060

 DATA GPLXRT-GPLLNS+PAD
GPLXAD DATA >1675
GPLXRT
 MOV @>166C,R4
 BL *R4
 LWPI WKSP

 LI R11,>0649 = DEC R9 scroll dels
 MOV R11,@>837E

 MOVB R12,@>8373 restores subtask pointer
 BL @NEXT
 DATA DSRRE
GPLH
 MOVB @>8373,R12
 MOVB R11,@>8373 set subtask pointer to PAD

 LWPI >83E0
 JMP GPLHR
GPLLNE

EDITOR DATA EDITOE-EDITOS
EDITOS
 CLR R11
 JMP EDITH
EDITHR
 MOV R2,@>8320
 LWPI >83E0
 MOV @>0050,R4
 MOV @M6,R6 old R6 on R6
 BL *R4
 INCT @>8373
 JMP AFT20
 DATA EDIXRT-EDITOS+PAD
EDIXAD DATA >1675
 DATA 0
AFT20
 MOV @EDIXAD-EDITOS+PAD,@>8302(R4)
 JMP AFT2A
 DATA 0
AFT2A
 B @>0060
EDIXRT
 MOV @>166C,R4
 BL *R4
 LWPI WKSP

 LI R11,>D7EB = MOVB clear dels
 MOV R11,@>8388

 MOV @>832A,R1

 MOVB R12,@>8373 restores subtask pointer
 BL @RET
 DATA POP
EDITH
 MOVB @>8373,R12
 MOVB R11,@>8373 set subtask pointer to PAD

 MOV R1,@>832A
 MOV R1,@>835E
 MOVB R0,@>8361 odd
 MOVB @L0,@>8362
 JMP EDITHR
EDITOE

TIT
 BYTE >8A,>8A,>80 **
 BYTE >AB,>C9,>A4,>C9,>D3,>A1,>D3,>CD KiDisAsm
 BYTE >80,>8A,>8A  **
TITE

*begin
*title
*background
*color table
*copies PGloader,MOD,POP
*fills remains 6k vdp with NOPs
*sets PTR after code
BEG DATA BEGE-BEG-2
 LI R3,1

 LI R0,TIT-1
 A R13,R0
 LI R1,BLN+2-32
 LI R2,TITE-TIT
 BL @CALL
 DATA MOVVDP

 LI R12,>8705 VDP7 blue
 MOVB @L12,*R15
 MOVB R12,*R15

 LI R12,>430F 0 basic char set
 MOVB @L12,*R15
 MOVB R12,*R15
 LI R12,>F500 white on blue
 LI R11,17
CLTL
 MOVB R12,*R10
 DEC R11
 JNE CLTL

 BL @NEXT
 DATA BEG2
BEGE

*prints word hex
PWH DATA PWHE-PWH-2
 LI R12,>9E00
 MOVB R12,*R0+

 LI R12,4
 SRC R5,4
PWHL
 MOV R5,R6

 ANDI R6,>0F00
 CI R6,>0900
 JH PWHLE

 AI R6,>9000
 JMP PWHN
PWHLE
 AI R6,>9700
PWHN
 MOVB R6,*R0+

 SRC R5,12
 DEC R12
 JNE PWHL

 SRC R5,12
 BL @RET
 DATA POP
PWHE
 COPY "KDA3"


*main loop start
MLPS DATA MLPSE-MLPS-2
 MOV @PTR,R7
 LI R1,BUF

 MOV R7,R5
 MOV R1,R0
 BL @CALL
 DATA PWH

 LI R12,BLN+>4000
 MOVB @L12,*R15
 MOVB R12,*R15
 LI R12,4
 INC R1
P1L
 MOVB *R1+,*R10
 DEC R12
 JNE P1L

 MOVB @L7,*R15
 MOVB R7,*R15
 NOP
 MOVB *R14,R5
 MOVB *R14,@L5

 BL @NEXT
 DATA FPOC
MLPSE

*main loop end
MLPE DATA MPLEE-MLPE-2
 LI R6,>56CD scroll
 BL @CALL
 DATA EDITOR
 LI R11,>0649 = DEC R9 scroll dels
 MOV R11,@>837E

 BL @NEXT
 DATA MLPS
MPLEE

BEG2 DATA BEG2E-BEG2-2
 LI R0,>A000-SPG-1
 A R13,R0
 LI R1,BVDP-SPG
 LI R2,SPG+MODE-DUM
 BL @CALL
 DATA MOVVDP

 MOVB @L1,*R15
 MOVB R1,*R15
 LI R11,>1000 NOP
 LI R12,>1800-MODE+DUM
 SRL R12,1
NEL
 MOVB R11,*R10
 MOVB @L11,*R10
 DEC R12
 JNE NEL

 LI R12,BVDP+MODE-DUM
 MOV R12,@PTR
 BL @NEXT
 DATA MLPE
BEG2E

LST
 DATA >ADAF,>B6A5,>000F,>B3A1,>B6A5,>0009 MOVE SAVE
 DATA >A5AE,>A480,>000C,>A3AF,>B0B9,>000D END COPY
 DATA >A1AF,>B2A7,>000E AORG
OCLST
 DATA >A180,>8080,>A001,>A1A2,>8080,>B001 A AB
 DATA >A1A2,>B380,>0746,>A1A9,>8080,>022A
 DATA >A1AE,>A4A9,>024A,>A280,>8080,>0446
 DATA >A2AC,>8080,>0686,>A2AC,>B7B0,>0406
 DATA >A380,>8080,>8001,>A3A2,>8080,>9001
 DATA >A3A9,>8080,>028A,>A3AC,>B280,>04C6
 DATA >A3AF,>A380,>2003,>A3BA,>A380,>2403
 DATA >A4A5,>A380,>0606,>A4A5,>A3B4,>0646
 DATA >A4A9,>B680,>3C03,>A9AE,>A380,>0586
 DATA >A9AE,>A3B4,>05C6,>A9AE,>B680,>0546
 DATA >AAA5,>B180,>1302,>AAA7,>B480,>1502
 DATA >AAA8,>8080,>1B02,>AAA8,>A580,>1402
 DATA >AAAC,>8080,>1A02,>AAAC,>A580,>1202
 DATA >AAAC,>B480,>1102,>AAAD,>B080,>1002
 DATA >AAAE,>A380,>1702,>AAAE,>A580,>1602
 DATA >AAAE,>AF80,>1902,>AAAF,>A380,>1802
 DATA >AAAF,>B080,>1C02,>ACA4,>A3B2,>3003
 DATA >ACA9,>8080,>020A,>ACA9,>ADA9,>030B
 DATA >ACB7,>B0A9,>02EB,>ADAF,>B680,>C001
 DATA >ADAF,>B6A2,>D001,>ADB0,>B980,>3803
 DATA >AEA5,>A780,>0506,>AFB2,>A980,>026A
 DATA >B2B4,>B7B0,>0387,>B380,>8080,>6001
 DATA >B3A2,>8080,>7001,>B3A2,>AF80,>1D02
 DATA >B3A2,>BA80,>1E02,>B3A5,>B4AF,>0706
 DATA >B3AC,>A180,>0A05,>B3AF,>A380,>E001
 DATA >B3AF,>A3A2,>F001,>B3B2,>A180,>0805
 COPY "KDA4"


 DATA >B3B2,>A380,>0B05,>B3B2,>AC80,>0905
 DATA >B3B4,>A3B2,>3403,>B3B4,>B3B4,>02C8
 DATA >B3B4,>B7B0,>02A8,>B3B7,>B0A2,>06C6
 DATA >B3BA,>A380,>4001,>B3BA,>A3A2,>5001
 DATA >B4A2,>8080,>1F02,>B880,>8080,>0486
 DATA >B8AF,>B080,>2C03,>B8AF,>B280,>2803 XOP XOR
 DATA >A4A1,>B4A1,>0000 DATA

*finds print operation code
FPOC DATA FPOCE-FPOCS
FPOCS
 LI R6,OCLST-1
 A R13,R6
 MOVB @L6,*R15
 MOVB R6,*R15
FPOCN
 CLR R1
FPOCL
 MOVB *R14,@M2(R1)
 INC R1
 CI R1,6
 JNE FPOCL

 MOV R4,R8
 MOV R5,R6
 ANDI R8,>000F
 ANDI R4,>FFF0
 SLA R8,1
 MOV @FLST-FPOCS+PAD(R8),@LAB-FPOCS+PAD+2
LAB ANDI R6,0
 C R4,R6
 JNE FPOCN

 BL @CALL
 DATA SPBUF

 BL @NEXT
 DATA EDIT
FLST DATA 0,>F000,>FF00,>FC00,>FC00,>FF00,>FFC0
 DATA >FFFF,>FFF0,>FC00,>FFF0,>FFFF
FPOCE

*positions cursor on error
POER DATA EDITE-POER-2
 LI R6,>0036 bad tone
 BL @CALL
 DATA EDITOR

 AI R0,-BUF+BLN+4
 JMP AFPO

*edits line/reads DATAs
EDIT DATA EDITE-EDIT-2
 LI R0,BLN+5 cursor position
AFPO
 LI R2,BLN+5 start of line
 LI R1,BLN+5+24 end/size of line
 LI R6,>2A4F 3rd entry editor
 BL @CALL
 DATA EDITOR

 CLR R1
 MOVB @>8375,R1

 MOV @PTR,R7

 CI R1,>0D00
 JNE NOENT

 BL @RET
 DATA SRBUF
NOENT
 MOVB @L7,*R15
 MOVB R7,*R15
 LI R2,>A4A1 DA
 MOVB *R14,R5
 MOVB *R14,@L5

 LI R3,>B4A1 TA
 CLR R8
 BL @CALL
 DATA SPBUF

 CI R1,>0B00
 JNE DWN

 DECT @PTR
 JMP SCRO
DWN
 INCT @PTR
SCRO
 BL @NEXT
 DATA MLPE
EDITE

*sets read buffer
SRBUF DATA SRBUFE-SRBUF-2
 LI R0,BLN+5
 MOVB @L0,*R15
 MOVB R0,*R15

 LI R0,BUF

 MOV R0,R11
 LI R12,26
VD2RA
 MOVB *R14,*R11+
 DEC R12
 JNE VD2RA

 LI R1,>8080
 MOV R1,R2
 MOVB R1,R11
CPOCL
 MOVB *R0+,@M1(R12)
 CB R11,@M1(R12)
 JEQ OCEND

 INC R12
 CI R12,6
 JNE CPOCL

 DEC R0
 BL @NEXT
 DATA POER
OCEND
 BL @RET
 DATA FROC
SRBUFE
 COPY "KDA5"


*finds read operation code
FROC DATA FROCE-FROC-2
 LI R6,LST-1
 A R13,R6
 MOVB @L6,*R15
 MOVB R6,*R15
 LI R6,5+64+1
FROCN
 CLR R12
GETL
 MOVB *R14,@M3(R12)
 INC R12
 CI R12,6
 JNE GETL

 C R1,R3
 JNE FROCW

 C R2,R4
 JEQ NERRD
FROCW
 DEC R6
 JNE FROCN

 LI R0,BUF+1
 BL @NEXT
 DATA POER
NERRD
 BL @RET
 DATA DSTR
FROCE

*prints immediate word hex
PIWH DATA PIWHE-PIWH-2
 MOV R5,R8

 INCT R7
 MOVB @L7,*R15
 MOVB R7,*R15
 NOP
 MOVB *R14,R5
 MOVB *R14,@L5
 BL @CALL
 DATA PWH

 MOV R8,R5
 BL @RET
 DATA POP
PIWHE

*prints addressing mode
PAM DATA PAME-PAM-2
 MOV R5,R4
 ANDI R4,>0030
 CI R4,>0020
 JNE PAMAS

 LI R12,>A000
 MOVB R12,*R0+

 BL @CALL
 DATA PIWH
 ANDI R8,>000F
 SOC R8,R8
 JNE PAMPA

 BL @RET
 DATA POP
PAMPA
 LI R12,>8800
 MOVB R12,*R0+

 JMP PAMR
PAMAS
 CI R4,>0010
 JL PAMR

 LI R12,>8A00
 MOVB R12,*R0+
PAMR
 BL @NEXT
 DATA PAM2
PAME

*prints nibble decimal
PND DATA PNDE-PND-2
 CI R6,>0A00
 JL PNDN

 AI R6,->0A00
 LI R12,>9100
 MOVB R12,*R0+
PNDN
 AI R6,>9000
 MOVB R6,*R0+

 BL @RET
 DATA POP
PNDE

PAM2 DATA PAM2E-PAM2-2
 MOV R5,R6
 ANDI R6,>000F
 SRC R6,8
 BL @CALL
 DATA PND
 CI R4,>0030
 JNE PAMX

 LI R12,>8B00
 MOVB R12,*R0+
PAMX
 CI R4,>0020
 JNE PAMX2

 LI R12,>8900
 MOVB R12,*R0+
PAMX2
 BL @RET
 DATA POP
PAM2E

*prints buffer
PBUF DATA PBUFE-PBUF-2
 LI R11,BLN+5+>4000
 MOVB @L11,*R15
 MOVB R11,*R15

 LI R11,BUF
 LI R12,25
RA2VD
 MOVB *R11+,*R10
 DEC R12
 JNE RA2VD

 BL @RET
 DATA POP
PBUFE

*prints type 0
PT0 DATA PT0E-PT0-2
 BL @CALL
 DATA PWH

 BL @RET
 DATA PBUF
PT0E

*prints type 1
PT1 DATA PT1E-PT1-2
 BL @CALL
 DATA PAM

 LI R12,>8C00
 MOVB R12,*R0+

 SRC R5,6
 BL @CALL
 DATA PAM

 BL @RET
 DATA PBUF
PT1E

*prints type 2
PT2 DATA PT2E-PT2-2
 MOV R7,R12
 INCT R12
 SLA R5,8
 SRA R5,7
 A R12,R5
 BL @CALL
 DATA PWH

 BL @RET
 DATA PBUF
PT2E

*prints type 3/4/9
PT3 DATA PT3E-PT3-2
 BL @CALL
 DATA PAM

 LI R12,>8C00
 MOVB R12,*R0+

 MOV R5,R6
 SRC R6,6
 ANDI R6,>000F
 SRC R6,8
 BL @CALL
 DATA PND

 BL @RET
 DATA PBUF
PT3E
 COPY "KDA6"


*prints type 5
PT5 DATA PT5E-PT5-2
 MOV R5,R6
 ANDI R6,>000F
 SRC R6,8
 BL @CALL
 DATA PND

 LI R12,>8C00
 MOVB R12,*R0+

 MOV R5,R6
 ANDI R6,>00F0
 SRC R6,12
 BL @CALL
 DATA PND

 BL @RET
 DATA PBUF
PT5E

*prints type 6
PT6 DATA PT6E-PT6-2
 BL @CALL
 DATA PAM
 JMP PT7+2

*prints type 7
PT7 DATA PT6E-PT7-2
 BL @RET
 DATA PBUF
PT6E

*prints type 8
PT8 DATA PT8E-PT8-2
 MOV R5,R6
 ANDI R6,>000F
 SRC R6,8
 BL @CALL
 DATA PND

 BL @RET
 DATA PBUF
PT8E

*prints type 10
PTA DATA PTAE-PTA-2
 MOV R5,R6
 ANDI R6,>000F
 SRC R6,8
 BL @CALL
 DATA PND

 LI R12,>8C00
 MOVB R12,*R0+
 JMP PTB+2

*prints type 11
PTB DATA PTAE-PTB-2
 BL @CALL
 DATA PIWH

 BL @RET
 DATA PBUF
PTAE

*sets print buffer and decodes
SPBUF DATA SPBUFE-SPBUFS
SPBUFS
 LI R0,BUF

 MOV R0,R11
 LI R4,>8000
 LI R12,26
CLRBUF
 MOVB R4,*R11+
 DEC R12
 JNE CLRBUF
SPBUFL
 MOVB @M2(R12),*R0+
 CB @M2(R12),R4
 JEQ OCE

 INC R12
 JMP SPBUFL
OCE
 MOV @TYPDL-SPBUFS+PAD(R8),@TYPDL-SPBUFS+PAD
 BL @NEXT
TYPDL DATA PT0,PT1,PT2,PT3,PT3,PT5,PT6,PT7,PT8
 DATA PT3,PTA,PTB
SPBUFE

*tests hex sign
TG DATA TDE-TG-2
 CI R6,>9E00 >
 JEQ NER

 JMP ER
*tests hex values
TH DATA TDE-TH-2
 CI R6,>A600 F
 JH ER

 CI R6,>A100 A
 JL TD+2

 JMP NER
*tests dec values
TD DATA TDE-TD-2
 CI R6,>9900 9
 JH ER

 CI R6,>9000 0
 JL ER
NER
 BL @RET
 DATA POP
ER
 LI R9,>8370
 BL @NEXT
 DATA POER
TDE

*reads word hexadecimal
RWH DATA RWHE-RWH-2
 CLR R6
 MOVB *R0+,R6
 BL @CALL
 DATA TG

 LI R8,4
 CLR R4
RWHL
 MOVB *R0+,R6
 BL @CALL
 DATA TH

 CI R6,>9900 9
 JH H2BLE

 AI R6,->9000
 JMP H2BX
H2BLE
 AI R6,->9700
H2BX
 SOC R6,R4
 SRC R4,12
 DEC R8
 JNE RWHL

 SRC R4,12
 BL @RET
 DATA POP
RWHE

*reads adressing mode
RAM DATA RAME-RAM-2
 CLR R8
 MOVB *R0,R8
 CLR R3

 CI R8,>8A00 *
 JNE TSTAT

 ORI R3,>1000
 JMP REG
TSTAT
 CI R8,>A000 @
 JNE REG2

 ORI R3,>2000
 INC R0
 BL @CALL
 DATA RWH

 MOVB *R0,R8
 CI R8,>8800 (
 JEQ REG

 MOV R3,R6

 BL @RET
 DATA POP
REG
 INC R0
REG2
 BL @NEXT
 DATA RAM2
RAME
 COPY "KDA7"


*reads nibble decimal
RND DATA RNDE-RND-2
 CLR R6
 MOVB *R0+,R6
 BL @CALL
 DATA TD

 CLR R8
 CI R6,>9100 1
 JNE RRDX

 MOVB *R0,R8
 CI R8,>9000 0
 JL RRDX

 CI R8,>9500 5
 JH RRDX

 MOV R8,R6
 INC R0
 AI R6,>0A00 10
RRDX
 AI R6,->9000

 BL @RET
 DATA POP
RNDE

RAM2 DATA RAM2E-RAM2-2
 BL @CALL
 DATA RND

 MOVB *R0,R8

 CI R8,>8B00 +
 JNE RAMT

 CI R3,>1000
 JNE RAM2ER

 ORI R3,>2000
 JMP RAMC
RAMT
 CI R3,>2000
 JNE RAMS

 CI R0,BUF+25
 JEQ RAMS

 CI R8,>8900 )
 JNE RAM2ER
RAMC
 INC R0
RAMS
 SOC R3,R6
 BL @RET
 DATA POP
RAM2ER
 LI R9,>8370
 BL @NEXT
 DATA POER
RAM2E

*writes word at PTR
WWB DATA WWBE-WWB-2
 MOV @PTR,R12
 ORI R12,>4000
 MOVB @L12,*R15
 MOVB R12,*R15
 MOVB R5,*R10
 MOVB @L5,*R10

 INCT @PTR
 BL @RET
 DATA POP
WWBE

*reads type 0 immediate
RT0 DATA RT0E-RT0-2
 BL @CALL
 DATA RWH

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT0NE

 BL @NEXT
 DATA POER
RT0NE
 MOV R4,R5
 BL @CALL
 DATA WWB

 BL @NEXT
 DATA MLPE
RT0E

*reads type 1 source addressing,destination addressing
RT1 DATA RT1E-RT1-2
 BL @CALL
 DATA RAM

 MOVB *R0+,R8
 CI R8,>8C00 ,
 JNE RT1ER

 SRL R6,8
 SOC R6,R5

 MOV R3,R2
 MOV R4,R1

 BL @CALL
 DATA RAM

 CI R0,BUF+25 guess what,no more space!
 JEQ RT1NE

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT1NE
RT1ER
 BL @NEXT
 DATA POER
RT1NE
 BL @NEXT
 DATA RT1B
RT1E

RT1B DATA RT1BE-RT1B-2
 SRL R6,2
 SOC R6,R5
 BL @CALL
 DATA WWB

 CI R2,>2000
 JNE RT1X1

 MOV R1,R5
 BL @CALL
 DATA WWB
RT1X1
 CI R3,>2000
 JNE RT1X2

 MOV R4,R5
 BL @CALL
 DATA WWB
RT1X2
 BL @NEXT
 DATA MLPE
RT1BE

*reads type 2 PC relative
RT2 DATA RT2E-RT2-2
 BL @CALL
 DATA RWH

 MOVB *R0+,R8
 CI R8,>8000
 JNE RT2ER

 MOV R7,R12
 INCT R12
 S R12,R4
 CI R4,-256
 JLT RT2ER2

 CI R4,256
 JLT RT2NE
RT2ER2
 AI R0,-4
RT2ER
 BL @NEXT
 DATA POER
RT2NE
 SLA R4,7
 SRL R4,8
 SOC R4,R5
 BL @CALL
 DATA WWB

 BL @NEXT
 DATA MLPE
RT2E
 COPY "KDA8"


*reads type 3/4/9 source addressing,register/bits
RT3 DATA RT3E-RT3-2
 BL @CALL
 DATA RAM

 MOVB *R0+,R8
 CI R8,>8C00 ,
 JNE RT3ER

 SRL R6,8
 SOC R6,R5

 BL @CALL
 DATA RND

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT3NE
RT3ER
 BL @NEXT
 DATA POER
RT3NE
 SRL R6,2
 SOC R6,R5
 BL @CALL
 DATA WWB

 CI R3,>2000
 JNE RT3X

 MOV R4,R5
 BL @CALL
 DATA WWB
RT3X
 BL @NEXT
 DATA MLPE
RT3E

*reads type 5 register,count
RT5 DATA RT5E-RT5-2
 BL @CALL
 DATA RND

 MOVB *R0+,R8
 CI R8,>8C00 ,
 JNE RT5ER

 SRL R6,8
 SOC R6,R5

 BL @CALL
 DATA RND

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT5NE
RT5ER
 BL @NEXT
 DATA POER
RT5NE
 SRL R6,4
 SOC R6,R5

 BL @CALL
 DATA WWB

 BL @NEXT
 DATA MLPE
RT5E

*reads type 6 destination addressing
RT6 DATA RT6E-RT6-2
 BL @CALL
 DATA RAM

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT6NE

 BL @NEXT
 DATA POER
RT6NE
 SRL R6,8
 SOC R6,R5
 BL @CALL
 DATA WWB

 CI R3,>2000
 JNE RT6X

 MOV R4,R5
 JMP RT7+2

*reads type 7 nothing
RT7 DATA RT6E-RT7-2
 BL @CALL
 DATA WWB
RT6X
 BL @NEXT
 DATA MLPE
RT6E

*reads type 8 register
RT8 DATA RT8E-RT8-2
 BL @CALL
 DATA RND

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RT8NE

 BL @NEXT
 DATA POER
RT8NE
 SRL R6,8
 SOC R6,R5
 BL @CALL
 DATA WWB

 BL @NEXT
 DATA MLPE
RT8E

*reads type 10 register,immediate
RTA DATA RTAE-RTA-2
 BL @CALL
 DATA RND

 MOVB *R0+,R8
 CI R8,>8C00 ,
 JNE RTBER

 SRL R6,8
 SOC R6,R5
 JMP RTB+2

*reads type 11 immediate
RTB DATA RTAE-RTB-2
 BL @CALL
 DATA WWB

 BL @CALL
 DATA RWH

 MOVB *R0+,R8
 CI R8,>8000
 JEQ RTBNE
RTBER
 BL @NEXT
 DATA POER
RTBNE
 MOV R4,R5
 BL @CALL
 DATA WWB

 BL @NEXT
 DATA MLPE
RTAE

*END [>HEXA]
*closes code from BVDP/>HEXA-SPG to PTR
*exits to basic to RUN/SAVE
EN DATA ENE-EN-2
 LI R4,BVDP

 LI R12,>9E00 >
 CB *R0,R12
 JNE ENNE

 BL @CALL
 DATA RWH

 CI R4,>3FFF
 JH ENER

 MOVB *R0+,R8
 CI R8,>8000
 JEQ ENNE
ENER
 BL @NEXT
 DATA POER
ENNE
 C R4,R7
 JH ENER

 LI R6,>56CD scroll
 BL @CALL
 DATA EDITOR
 LI R11,>0649 = DEC R9 scroll dels
 MOV R11,@>837E

 LI R0,>37D7
 BL @RET
 DATA EN2
ENE
 COPY "KDA9"


EN2 DATA EN2E-EN2-2
 MOVB @L0,*R15
 MOVB R0,*R15
 MOV R7,R2
 MOVB *R14,R12
 MOVB *R14,@L12
 CI R12,>FFAA last KDA byte FILES flag
 JEQ STVDP

 LI R0,>3FFF
STVDP

 MOV R0,R6

 S R4,R2
 S R2,R0

 LI R5,SPG
 S R5,R4

 INCT R4
 ORI R4,>4000
 MOVB @L4,*R15
 MOVB R4,*R15

 LI R12,-137
 A R0,R12
 MOVB R12,*R10
 MOVB @L12,*R10
 MOVB *R14,R11
 MOVB *R14,R11
 AI R12,-39
 MOVB R12,*R10
 MOVB @L12,*R10

 INC R0
 S R5,R0

 A R2,R5
 MOV R6,R8

 ORI R6,>4000
 DEC R7

 BL @RET
 DATA EXI
EN2E

EXI DATA EXIE-EXI-2
MOVL
 MOVB @L7,*R15
 MOVB R7,*R15
 DEC R7
 MOVB *R14,R12
 MOVB @L6,*R15
 MOVB R6,*R15
 DEC R6
 MOVB R12,*R10
 DEC R5
 JNE MOVL

 JMP AFTBP lots of basic pointers!
 DATA       >0000,>0000,>0000,>02E2,>0000
 DATA >06F8,>0000,>0000,>02E2,>0000,>0000
 DATA >0000,>0000,>FF00,>0000,>0000,>0000
 DATA >0000
AFTBP
 CLR @>8388

 MOV R0,@>8330
 DEC R0
 MOV R0,@>8340
 DEC R0
 MOV R0,@>8318
 MOV R0,@>831A
 AI R0,9
 MOV R0,@>8332

 MOV R8,@>8370

 LWPI >83E0
 LI R6,>4DED basic END
 B @>0060
EXIE

*SAVE >HEXA,"DEVICE""
*saves code from PTR to >HEXA to file
SA DATA CO2E-SA-2
 LI R1,>0600 save

 BL @CALL
 DATA RWH

 INC R0
 JMP CO2

*COPY "DEVICE"
*copies file to PTR
*sets PTR after code
CO DATA CO2E-CO-2
 LI R1,>0500 load
 LI R4,BVDP+>1800 max vdp address
CO2
 S R7,R4
 CLR R11

 MOVB *R0+,R11
 CI R11,>8200 "
 JEQ CONE
COER
 BL @NEXT
 DATA POER
CONE
 MOV R0,R8
 LI R3,BUF+14+10
 MOV R3,R6
 MOV R11,R12
CO2L
 MOVB *R0+,R11
 AI R11,->6000
 MOVB R11,*R3+
 C R0,R6
 JEQ COER

 CB *R0,R12
 JNE CO2L

 BL @RET
 DATA CO3
CO2E

CO3 DATA CO3E-CO3-2
 S R8,R0

 LI R2,BUF+14

 MOV R2,R8
 MOV R1,*R8+
 AI R7,-8 address
 MOV R7,*R8+
 CLR R12 program
 MOV R12,*R8+
 MOV R4,R3
 AI R4,8 bytes
 MOV R4,*R8+
 LI R12,>6000 bias for CS_
 MOVB R12,*R8+
 MOVB @L0,*R8 name size

 LI R11,PAB+>4000
 MOVB @L11,*R15
 MOVB R11,*R15
 LI R12,10
 A R0,R12
COL3
 MOVB *R2+,*R10
 DEC R12
 JNE COL3

 BL @NEXT
 DATA CO4
CO3E
 COPY "KDA10"


*saves screen before gsr display
SASC DATA SASCE-SASC-2
 CLR R0
 LI R11,SSB+>4000
 LI R2,>300
 JMP SCL

*restores screen after gsr display
RESC DATA SASCE-RESC-2
 LI R0,SSB
 LI R11,>4000
SCL2
 LI R2,32
SCL
 MOVB @L0,*R15
 MOVB R0,*R15
 INC R0
 MOVB *R14,R12
 MOVB @L11,*R15
 MOVB R11,*R15
 INC R11
 MOVB R12,*R10
 DEC R2
 JNE SCL

 CI R0,>300
 JEQ SASCX

 CI R11,>4300
 JEQ SASCX

 LI R2,>B00
DELAY
 DEC R2
 JNE DELAY

 JMP SCL2
SASCX
 BL @RET
 DATA POP
SASCE

CO4 DATA CO4E-CO4-2
 CLR R12 saves code file header overwrites
 MOVB @L7,*R15
 MOVB R7,*R15
COL4
 MOV R3,R2
 MOVB *R14,@M3(R12)
 INC R12
 CI R12,8
 JNE COL4

 MOV R7,R8
 AI R8,4
 CI R1,>0500
 JEQ CO4X

 ORI R8,>4000
 MOVB @L8,*R15
 MOVB R8,*R15

 MOV @PTR,R12
 MOVB R12,*R10
 MOVB @L12,*R10 start of code
 A R12,R2
 DEC R2
 MOVB R2,*R10
 MOVB @L2,*R10 base vdp

 ANDI R8,>BFFF
CO4X
 ORI R7,>4000

 BL @CALL
 DATA SASC

 BL @RET
 DATA DSR
CO4E

DSR DATA DSRE-DSR-2
 LI R12,PAB+9
 MOV R12,@>8356 ptr to PAB name size

 CLR @>8373 set subtask pointer to PAD

 LI R12,>0800 search device
 MOVB R12,@>836D

 LI R12,>37D7
 MOV R12,@>8370 for disk controller

 LI R0,>0010 dsrlnk
 LI R12,>9800
 MOVB R0,@>0402(R12)
 MOVB @L0,@>0402(R12)
 MOVB *R12,R0
 MOVB *R12,@L0
 ANDI R0,>1FFF
 INCT R0 gpl address after FETCH
 BL @RET
 DATA GPLLNK
DSRE

DSRRE DATA DSRREE-DSRRE-2
 BL @CALL
 DATA RESC

 MOVB @L8,*R15
 MOVB R8,*R15
 NOP
 MOVB *R14,R12
 MOVB *R14,@L12
 MOVB *R14,R11
 MOVB *R14,@L11
 S R12,R11 computes code size

 CLR R12
 MOVB @L7,*R15 restores code overwriten
 MOVB R7,*R15
DSRREL
 MOVB @M3(R12),*R10
 INC R12
 CI R12,8
 JNE DSRREL

 LI R12,PAB+1 PAB error
 MOVB @L12,*R15
 MOVB R12,*R15
 NOP
 MOVB *R14,R12
 SOCB R12,R12
 JNE DSRER

 MOVB @>837C,R12 dsr status byte
 ANDI R12,>0400
 JNE DSRNE
DSRER
 LI R0,BUF+7
 BL @NEXT
 DATA POER
DSRNE
 CI R1,>0600
 JEQ DSRREX

 INC R11
 A R11,@PTR
 BL @NEXT
 DATA MLPE
DSRREX
 BL @NEXT
 DATA MLPS
DSRREE
 COPY "KDA11"


*AORG >HEXA
*sets PTR to >HEXA
AO DATA AOE-AO-2
 BL @CALL
 DATA RWH

 CI R4,>3FFF
 JH AOER

 MOVB *R0+,R8
 CI R8,>8000
 JEQ AONE
AOER
 BL @NEXT
 DATA POER
AONE
 MOV R4,@PTR

 BL @NEXT
 DATA MLPE
AOE

*MOVE >HEX1,>HEX2
*copies code from >HEX1 to >HEX2 to PTR
*sets PTR after code
MO DATA MOE-MO-2
 BL @CALL
 DATA RWH
 MOV R4,R3

 INC R0

 BL @CALL
 DATA RWH
 MOV R4,R2

 MOV R3,R0
 MOV R7,R1
 S R3,R2
 A R2,R7

 LI R3,1
 C R0,R1
 JH MOP

 NEG R3
MOP
 BL @CALL
 DATA MOVVDP

 MOV R7,@PTR
 BL @NEXT
 DATA MLPS
MOE

*encodes string
DSTR DATA DSTRE-DSTRS
DSTRS
 MOV R5,R6
 ANDI R5,>FFF0
 ANDI R6,>000F
 SLA R6,1
 MOV @TYPL-DSTRS+PAD(R6),@TYPL-DSTRS+PAD
 BL @NEXT
TYPL DATA RT0,RT1,RT2,RT3,0,RT5,RT6,RT7,RT8
 DATA SA,RTA,RTB,EN,CO,AO,MO
DSTRE

 DATA >00FF
 END
 

Hi all,let me introduce myself i was the pround owner of a ti when was twelve,

34 years ago,I'm from Paris,that's why my english is so poor apologize,and you could
be sure that PARIS WILL LIVE.
I wrote this piece of s... because PLAYGROUND was the prog that always wanted to have.
It's basicaly a simple assembler disassembler in playgroung env.
Let me know what you think about this.
 
 
 

 

KDA.zip

Edited by moije
  • Like 3
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...