ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
935
935
EMPFEHLEN
-
04.03.11 16:20 #1
- Registriert seit
- Feb 2011
- Beiträge
- 33
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156
mov ax, 0x1000 mov es, ax mov ds, ax mov ah, 2 mov dh, 2 int 10h mov si, welcome call print loop: mov si, prompt call print mov di, buffer call keyboard mov si, buffer cmp byte [si], 0 jc loop mov si, buffer mov di, cmd_help call strcmp je .help mov si, buffer mov di, cmd_h call strcmp je .help mov si, buffer mov di, cmd_write call strcmp je .write mov si, buffer mov di, cmd_read call strcmp je .read mov si, badcomm call print jmp loop .help: mov si, command1 call print jmp loop .write: mov ax, 0x2000 mov es, ax mov bx,0 mov ah, 2 mov al, 1 mov dl, 0 mov dh, 1 mov ch, 0 mov cl, 7 int 13h jc loop .read: mov ax, 0x2000 mov es, ax mov bx,0 mov ah, 2 mov al, 1 mov dl, 0 mov dh, 1 mov ch, 0 mov cl, 7 int 13h je loop mov si, yes call print jmp loop yes db "a byte was found in the 7th sector", 13, 10, 0 cmd_read db "read", 0 cmd_write db "write", 0 command1 db "folgende kommandos stehen ihnen zur verf", 129, "gung:", 13, 10, 0 badcomm db "es wurde ein unbekannter befehl eingegeben", 13, 10, 0 cmd_help db "help", 0 cmd_h db "-h", 0 prompt db "#>", 0 welcome db "nerdix version 0.1.0", 13, 10, 0 buffer times 64 db 0 print: lodsb or al, al jz .done mov ah, 0eh int 10h jmp print .done: ret keyboard: xor cl, cl keyboard1: mov ah, 0 int 0x16 ; wait for keypress cmp al, 0x0D ; enter pressed? je .return mov ah, 0x0E int 0x10 ; print out character stosb ; put character in buffer inc cl jmp keyboard1 .return: mov al, 0 stosb mov ah, 0x0E mov al, 0x0D int 0x10 mov al, 0x0A int 0x10 ; newline ret strcmp: mov al, [si] mov bl, [di] cmp al, bl jne .not cmp al, 0 je done inc di inc si jmp strcmp .not: clc ret done: stc ret times 512 - ($ - $$) hlt
wenn ich read oder write eingebe, dann gehe ich halt zurück zu der main funktion, aber die eingabe dann ist nicht ,ehr gültig. also es ignoiert es sozusagen. noch was:
wenn ich write eingebe, soll es eigentlich was in ein sektor schreiben. es sollte dann acuh eine anchricht in den terminal kommen(in linux unter qemu), dass es da rein geschrieben wurde. aber leider kommt da keine nachricht. ich bibn echt sprachlos
Ähnliche Themen
-
Warum hoert while loop nicht auf und Wert aendert sich nicht?
Von DDDB im Forum Java GrundlagenAntworten: 5Letzter Beitrag: 31.10.10, 18:32 -
Jar Datei startet nicht - Could not find the main main class...
Von dbzworld im Forum JavaAntworten: 3Letzter Beitrag: 13.10.08, 11:05 -
warum funktioniert name="main" als namengebung nicht?
Von Onkel-Timo im Forum PHPAntworten: 7Letzter Beitrag: 11.04.04, 15:30 -
Warum geht denn das schon wieder nicht****?
Von Feldhofe im Forum PHPAntworten: 3Letzter Beitrag: 28.12.01, 18:15





Zitieren
Login





