flat assembler
Message board for the users of flat assembler.
Index
> DOS > Newbie here! (HEX vs DEC, text output using DOS, VGA) Goto page 1, 2 Next |
Author |
|
revolution 22 Dec 2009, 06:27
mov ax,3 - move dest,source. Moves that number '3' into the register 'ax'. The instruction that comes next (i.e. 'int 10h') is where the work of changing screen modes is done. It call the BIOS (some pre-written code) to make changes. The value in ax tells the BIOS code what you want it to do.
The CPU has registers named ax, bx, cx, dx, si, di, bp and sp in 16bit mode. |
|||
22 Dec 2009, 06:27 |
|
p3rlphr33k 22 Dec 2009, 06:32
Nice! I am familiar with hardware and the that it is placing the value in the register. I just didnt know the the 3 was triggering the bios. So is there a chart of what number do what in the bios? How do you know what numbers do what?
Thanks again! |
|||
22 Dec 2009, 06:32 |
|
p3rlphr33k 22 Dec 2009, 06:37
Sorry for the newbie questions...
I feel as though I have stepped back 8 years and I am learning to program from the beginning. I have only ever "programmed" in PERL, PHP... the usual web stuff. But assembly has always been in the back of my mind. I am excited to finally program something that matters much more on a machine level. I will be excited to know how to write my own hello world without cheating..hehehe |
|||
22 Dec 2009, 06:37 |
|
revolution 22 Dec 2009, 06:42
Search for Ralf Brown's Interrupt List.
|
|||
22 Dec 2009, 06:42 |
|
p3rlphr33k 22 Dec 2009, 07:04
Sorry but... I just dont know how this works..
I looked here: http://www.ctyme.com/intr/int.htm I see 03, it doesnt say anything about text mode in any of the links provided, and there is not just a '3'. also looked here: http://en.wikipedia.org/wiki/BIOS_interrupt_call still no 3.. I am back to being lost wiki also has 03: "03h CPU: The lowest non-reserved interrupt, it is used exclusively for debugging, and the INT 03 handler is always implemented by a debugging program" Any other resources, or can you help me make sense of this? |
|||
22 Dec 2009, 07:04 |
|
p3rlphr33k 22 Dec 2009, 07:05
i understand that 3 decimal and 03h is hex so are they the same interrupt?
|
|||
22 Dec 2009, 07:05 |
|
p3rlphr33k 22 Dec 2009, 07:32
This what im looking for?
Code: 10h ----- Video Services - installed by the BIOS or operating system; called by software programs AH Description 00h Set Video Mode 01h Set Cursor Shape 02h Set Cursor Position 03h Get Cursor Position And Shape 04h Get Light Pen Position 05h Set Display Page 06h Clear/Scroll Screen Up 07h Clear/Scroll Screen Down 08h Read Character and Attribute at Cursor 09h Write Character and Attribute at Cursor 0Ah Write Character at Cursor 0Bh Set Border Color 0Eh Write Character in TTY Mode 0Fh Get Video Mode 13h Write String |
|||
22 Dec 2009, 07:32 |
|
p3rlphr33k 22 Dec 2009, 07:34
and more...
http://en.wikipedia.org/wiki/INT_10 found here too! http://www.ctyme.com/intr/rb-0088.htm Think this is what i wanted to know! Sorry i keep talking to myself.. I am really not an idiot i swear all though I feel like it asking newbie questions. I am just not used to this type of programming. |
|||
22 Dec 2009, 07:34 |
|
p3rlphr33k 22 Dec 2009, 07:50
Thanks for your help revolution! I would stay and get to know more about you but its 2am here and I need to get some rest for work tomorrow. I will be back on later for sure. I look forward to meeting more people on this board Im sure everyone here is great!
Thanks again |
|||
22 Dec 2009, 07:50 |
|
revolution 22 Dec 2009, 08:46
ax=3 means: ah=0 and al=3.
So int 10h with ah=0 is to set the video mode. al=3 tells the BIOS code you want video mode 3 (80x25 text mode) |
|||
22 Dec 2009, 08:46 |
|
LocoDelAssembly 22 Dec 2009, 14:36
p3rlphr33k, I'll move this thread to DOS forum (or perhaps Main), so be ready to find it there (I'll wait some days before doing it or until you reply something here, whatever comes first).
|
|||
22 Dec 2009, 14:36 |
|
p3rlphr33k 22 Dec 2009, 18:49
whenever your ready locodeassembly
|
|||
22 Dec 2009, 18:49 |
|
p3rlphr33k 22 Dec 2009, 21:48
Round II DING
ok, I understand the ORG tell the compiler that it is a specific file type.. Is there also a chart that shows what each type is? and what does ORG stand for? I tried google but its difficult to search for a domain extension lol "Assebmly language ORG" = "did you mean assemblylanguage.org?" in one of my example programs i noticed ORG 100h, another was ORG 256, and another didnt have one at all! Any one care to fill me in? Thanks _________________ -p3rlphr33k- (Soon to be ASMphr33k) |
|||
22 Dec 2009, 21:48 |
|
Teehee 22 Dec 2009, 21:54
Quote: i noticed ORG 100h, another was ORG 256 100h = hexa 256 = decimal 100h = 256 |
|||
22 Dec 2009, 21:54 |
|
p3rlphr33k 22 Dec 2009, 22:03
why does this work:
Code: org 256 mov ah,2 mov dl,'A' int 21h int 20h but this doesnt? Code: org 256 mov ah,2 mov dl,'Test print' int 21h int 20h I know it has some thing to do with moving a single letter rather than a string.. do I need to define a db first? Code: org 256 mesg db 'test print' mov ah,2 mov dl,mesg int 21h int 20h this doesnt work.. but am i on the right track? |
|||
22 Dec 2009, 22:03 |
|
p3rlphr33k 22 Dec 2009, 22:06
Teehee wrote:
WOW did i over look that, thanks teehee lol _________________ -p3rlphr33k- (Soon to be ASMphr33k) |
|||
22 Dec 2009, 22:06 |
|
revolution 22 Dec 2009, 22:14
In DOS function 9 is for printing strings. And the strings are terminated by a $ symbol.
Code: mov ah,9 ;print string mov dx,mystring int 21h int 20h mystring: db 'Hello everybody$' |
|||
22 Dec 2009, 22:14 |
|
revolution 22 Dec 2009, 22:15
p3rlphr33k: look into the examples folder that comes with the fasm download. It has working examples that you can use to learn from.
|
|||
22 Dec 2009, 22:15 |
|
Teehee 22 Dec 2009, 22:18
p3rlphr33k wrote: why does this work: Because DL = 1byte and 'Test print' = 10 bytes You are trying to move a value greater than register size. Quote: I know it has some thing to do with moving a single letter rather than a string.. do I need to define a db first? try this: Code: org 256 mov ah,2 mov dl,mesg int 21h int 20h mesg db 'test print$' ; at end... and don't forget '$' _________________ Sorry if bad english. |
|||
22 Dec 2009, 22:18 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.