flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Some code that works on 1 PC: and nothing else |
Author |
|
Artlav 01 Oct 2007, 14:32
There are 2.5 problems with this program:
1. DS in not initialised - it appears that some BIOSes set it right to 0, other don't. 2. No boot signature - sometimes it is chrecked. 2.5. Only letters are printed, without attribute part - it may lead to invisible text, if BIOS clears the video memory. Fixed code: Code: org 0x7C00 use16 app_start: func_set_registers: MOV ax, 0xB800 MOV es, ax MOV ax, 0x0000 MOV ds, ax LEA bp, [msg_1] MOV si, 0 MOV bx, 0x0000 MOV ax, 0x0000 MOV cx, 0 mov ah,22 func_print_string: MOV al, [ds:bp] CMP al, 0 JE app_end MOV [es:bx], ax INC bp ADD bx, 2 JMP func_print_string jmp app_end app_data: msg_1 db "Please wait while we load this OS", 0 app_end: NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP jmp app_end rb 7c00h+512-2-$ sign1 db 055h sign2 db 0AAh |
|||
01 Oct 2007, 14:32 |
|
jatos 01 Oct 2007, 16:04
I will add code to clear the screen at some point, I also going to have to find the code for white on black.
Anyway thanks for that, hopefully my program will now work. |
|||
01 Oct 2007, 16:04 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.