小编kim*_*yun的帖子

Emacs 中的汇编编程如何?

Emacs 中的汇编编程如何?我希望 Emacs 做以下事情 1. 组装 2. 在 Emacs 中运行之前制作的程序 3. 使用观察标志和寄存器进行调试,如 ollydbg 或 softice 4. 反编译可执行文件以查看由 c 制作的汇编代码,但我不不知道怎么做,有人可以告诉我吗?

debugging emacs assembly

2
推荐指数
1
解决办法
2518
查看次数

为什么这个启动加载程序代码不起作用?

我的期望是它打印一个字符串,但没有打印出来.当我把字符串缩短时,它有时会起作用,当我再次使它们变长时,它有时会起作用.

我不知道为什么这不起作用.

有人能帮帮我吗?谢谢.

我正在使用的汇编代码是:

(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)

x86 assembly bios nasm bootloader

2
推荐指数
1
解决办法
594
查看次数

LBA和集群

我想知道LBA和簇号.

我的问题是:

  1. LBA 0总是第2组?

  2. 那么集群0和1是什么?

  3. 只有集群和L​​BA之间的区别就在于它们从磁盘开始的位置?

  4. CHS,LBA,集群nubmer之间的关系?

  5. 在流动的代码中, 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

2
推荐指数
1
解决办法
2929
查看次数

读取屏幕的一个像素(即1024*768,你现在可以看到)

在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来读取像素吗?

欢迎任何可能的方式

c desktop framebuffer pixel

2
推荐指数
1
解决办法
360
查看次数

点2像素在一起

我在第一个像素旁边点了一个像素但结果却不同了.第二个像素远离第一个像素.

怎么了?

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)

谢谢!

graphics x86 assembly dos framebuffer

2
推荐指数
1
解决办法
230
查看次数