What would be the best way to do this? Thanks Smile (I included brass because I think there is a special brass function that can put things in blocks)

Edit: Off topic, but if anyone has a link to the brass docs, I would be very thankful Smile I seem to have lost my link Sad
Brass Manual: http://lmgtfy.com/?q=brass+manual+benryves

Anyway, I don't use the blocks functions. How familiar are you with interrupts in general, like the valid addresses, the i register, limitations, shadow registers, timing and triggering, and all that fun stuff? Should I go through some of those details?
I'm pretty familiar with interrupts. I know that they need a 257 byte block (because it's I register * 256 + bus, and the bus is presumed random at best). I know there are 4 modes for interrupts, slow, fast, slowest, and fastest. It triggers at different speeds for each of the speeds of the interrupts (choppy, I know) and shadows, dunno for certain :/ I just know they are special registers you can use so you don't disturb the normal registers. You access them by methods like A' HL' etc. Limitations, if they take too long, you will have to di then do your code and ei at the end of your interrupt. Valid addresses, I'd have to assume that it has to be before that 8kb code limit. Anything I'm missing?

Edit: Oh and about the manual, I had been searching for: Brass Manual ASM, thanks Smile
I'm helping on IRC, but here's some generic interrupt code:

Code:
  di ;Turn off interrupts ;)
  im 2 ;Set interrupt mode 2
  ld a,$99 ;Our vector table will be from $9900-$9A00, near the beginning of appBackupScreen
  ld i,a ;Set i, the msb of the table's address
  ld h,a
  ld l,0
  ld d,h
  ld e,l
  inc de
  inc a
  ld (hl),a
  ld bc.$0100
  ldir ;Fill $9900-$9A00 with $9A, since the interrupt will begin at $9A9A
  ld d,a
  ld e,a
  ld hl,interrupt
  ld bc,interrupt_end-interrupt
  ldir ;Copy the interrupt into appBackupScreen
;Other program code
interrupt:
.relocate $9A9A
  exx
  ex af,af'
;interrupt code here
  ex af,af'
  exx
  ei
  ret
.endrelocate
interrupt_end:

;Code notes: put the calc back in im 1 before exiting unless you've chained the os interrupt and like your interrupt
;This can be done by replacing "ei \ ret" with "jp $0038"
;MAKE SURE TO ZERO OUT AND RESET PORT $03


Edit: .(end)relocate are brass-specific AFAIK.
Edit by Kerm: Added slight indentaton.
For comparison, here's (some) of the relevant sections from CALCnet2.2:


Code:
Cn3_Setup:
    di
    ld hl,SavesScreen
    push hl
    pop de
    push de
        inc de
        ld bc,546-1
        ld (hl),0                    ;this covers everything incl Cn2_Last_Send
        ldir
#ifndef cn2fakeserial
#ifndef cn2fakeserial_gcnhost
        bcall(_GetSerial)
        ld hl,Op4
        pop de
    inc de
    inc de
    ld bc,5
    ldir
#endif
#endif
#ifdef cn2fakeserial_gcnhost
        pop hl
    inc hl
    inc hl
    ld a,$aa
    ld (hl),a
    inc hl
    ld (hl),a
    inc hl
    ld (hl),a
    inc hl
    ld (hl),a
    inc hl
    ld (hl),a
#endif
#ifdef cn2fakeserial
        pop hl
    ld b,5
    inc hl
    inc hl
cn2_ptiserialsetloop:
    push bc
        ld b,250
        call iRandom
        pop bc
    ld (hl),a                                ;base fake-address is $00,$00,$00,$01,$00
    inc hl
    djnz cn2_ptiserialsetloop
#endif
    di
    ld hl,Cn2_Caller_Routine
    ld de,$9999
    ld bc,Cn2_Caller_RoutineDone-Cn2_Caller_Routine
    ldir
#ifdef cn2_installerinflash
    in a,(6)
    ld ($9999+Cn2_caller_HomePage-Cn2_Caller_Routine+1),a                ;SMC if this code is on a Flash page
#endif cn2_installerinflash
    ld a,$9a
    ld i,a
    ld h,a
    ld l,0
    ld (hl),$99
    push hl
    pop de
    inc de
    ld bc,256
    ldir
    ld a,%00001000        ;Acknowledge and disable
    out (3),a
    ld a,%00001010        ;Set 1st timer active
    out (3),a
    ld a,%00000110        ;Slowest frequency, ~110hz
    out (4),a
    im 2
    ld a,sendCLDL
    out (0),a
    ei
    ret

Cn2_Caller_Routine:
    ex af,af'
    exx
#ifdef cn2_installerinflash
    in a,(6)
    push af
Cn2_Caller_HomePage:
    ld a,0                        ;SMC field
    out (6),a
#endif ;cn2_installerinflash
    call Cn2_Int_Start
#ifdef cn2_installerinflash
        pop af
    out (6),a
#endif ;cn2_installerinflash
    ld a,%00001000        ;Acknowledge and disable
    out (3),a
    ld a,%00001010        ;Set 1st timer active
    out (3),a
    ld a,%00000110        ;Slowest frequency, ~110hz
    out (4),a
    exx
    ex af,af'
    ei
    reti            ;-1-8- -1-9- 9 bytes total now
Cn2_Caller_RoutineDone:
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement