Mal wieder zurück zum Thema: Assemblercodes!
Hier ein kleiner trickreicher Code um die Bytes eines 32-Bit-Wertes in umgekehrte Reihenfolge zu bringen (z.B. Intel- in 68000-Format und umgekehrt):
Code
CLS
' Set("AsmMode", 2)
asm "SwapInt", 1
mov edx,par1
mov ah,dl
mov al,dh
shl eax,$10
shr edx,$10
mov ah,dl
mov al,dh
endasm
var int wert = $11223344
Print hex$(wert)
Print hex$(SwapInt(wert))
waitinput
end
Alles anzeigen
Das kann z.B. auch im Zusammenhang mit MIDI (benutzt 68000 Format) interessant sein.
Gruß
Roland