x86-16 Questions
4
Solved
Many of you may recall the old DOS program--debug. Though outdated in many respects, one of the nice things about it was that one could easily find the byte-sequence for a given instruction w...
8
Solved
I'm getting stair-step output like this
My program works correctly, except that when I print a new line, and then print something in the current line, it shows on the next line but with some spac...
10
Solved
I'm curious how many ways are there to set a register to zero in x86 assembly. Using one instruction. Someone told me that he managed to find at least 10 ways to do it.
The ones I can think of are...
3
Solved
The input in next program (using DOS.BufferedInput function 0Ah) works OK, but when I ask to show the output, DOS doesn't display anything at all. How is this possible?
ORG 256
mov dx, msg1
mov ...
2
I am trying to print a string in Q Emulator using NASM. My code is as below:
mov bx,HELLO
mov ah, 0x0e
int 0x10
HELLO:
db 'Hello', 0
jmp $
times 510-($-$$) db 0
dw 0xaa55
However when I compile...
Frederick asked 20/10, 2016 at 0:27
5
Solved
When I add two values in 16 bit assembly, what is the best way to print the result to console?
At the moment I have this code:
;;---CODE START---;;
mov ax, 1 ;put 1 into ax
add ax, 2 ; add 2 to a...
3
Solved
Suppose an external interrupt request is made to 8086. Processor will handle the interrupt after completing the current instruction being executed (if any). Before handling of the interrupt, the st...
Platon asked 23/5, 2014 at 21:13
4
Solved
Most of the assembly code is terminate by the following instructions
MOV AH, 4CH
INT 21H
What does it mean by "MOV AH, 4CH" ?
Lipson asked 3/3, 2017 at 8:19
1
Solved
I am in the process of making a bootloader as a way for me to learn assembly. I have looked into using sections to organize and optimize my code, but one thing that doesn't work is when I call my p...
Emblem asked 4/11, 2022 at 20:20
4
I want to set the leading zero bits in any size integer to 1 in standard C++.
eg.
0001 0011 0101 1111 -> 1111 0011 0101 1111
All the algorithms I've found to do this require a rather expensive l...
Bulbiferous asked 18/9, 2022 at 6:3
7
Solved
I'd like to disassemble the MBR (first 512 bytes) of a bootable x86 disk that I have. I have copied the MBR to a file using
dd if=/dev/my-device of=mbr bs=512 count=1
Any suggestions for a Linux...
2
Solved
Mostly of a historical interest and if I were to implement 8086 compatibility for assembler, what operands are considered valid for ESC instruction?
ESC opcode, source
From 8086 Programmer's manu...
Crossbeam asked 1/3, 2017 at 23:11
6
Solved
In our system's programming classes, we're being taught assembly language. In most of the sample programs our prof. has shown in classes; he's using:
XOR CX, CX
instead of
MOV CX, 0
or
OR AX...
Ladin asked 12/8, 2013 at 17:9
7
Solved
I am trying to create a sleep/delay procedure in 16bit MASM Assembly x86 that will, say, print a character on the screen every 500ms.
From the research I have done, it seems that there are three me...
1
Solved
This question is purely academic because no-one uses MS-DOS now, but I still want to know why.
In some books and articles they said if you call a DOS interrupt during another one, it may cause a de...
Standstill asked 7/5, 2022 at 12:1
1
Solved
I'm trying to get my head around programming real mode MS-DOS in C. Using some old books on game programming as a starting point.
The source code in the book is written for Microsoft C, but I'm try...
3
My professor claimed that LOOP is faster on 8086 because only one instruction is fetched instead of two, like in dec cx, jnz. So I think we are saving time by avoiding the extra fetch and decode pe...
Adversary asked 14/2, 2022 at 19:17
1
Solved
When trying to write some routine in x86 assembly for a boot loader, I came across a bug where when a division error happened, the program would get stuck in an infinite loop. Through investigating...
Schwejda asked 10/2, 2022 at 19:13
1
I am developing a toy OS in assembly and I have a problem when switching from protected mode back to real mode. I have successfully switched to protected mode, called the kernel that writes text to...
Religion asked 24/2, 2020 at 15:12
9
Solved
I have learned how to work with 80x86 assembler, so in bit-wise shift operation, I faced a problem with SAL and SHL usage. I means the difference between lines of code as follow :
MOV X, 0AAH
SAL ...
3
Solved
In 8086 this structure is correct:
mov bh,[bx]
but this is not correct:
mov bh,[cx]
I don't know why. I think that the general purpose registers (AX, BX, CX, DX, SP, BP, SI and DI) are regist...
Tranquillize asked 20/12, 2018 at 10:30
17
For me, it just seems like a funky MOV. What's its purpose and when should I use it?
3
I'm trying to compile and link a simple program to a DOS .com file using Turbo C compiler and linker. By that I try the simplest C-program I can think of.
void main()
{}
Are there command line a...
Sour asked 1/5, 2019 at 14:50
1
I am a beginner in assembly and This is a code that I designed to convert from binary and to gray, and prints the resulting bit-pattern in hex.
mov al, a
mov bl, al
shr bl, 1
xor al, bl
Alth...
Rendering asked 5/5, 2021 at 11:10
2
Solved
I want to convert simple loops in high-level languages into assembly language (for emu8086) say, I have this code:
for(int x = 0; x<=3; x++)
{
//Do something!
}
or
int x=1;
do{
//Do s...
Insufficient asked 23/2, 2015 at 1:7
1 Next >
© 2022 - 2024 — McMap. All rights reserved.