3,082 questions
4
votes
1
answer
106
views
nasm bios int 13h read sector issue [duplicate]
im trying to make a simple bootloader that loads a simple kernel and the problem is that the kernel code doesnt run i do see prints from the bootloader but not from the kernel here is my code:
boot....
4
votes
1
answer
139
views
Qemu Bios; Configuring VGA
I'm trying to write a simple hello world bios for Qemu as an academic exercise, and I've gotten Qemu to believe the display is initialized. I see a black screen upon boot, but writing to character ...
4
votes
1
answer
190
views
Is 0x0000:0x7000 a unsafe address to load your kernel? Or is it just qemu annoying me
So I thought I'd try to make a DOS copy but it runs on a floppy and its just a simple plug and play with fat12 partition for user applications and drivers.
I first attempted to load my kernel using ...
4
votes
2
answers
186
views
MBR works in QEMU/BOCHS but not on real hardware
I threw together a makeshift MBR for a chainloader project I have been working on for sometime now. I tested on QEMU and BOCHS and no issues, besides throwing earlier 386 BIOS images into the mix (...
3
votes
2
answers
112
views
How to detect the slave PIC in an old PC using assembly?
I am modifying the source code of a driver for an ISA card that uses IRQ2. The case, as we all know, IBM added a second PIC and chained it using IRQ2, and the IRQ2 present in the ISA bus was replaced ...
2
votes
1
answer
93
views
Stuck on Second Stage Bootloader – Turbo C + TASM + DOSBox + QEMU Setup
I'm working on a retro programming project and running into trouble with my bootloader setup. I'm using:
Turbo Assembler 4.01 for the first-stage bootloader (x86 Assembly)
Turbo C 2.0 for the second-...
-5
votes
2
answers
88
views
Why does my 32bit kernel randomly flicker?
For some reason every time I try entering 32bit protected mode.. it always FLICKERS AND FLICKERS FOR NO REASON..
I am using QEMU and my kernel is being assembled into a raw binary and then written ...
3
votes
1
answer
85
views
Why does working Assembly code not work when loaded into different memory by disk read?
Problem
I have assembly code that switches to 32bit mode and prints a character successfully when I have it inside the boot sector -
But when I use a disk read to load the code to the next sector the ...
3
votes
2
answers
89
views
How do I use the int 16h interrupt to store a number of more than one digit typed from the keyboard?
I am implementing a fractional number calculator (numerators and denominators must be entered separately) for an assembly language course. I had already finished the logic of my program, but I ...
0
votes
1
answer
91
views
I need help for making a dice game with assembly language
I'm trying to make a simple dice game using assembly language (MASM).
The program generates two random numbers (1~6) and compares them.
If the player's number is higher, it prints "You Win!",...
1
vote
1
answer
33
views
Where can I assemble my assembly file aside from TASM that supports .STACK
I am just following the book from my university to run this simple code I found as an example for my coding practice. I am new to assembly language.
The problem is that I only know how to assemble in ...
1
vote
3
answers
119
views
How to force/specify a long jump in fasm?
I am doing some basic tests in fasm
I try to emulate a jump instruction in the reset location of 16 bit 8086 real mode:
$ cat bios.asm
; BIOS ROM START (64 KB ROM)
org 0xF0000
start:
mov ah, 0x0E
...
2
votes
1
answer
85
views
Performing multiplication of 32-bit numbers in 16-bit real mode in order to traverse FAT table
I am writing a simple bootloader (and, hopefully soon, an operating system). I have been making progress, but this part is stumping me a bit.
I am writing this operating system and bootloader into a ...
2
votes
1
answer
122
views
Issue when running Makefile on boot.asm, "init :: non dos media"
I've been trying to build a custom OS following the steps in this guide. However, I continue to get the following error from my Makefile,
init :: non DOS media
Cannot initialize '::' ::kernel.bin: ...
1
vote
1
answer
96
views
Hello World in real mode
I am trying to write a sample “Hello World” in real mode that will run in QEMU. The host is a 64 bits intel running FreeBSD 14.
I have tried the following:
This is boot.asm file:
format binary
org ...
2
votes
1
answer
73
views
Can't print out 8-bit values of registers
I'm trying to print out current year (CX), month (DH), day (DL) and day of the week (AL) from system timer.
Year stored in CX is printed out correctly.
I tried to printout DH, DL and AL with ...
2
votes
1
answer
135
views
Why CX register already has a non-zero value on startup of a DOS program, unlike AX and BX?
I noticed that, whenever I started my AFD (Avance Fullscreen Debugger), even before the execution of the first command, the CX register has already some value. What can be the reason for this?
As you ...
0
votes
2
answers
115
views
Available registers for assembly "function"
I am using a typical x86-16 assembly random number generator, using the BIOS timer and the current milliseconds.
random_number:
mov ah, 00h ; interrupts to get system time
int 1Ah ; CX:DX now ...
1
vote
0
answers
60
views
Control Data Address Mark Detected when attempting to read sectors in Qemu
I am trying to write a custom bootloader, when I call int 13h, I keep encountering the error 0x0e - Control Data Address Mark Detected on the drive that I attempt to read to. I don't really get any ...
0
votes
0
answers
50
views
How many machine cycles does the pop instruction require in i8086?
I had a test from assembly in my college, and one of the tasks was to say "what values do appear on address lines at cycle 2 and 3, for instruction: pop %BX". The problem is, from what I ...
2
votes
0
answers
61
views
How does this code detect whether the timer is working?
; VERIFY THAT TIMER 1 FUNCTIONS OK
MOV AL,54H ;SEL TIMER 1,LSB,MODE 2
OUT TIMER+3,AL
SUB CX,CX ;
MOV BL,CL
MOV AL,CL ;SET INITIAL TIMER ...
0
votes
1
answer
86
views
Drag and Drop project in assembly 8086 (move a square with the mouse)
I'm a CS student and I need to build a project for my architecture class. I have tried to build a simple drag and drop program in asm. The whole idea would be to draw a square somewhere on the screen ...
0
votes
0
answers
39
views
Calculating Fibonacci Sequence to 46 times or more in 8086 Assembly [duplicate]
I'm learning 8086 assembly through college course and i ran into a problem. I'm trying to calculate Fibonacci sequence to 46 places but 16-bits registers inside this processors can't handle large ...
1
vote
1
answer
173
views
8086 memory to accumulator encoding: why do mov al, [absolute] and mov ah, [absolute] have different sizes?
mov al, [10] ; a0 0a 00
mov ah, [10] ; 8a 26 0a 00
After assembling the above 8086 assembly code using NASM, I noticed a length disparity in the resulting machine code (shown in the comments above ...
1
vote
1
answer
94
views
Filling color in enclosed area in MASM using recursion
I have a function vmem, which is for drawing at (CX,DX). The function vmemr is for reading (CX,DX) to see if the pixel is painted. And vmemr will return AL=1 if there is color on (CX,DX).
Now I want ...