Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INT 21H writing data to memory +1, amount of chars 1 short #33

Open
digitalandrew opened this issue Nov 15, 2023 · 0 comments
Open

INT 21H writing data to memory +1, amount of chars 1 short #33

digitalandrew opened this issue Nov 15, 2023 · 0 comments

Comments

@digitalandrew
Copy link

If I run the following code:
start:
MOV DX, 0x00
MOV AH, 0x0A
INT 0x21

And at the interrupt enter 123

I would expect the memory starting at 0 to look something like:

03,31,32,33

Where the first byte stores the number of chars read and then the remaining 3 are the data.

Instead I get the following in the memory starting at 0:

00,02,31,32,33

Even though DX is pointing to 0x00 the data is written starting at 0x01, also the amount of chars appears to be 0 indexed so is 1 lower than the actual amount written.

This can be a bit of an annoyance if you want to print out a string you receive through the interrupt as you need to increment the value read for the amount of chars and remember to add one to memory location of wherever you wrote to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant