x86-16

Assembly Language x8086 - Getting User input

大憨熊 提交于 2020-01-23 17:34:28
问题 I am stuck on a problem I have for a homework assignment that is asking me to ask the user fora digit ranging from 1 digit to 5 digits (eg. they can input 1, 12, 123, 1234) I know how to ask the user for whatever number they want, using a loop and then using the mov ah, 1h function, but I want to take the user's input, let's say 123, and then store that number in a variable that I've created, Y. Then I want to process it, I already know how to process the number, but only when I've already

Mode X in Assembly x86-16, Why plane 1 is not printing and all the other planes are not in the correct order?

我与影子孤独终老i 提交于 2020-01-23 00:35:45
问题 I am writing in TASM 3.0 on DosBox 0.74 and I am trying to write in Mode x (Tweaked 13h, unchained mode 13), but how you can see on the image, it's not creating the quite right. It seems that plane 1 (second plane) is not printing at all, and all the others are not in the right order. I know that the code that I will show you is slow and is not productive, but I want to make it work then clean up the code. proc showBMP push cx mov ax, 0A000h mov es, ax mov cx, [BMPHeight] mov ax, [BMPWidth]

Mode X in Assembly x86-16, Why plane 1 is not printing and all the other planes are not in the correct order?

本小妞迷上赌 提交于 2020-01-23 00:35:09
问题 I am writing in TASM 3.0 on DosBox 0.74 and I am trying to write in Mode x (Tweaked 13h, unchained mode 13), but how you can see on the image, it's not creating the quite right. It seems that plane 1 (second plane) is not printing at all, and all the others are not in the right order. I know that the code that I will show you is slow and is not productive, but I want to make it work then clean up the code. proc showBMP push cx mov ax, 0A000h mov es, ax mov cx, [BMPHeight] mov ax, [BMPWidth]

Issues writing to file in assembly

£可爱£侵袭症+ 提交于 2020-01-22 04:06:28
问题 I am trying to write a simple program in assembly in which I open an existing file and I write a message in it, a message which I define in my data segment. The problem occurs when I want to write to my file. The AX register will contain 5 after I try writing to it, and the Norton Expert Guide says that is an 'Access denied' error code. Any ideas on what I'm doing wrong? Sorry if this question is pretty easy, I'm just trying to learn some assembly for an upcoming test. I am using TASM to

how to accept input with a large (multi-digit) number

匆匆过客 提交于 2020-01-21 06:03:00
问题 How to accept input with a large number then compare it for example mov ah,01h int 21h i want to accept more than one characters and move that number to al to access the port in blinking an led by input of the user example the user wants to type 32 but single character was mov bl,al delay: mov ctr,'0' mov al,bl mov cx,100 skip: x: mov al,00000000b mov dx,378h out dx,al loop x Z: mov al,bl mov dx,378h out dx,al loop z inc ctr Cmp ctr,'8' Je exit jmp skip Exit : Mov ah,4ch int 21h End start 回答1

CONCEPT OF MOV AX,CS and MOV DS,AX

喜夏-厌秋 提交于 2020-01-21 05:18:08
问题 can someone please explain the functions of the three instructions..... > ORG 1000H > MOV AX,CS > MOV DS,AX I know what is code , data , extra segments in theory. But, 1.How they are implementing in these program? 2.Why they move the entire segment into another? (MOV AX,CS;MOV DS,AX; ) (excuse me if question is absurd) what is the real concept of these 2 instructions... /* The below given Assembly program of 8086 Works well. I can Understand the meaning of every instruction in this code,

invalid use of registers

假装没事ソ 提交于 2020-01-17 05:21:26
问题 VElist dw 2,40; dw 3,55; dw 4,70; dw 5,60; dw 6,70; dw 7,80; dw 8,170; dw 9,120; dw 1,56; I'm trying to add all this numbers that are the second number in this array of number pairs, ex:40,55,70 I typed mov cx,des sub cx,beg mov ax,0 mov di,Beg add ax,VElist[4*di-1] where my program allowed us to enter the Variable "beg" and "des" between 1 to 0. But the assembler keeps telling me the error information :invalid use of registers at add ax,VElist[4*di-1]. I can't see I did any where wrong, I'll

Is INT13H (non extended) capable of accessing drives with more than 16 heads per cylinder?

家住魔仙堡 提交于 2020-01-15 08:10:42
问题 I know that you need the INT 13H extended functions to access drives over 8GB in size. This question refers to standard INT 13H, function 02H. I also know the old 504MB hard drive limit was a result of: 1024 cylinders x 16 heads x 63 sectors x 512 bytes = 528,482,304 bytes. But was this hard drive limitation caused by Int 13h itself? Is there any particular reason the head number was limited to 16 when there is an entire byte of space (dh) for the head number? Obviously later on the standard

How to subtract two 64 bit integers in 8086 assembly

寵の児 提交于 2020-01-14 14:01:48
问题 Write a program called SUB64 to subtract the 64-bit integer in memory locations 0x0150 and 0x0154 from the 64-bit integer in 0x0160 and 0x0164. Store the result in memory location 0x0170 and 0x0174. I understand the logic behind separating it into smaller pieces since we can't fit 64 bits into the registers. And I know we subtract the least significant pieces first. I'm struggling with actually coding it. Does it matter which GPIO we use? This is my example, so maybe you can see how I'm

“times 510-($-$$) db 0” does not work

天涯浪子 提交于 2020-01-13 20:32:12
问题 I am learning about boot sectors. I downloaded nasm-installer-x64.exe from the NASM website. My operating system is win7-64bit. When I run the following code it does not work correctly mov ah, 0x0e; mov al, the_secret; int 0x10; mov al, [the_secret]; int 0x10; mov bx, [the_secret]; add bx, 0x7c00; mov al, [bx]; int 0x10; mov al, [0x7c1e]; int 0x10; jmp $; the_secret:; db 'X'; times 510-($-$$) db 0; dw 0xaa55; 回答1: I don't believe there is anything wrong with times 510-($-$$) db 0 . It seems