101
Lowlevel-Coding / Re: Division mit 0?
« am: 15. November 2008, 19:47 »
thx naja es ist spät
ich wusste doch es ist bestimmt nur ein dämlicher fehler
danke...
ich wusste doch es ist bestimmt nur ein dämlicher fehler
danke...
29. March 2024, 13:21
Diese Sektion erlaubt es dir alle Beiträge dieses Mitglieds zu sehen. Beachte, dass du nur solche Beiträge sehen kannst, zu denen du auch Zugriffsrechte hast.
mov ax, 0
mov bl, 01h
div bl
und nun kommt das spanneste: es kommt 0 raus! asm("int $50");
geschrieben in asm hießt es doch int 0x50
oderint 50h
also müsste es doch asm("int 0x50");
oder
asm("int 50h");
;unmengen zeilen an code .....
mov si, sys_msg ;<---- das ist farbig
mov al, 01h
mov ah, 01h
mov bl, 09h
int 21h
mov si, ent ;<-------- das ist das 'Enter'-zeichen
mov al, 0x01
int 0x21
;########
;#Variablen#
;########
;andere variablen...
ent db "",13,10,0
sys_msg db "SolOS System Ready.",0
;noch mehr variablen
;##############
;#int's und funktionen#
;##############
;int....
_int0x21:
_int0x21_ser0x01:
cmp al, 0x01
jne _int0x21_end
cmp ah, 0x01
jne _int0x21_ser0x01_start
_int0x21_ser0x01_ser0x01_start:
lodsb
or al,al
jz _int0x21_ser0x01__ser0x01_end
mov ah,09h
;<--- Farbattribut 0 = Schwarz 1 = Blau 2 = Grün 3 = Türkis 4 = Rot 5 = Magenta 6 = braun 7 = Hellgrau 8 = Dunkelgrau 9 = Hellblau a = Hellgrün b = Helltürkis c = Hellrot d = Hellmagenta e = gelb f = weiß
mov cx,0001h
int 10h
;Cursorposition auslesen
mov ah,03h
int 10h
inc dl
;und Cursorposition schreiben
mov ah,02h
int 10h
jmp _int0x21_ser0x01_ser0x01_start
_int0x21_ser0x01__ser0x01_end:
jmp _int0x21_end
_int0x21_ser0x01_start:
lodsb
or al, al
jz _int0x21_ser0x01_end
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x07
int 0x10
jmp _int0x21_ser0x01_start
_int0x21_ser0x01_end:
jmp _int0x21_end
_int0x21_end:
iret
;funktionen
;....
ich hoffe du kannst damit was anfangen_int0x21:
_int0x21_ser0x01:
cmp al, 0x01
jne _int0x21_end
cmp ah, 0x01
jne _int0x21_ser0x01_start
_int0x21_ser0x01_ser0x01_start:
lodsb
or al,al
jz _int0x21_ser0x01__ser0x01_end
mov ah,09h
;<--- Farbattribut 0 = Schwarz 1 = Blau 2 = Grün 3 = Türkis 4 = Rot 5 = Magenta 6 = braun 7 = Hellgrau 8 = Dunkelgrau 9 = Hellblau a = Hellgrün b = Helltürkis c = Hellrot d = Hellmagenta e = gelb f = weiß
mov cx,0001h
int 10h
;Cursorposition auslesen
mov ah,03h
int 10h
inc dl
;und Cursorposition schreiben
mov ah,02h
int 10h
jmp _int0x21_ser0x01_ser0x01_start
_int0x21_ser0x01__ser0x01_end:
jmp _int0x21_end
_int0x21_ser0x01_start:
lodsb
or al, al
jz _int0x21_ser0x01_end
mov ah, 0x0E
mov bh, 0x00
mov bl, 0x07
int 0x10
jmp _int0x21_ser0x01_start
_int0x21_ser0x01_end:
jmp _int0x21_end
_int0x21_end:
iret
und auf rufen kann man das mit:mov si, <text>
mov al, 0x01 ;<--- normale bios teletype output
int 0x21 ;<--- int 21h
mov si, <text>
mov al, 01h ;<--- schreiben
mov ah, 01h ;<--- mit farbe
mov bl, 0x7E ;<--- welche farbe: 0xhintergrund/textfarbe
int 21h ;<--- int 21h
push dx
push es
xor ax, ax
mov es, ax
cli
mov word [es:0x21*4], _int0x21 ; Pointer auf den Handler
mov [es:0x21*4+2], cs ; Pointer auf CS
sti
pop es
pop dx
ich hoffe ich konnte helfen
tasttr:
mov ah, 0
int 16h
cmp ah, 0x4B ;scancode für pfeiltaste links
je near key_left
.
. ;hier werden noch andere scancodes abgefragt
.
cmp al, 'z'
je near key_y
.
. ;hier werden noch andere ascii zeichen und codes abgefragt
.
weiter:
mov ah, 0x0e
int 10h
;das folgende sind konvertierungen von groß zu klein; haben nur bedeutung fur die befehlsauswehrtung
mov dl, 'A'
cmp al, dl
je near A2a_a
.
. ;hier werden alle buchstaben Von groß zu klein konvertiert
.
ret
A2a_a:
mov al, 'a'
ret
.
. ;hier werden alle buchstaben Von groß zu klein konvertiert
.
key_left:
mov si, left ;Inhalt: 'left wurde gedrückt'
mov al, 01h ;funktion 01h (schreiben) des
int 21h ;int 21h (eigenes int mit bios teletype)
jmp weiter
.
.
.
key_y:
mov al, 'y'
jmp weiter
.
.
.
mfg bb chris12
68 61 6C 6C 6F
(hallo)B8 00 30 8E D8 8E C0
entspricht mov ax, 0x3000
mov ds, ax
mov es, ax
oder?
echo test > test.txt
nachricht db "bla bla bla...",13,10,0
defieniert und das geht so bei mir nicht