Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Inline Assembler und int 21

Empfohlene Antworten

Veröffentlicht

Hi,

warum klappt das:


main()
{
int i=0;
scanf("%i",&i);
__asm
{
mov al,BYTE PTR i
add al,06
mov BYTE PTR i, al
}
printf ("\n%i",i);
return 0;
}
[/PHP]

und warum stürzt dabei immer der PC ab?

[PHP]
main()
{
int i=0;
__asm
{
mov ah,01
int 21
add al,06
mov BYTE PTR i, al
}
printf ("\n%i",i);
return 0;
}

Darf ich beim Inline Assembler etwa keine Interupts aufrufen?

Wenn ja warum nicht, dass wäre doch komisch wenn das nicht geht.

Gruß

Guybrush

Probiers mal mit int 0x21

M.E. nach hat man unter Windows keine Ring 0 Rechte. Das hat seinen Grund, denn sonst könnte jedermann ganz einfach in Speicherbereiche schreiben...und das wäre "nix gut".

Deswegen kann unter "normalen" Umständen auch z.B. keine abs. Adresse angeben. Windows lädt eine EXE in eine virtuelle 4GB-Umgebung und der Kernel berechnet daraus dann die abs. Adresse.

Treiber sitzen auf der HAL auf und haben Ring 0 Rechte....

  • Autor

@gugelhupf

Ah, danke. Das heißt also ich kann mit dem Inline Assembler "nur" ein bischen mit

den Registern "rumspielen" und keine Interruptaufrufe durchführen.

Korrigier mich bitte wenn ich das falsch Verstanden habe, weil ich hab in

Assembler nur ein paar Grundkenntnisse.

Was sind denn Ring 0 Rechte?:confused:

Gruß

Guybrush

Schau mal hier rein....soll keine Schleichwerbung sein *ggg*

http://www.kithara.de/ge/paper03.htm

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.