I don't know what's wrong with this code. I know that getkey, putc, and DispHexA all work from previous testing. I also know that interrupts work as I was able to get a counter working but this dosen't work for some reason.
Code:
#define curCol $8300
#define curRow $8301
#define key $8303


boot:
        jp Init
        .fill 038h - $, 0
        jp count
        .fill 056h - $, 0
        .dw $A55A

count:
    di
    exx
    ex af,af'
    call getkey
    ld (key),a
    ex af,af'
    exx
    ei
    reti


Init:
   di
   im 1
memInit:
   ld a,1
   out (6),a
   in a,(2)
   rlca
   ld a,$41
   jr nc,LowerModel
HigherModel:
   out (5),a
   ld a,$81
   out (7),a
   jr memDone
LowerModel:
   out (6),a
   out (7),a
memDone:
   ld sp,0
lcdInit:
   ld a,$40
   out ($10),a
   call lcdDelay
   ld a,5
   out ($10),a
   call lcdDelay
   ld a,1
   out ($10),a
   call lcdDelay
   ld a,3
   out ($10),a
   call lcdDelay
   ld a,$90
   out ($10),a
   call lcdDelay
   ld a,$f3
   out ($10),a
   call lcdDelay
   ld a,$20
   out ($10),a
   call lcdDelay

    ld a,'H'
    call putc
    ld a,$20
    call putc
    ld a,$FF
    ld (key),a
    ei

Loop:
    ld a,(key)
    inc a
    jr z,Loop
    dec a
    call DispHexA
    jr $
Which calculator is this, and is this all of your code?

I am confused as to why you are using just call and not bcall though it may be your assembler not being one I am familiar with as its been a while since I've worked on code myself.

Also looking closer it looks like you are trying to call into getkey with interrupts disabled, I know there are a few key related bcalls on on the 8x calculators but I believe most of them require interrupts enabled to work.
If this is at all affiliated with ti_kid's OS project, it is probably Z80 ASM for the 83/84+ monochrome line.
This is not reliant on the os’s getkey , this is my own implementation.Actually this is part of the code for my own OS. This is targeted to the 83+ family (black and white not color). I use Brass to assemble. I was able to get a counter working (the reason the label is called count) and here is the code for that.
Code before the ei was :
Code:
ld hl,curCol
  xor a
  ld d,a
  ld e,a
  ld b,a
  ld c,a
  Exx
  ex af,af’

And the interrupt

Code:

  di
  exx
  ex af,af’
  ld (hl),a
  inc hl
  Ld (hl),a
  dec hl
  inc c
  jr nz,skip-carry
  inc b
  jr nz,skip-carry
  Inc e
  jr nz,skip
  Inc d
skip-carry:
  push hl
  push de
  pop hl
  call DispHexHL
  push bc
  pop hl
  call DispHexHL
  pop hl
  Exx
  ex af,af’
  ei
  Reti
  
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