flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Help to write driver to write into console in real mode

Author
Thread Post new topic Reply to topic
Fulgurance



Joined: 27 Nov 2017
Posts: 276
Fulgurance 20 Dec 2018, 22:35
Hello, just for training, i try to write simple driver he have role to write text into console on real mode.

But i have problem, i need to do MOV TARGET,SOURCE instruction with calculated variables adress for target and source. How is it possible to do that. I try many idea, but i don't have any success to compile. (Without interrupt)
Post 20 Dec 2018, 22:35
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4060
Location: vpcmpistri
bitRAKE 20 Dec 2018, 23:29
If you can calculate the addresses then the general solution is a PUSH/POP. In the rare case you don't have a stack, you'll need to store the value in a temporary register or memory space.
Post 20 Dec 2018, 23:29
View user's profile Send private message Visit poster's website Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20418
Location: In your JS exploiting you and your system
revolution 21 Dec 2018, 01:31
Fulgurance, do you mean computing the address of the characters on the text mode screen?

Something like this:
address = (y * 80 + x) * 2 + base
Where x and y are the coordinates of the character and the "* 2" is for two bytes per character, with the final "base" being the screen buffer start address.

To do that in code you need to write a sequence of instructions with intermediate values. It can't be done with a single "mov [(y * 80 + x) * 2 + base],character".
Post 21 Dec 2018, 01:31
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
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
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.