我正在按照本教程了解如何检查和启用 A20 线路。我想我明白了,但是有人可以帮我澄清一下吗?
该教程中已有的评论开始; <comment>,
我的评论开始;<comment>
; The following code is public domain licensed
[bits 16]
; Function: check_a20
;
; Purpose: to check the status of the a20 line in a completely self-contained state-preserving way.
; The function can be modified as necessary by removing push's at the beginning and their
; respective pop's at the end if complete self-containment is not required.
;
; Returns: 0 in ax if the a20 line is …Run Code Online (Sandbox Code Playgroud) 我想将一个文件的内容复制到另一个文件。
最初我认为这fgetc()会更好,fread()因为程序不需要重复通过缓冲区来复制每个字符。
但我很快意识到,重复使用fgetc()相当于执行多个函数调用(堆栈指针),这样在大文件的情况下会使过程更加耗时。
哪个更有效率?
size_t _Cdecl fread(void *__ptr, size_t __size, size_t __n,
FILE *__stream);
与
int _Cdecl fgetc(FILE *__stream);
我正在编写一些汇编 BIOS 代码,通常我们使用中断来访问磁盘功能。我们给出命令,例如寻找该扇区读取字节等,但是磁盘如何知道它是否是第一个扇区,同样,当 cd/dvd 从随机位置插入 CD 驱动器时,cd/dvd 如何识别扇区。是否有与这些硬件中的扇区相关的任何类型的标识号?
我知道这个问题被问了很多,但我找到的每个答案都不适合我。我正在尝试加载stage 2位于图像文件第二个扇区的操作系统(0x200)
这是我尝试使用的代码:
bits 16 ; Starting at 16 bits
org 0x0 ; And starting at 0
jmp main ; Hop to main!
; TODO: copy comment from prev. loader
; args: SI
print:
lodsb ; Load the next/first character to AL
or al, al ; Is it 0?
jz donePrint ; Yes - Done.
mov ah, 0eh ; No - keep going.
int 10h ; Print character.
jmp print ; Repeat
donePrint:
ret ; Return …Run Code Online (Sandbox Code Playgroud) memset我在 Turbo C 中遇到了一个大的 for 循环问题。
当代码开始崩溃时,我正在 Virtual Box 上的 MS-DOS 6.22 上使用 Turbo C++ 3.00 编写一个基于模式 13h 的小型图形库。
我知道 Turbo C 确实已经过时了,但我想在类似 DOS 的系统上尝试旧式编码。
这是我的代码:
#include <stdlib.h>
#include <conio.h>
#include <stdio.h>
#include <string.h>
#include <dos.h>
int main(void) {
int *buf;
unsigned int i;
_AH = 0x0;
_AL = 0x13;
geninterrupt(0x10);
buf = malloc(sizeof(int)*64000);
memset(buf,15,64000); //can't figure out why memset does not work properly...
for (i=0;i< (unsigned int)64000;i++){
buf[i] = 15; //trying to forcely set each byte to 0xf... …Run Code Online (Sandbox Code Playgroud) I would like a practical example of the cli and sti instructions in x86 16-bit assembly, i.e. an example in code written in this language which allows me to know what these instructions are for by practice and to go further than theory.
I know the documentation says that cli disables the interrupt flag and sti enables it and the interrupt flag does not affect
not handling non-maskable interrupts (NMI) or software interrupts generated by the int instruction.
In the …
我的老师已经指示我在编写指令0之前追加,hexa numbers因为一些编译器会0在指令编号之前搜索,以区别于标签.如果指令已经以0开头,我很困惑,在这种情况下该怎么办?
例如,
AND BL, 0FH
Run Code Online (Sandbox Code Playgroud)
是否需要0在该六进制数之前添加?请帮帮我.谢谢
对不起,如果我以前不够清楚.我的意思是,在上面的例子中,0已经存在,我是否需要将其转换为,
AND BL, 00FH
Run Code Online (Sandbox Code Playgroud) 我搜索了大约一天但我找不到任何关于 adding 64 bit numbers in assembly - emu8086
我怎样才能做到这一点 ?
我的寄存器只有16位,我有2位64位.我正在使用它的应用程序是emu8086.(这是一个学校项目)
如何在VESA图形模式下绘制像素?
我正在尝试中断10h功能0ch,但它无法正常工作.怎么了?
(注意:我用NASM语法编写了这段代码并用qemu测试了它)
; Code:
Mov ax, 4F02h
Mov bx, 0105h ; 1024x768 pixels
Int 10h
Mov ah, 0ch ; Draw pixel function
Mov cx, 2 ; column
Mov dx, 3 ; row
Mov bh, 0
Mov bl, 00000101b ; colour
Int 10h
Jmp $ ; jump forever
Times 510-($-$$) db 0
Dw 0xaa55
Run Code Online (Sandbox Code Playgroud) 我已经在大学里学习了8086英特尔处理器的汇编编程.我现在正试图修改它.
我听说汽车嵌入式系统需要汇编,所以我想知道哪种方式可以学习它是最好的?我不需要浪费时间,因为我想找份工作.
修改8086大会真的有帮助吗?或者转向32位x86组件更好?
谢谢.