flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > [] |
Author |
|
mikegonta 10 Oct 2007, 20:35
[ Post removed by author. ]
Last edited by mikegonta on 27 Jan 2009, 22:02; edited 3 times in total |
|||
10 Oct 2007, 20:35 |
|
dasyar 11 Oct 2007, 22:40
Mike,
Below is a small snippet, which seems to work. The problem is that when I try to use int 1Ah or int 16h, it seems to corrupt the program. There is also a problem with the keyboard int, that also seems to corrupt. The int 10h seems to behave like it's supposed too. ;MyClock.asm use32 org 100000h ; mov eax, 86h*256 ; mov edx, 3000000 ; int 15h ;;;This starts the interrupt process mov eax, 0ffh*256+50h mov ebx, timer_hook int 15h mov [continue], eax ; mov ah, 02h ; int 1Ah ; mov al, ch ; shr al, 4 ; add al, "0" ; mov [clock], al ; and ch, 0fh ; add ch, "0" ; mov ah, 2 ; xor ebx, ebx ; mov edx, 12*256+36 ; int 10h ; mov eax, 86h*256 ; mov edx, 3000000 ; int 15h jmp exit ;;;This is a slave loop timer_hook: jmp timer_hook show_time: ret ;;;This necessary for a clean return exit: mov eax, 0ffh*256+50h mov ebx, [continue] int 15h int 20h retnd continue: dd 0 second: dd 18 clock: db "00:00:00" times 8 db 8 db 0 |
|||
11 Oct 2007, 22:40 |
|
mikegonta 11 Oct 2007, 23:33
[ Post removed by author. ]
Last edited by mikegonta on 27 Jan 2009, 22:02; edited 3 times in total |
|||
11 Oct 2007, 23:33 |
|
dasyar 12 Oct 2007, 15:19
I just tried out the new progs, and they work. I assume that int 20 is the same as doing a retnd, which is needed for a clean return of an app. So far your aeBIOS seems to be running smoothly, now on to some other testing.
I guess the next thing to consider is creating a bootable HD, at some point some people might want to work from an HD. Thanks |
|||
12 Oct 2007, 15:19 |
|
dasyar 15 Oct 2007, 22:58
I have some code below where I am trying to include a cli as a task. The problem with the code below is, the floppy keeps spinning. It seems when it tries to do the keyboard int 16, the program does not work the way I expect it to work. Now is there a problem with my programming technique, or is there a subtle problem with aeBIOS?
I would sure like to see some simple code that runs more than one task, maybe that would put me on the right track. Thanks ;MyCli.asm use32 org 100000h call cls mov eax, 0ffh*256+50h mov ebx, continue int 15h slave: jmp slave timer_hook: pusha call main_thrd ; call oneT popa jmp DWORD [continue] continue: dd timer_hook oneT: pusha mov ah, 02h ;Get time via BIOS int 1ah mov al, ch shr al, 4 add al, "0" mov [clock], al and ch, 0fh add ch, "0" mov [clock+1], ch mov al, cl shr al, 4 add al, "0" mov [clock+3], al and cl, 0fh add cl, "0" mov [clock+4], cl mov al, dh shr al, 4 add al, "0" mov [clock+6], al and dh, 0fh add dh, "0" mov [clock+7], dh mov ah, 2 ;Move cursor to bottom xor ebx, ebx mov edx, 24*256+71 int 10h .display: mov esi, clock mov ah, 0eh mov bl, 0fh @@: mov al, [esi] lea esi, [esi+1] test al, al je @F int 10h jmp @B @@: popa ret main_thrd: pusha .next_character: xor eax, eax int 16h cmp al, 0dh jne @F call printc mov al,0ah call printc jmp .exit @@: mov [edi], al .print: call printc lea edi, [edi+1] cmp edi, command_line+1023 jne .next_character .exit: mov BYTE [edi], 0 popa ret ;;;;;;;;;;;;;;;; prints: pusha @@: mov al, [esi] lea esi, [esi+1] test al, al je @F call printc jmp @B @@: popa ret ;;;;;;;;;;;;;;;;;; printc: pusha mov ah, 0eh mov bl, 0fh int 10h popa ret cls: pusha mov ecx, 80/2 mov esi, logo mov edi, 0b8000h @@: mov eax, [esi] lea esi, [esi+4] mov [edi], eax lea edi, [edi+4] dec ecx jne @B mov eax, 2*256 xor ebx, ebx mov edx, 1*256 int 10h popa ret clock: db "00:00:00" times 8 db 8 db 0 logo: times 40 dd 0 prompt: db "A:\>", 0 command_line: rb 1024 exit: mov eax, 0ffh*256+50h mov ebx, continue int 15h jmp $ |
|||
15 Oct 2007, 22:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.