Various Questions

I have that horrible sensation of a whole world knowing something that I do not.

1: What is an ASCIIZ string?

2: I have written a very nice keyboard handler which takes complete control and does NOT call the old handler. This way I have total control and can detect ANY key or key combination on the keyboard. It is slow, has no buffer and does not work.

The buffer is not needed. Speed neither - I won't use it for fast execution purposes.
But it should work. I "case port[$60] of ... end; port[$20] := $20;"
then the procedure ends. Then I noticed that I do not have capital letters and the num/caps/scroll LED's does not work.

So I called an int 16h,12h to get the shiftstates, but seeing as the old keyboard handler does not execute, nothing updates this. The memory area does not update either.
I have also read that in the interrupt intercept you cannot call other interrupts.
::>> is there any way to get the shiftstate?

(what would also have been nice is to be able to use readln etc. in the kbd handler)

3: OK. So MSB means "most significant byte first". But define most significant.

Thank you


  • [b][red]This message was edited by the iby at 2002-7-10 17:37:57[/red][/b][hr]
    : 1: What is an ASCIIZ string?

    There are different ways to define strings. Standard pascal version
    is combination of:
    a) one byte which tells the string length and
    b) actual string

    Since the string length is described by a byte (value range 0-255)
    maximum string is also limited to 255 sharacters.

    For example if you have something like this in your program:
    [code] my_str:='Hello'; [/code]
    compiler would create string of 6 bytes ( 1 for length + 5 for content ).
    It would be saved in memory as

    If you replace this [b]6[/b] by let's say [b]4[/b], you would
    get 'Hell':

    [code] my_str:='Hello';
    Mem[DSeg:Ofs(my_str)]:=4; { change string length to 4 }
    Write(my_str); { displays "Hell" } [/code]

    ASCIIZ string is different. It can be any length (normally
    up to 64kb). It's structure is oposite from what we have just
    a) string content
    b) zero byte ( used to mark string end )

    So string 'Hello' would be stored in RAM as
    [b]'H','e','l','l','o',0 [/b]

    : ::>> is there any way to get the shiftstate?

    Yes. You can use control state registers to monitor
    status of say SHIFT and ALT keys...

    : 3: OK. So MSB means "most significant byte first". But define most significant.

    First of all, it is "most significant [b]bit[/b]"
    If you have byte with binary value 6 for example,
    it is represented as

    ^ ^
    | |___ This is LSB ("least significant bit")
    |___________ This is MSB ("most significant bit")[/code]

    MSB is the "biggest" (most significant) bit.
    In animal world elephant is more significant than a mouse
    due it's size. In computer world size does matter too
    (it always does, doesn't it?).


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion