I/O operations

Es gibt 12 Antworten in diesem Thema, welches 2.051 mal aufgerufen wurde. Der letzte Beitrag (28. August 2009 um 04:32) ist von mc71.

  • Hi!

    I'm trying to INITIALIZE and VALIDATE device - I'm not sure with code. Can any advanced programmer look at this and help me?
    Here's most important part of code:

    .namespace io {

    operation:

    lda #$0f
    ldx device
    ldy #$0f
    jsr $ffba // SETLFS
    lda len
    ldx #<meno
    ldy #>meno
    jsr $ffbd // SETNAM
    jsr $ffc0 // OPEN
    jsr $ffcc // CLRCH
    lda #$0f
    jsr $ffc3 // CLOSE
    ldx #$00
    wpass: lda pass,x
    cmp #$01
    beq finish
    jsr toscreen
    inx
    jmp wpass
    finish: rts

    }

    .namespace init {

    ialize:
    .var meno = "I:"
    .var len = 2
    jmp io.operation

    }

    .namespace valid {

    ate:
    .var meno = "V:"
    .var len = 2
    jmp io.operation

    }

  • check the manual of your assembler, i doubt this code assembles into what you intend. (and check the assembled code in a monitor too)

  • Hi!

    I checked my assembly code, direct addressing was changed to labels/variables, only one I let it yet directly - 'cause it ends my program at address $1BFF - at $1C00 begins BASIC (right?)...

    So, I attached source code and compiled program.
    If anybody want look at.
    Code is not yet full, but problems still are, maybe when you'll see it - you can help.

    To compiled program: BLOAD"KOD":SYSDEC("1300")

    Thanks.

    Miro

  • Set BANK 15, and use a bank parameter (B15? not sure about syntax...) in the BLOAD statement to make sure your code is in the correct bank, and it will see the KERNAL. Also, there might be a bank parameter in SETNAM, or somehin like a SETBANK routine in the 128's KERNAL.

    KI-Verwendung in diesem Posting: Rechtschreibkontrolle des Browsers.
    Abweichungen aufgrund des technischen Fortschritts oder individueller Vorlieben vorbehalten.

  • Hi!

    As you know, if you read this thread before, my computer has no understandable behavior.

    I wrote ERROR CHANNEL READ routine 100% identical with INTEGRATED:

    If I use this routine single - WORKS CORRECTLY

    If I integrate this routine into BASIC extension program - NO ACCESS (it seems that it checks disk neither)

    So, I tried all my routines if works single, and my surprise was: ALL ROUTINES WORKS CORRECTLY!!!

    Can be anything what does not access, problems with directory in program "BASIC EXTENSION"? - there are rewritten any vectors.

    So, I'm sure that I wrote 100% properly working routines - but works only single... WHY? :baby:

    Thanks for every help.

    Miro

  • I don't know what you "checked" but I downloaded your object code "kod.prg" and found jumps to $1cbe, 1e2a, 1e7f. (Not really a good Idea!)
    Do you really understand what your assembler is doing?

    Regards WTE

    Bitte melde dich an, um diesen Link zu sehen. --- Bitte melde dich an, um diesen Link zu sehen.

  • Hi!

    Thanks. I know what does assembler.

    But don't understand you: these jumps I've seen never - to be sure I dissassembled kod.prg and never seen jumps over $1aa8...
    Also I used H to find this jumps and never was output any address... (with MONITOR included in C128).
    If you try only dissassemble, don't look at with M command, you can't see also text data and variables which are before main code.
    I'm surprised what you wrote.
    My program (actually) sure has no jumps to this addresses.
    Works only in area $1300 - $1BFF...

    So, I don't know which file you downloaded and there found these jumps...?!?!

    Miro

    3 Mal editiert, zuletzt von MIRKOSOFT (26. August 2009 um 00:42)

  • Are you kidding?

    1. I downloaded "kod.prg (3,03 kB)". (Your post: Montag, 24. August 2009, 00:10)
    2. BLOAD into C128
    3. MONITOR
    4. d 1300


    Any questions left?

    Regards WTE

    Bitte melde dich an, um diesen Link zu sehen. --- Bitte melde dich an, um diesen Link zu sehen.

  • Hi!

    Questions are: but to me - how can I attach other code as I'm programming... ?!?!?!?! - I'm idiot...
    'Cause:
    C128
    MONITOR:
    d1300
    . 01300 a9 0f lda #$0f
    . 01302 a2 0f ldx #$0f
    . 01304 a0 0f ldy #$0f
    . 01306 20 68 ff jsr $ff68
    . 01309 a9 20 lda #$20
    . 0130b a2 13 ldx #$13
    . 0130d 8d 02 03 sta $0302
    . 01310 8e 03 03 stx $0303
    . 01313 20 3b 16 jsr $163b
    d
    . 01316 20 86 16 jsr $1686
    . 01319 60 rts
    . 0131a 00 brk
    . 0131b 00 brk
    . 0131c 00 brk
    . 0131d 00 brk
    . 0131e 00 brk
    . 0131f 00 brk
    . 01320 a2 ff ldx #$ff
    . 01322 86 3c stx $3c
    . 01324 20 93 4f jsr $4f93
    . 01327 86 3d stx $3d
    . 01329 84 3e sty $3e

    here's Q to me - Attached I different file????

    Thanks for warning...

    Miro

  • Yes, I attached different or too old file...
    Sorry for all...

    And now I'm programming new code - in C128 ML monitor (I let go out KickAssembler - for the mistakes)
    But it's not working also and doing it in ML monitor is too hard and has no other effect - have to go back to KickAssembler???

    if you want look at thread: Bitte melde dich an, um diesen Link zu sehen.

    Thanks.
    Miro

    Einmal editiert, zuletzt von MIRKOSOFT (28. August 2009 um 01:19)

  • See other thread, and see my posting above: You have banking trouble. Get to know what memory configurration >BASIC is in when it calls the 'new token' vector; keep in mind that BASIC uses memory schemes that are different from the usual BANK 0 ... BANK 15!

    KI-Verwendung in diesem Posting: Rechtschreibkontrolle des Browsers.
    Abweichungen aufgrund des technischen Fortschritts oder individueller Vorlieben vorbehalten.