Emacs 中的汇编编程如何?我希望 Emacs 做以下事情 1. 组装 2. 在 Emacs 中运行之前制作的程序 3. 使用观察标志和寄存器进行调试,如 ollydbg 或 softice 4. 反编译可执行文件以查看由 c 制作的汇编代码,但我不不知道怎么做,有人可以告诉我吗?
我的期望是它打印一个字符串,但没有打印出来.当我把字符串缩短时,它有时会起作用,当我再次使它们变长时,它有时会起作用.
我不知道为什么这不起作用.
有人能帮帮我吗?谢谢.
我正在使用的汇编代码是:
(Emacs 23,Ubuntu 10.10,nasm,VirtualBox OSE)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
org 0x7c00
bits 16
str:
db "Some say the world will end in fire",10,13
db "Some say in ice",10,13
db "From what I've tasted of desire",10,13
db "I hold with those who favor fire",10,13
db "But if I had to perish twice,",10,13
db "I think I know enough of hate",10,13
db "To say that for destruction ice",10,13
db "is also great and would suffice."
db "Robert Frost - Fire and Ice" …
Run Code Online (Sandbox Code Playgroud) 我想知道LBA和簇号.
我的问题是:
LBA 0总是第2组?
那么集群0和1是什么?
只有集群和LBA之间的区别就在于它们从磁盘开始的位置?
CHS,LBA,集群nubmer之间的关系?
在流动的代码中, add ax, WORD [datasector]
代码是什么?
;************************************************;
; Convert CHS to LBA
; LBA = (cluster - 2) * sectors per cluster
;************************************************;
ClusterLBA:
sub ax, 0x0002 ; zero base cluster number
xor cx, cx
mov cl, BYTE [bpbSectorsPerCluster] ; convert byte to word
mul cx
add ax, WORD [datasector] ; base data sector
ret
Run Code Online (Sandbox Code Playgroud)filesystems operating-system disk cluster-computing relationship
在Windows XP中,C编程语言
我想快速读取屏幕的一个像素(即你现在可以看到的1024*768)
我认为帧缓冲是解决方案.
所以
我试过了
#include "SDL.h"
#include <stdio.h>
#include <time.h>
SDL_Surface *screen;
int main(int argc, char *argv[])
{
if ( SDL_Init(SDL_INIT_VIDEO) < 0 )
{
fprintf(stderr, "Unable to init SDL: %s\n", SDL_GetError());
exit(1);
}
screen = SDL_GetVideoSurface();
if ( screen == NULL )
{
exit(1);
}
return 0;
}
Run Code Online (Sandbox Code Playgroud)
但屏幕似乎是NULL
对不起新问题
但有人可以告诉我如何访问framebuffer来读取像素吗?
欢迎任何可能的方式
我在第一个像素旁边点了一个像素但结果却不同了.第二个像素远离第一个像素.
怎么了?
org 100h
;change to 320x200 graphic mode
mov ax, 13
int 10h
;frame buffer location
push 0xa000
pop es
xor di, di
;dot 2 pixels
mov ax, 1
mov [es:di], ax
inc di
mov [es:di], ax
;prevent ending
a:
jmp a
Run Code Online (Sandbox Code Playgroud)
谢谢!
assembly ×3
framebuffer ×2
x86 ×2
bios ×1
bootloader ×1
c ×1
debugging ×1
desktop ×1
disk ×1
dos ×1
emacs ×1
filesystems ×1
graphics ×1
nasm ×1
pixel ×1
relationship ×1