Jump to content
IGNORED

TurboBasicXL problem


bob1200xl

Recommended Posts

call no. / iccom / icba / icbl / P-register / A-register / X-Register / Y-Register

 

count / 7 = BGET / buffer address / buffer length / $31 or $81 if Y>=$80 / $10 (channel 1) / CIO Status ($01 = OK, $88 = EOF)

Link to comment
Share on other sites

The problem seems to be that reading the last sector ($ED) does NOT give you an EOF. MyDOS reads sector 1, instead - then loads DUP. On a load from DOS 2.0, it looks like it does get the 136, does a Directory and branches to Prompt.

 

What program gives you that display?

 

Bob

 

 

call no. / iccom / icba / icbl / P-register / A-register / X-Register / Y-Register

 

count / 7 = BGET / buffer address / buffer length / $31 or $81 if Y>=$80 / $10 (channel 1) / CIO Status ($01 = OK, $88 = EOF)

Link to comment
Share on other sites

OK -- I ran TEST.XEX on my HDD system under OmniMon and it loads all the sectors and falls back to DUP, just like before. It does not list any CIO activity at all. I tried it with the 800XL OS and it did the same.

 

I tried it on a stock 1200XL and it ran with a list, like yours did.

 

So, whatever you use to break into the loading chain does not work on my new hardware. How is it supposed to list the disk activity?

 

Bob

 

 

 

Aargh, wrong file uploaded, sorry. Too many foders on C:\ error. Here's the correct one.

Link to comment
Share on other sites

The "test.xex" is a TurboBasic 1.5 Executable where I have exchanged the loader part at $6000 by a modified loader. See attached source. If you don't get any output at all, it means (like you mentioned before) that INIADR=$6000 is not called at all by the DOS. Do you get the "Happy Computer..." loading screen at all (that's the first INIADR segment)?

 

Which is the device the HDD ist mapped to? "D1:"?

 


;
; TurboBasic XL 1.5 - CIO Lister
; Replaces the OS-RAM loader segment at $6000
; JAC! - 2012-02-20
;
opt l+

flag = 1 ;0=original, 1=with CIO lister

iccom = $0002
icbal = $0004
icbah = $0005
icbll = $0008
icblh = $0009

;
; OS variables for XL/XE
;
; page 0 and 2
;

boot = $0009
dosvec = $000a
dosini = $000c
appmhi = $000e
ramtop = $006a
coldst = $0244
iocb0 = $0340
basicf = $03f8

;
; PIA
;
portb = $d301

;
; ANIC
;
nmien = $d40e

;
; ROM vectors
;
.if flag = 0
ciov = $e456
.else
ciov = loader.print_ciov
.endif

;
; Code equates
;
l0097 = $0097
l00a0 = $00a0
l00a1 = $00a1
l00ca = $00ca
l00d4 = $00d4 ;word
l00d6 = $00d6 ;word
l00d8 = $00d8
l00da = $00da ;word
l00dc = $00dc

l208e = $208e
l208f = $208f
l24f8 = $24f8
lb000 = $b000
le000 = $e000
le400 = $e400
le401 = $e401
le424 = $e424
le425 = $e425
lf53a = $f53a
lfffa = $fffa
lfffe = $fffe
l2100 = $2100
l2586 = $2586
lc95f = $c95f
lc9c5 = $c9c5
lcc00 = $cc00
le604 = $e604
;
; Start of code
;

.macro m_push
php
pha
txa
pha
tya
pha
.endm

.macro m_pop
pla
tay
pla
tax
pla
plp
.endm


opt h-
org $2000
ins "turbo15.bin",+0,$1542

opt h+
org $6000
;
.proc loader
ldx le424
ldy le425
inx
sne
iny
stx l24f8
sty l24f8+1
lda #$00
sta nmien
sei
lda #$fe
sta portb
lda #$ab
sta lfffa
lda #$24
sta LFFFa+1
lda #$d0
sta lfffe
lda #$24
sta lfffe+1
lda #>lcc00
jsr copy_charset_to_ram
lda #>LE000
jsr copy_charset_to_ram
lda #$40
sta nmien
cli
lda #$ff
sta portb
jsr load_segments
lda #$00
sta boot
lda dosini
ldy dosini+1
sta l208e
sty l208f
lda #$80
ldy #$20
sta dosini
sty dosini+1
lda #$fe
sta portb
sta l00ca
ldx #$01
stx basicf
stx boot
dex
stx coldst
jsr le604
lda #$00
sta l00a0
sta l00a1
jsr lc95f
ldy #$1f
ldx #$8a
jsr l2586
.proc copy_autorun_bas
ldy #$1e
loop lda autorun_bas,y
sta (l0097),y
dey
bpl loop
.endp
jsr lc9c5
lda #$ff
pha
lda #$ae
pha
jsr open_editor
dec portb

.proc clear_b000
lda #$00
tay
loop sta lb000,y
dey
bpl loop
.endp

jmp lf53a

.local autorun_bas
.byte $00,$00,$19,$07,$0d,$67,$14,$19,$25,$0f,$0d
.byte 'D:AUTORUN.BAS'
.byte $16,$01,$00,$06,$06,$16,$16
.endl

.proc open_editor
lda #$ff
sta portb
lda #$c0
sta ramtop
lsr
sta appmhi+1
lda le401
pha
lda le400
pha
rts
.endp


.proc copy_charset_to_ram
sta l00d4+1
ldy #$00
sty l00d4
ldx #$04
loop
.proc rom_to_buffer
lda #$ff
sta portb

loop lda (l00d4),y
sta l2100,y
iny
bne loop
.endp

.proc buffer_to_ram
dec portb
loop lda l2100,y
sta (l00d4),y
iny
bne loop
.endp

inc l00d4+1
dex
bne loop
rts
.endp

.proc load_segments
ldx #$10
lda #$d6
sta iocb0+icbal,x
lda #$00
sta iocb0+icbah,x
sta iocb0+icblh,x
lda #$04
sta iocb0+icbll,x
lda #$07
sta iocb0+iccom,x
jsr ciov
bmi last_segment

lda #<buffer_l617c
sta l00da
sta iocb0+icbal,x
lda #>buffer_l617c
sta l00da+1
sta iocb0+icbah,x
lda l00d8
sbc l00d6
sta l00dc
lda l00d8+1
sbc l00d6+1
sta l00dc+1
inc l00dc
sne
inc l00dc+1

lda l00dc
sta iocb0+icbll,x
lda l00dc+1
sta iocb0+icblh,x
jsr ciov
bmi cio_error

.proc copy_to_ram
dec portb
ldy #$00
ldx l00dc+1
beq no_hi
hi_loop lda (l00da),y
sta (l00d6),y
iny
bne hi_loop
inc l00d6+1
inc l00da+1
dex
bne hi_loop
no_hi ldx l00dc
beq no_lo
lo_loop lda (l00da),y
sta (l00d6),y
iny
dex
bne lo_loop
no_lo lda #$ff
sta portb
.endp

bmi load_segments
last_segment
; lda #0
; .byte 2
rts
cio_error
.if flag = 1
lda $d20a
sta $d01a
jmp cio_error
.endif
jmp (dosvec)
.endp

.if flag = 1
.proc print_ciov
m_push

inc cio_count
lda cio_count
jsr print_hex

lda #' '
jsr print_char

lda iocb0+iccom,x
jsr print_hex
lda #' '
jsr print_char

lda iocb0+icbah,x
jsr print_hex
lda iocb0+icbal,x
jsr print_hex
lda #' '
jsr print_char

lda iocb0+icblh,x
jsr print_hex
lda iocb0+icbll,x
jsr print_hex
lda #' '
jsr print_char

m_pop
jsr $e456
php
sta tmpa
pla
sta tmpp
pha
stx tmpx
sty tmpy

lda #' '
jsr print_char

lda tmpp
jsr print_hex
lda #' '
jsr print_char
lda tmpa
jsr print_hex
lda #' '
jsr print_char
lda tmpx
jsr print_hex
lda #' '
jsr print_char
lda tmpy
jsr print_hex
lda #' '
jsr print_char

lda #$9b
jsr print_char

key1 lda $d20f
and #12
cmp #12
beq key1

key2 lda $d20f
and #12
cmp #12
bne key2

ldy tmpy
ldx tmpx
lda tmpa
plp
rts

tmpp .byte 0
tmpa .byte 0
tmpx .byte 0
tmpy .byte 0

.proc print_hex
sta tmpa
m_push

lda tmpa
lsr
lsr
lsr
lsr
tay
lda hextab,y
jsr print_char

lda tmpa
and #15
tay
lda hextab,y
jsr print_char

m_pop
rts

tmpa .byte 0
hextab .byte '0123456789ABCDEF'
.endp

.proc print_char
sta tmpa
stx tmpx
sty tmpy
jsr putchar
ldy tmpy
ldx tmpx
lda tmpa
rts

putchar lda $e407
pha
lda $e406
pha
lda tmpa
rts

tmpa .byte 0
tmpx .byte 0
tmpy .byte 0
.endp

cio_count .byte 0
.endp

.endif

.endp

buffer_l617c

;
ini loader

opt h-
org $2000
ins "turbo15.bin",+$16c8

Edited by JAC!
Link to comment
Share on other sites

The HDD isn't mapped anywhere - this is all SIO from a floppy or APE. Even in 1200XL mode, which had NO PBI code at all, TBXL fails.

 

Anyway, no HDD is in play here. Just hardware.

 

If $6000 isn't loading TBXL - what is? How could that happen? Whoever is loading TBXL loads up through the last sector of the file, then reads sector $01, then does a Status commnd to the drive and then loads DUP.

 

Yes, I get the Happy Computer screen and colors.

 

Wow... that's a lot of code.

 

Bob

 

 

The "test.xex" is a TurboBasic 1.5 Executable where I have exchanged the loader part at $6000 by a modified loader. See attached source. If you don't get any output at all, it means (like you mentioned before) that INIADR=$6000 is not called at all by the DOS. Do you get the "Happy Computer..." loading screen at all (that's the first INIADR segment)?

 

Which is the device the HDD ist mapped to? "D1:"?

 


;
; TurboBasic XL 1.5 - CIO Lister
; Replaces the OS-RAM loader segment at $6000
; JAC! - 2012-02-20
;
opt l+

flag = 1 ;0=original, 1=with CIO lister

iccom = $0002
icbal = $0004
icbah = $0005
icbll = $0008
icblh = $0009

;
; OS variables for XL/XE
;
; page 0 and 2
;

boot = $0009
dosvec = $000a
dosini = $000c
appmhi = $000e
ramtop = $006a
coldst = $0244
iocb0 = $0340
basicf = $03f8

;
; PIA
;
portb = $d301

;
; ANIC
;
nmien = $d40e

;
; ROM vectors
;
.if flag = 0
ciov = $e456
.else
ciov = loader.print_ciov
.endif

;
; Code equates
;
l0097 = $0097
l00a0 = $00a0
l00a1 = $00a1
l00ca = $00ca
l00d4 = $00d4 ;word
l00d6 = $00d6 ;word
l00d8 = $00d8
l00da = $00da ;word
l00dc = $00dc

l208e = $208e
l208f = $208f
l24f8 = $24f8
lb000 = $b000
le000 = $e000
le400 = $e400
le401 = $e401
le424 = $e424
le425 = $e425
lf53a = $f53a
lfffa = $fffa
lfffe = $fffe
l2100 = $2100
l2586 = $2586
lc95f = $c95f
lc9c5 = $c9c5
lcc00 = $cc00
le604 = $e604
;
; Start of code
;

.macro m_push
php
pha
txa
pha
tya
pha
.endm

.macro m_pop
pla
tay
pla
tax
pla
plp
.endm


opt h-
org $2000
ins "turbo15.bin",+0,$1542

opt h+
org $6000
;
.proc loader
ldx le424
ldy le425
inx
sne
iny
stx l24f8
sty l24f8+1
lda #$00
sta nmien
sei
lda #$fe
sta portb
lda #$ab
sta lfffa
lda #$24
sta LFFFa+1
lda #$d0
sta lfffe
lda #$24
sta lfffe+1
lda #>lcc00
jsr copy_charset_to_ram
lda #>LE000
jsr copy_charset_to_ram
lda #$40
sta nmien
cli
lda #$ff
sta portb
jsr load_segments
lda #$00
sta boot
lda dosini
ldy dosini+1
sta l208e
sty l208f
lda #$80
ldy #$20
sta dosini
sty dosini+1
lda #$fe
sta portb
sta l00ca
ldx #$01
stx basicf
stx boot
dex
stx coldst
jsr le604
lda #$00
sta l00a0
sta l00a1
jsr lc95f
ldy #$1f
ldx #$8a
jsr l2586
.proc copy_autorun_bas
ldy #$1e
loop lda autorun_bas,y
sta (l0097),y
dey
bpl loop
.endp
jsr lc9c5
lda #$ff
pha
lda #$ae
pha
jsr open_editor
dec portb

.proc clear_b000
lda #$00
tay
loop sta lb000,y
dey
bpl loop
.endp

jmp lf53a

.local autorun_bas
.byte $00,$00,$19,$07,$0d,$67,$14,$19,$25,$0f,$0d
.byte 'D:AUTORUN.BAS'
.byte $16,$01,$00,$06,$06,$16,$16
.endl

.proc open_editor
lda #$ff
sta portb
lda #$c0
sta ramtop
lsr
sta appmhi+1
lda le401
pha
lda le400
pha
rts
.endp


.proc copy_charset_to_ram
sta l00d4+1
ldy #$00
sty l00d4
ldx #$04
loop
.proc rom_to_buffer
lda #$ff
sta portb

loop lda (l00d4),y
sta l2100,y
iny
bne loop
.endp

.proc buffer_to_ram
dec portb
loop lda l2100,y
sta (l00d4),y
iny
bne loop
.endp

inc l00d4+1
dex
bne loop
rts
.endp

.proc load_segments
ldx #$10
lda #$d6
sta iocb0+icbal,x
lda #$00
sta iocb0+icbah,x
sta iocb0+icblh,x
lda #$04
sta iocb0+icbll,x
lda #$07
sta iocb0+iccom,x
jsr ciov
bmi last_segment

lda #<buffer_l617c
sta l00da
sta iocb0+icbal,x
lda #>buffer_l617c
sta l00da+1
sta iocb0+icbah,x
lda l00d8
sbc l00d6
sta l00dc
lda l00d8+1
sbc l00d6+1
sta l00dc+1
inc l00dc
sne
inc l00dc+1

lda l00dc
sta iocb0+icbll,x
lda l00dc+1
sta iocb0+icblh,x
jsr ciov
bmi cio_error

.proc copy_to_ram
dec portb
ldy #$00
ldx l00dc+1
beq no_hi
hi_loop lda (l00da),y
sta (l00d6),y
iny
bne hi_loop
inc l00d6+1
inc l00da+1
dex
bne hi_loop
no_hi ldx l00dc
beq no_lo
lo_loop lda (l00da),y
sta (l00d6),y
iny
dex
bne lo_loop
no_lo lda #$ff
sta portb
.endp

bmi load_segments
last_segment
; lda #0
; .byte 2
rts
cio_error
.if flag = 1
lda $d20a
sta $d01a
jmp cio_error
.endif
jmp (dosvec)
.endp

.if flag = 1
.proc print_ciov
m_push

inc cio_count
lda cio_count
jsr print_hex

lda #' '
jsr print_char

lda iocb0+iccom,x
jsr print_hex
lda #' '
jsr print_char

lda iocb0+icbah,x
jsr print_hex
lda iocb0+icbal,x
jsr print_hex
lda #' '
jsr print_char

lda iocb0+icblh,x
jsr print_hex
lda iocb0+icbll,x
jsr print_hex
lda #' '
jsr print_char

m_pop
jsr $e456
php
sta tmpa
pla
sta tmpp
pha
stx tmpx
sty tmpy

lda #' '
jsr print_char

lda tmpp
jsr print_hex
lda #' '
jsr print_char
lda tmpa
jsr print_hex
lda #' '
jsr print_char
lda tmpx
jsr print_hex
lda #' '
jsr print_char
lda tmpy
jsr print_hex
lda #' '
jsr print_char

lda #$9b
jsr print_char

key1 lda $d20f
and #12
cmp #12
beq key1

key2 lda $d20f
and #12
cmp #12
bne key2

ldy tmpy
ldx tmpx
lda tmpa
plp
rts

tmpp .byte 0
tmpa .byte 0
tmpx .byte 0
tmpy .byte 0

.proc print_hex
sta tmpa
m_push

lda tmpa
lsr
lsr
lsr
lsr
tay
lda hextab,y
jsr print_char

lda tmpa
and #15
tay
lda hextab,y
jsr print_char

m_pop
rts

tmpa .byte 0
hextab .byte '0123456789ABCDEF'
.endp

.proc print_char
sta tmpa
stx tmpx
sty tmpy
jsr putchar
ldy tmpy
ldx tmpx
lda tmpa
rts

putchar lda $e407
pha
lda $e406
pha
lda tmpa
rts

tmpa .byte 0
tmpx .byte 0
tmpy .byte 0
.endp

cio_count .byte 0
.endp

.endif

.endp

buffer_l617c

;
ini loader

opt h-
org $2000
ins "turbo15.bin",+$16c8

Link to comment
Share on other sites

call no. / iccom / icba / icbl / P-register / A-register / X-Register / Y-Register

 

count / 7 = BGET / buffer address / buffer length / $31 or $81 if Y>=$80 / $10 (channel 1) / CIO Status ($01 = OK, $88 = EOF)

I get:

count/iccmd/icba/icbl/31 or B1/

What is this? CB,C5,DF,CF,FF,E6,07/

Chan/Y=status I get 1s except 3 next to last and 88, last.

post-21816-0-59667300-1329791803_thumb.png

Edited by russg
Link to comment
Share on other sites

>If $6000 isn't loading TBXL - what is? How could that happen? Whoever is loading TBXL loads up through the last sector of the file, then reads sector $01, then does a Status commnd to the drive and then loads DUP.

Well, that's what happens when the INIADR=$6000 is not executed: DOS simply loads all following sements (which are in the ROM area,so they have no effect), does not find a RUNADR and hence returns to DUP. I'll create a version with multiple INIADRs to check.

>What is this? CB,C5,DF,CF,FF,E6,07

Values of the accumulators when returning from CIO

>Chan/Y=status I get 1s except 3 next to last and 88, last

Seems CIO returns 3 instead of 1 to indicate the last byte has been read.

Link to comment
Share on other sites

Here's a test executable which goes though INIADR 3 times during loading. Every time it outputs a number (1/2/3) and waits for a key. Let's see if the INIADR calls are performed. This is what it looks like in the EMU under MyDOS before it returns to DUP.

 

post-17404-0-38307300-1329844302_thumb.png

iniadr.xex

Link to comment
Share on other sites

INIADR works properly - rainbow and all.

 

Bob

 

 

 

Here's a test executable which goes though INIADR 3 times during loading. Every time it outputs a number (1/2/3) and waits for a key. Let's see if the INIADR calls are performed. This is what it looks like in the EMU under MyDOS before it returns to DUP.

 

post-17404-0-38307300-1329844302_thumb.png

Link to comment
Share on other sites

>OK -- I ran TEST.XEX on my HDD system under OmniMon and it loads all the sectors and falls back to DUP, just like before. It does not list any CIO activity at all. I tried it with the 800XL OS and it did the same.

 

I won't give up so easily :-) Here's a test.xex which outputs "?" when the $6000 loader is called, and "!" when the loading of the first segment starts.

test.xex

Edited by JAC!
Link to comment
Share on other sites

No characters were output - loaded TBXL and reverted to DUP, as always. I would say that it does not execute $6000...

 

Bob

 

 

 

>OK -- I ran TEST.XEX on my HDD system under OmniMon and it loads all the sectors and falls back to DUP, just like before. It does not list any CIO activity at all. I tried it with the 800XL OS and it did the same.

 

I won't give up so easily :-) Here's a test.xex which outputs "?" when the $6000 loader is called, and "!" when the loading of the first segment starts.

Link to comment
Share on other sites

That is weird Turbobasic and MyDos 4.5x does not work together on an 1200XL. With all the hardware mods, could this be an issue with the way PortB works with bank switching, turning Basic and OS on and off? I remember there were issues with different MyDOS 4.5x variants causing some software conflicts. I would have to go between pages in this thread, but did you try 4.53, 4.55, etc? Another thought with the 65816 CPU. could DOS or TB executing any undocumented (illegal) 6502 instructions or be doing JMP/JSR to the OS outside of the jump table?

 

This is offtopic, but what are the differences between Turbobasic variants 1.5, 2.0, 2.11 etc? Any extra commands or changes in speed? I don't do much with Turbobasic XL anymore, maybe some quick tests here and there. Everygame I write now is all done in Assembly.

Edited by peteym5
Link to comment
Share on other sites

Not any 1200XL - just my modified system(s).

 

BASIC and OS work the same as an 800XL.

 

I don't know much about TBXL, I'm afraid.

 

Bob

 

 

That is weird Turbobasic and MyDos 4.5x does not work together on an 1200XL. With all the hardware mods, could this be an issue with the way PortB works with bank switching, turning Basic and OS on and off? I remember there were issues with different MyDOS 4.5x variants causing some software conflicts. I would have to go between pages in this thread, but did you try 4.53, 4.55, etc?

 

This is offtopic, but what are the differences between Turbobasic variants 1.5, 2.0, 2.11 etc? Any extra commands or changes in speed? I don't do much with Turbobasic XL anymore, maybe some quick tests here and there. Everygame I write now is all done in Assembly.

Link to comment
Share on other sites

Another thought with the 65816 CPU. could DOS or TB executing any undocumented (illegal) 6502 opcode. Some of those opcodes become different instructions with a different CPU. This is also a long shot, but cold TB or Mydos be doing JMP/JSR to the OS outside of the jump table?

Link to comment
Share on other sites

I'm getting closer. I have created a CIO tracer which yielded that MyDos uses a special CIO command $27 to load the COm file. This causes the CIOV to return back to MyDOS $1275. This routine does not perform further CIO calls and seems to skip $6000. Now I'll check what's there.

Link to comment
Share on other sites

I found that my versions of MyDOS source code do not match the .OBJ code that I run (4.50). Larry found the correct code and I generated a listing and cross-reference for it. It takes a little work, so I am uploading it here.

 

On your PC (or, whatever...), load this into WordPad, set the margins so the pages line up, and print.

 

Bob

MYDOS45.TXT

MYDOS45X.TXT

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...