Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
timerInt:
pusha
inc word [tc] ; increment the counter
popa
iret
There is no evidence at all of the incrementing of the value, and the only way I've been able to test that the ISR is firing is by adding in code to print the current value of tc, which works but because my ISR runs every time a timer interrupt happens, thousands of numbers just fill the screen...
1. One thought about the debugging - if you print a dot between each number and run in an emulator, when you pause the emulator you will be able to see if the number really does increment by one every time.
2. If you are not using any registers in your ISR, do you need to pusha and popa?
3. Is a word value enough to hold your system's tick counter?
4. If you are trying to read the value 'tc' in c (i assume you're not yet as there is no leading underscore), be careful that you are reading the value from memory every time. If you have just set up a loop to check the value, most compilers will just move the value to a register and keep reading the value from there. Use of the word 'volatile' will prevent this.
timerInt:
pusha
push ds
mov ds,word [tc_ds]
mov al,'.'
mov ah,0x0e
mov bx,0x0007
int 0x10
inc word [ds:tc]
pop ds
popa
iret
This works, but again, the counter is not incremented globally. I've tried putting it into the 'uninitialized data' section ie. bss but it still does not increment. It seems the only way I can access the data is from inside the ISR...
Okay one thing I can add to this post is that creating variables in your code segment specially when all scattered around is a bad practice. Your code would easily get unaligned and you will run into troubles every now and then specially in real mode. It would be better if you could put all your data in your Data Segment and thus use the default addressing mode rather than specifying the code segment explicitly.